Dear all,
I am a new user of LAMMPS and I have been trying to experiment with Moltemplate to gain some experience into creating LAMMPS input data.
I successfully recreated the “nanotube+water” example from moltemplate, and then proceded with a few tweaks to make it progressively closer to the systems I will study using LAMMPS. First of all, swapped the bespoke SPC/E water model with the SPC water model in the OPLSAA force field, to study the use of pre-existing force fields in moltemplate. After ironing a few spelling mistakes, the swap was successful and I could run a simulation.
Later, however, I tried creating a box of Acetonitrile using a bespoke force field file but molteplate seems unable to identify the “Data Atoms” field, and therefore the final system shows no atoms or bonds.
As far as I could see, the syntax of my structural (from ltemplify.py) and force field is consistent with both the OPLSAA file and the manual pages for creating force fields, but clearly something is missing my inspection, because molteplate runs normally elsewhere.
I have attached my input files. The “system” file is ‘acn_box.lt’, which depends on ‘acn.lt’ and ‘forcefield.lt’ files. I have omitted the carbon nanostructure files from the example, though including them through a final ‘system.lt’ file did not change the result. The assignment file does recognise the force field file, but seems unable to create instance of my Acetonitrile molecule, and I do not understand why.
Being a new user I cannot attach files unfortunately, so I will copy them below. ‘#’ lines have been removed for clarity, '@' is there to avoid tags.
Is there anyone who can find the mistake in my input? I would be very grateful for your help.
It must be in the syntax of some parts, but however long I inspect them I am unable to locate it.
Thank you in advance for your support.
Best regards,
Fabrizio Silveri
------- input files --------
------- File: ForceField_ACN.lt >
ForceField {
write_once(“Data Masses”) {
@\atom:CT 12.010700
@\atom:CZ 12.010700
@\atom:NZ 14.006700
@\atom:HC 1.007940
}
write_once(“In Init”) {
units real
atom_style full
pair_style lj/cut/coul/long 11.0 11.0
bond_style harmonic
angle_style harmonic
dihedral_style opls
improper_style harmonic
pair_modify mix geometric
special_bonds lj/coul 0.0 0.0 0.5
kspace_style pppm 0.0001
}
write_once(“In Settings”) {
pair_coeff @\atom:CT @\atom:CT 0.066 3.30
pair_coeff @\atom:HC @\atom:HC 0.015 2.50
pair_coeff @\atom:NZ @\atom:NZ 0.170 3.20
pair_coeff @\atom:CZ @\atom:CZ 0.066 3.30
}
write_once(“In Settings”) {
bond_coeff @\bond:CT-CZ 385.0 1.458
bond_coeff @\bond:CT-HC 410.0 1.087
bond_coeff @\bond:CZ-NZ 650.0 1.157
}
write_once(“Data Bonds By Type”) {
@\bond:CT-CZ @\atom:CT @\atom:CZ
@\bond:CT-HC @\atom:CT @\atom:HC
@\bond:CZ-NZ @\atom:CZ @\atom:NZ
}
write_once(“In Settings”) {
angle_coeff @\angle:HC–CT–CZ 35.0 108.5
angle_coeff @\angle:CT–CZ–NZ 150.0 180.0
angle_coeff @\angle:HC–CT–HC 35.0 109.5
}
write_once(“Data Angles By Type”) {
@\angle:HC–CT–CZ @\atom:HC @\atom:CT @\atom:CZ
@\angle:CT–CZ–NZ @\atom:CT @\atom:CZ @\atom:NZ
@\angle:HC–CT–HC @\atom:HC @\atom:CT @\atom:HC
}
< forcefield.lt END
------- File: acn.lt >
import “ForceField_ACN.lt”
ACN inherits ForceField {
write(“Data Atoms”) {
$atom:c2 $mol:acn @\atom:CT −0.08 -0.527520 -0.736650 -0.061930
$atom:c1 $mol:acn @\atom:CZ 0.460 -0.490180 0.691350 0.123090
$atom:n1 $mol:acn @\atom:NZ -0.56 -0.460210 1.840750 0.272090
$atom:h21 $mol:acn @\atom:HC 0.060 0.490830 -1.139500 -0.140720
$atom:h22 $mol:acn @\atom:HC 0.060 -1.074560 -0.989770 -0.979630
$atom:h23 $mol:acn @\atom:HC 0.060 -1.028760 -1.219740 0.787100
}
write(“Data Bond List”) {
$bond:cc $atom:CT $atom:CZ
$bond:ch1 $atom:CT $atom:HC_1
$bond:ch2 $atom:CT $atom:HC_2
$bond:ch3 $atom:CT $atom:HC_3
$bond:cn $atom:CZ $atom:NZ
}
write_once(“In Settings”) {
group acn type @\atom:CT @\atom:CZ @\atom:NZ @\atom:HC
}
write_once(“In Constraints”) {
fix fRattleAcn acn rattle 0.0001 10 100 b @\bond:CT-HC a @\angle:HC–CT–HC
}
} # end of “ACN” type definition
< acn.lt END
----- File: acn_box.lt >
import “acn.lt”
write_once(“Data Boundary”) {
-15.98682895386 15.98682895386 xlo xhi
-14.91 14.91 ylo yhi
-31.0 31.00 zlo zhi
}
solv = new ACN [7].move(2.5, 0, 0).rot(90, 1, 0, 0)
[7].move(0, 5.0, 0)
[4].move(2.5, 0, 0)
< acn_box.lt END