In complex simulations where different atoms use different force fields (e.g., a mix of standard parameters and OPLSAA), you may need to specify charges using multiple methods. Moltemplate supports both the LAMMPS DATA file method and the set command method.
1. Standard Data Atoms Method
For atoms using standard force fields, specify charges directly in the Data Atoms section of your .lt files. After running moltemplate.sh, these charges are written to the Atoms section of the generated system.in.data file.
2. Force Field Lookup Method (e.g., OPLSAA)
For atoms using the OPLSAA force field, charges are assigned via a lookup table based on @atom type. This information is written to the system.in.charges file. Because LAMMPS reads the charges file after the data file, these values will override any charges specified in the Atoms section.
3. Individual Atom Customization via 'set' commands
To modify the charge of a specific atom without changing its type (especially when that atom belongs to a force field like OPLSAA), you can append a LAMMPS set command to a file named In XXX.
Any text written to a file named In charges will be appended to the end of the system.in.charges file. This allows you to override the charge for a specific atom ID using the LAMMPS set syntax.
Example Pattern:
To modify the charge of a specific atom in a Graphene_NH2 object, add a set command to the end of the graphene_nh2.lt file (or a file that generates the In charges section).