Overriding default CHARMM parameters for 1-4 interactions

Here’s a focused version of what I posted earlier. I have a hexagonal boron nitride (hBN) monolayer under CHARMM and I need to override the defaults for all 1-4 interactions, which includes the fudge factor and the LJ parameters. I have a local topology created by x2top (very functional for 2D crystals) and in that file so far I did the following: replaced all function types (third column) under [ pairs ] from 1 to 2. In addition, I replaced ‘gen-pairs’ to ‘no’ in the forcefield defaults. Finally, I added the following under [ pairtypes ] in ffnonbonded.itp according to my likely incorrect understanding of table 5.14 in the 2020 manual:

  hbn_N hbn_N     2  0.5 -0.75 -0.75 0.32174  0.19790
  hbn_B hbn_B     2  0.5  0.75  0.75 0.33087  0.28970
  hbn_B hbn_N     2  0.5  0.75 -0.75 0.32630  0.23940

grompp throws exactly three errors for these lines: “ERROR 1 [file ffnonbonded.itp, line xxxx]: … Too many parameters”

Is there a formatting issue, or am I doing the whole thing wrong?

Thank you.

The directive you want to use is [pairs_nb], not [pairtypes]. Also take care to note what is stated in the manual about using such interactions and the need for special exclusions:

Note that one should add exclusions for all atom pairs listed in [ pairs_nb ], otherwise such pairs will also end up in the normal neighbor lists.

Hey Justin! Does this mean that I have to replace the entire [ pairs ] section for that “molecule” with [ exclusions ]? Because that entire list of pairs I have consists only of what I will have in [ pairs_nb ]… Also, is the ‘gen-pairs’ set to ‘no’ correct in this case? Thanks a whole bunch!

You would need both directives, as I understand it. But I’ve never worked with such a setup.

That shouldn’t matter if parameters are explicitly specified for all possible 1-4 pairs.

I am seriously confused by this. Sticking a [pairs_nb] section into ffnonbonded in the form of a “template” (by that i mean the list of three pairs shown above) results in “invalid order” from grompp. Does this need a full (per-pair) list for all atoms in the local itp specific to the molecule, or is it supposed to be part of ffnonbonded? I just can’t find a working example of how this needs to be implemented. :(

The [pairs_nb] belongs within the corresponding [moleculetype] definition. The “normal” pair interactions have to be excluded in [exclusions] so [pairs_nb] take effect. At least that’s what I gather from a quick look at the code.

OK, so some scripting will be needed there. I still don’t get it though. I need to specify the fudge factor and it is not part of [pairs_nb] according to table 14 of the 2024 online manual (sorry, this forum is stopping me from posting the link).
[pairs] type 2, however, is. Why not just edit my existing [pairs] section to be type 2 with the parameters set explicitly, all as part of [moleculetype]??

Maybe Berk could clarify this, because I think it was mentioned somewhere that he is the one who introduced pairs_nb and the manual sounds like it is in a bit of a conflict with what Justin is suggesting…

pairs_nb is not what you want here.

I think you need to specify the parameters manually for each 1-4 pair using a [ pairs ] section with type 2.

Ah, many thanks! That’s what I thought and this is what my postdoc and I did earlier today. It seems to work exactly as expected without adding any [exclusions]… Do we need those for a “molecule” that essentially stays in place nearly unchanged throughout the simulation?

I don’t understand your question. Why would you need to add exclusions?

I never thought I did. It’s just that given the discussion above I got quite confused, because originally I wanted to do more or less what you just described – except I thought those type 2 pairs could be added as pairtypes directly into ffnonbonded. I think the case is more or less closed, thank you very much. ;)