<div dir="ltr">Hi,<div><br></div><div>On point, you have probably not correctly modified all of the arrays whose size is supposed to be F_NRE. There are several nearby comments that note the need for things to stay in step with each other. There is also logic that chooses sub-ranges of those arrays to be handled in different parts of the code, so I would probably insert your new 4-body form near the dihedrals, and watch out for parts of the listed-forces high-level dispatch logic working on subranges of ftype differently.</div><div><br></div><div>More broadly, please note that even something simple sounding as &quot;add a new dihedral-like term&quot; is often best tackled in stages. For example, first add a new interaction type that functions the same as an old one (which is probably where you already have an issue), then change its functional form to what you really want.</div><div><br></div><div>I also strongly suggest not picking an out-of-maintenance release tarball for a development starting point. You are deliberately choosing to avoid all of the bugs fixed in the later 5.1.x, and none of those fixed since, and can only be helped by someone who can remember how 5.1.x worked. Also, for your own sake, please use the git repository so you have version control. If you were, then it would be easy for you to share your work somewhere e.g. on github, and someone might be able to see where your issue lies. :-)</div><div><br></div><div>Mark</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 10, 2017 at 6:06 PM Hoa Trinh &lt;<a href="mailto:trinhlanhoa@gmail.com">trinhlanhoa@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear Gromacs developers,<div>I am trying to hack Gromacs to include a new 4-body short-ranged potential which Gromacs has not implemented yet. My strategy is to define the potential as a new dihedral types. I will have 2 input parameters, so I expected that I will do something very similar to what Gromacs does for improper dihedral angle. Therefore by grepping for F_IDIHS and eNR_IMPROPER, I think I need to modify the following files:<div><div>src/gromacs/listed-forces/bonded.h</div><div>src/gromacs/listed-forces/bonded.cpp</div><div>src/gromacs/gmxlib/ifunc.c<br></div><div>src/gromacs/gmxlib/nrnb.c</div><div>src/gromacs/legacyheaders/types/nrnb.h</div><div>src/gromacs/topology/idef.h</div><div>src/gromacs/gmxpreprocess/topdirs.c<br></div><div>src/gromacs/gmxpreprocess/convparm.c</div><div>src/gromacs/gmxpreprocess/toppush.c<br></div><div>src/gromacs/fileio/tpxio.c</div><div><br></div><div>However, when I run test, I get the following fatal error at grompp step:</div><div><div>&quot;Incorrect number of parameters - found 2, expected 32621 or -26576307 for. &quot;</div></div><div><br></div><div>I think there is something wrong related to toppush.c but I am really clueless. The file is too complicated for me to understand. In your opinion, what is wrong with my modification? Besides the following file, is there any other files which I need to modify also?</div><div><br></div><div>I am looking forward to hearing from you.</div><div>Thank you very much in advance.</div><div>Best regards, </div><div><div><br></div></div><div><br></div><div><div class="m_372429673233026626gmail_signature"><div dir="ltr"><i>Lan Hoa</i></div></div></div>
</div></div></div>
--<br>
Gromacs Developers mailing list<br>
<br>
* Please search the archive at <a href="http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists/GMX-developers_List</a> before posting!<br>
<br>
* Can&#39;t post? Read <a href="http://www.gromacs.org/Support/Mailing_Lists" rel="noreferrer" target="_blank">http://www.gromacs.org/Support/Mailing_Lists</a><br>
<br>
* For (un)subscribe requests visit<br>
<a href="https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers" rel="noreferrer" target="_blank">https://maillist.sys.kth.se/mailman/listinfo/gromacs.org_gmx-developers</a> or send a mail to <a href="mailto:gmx-developers-request@gromacs.org" target="_blank">gmx-developers-request@gromacs.org</a>.</blockquote></div>