Merge pull request #288 from akohlmey/moltemplate-1.40
update bundled version of moltemplate to v1.40
|
@ -1,24 +0,0 @@
|
|||
|
||||
This is an example of how to use the OPLSAA force-field in LAMMPS
|
||||
(using moltemplate.sh and Jason Lambert's oplsaa_moltemplate.py conversion tool)
|
||||
|
||||
This example also shows how to use moltemplate in combination with PACKMOL.
|
||||
(PACKMOL is a useful program for generating atomic coordinates. In this example,
|
||||
moltemplate.sh is only used to create the topology, force-field and charges,
|
||||
and PACKMOL generates the coordinates, which moltemplate reads (in "step 1").
|
||||
Moltemplate can also be used for generating atomic coordinates, especially
|
||||
for mixing many small molecules together, as we do in this example. However
|
||||
I wanted to demonstrate how to combine PACKMOL with moltemplate.sh.
|
||||
In some other scenarios, such as protein solvation, PACKMOL does a much
|
||||
better job than moltemplate.)
|
||||
|
||||
As of 2014-4-06, this code has not been tested for accuracy.
|
||||
(See the WARNING.TXT file.)
|
||||
|
||||
step 1)
|
||||
To build the files which LAMMPS needs, follow the instructions in:
|
||||
README_setup.sh
|
||||
|
||||
step 2)
|
||||
To run LAMMPS with these files, follow these instructions:
|
||||
README_run.sh
|
|
@ -1,78 +0,0 @@
|
|||
This example is a simple simulation of a long alkane chain,
|
||||
in a vacuum at room temperature using the OPLSAA force field.
|
||||
|
||||
|
||||
NOTE: This particular file contains instructions for how to build molecules
|
||||
using the OPLSAA force-field. However, moltemplate is not limited to
|
||||
OPLSAA. Moltemplate allows users to access any of the force-field
|
||||
styles available in LAMMPS (including custom, user-defined force-fields).
|
||||
|
||||
|
||||
-------- INSTRUCTIONS FOR USING OPLSAA WITH YOUR OWN MOLECULES: --------
|
||||
|
||||
1) Download the "oplsaa.prm" file containing the OPLSAA force field
|
||||
parameters. I do not have permission to distribute this file,
|
||||
but you can download the latest version from one of these URLS:
|
||||
http://dasher.wustl.edu/tinker/distribution/params/oplsaa.prm
|
||||
http://dasher.wustl.edu/ffe/distribution/params/oplsaa.prm
|
||||
|
||||
2) Create the "oplsaa_subset.prm" file by making a copy of the "oplsaa.prm"
|
||||
file, renaming it to "oplsaa_subset.prm", and deleting the atoms you don't need.
|
||||
For example, if you are building a simple alkane chain, you would delete every
|
||||
line beginning with the word "atom", except for these three lines:
|
||||
|
||||
atom 80 13 CT "Alkane CH3-" 6 12.011 4
|
||||
atom 81 13 CT "Alkane -CH2-" 6 12.011 4
|
||||
atom 85 46 HC "Alkane H-C" 1 1.008 1
|
||||
|
||||
(Leave the rest of the file unmodified.)
|
||||
|
||||
|
||||
3) Create the "oplsaa.lt" file using this command:
|
||||
|
||||
oplsaa_moltemplate.py oplsaa_subset.prm
|
||||
|
||||
(Credit to Jasen Lambert for contributing this useful script.)
|
||||
|
||||
|
||||
4) Create the "system.data", "system.in.init", and "system.in.settings"
|
||||
files which LAMMPS will read by running:
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
|
||||
5)
|
||||
To run LAMMPS, you must make sure LAMMPS was built with the "USER-MISC" package.
|
||||
(because oplsaa_moltemplate.py uses dihedral_style fourier)
|
||||
To do this, type "make yes-user-misc" before compiling LAMMPS.
|
||||
http://lammps.sandia.gov/doc/Section_start.html#start_3
|
||||
|
||||
|
||||
6) Run LAMMPS in this order:
|
||||
|
||||
lmp_g++ -i run.in.min # minimize the energy (to avoid atom overlap) before...
|
||||
lmp_g++ -i run.in.nvt # running the simulation at constant temperature
|
||||
|
||||
(Replace "lmp_g++" with the name of the LAMMPS executable you are using.)
|
||||
|
||||
---- Details ----
|
||||
|
||||
The "Alkane50" molecule, as well as the "CH2", and "CH3" monomers it contains
|
||||
use the OPLSAA force-field. This means that when we define these molecules,
|
||||
we only specify the atom names, bond list, and coordinates.
|
||||
We do not have to list the atom charges, angles, dihedrals, or impropers.
|
||||
The rules for creating atomic charge and angle topology are contained in
|
||||
the "oplsaa.lt" file created by step 3) above. The "ch2group.lt",
|
||||
"ch3group.lt", and "alkane50.lt" files all refer to "oplsaa.lt",
|
||||
(as well as the "OPLSAA" force-field object which it defines). Excerpt:
|
||||
|
||||
import "oplsaa.lt"
|
||||
CH2 inherits OPLSAA { ...
|
||||
CH3 inherits OPLSAA { ...
|
||||
Alkane50 inherits OPLSAA { ...
|
||||
|
||||
Alternatively, you can manually define a list of angles, dihedrals, and
|
||||
improper interactions in these files, instead of asking the force-field
|
||||
to generate them for you. You can also specify some of the angles and
|
||||
dihedrals explicitly, and let the force-field handle the rest.
|
||||
(Many of the molecule examples which come with moltemplate do this.)
|
|
@ -1,36 +0,0 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
||||
|
||||
# Create the "oplsaa.lt" file which moltemplate will need
|
||||
|
||||
cd oplsaa_lt_generator/
|
||||
oplsaa_moltemplate.py oplsaa_subset.prm
|
||||
mv -f oplsaa.lt ..
|
||||
cd ..
|
||||
|
||||
# run moltemplate
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
# This will generate various files with names ending in *.in* and *.data.
|
||||
# Move them to the directory where you plan to run LAMMPS (in this case "../")
|
||||
mv -f system.data system.in* ../
|
||||
|
||||
# Optional:
|
||||
# The "./output_ttree/" directory is full of temporary files generated by
|
||||
# moltemplate. They can be useful for debugging, but are usually thrown away.
|
||||
rm -rf output_ttree/
|
||||
|
||||
# Optional:
|
||||
# Delete the "oplsaa.lt" file:
|
||||
rm -f oplsaa.lt
|
||||
|
||||
|
||||
|
||||
cd ../
|
|
@ -1,55 +0,0 @@
|
|||
|
||||
import "oplsaa.lt" # <-- defines the "OPLSAA" force field
|
||||
|
||||
|
||||
CH2 inherits OPLSAA {
|
||||
|
||||
# atom-id mol-id atom-type charge x y z
|
||||
|
||||
write("Data Atoms") {
|
||||
$atom:C $mol:... @atom:81 0.00 0.000 0.000 0.000
|
||||
$atom:H1 $mol:... @atom:85 0.00 0.000 0.63104384422426 0.892430762954
|
||||
$atom:H2 $mol:... @atom:85 0.00 0.000 0.63104384422426 -0.892430762954
|
||||
}
|
||||
|
||||
# Atom type numbers (@atom:80,@atom:85) are defined in "oplsaa.lt". Excerpt:
|
||||
# @atom:80 12.011 #CT "Alkane CH3-" 6 partial charge=-0.18
|
||||
# @atom:81 12.011 #CT "Alkane -CH2-" 6 partial charge=-0.12
|
||||
# @atom:85 1.008 #HC "Alkane H-C" 1 partial charge=0.06
|
||||
# In this example, atomic charges are generated by atom type (according to
|
||||
# rules in oplsaa.lt), and can be omitted. Just leave them as "0.00" for now.
|
||||
# The "..." in "$mol:..." tells moltemplate that this molecule may be part
|
||||
# of a larger molecule, and (if so) to use the larger parent object's
|
||||
# molecule id number as it's own.
|
||||
|
||||
# Now specify which pairs of atoms are bonded:
|
||||
write('Data Bond List') {
|
||||
$bond:CH1 $atom:C $atom:H1
|
||||
$bond:CH2 $atom:C $atom:H2
|
||||
}
|
||||
|
||||
} # CH2
|
||||
|
||||
|
||||
|
||||
# Optional: Shift all the coordinates in the +Y direction by 0.4431163.
|
||||
# This way, the carbon atom is no longer located at 0,0,0, but the
|
||||
# axis of an alkane chain containing this monomer is at 0,0,0.
|
||||
# (This makes it more convenient to construct a polymer later.
|
||||
# If this is confusing, then simply add 0.4431163 to the Y
|
||||
# coordinates in the "Data Atoms" section above.)
|
||||
|
||||
CH2.move(0,0.4431163,0)
|
||||
|
||||
|
||||
|
||||
|
||||
######### (scratchwork calculations for the atomic coordinates) #########
|
||||
# Lcc = 1.5350 # length of the C-C bond (Sp3)
|
||||
# Lch = 1.0930 # length of the C-H bond
|
||||
# theta=2*atan(sqrt(2)) # ~= 109.5 degrees = tetrahedronal angle (C-C-C angle)
|
||||
# DeltaXc = Lcc*sin(theta/2) # = 1.2533222517240594
|
||||
# DeltaYc = Lcc*cos(theta/2) # = 0.8862326632060754
|
||||
# # 0.5*DeltaYc = 0.4431163316030377
|
||||
# DeltaZh = Lch*sin(theta/2) # = 0.8924307629540046
|
||||
# DeltaYh = Lch*cos(theta/2) # = 0.6310438442242609
|
|
@ -1,58 +0,0 @@
|
|||
|
||||
import "oplsaa.lt" # <-- defines the "OPLSAA" force field
|
||||
|
||||
|
||||
CH3 inherits OPLSAA {
|
||||
|
||||
# atom-id mol-id atom-type charge x y z
|
||||
|
||||
write("Data Atoms") {
|
||||
$atom:C $mol:... @atom:80 0.00 0.000000 0.000000 0.000000
|
||||
$atom:H1 $mol:... @atom:85 0.00 0.000000 0.6310438442242609 0.8924307629540046
|
||||
$atom:H2 $mol:... @atom:85 0.00 0.000000 0.6310438442242609 -0.8924307629540046
|
||||
$atom:H3 $mol:... @atom:85 0.00 -0.8924307629540046 -0.6310438442242609 0.000000
|
||||
}
|
||||
|
||||
# Atom type numbers (@atom:80,@atom:85) are defined in "oplsaa.lt". Excerpt:
|
||||
# @atom:80 12.011 #CT "Alkane CH3-" 6 partial charge=-0.18
|
||||
# @atom:81 12.011 #CT "Alkane -CH2-" 6 partial charge=-0.12
|
||||
# @atom:85 1.008 #HC "Alkane H-C" 1 partial charge=0.06
|
||||
# In this example, atomic charges are generated by atom type (according to
|
||||
# rules in oplsaa.lt), and can be omitted. Just leave them as "0.00" for now.
|
||||
# The "..." in "$mol:..." tells moltemplate that this molecule may be part
|
||||
# of a larger molecule, and (if so) to use the larger parent object's
|
||||
# molecule id number as it's own.
|
||||
|
||||
# Now specify which pairs of atoms are bonded:
|
||||
write('Data Bond List') {
|
||||
$bond:CH1 $atom:C $atom:H1
|
||||
$bond:CH2 $atom:C $atom:H2
|
||||
$bond:CH3 $atom:C $atom:H3
|
||||
}
|
||||
|
||||
} # CH3
|
||||
|
||||
|
||||
|
||||
# Optional: Shift all the coordinates in the +Y direction by 0.4431163.
|
||||
# This way, the carbon atom is no longer located at 0,0,0, but the
|
||||
# axis of an alkane chain containing this monomer is at 0,0,0.
|
||||
# (This makes it more convenient to construct a polymer later.
|
||||
# If this is confusing, then simply add 0.4431163 to the Y
|
||||
# coordinates in the "Data Atoms" section above.)
|
||||
|
||||
CH3.move(0,0.4431163,0)
|
||||
|
||||
|
||||
|
||||
|
||||
######### (scratchwork calculations for the atomic coordinates) #########
|
||||
# Lcc = 1.5350 # length of the C-C bond (Sp3)
|
||||
# Lch = 1.0930 # length of the C-H bond
|
||||
# theta=2*atan(sqrt(2)) # ~= 109.5 degrees = tetrahedronal angle (C-C-C angle)
|
||||
# DeltaXc = Lcc*sin(theta/2) # = 1.2533222517240594
|
||||
# DeltaYc = Lcc*cos(theta/2) # = 0.8862326632060754
|
||||
# # 0.5*DeltaYc = 0.4431163316030377
|
||||
# DeltaZh = Lch*sin(theta/2) # = 0.8924307629540046
|
||||
# DeltaYh = Lch*cos(theta/2) # = 0.6310438442242609
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
||||
|
||||
# Create the "oplsaa.lt" file which moltemplate will need
|
||||
|
||||
cd oplsaa_lt_generator/
|
||||
oplsaa_moltemplate.py oplsaa_subset.prm
|
||||
mv -f oplsaa.lt ..
|
||||
cd ..
|
||||
|
||||
# run moltemplate
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
# This will generate various files with names ending in *.in* and *.data.
|
||||
# Move them to the directory where you plan to run LAMMPS (in this case "../")
|
||||
mv -f system.data system.in* ../
|
||||
|
||||
# Optional:
|
||||
# The "./output_ttree/" directory is full of temporary files generated by
|
||||
# moltemplate. They can be useful for debugging, but are usually thrown away.
|
||||
rm -rf output_ttree/
|
||||
|
||||
# Optional:
|
||||
# Delete the "oplsaa.lt" file:
|
||||
rm -f oplsaa.lt
|
||||
|
||||
cd ../
|
|
@ -1,24 +0,0 @@
|
|||
|
||||
This is an example of how to use the OPLSAA force-field in LAMMPS
|
||||
(using moltemplate.sh and Jason Lambert's oplsaa_moltemplate.py conversion tool)
|
||||
|
||||
This example also shows how to use moltemplate in combination with PACKMOL.
|
||||
(PACKMOL is a useful program for generating atomic coordinates. In this example,
|
||||
moltemplate.sh is only used to create the topology, force-field and charges,
|
||||
and PACKMOL generates the coordinates, which moltemplate reads (in "step 1").
|
||||
Moltemplate can also be used for generating atomic coordinates, especially
|
||||
for mixing many small molecules together, as we do in this example. However
|
||||
I wanted to demonstrate how to combine PACKMOL with moltemplate.sh.
|
||||
In some other scenarios, such as protein solvation, PACKMOL does a much
|
||||
better job than moltemplate.)
|
||||
|
||||
As of 2014-12-19, this code has not been tested for accuracy.
|
||||
(See the WARNING.TXT file.)
|
||||
|
||||
step 1)
|
||||
To build the files which LAMMPS needs, follow the instructions in:
|
||||
README_setup.sh
|
||||
|
||||
step 2)
|
||||
To run LAMMPS with these files, follow these instructions:
|
||||
README_run.sh
|
|
@ -1,44 +0,0 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
# Create the coordinates of the atoms using PACKMOL
|
||||
cd packmol_files
|
||||
|
||||
packmol < mix_ethylene+benzene.inp
|
||||
mv -f system.xyz ../moltemplate_files/
|
||||
|
||||
cd ..
|
||||
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
||||
|
||||
# Create the "oplsaa.lt" file which moltemplate will need
|
||||
|
||||
cd oplsaa_lt_generator/
|
||||
oplsaa_moltemplate.py oplsaa_subset.prm
|
||||
mv -f oplsaa.lt ..
|
||||
cd ..
|
||||
|
||||
# run moltemplate
|
||||
|
||||
moltemplate.sh -xyz system.xyz system.lt
|
||||
|
||||
# This will generate various files with names ending in *.in* and *.data.
|
||||
# Move them to the directory where you plan to run LAMMPS (in this case "../")
|
||||
mv -f system.data system.in* ../
|
||||
|
||||
# Optional:
|
||||
# The "./output_ttree/" directory is full of temporary files generated by
|
||||
# moltemplate. They can be useful for debugging, but are usually thrown away.
|
||||
rm -rf output_ttree/
|
||||
|
||||
# Optional:
|
||||
# Delete the "oplsaa.lt" file:
|
||||
rm -f oplsaa.lt
|
||||
|
||||
|
||||
cd ../
|
|
@ -1,81 +0,0 @@
|
|||
This example is a simple simulation of many long alkane chains (hexadecane) in a
|
||||
box at room temperature and atmospheric pressure. Please read "WARNING.TXT".
|
||||
|
||||
|
||||
NOTE: This particular file contains instructions for how to build molecules
|
||||
using the OPLSAA force-field. However, moltemplate is not limited to
|
||||
OPLSAA. You can use other force-fields, or define your own force-fields
|
||||
(or provide a list of bonded interactions explicitly).
|
||||
|
||||
|
||||
-------- INSTRUCTIONS: ---------
|
||||
|
||||
1) Download the "oplsaa.prm" file containing the OPLS force field
|
||||
parameters. I do not have permission to distribute those parameters,
|
||||
but you can download them from one of these URLS:
|
||||
http://dasher.wustl.edu/tinker/distribution/params/oplsaa.prm
|
||||
http://dasher.wustl.edu/ffe/distribution/params/oplsaa.prm
|
||||
|
||||
2) Create the "oplsaa_subset.prm" file by making a copy of the "oplsaa.prm"
|
||||
file, renaming it to "oplsaa_subset.prm", and deleting the atoms you don't need.
|
||||
For example, if you are building a simple alkane chain, you would delete every
|
||||
line beginning with the word "atom", except for these three lines:
|
||||
|
||||
atom 80 13 CT "Alkane CH3-" 6 12.011 4
|
||||
atom 81 13 CT "Alkane -CH2-" 6 12.011 4
|
||||
atom 85 46 HC "Alkane H-C" 1 1.008 1
|
||||
|
||||
(Leave the rest of the file unmodified.)
|
||||
|
||||
|
||||
3) Create the "oplsaa.lt" file using this command:
|
||||
|
||||
oplsaa_moltemplate.py oplsaa_subset.prm
|
||||
|
||||
(Credit to Jasen Lambert for contributing this useful script.)
|
||||
|
||||
|
||||
4) Create the "system.data", "system.in.init", and "system.in.settings"
|
||||
files which LAMMPS will read by running:
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
|
||||
5)
|
||||
To run LAMMPS, you must make sure LAMMPS was built with the "USER-MISC" package.
|
||||
(because it uses dihedral_style fourier)
|
||||
To do this, type "make yes-user-misc" before compiling LAMMPS.
|
||||
http://lammps.sandia.gov/doc/Section_start.html#start_3
|
||||
|
||||
|
||||
6) Run LAMMPS in this order:
|
||||
|
||||
lmp_g++ -i run.in.min
|
||||
lmp_g++ -i run.in.npt
|
||||
lmp_g++ -i run.in.nvt
|
||||
|
||||
(Replace "lmp_g++" with the name of the LAMMPS executable you are using.)
|
||||
|
||||
---- Details ----
|
||||
|
||||
The "Hexadecane" molecule, as well as the "CH2", and "CH3" monomers it contains
|
||||
use the OPLSAA force-field. This means that when we define these molecules,
|
||||
we only specify the atom names, bond list, and coordinates.
|
||||
We do not have to list the atom charges, angles, dihedrals, or impropers.
|
||||
The rules for creating atomic charge and angle topology are contained in
|
||||
the "oplsaa.lt" file created by step 3) above. The "ch2group.lt",
|
||||
"ch3group.lt", and "hexadecane.lt" files all refer to "oplsaa.lt",
|
||||
(as well as the "OPLSAA" force-field object which it defines). Excerpt:
|
||||
|
||||
import "oplsaa.lt"
|
||||
CH2 inherits OPLSAA { ...
|
||||
CH3 inherits OPLSAA { ...
|
||||
Hexadecane inherits OPLSAA { ...
|
||||
|
||||
Alternatively, you can manually define a list of angles, dihedrals, and
|
||||
improper interactions in these files, instead of asking the force-field
|
||||
to generate them for you. You can also specify some of the angles and
|
||||
dihedrals explicitly, and let the force-field handle the rest.
|
||||
(Many of the molecule examples which come with moltemplate do this.)
|
||||
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
||||
|
||||
# Create the "oplsaa.lt" file which moltemplate will need
|
||||
|
||||
cd oplsaa_lt_generator/
|
||||
oplsaa_moltemplate.py oplsaa_subset.prm
|
||||
mv -f oplsaa.lt ..
|
||||
cd ..
|
||||
|
||||
# run moltemplate
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
# This will generate various files with names ending in *.in* and *.data.
|
||||
# Move them to the directory where you plan to run LAMMPS (in this case "../")
|
||||
mv -f system.data system.in* ../
|
||||
|
||||
# Optional:
|
||||
# The "./output_ttree/" directory is full of temporary files generated by
|
||||
# moltemplate. They can be useful for debugging, but are usually thrown away.
|
||||
rm -rf output_ttree/
|
||||
|
||||
# Optional:
|
||||
# Delete the "oplsaa.lt" file:
|
||||
rm -f oplsaa.lt
|
||||
|
||||
cd ../
|
|
@ -1,55 +0,0 @@
|
|||
|
||||
import "oplsaa.lt" # <-- defines the "OPLSAA" force field
|
||||
|
||||
|
||||
CH2 inherits OPLSAA {
|
||||
|
||||
# atom-id mol-id atom-type charge x y z
|
||||
|
||||
write("Data Atoms") {
|
||||
$atom:C $mol:... @atom:81 0.00 0.000 0.000 0.000
|
||||
$atom:H1 $mol:... @atom:85 0.00 0.000 0.63104384422426 0.892430762954
|
||||
$atom:H2 $mol:... @atom:85 0.00 0.000 0.63104384422426 -0.892430762954
|
||||
}
|
||||
|
||||
# Atom type numbers (@atom:80,@atom:85) are defined in "oplsaa.lt". Excerpt:
|
||||
# @atom:80 12.011 #CT "Alkane CH3-" 6 partial charge=-0.18
|
||||
# @atom:81 12.011 #CT "Alkane -CH2-" 6 partial charge=-0.12
|
||||
# @atom:85 1.008 #HC "Alkane H-C" 1 partial charge=0.06
|
||||
# In this example, atomic charges are generated by atom type (according to
|
||||
# rules in oplsaa.lt), and can be omitted. Just leave them as "0.00" for now.
|
||||
# The "..." in "$mol:..." tells moltemplate that this molecule may be part
|
||||
# of a larger molecule, and (if so) to use the larger parent object's
|
||||
# molecule id number as it's own.
|
||||
|
||||
# Now specify which pairs of atoms are bonded:
|
||||
write('Data Bond List') {
|
||||
$bond:CH1 $atom:C $atom:H1
|
||||
$bond:CH2 $atom:C $atom:H2
|
||||
}
|
||||
|
||||
} # CH2
|
||||
|
||||
|
||||
|
||||
# Optional: Shift all the coordinates in the +Y direction by 0.4431163.
|
||||
# This way, the carbon atom is no longer located at 0,0,0, but the
|
||||
# axis of an alkane chain containing this monomer is at 0,0,0.
|
||||
# (This makes it more convenient to construct a polymer later.
|
||||
# If this is confusing, then simply add 0.4431163 to the Y
|
||||
# coordinates in the "Data Atoms" section above.)
|
||||
|
||||
CH2.move(0,0.4431163,0)
|
||||
|
||||
|
||||
|
||||
|
||||
######### (scratchwork calculations for the atomic coordinates) #########
|
||||
# Lcc = 1.5350 # length of the C-C bond (Sp3)
|
||||
# Lch = 1.0930 # length of the C-H bond
|
||||
# theta=2*atan(sqrt(2)) # ~= 109.5 degrees = tetrahedronal angle (C-C-C angle)
|
||||
# DeltaXc = Lcc*sin(theta/2) # = 1.2533222517240594
|
||||
# DeltaYc = Lcc*cos(theta/2) # = 0.8862326632060754
|
||||
# # 0.5*DeltaYc = 0.4431163316030377
|
||||
# DeltaZh = Lch*sin(theta/2) # = 0.8924307629540046
|
||||
# DeltaYh = Lch*cos(theta/2) # = 0.6310438442242609
|
|
@ -1,58 +0,0 @@
|
|||
|
||||
import "oplsaa.lt" # <-- defines the "OPLSAA" force field
|
||||
|
||||
|
||||
CH3 inherits OPLSAA {
|
||||
|
||||
# atom-id mol-id atom-type charge x y z
|
||||
|
||||
write("Data Atoms") {
|
||||
$atom:C $mol:... @atom:80 0.00 0.000000 0.000000 0.000000
|
||||
$atom:H1 $mol:... @atom:85 0.00 0.000000 0.6310438442242609 0.8924307629540046
|
||||
$atom:H2 $mol:... @atom:85 0.00 0.000000 0.6310438442242609 -0.8924307629540046
|
||||
$atom:H3 $mol:... @atom:85 0.00 -0.8924307629540046 -0.6310438442242609 0.000000
|
||||
}
|
||||
|
||||
# Atom type numbers (@atom:80,@atom:85) are defined in "oplsaa.lt". Excerpt:
|
||||
# @atom:80 12.011 #CT "Alkane CH3-" 6 partial charge=-0.18
|
||||
# @atom:81 12.011 #CT "Alkane -CH2-" 6 partial charge=-0.12
|
||||
# @atom:85 1.008 #HC "Alkane H-C" 1 partial charge=0.06
|
||||
# In this example, atomic charges are generated by atom type (according to
|
||||
# rules in oplsaa.lt), and can be omitted. Just leave them as "0.00" for now.
|
||||
# The "..." in "$mol:..." tells moltemplate that this molecule may be part
|
||||
# of a larger molecule, and (if so) to use the larger parent object's
|
||||
# molecule id number as it's own.
|
||||
|
||||
# Now specify which pairs of atoms are bonded:
|
||||
write('Data Bond List') {
|
||||
$bond:CH1 $atom:C $atom:H1
|
||||
$bond:CH2 $atom:C $atom:H2
|
||||
$bond:CH3 $atom:C $atom:H3
|
||||
}
|
||||
|
||||
} # CH3
|
||||
|
||||
|
||||
|
||||
# Optional: Shift all the coordinates in the +Y direction by 0.4431163.
|
||||
# This way, the carbon atom is no longer located at 0,0,0, but the
|
||||
# axis of an alkane chain containing this monomer is at 0,0,0.
|
||||
# (This makes it more convenient to construct a polymer later.
|
||||
# If this is confusing, then simply add 0.4431163 to the Y
|
||||
# coordinates in the "Data Atoms" section above.)
|
||||
|
||||
CH3.move(0,0.4431163,0)
|
||||
|
||||
|
||||
|
||||
|
||||
######### (scratchwork calculations for the atomic coordinates) #########
|
||||
# Lcc = 1.5350 # length of the C-C bond (Sp3)
|
||||
# Lch = 1.0930 # length of the C-H bond
|
||||
# theta=2*atan(sqrt(2)) # ~= 109.5 degrees = tetrahedronal angle (C-C-C angle)
|
||||
# DeltaXc = Lcc*sin(theta/2) # = 1.2533222517240594
|
||||
# DeltaYc = Lcc*cos(theta/2) # = 0.8862326632060754
|
||||
# # 0.5*DeltaYc = 0.4431163316030377
|
||||
# DeltaZh = Lch*sin(theta/2) # = 0.8924307629540046
|
||||
# DeltaYh = Lch*cos(theta/2) # = 0.6310438442242609
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
This example contains a mixture of water(SPCE) and methane.
|
||||
The methane molecules use OPLSAA force-field, but the water molecules do not.
|
||||
|
||||
---- Details ----
|
||||
|
||||
The methane molecules in this example use the OPLSAA force-field. This means
|
||||
that when we define "Methane", we only specify the atom names, bond list,
|
||||
and coordinates. We then use oplsaa_moltemplate.py and moltemplate.sh to load
|
||||
the OPLSAA force-field parameters (and atom charges) for the Methane molecule
|
||||
from an external file ("oplsaa.lt". Read the "oplsaa_lt_generator/README.TXT"
|
||||
file for details.) Consequently, the "moltemplate_files/methane.lt" file
|
||||
contains these lines which refer to OPLSAA:
|
||||
|
||||
import "oplsaa.lt"
|
||||
Methane inherits OPLSAA { ...
|
||||
|
||||
However the "SPCE" (water) molecules does NOT use a database to look up the
|
||||
force-field parameters for this tiny molecule.
|
||||
Instead, the "moltemplate_files/spce.lt" file declares all of the angle
|
||||
interactions, atom properties and force-field parameters for water explicitly.
|
||||
(Consequently, it makes no mention of "oplsaa.lt" or "OPLSAA".)
|
||||
|
||||
|
||||
-------- Instructions: ---------
|
||||
|
||||
More detailed instructions on how to build LAMMPS input files and
|
||||
run a short simulation are provided in other README files.
|
||||
|
||||
step 1)
|
||||
README_setup.sh
|
||||
|
||||
step 2)
|
||||
README_run.sh
|
|
@ -1,39 +0,0 @@
|
|||
# --- Running LAMMPS ---
|
||||
# -------- REQUIREMENTS: ---------
|
||||
# 1) This example requires building LAMMPS with the "USER-MISC" package.
|
||||
# (because it makes use of "gaff.lt" which uses dihedral_style fourier)
|
||||
# To do this, type "make yes-user-misc" before compiling LAMMPS.
|
||||
# http://lammps.sandia.gov/doc/Section_start.html#start_3
|
||||
# -------- PREREQUISITES: --------
|
||||
# The 2 files "run.in.npt", and "run.in.nvt" are LAMMPS
|
||||
# input scripts which link to the input scripts and data files
|
||||
# you hopefully have created earlier with moltemplate.sh:
|
||||
# system.in.init, system.in.settings, system.data
|
||||
# If not, carry out the instructions in "README_setup.sh".
|
||||
#
|
||||
# -- Instructions: --
|
||||
# If "lmp_mpi" is the name of the command you use to invoke lammps,
|
||||
# then you would run lammps on these files this way:
|
||||
|
||||
|
||||
lmp_mpi -i run.in.npt # minimization and simulation at constant pressure
|
||||
lmp_mpi -i run.in.nvt # minimization and simulation at constant volume
|
||||
|
||||
#(Note: The constant volume simulation lacks pressure equilibration. These are
|
||||
# completely separate simulations. The results of the constant pressure
|
||||
# simulation might be ignored when beginning the simulation at constant
|
||||
# volume. (This is because restart files in LAMMPS don't always work,
|
||||
# and I was spending a lot of time trying to convince people it was a
|
||||
# LAMMPS bug, instead of a moltemplate bug, so I disabled restart files.)
|
||||
# Read the "run.in.nvt" file to find out how to use the "read_restart"
|
||||
# command to load the results of the pressure-equilibration simulation,
|
||||
# before beginning a constant-volume run.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# If you have compiled the MPI version of lammps, you can run lammps in parallel
|
||||
#mpirun -np 4 lmp_mpi -i run.in.npt
|
||||
#mpirun -np 4 lmp_mpi -i run.in.nvt
|
||||
# (assuming you have 4 processors available)
|
|
@ -1,36 +0,0 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
||||
|
||||
# Create the "oplsaa.lt" file which moltemplate will need
|
||||
|
||||
cd oplsaa_lt_generator/
|
||||
oplsaa_moltemplate.py oplsaa_subset.prm
|
||||
mv -f oplsaa.lt ..
|
||||
cd ..
|
||||
|
||||
# run moltemplate
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
# This will generate various files with names ending in *.in* and *.data.
|
||||
# Move them to the directory where you plan to run LAMMPS (in this case "../")
|
||||
mv -f system.data system.in* ../
|
||||
|
||||
# Optional:
|
||||
# The "./output_ttree/" directory is full of temporary files generated by
|
||||
# moltemplate. They can be useful for debugging, but are usually thrown away.
|
||||
rm -rf output_ttree/
|
||||
|
||||
# Optional:
|
||||
# Delete the "oplsaa.lt" file:
|
||||
rm -f oplsaa.lt
|
||||
|
||||
|
||||
|
||||
cd ../
|
|
@ -1,39 +0,0 @@
|
|||
# --- Running LAMMPS ---
|
||||
# -------- REQUIREMENTS: ---------
|
||||
# 1) This example requires building LAMMPS with the "USER-MISC" package.
|
||||
# (because it makes use of "gaff.lt" which uses dihedral_style fourier)
|
||||
# To do this, type "make yes-user-misc" before compiling LAMMPS.
|
||||
# http://lammps.sandia.gov/doc/Section_start.html#start_3
|
||||
# -------- PREREQUISITES: --------
|
||||
# The 2 files "run.in.npt", and "run.in.nvt" are LAMMPS
|
||||
# input scripts which link to the input scripts and data files
|
||||
# you hopefully have created earlier with moltemplate.sh:
|
||||
# system.in.init, system.in.settings, system.data
|
||||
# If not, carry out the instructions in "README_setup.sh".
|
||||
#
|
||||
# -- Instructions: --
|
||||
# If "lmp_mpi" is the name of the command you use to invoke lammps,
|
||||
# then you would run lammps on these files this way:
|
||||
|
||||
|
||||
lmp_mpi -i run.in.npt # minimization and simulation at constant pressure
|
||||
lmp_mpi -i run.in.nvt # minimization and simulation at constant volume
|
||||
|
||||
#(Note: The constant volume simulation lacks pressure equilibration. These are
|
||||
# completely separate simulations. The results of the constant pressure
|
||||
# simulation might be ignored when beginning the simulation at constant
|
||||
# volume. (This is because restart files in LAMMPS don't always work,
|
||||
# and I was spending a lot of time trying to convince people it was a
|
||||
# LAMMPS bug, instead of a moltemplate bug, so I disabled restart files.)
|
||||
# Read the "run.in.nvt" file to find out how to use the "read_restart"
|
||||
# command to load the results of the pressure-equilibration simulation,
|
||||
# before beginning a constant-volume run.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# If you have compiled the MPI version of lammps, you can run lammps in parallel
|
||||
#mpirun -np 4 lmp_mpi -i run.in.npt
|
||||
#mpirun -np 4 lmp_mpi -i run.in.nvt
|
||||
# (assuming you have 4 processors available)
|
|
@ -1,36 +0,0 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
||||
|
||||
# Create the "oplsaa.lt" file which moltemplate will need
|
||||
|
||||
cd oplsaa_lt_generator/
|
||||
oplsaa_moltemplate.py oplsaa_subset.prm
|
||||
mv -f oplsaa.lt ..
|
||||
cd ..
|
||||
|
||||
# run moltemplate
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
# This will generate various files with names ending in *.in* and *.data.
|
||||
# Move them to the directory where you plan to run LAMMPS (in this case "../")
|
||||
mv -f system.data system.in* ../
|
||||
|
||||
# Optional:
|
||||
# The "./output_ttree/" directory is full of temporary files generated by
|
||||
# moltemplate. They can be useful for debugging, but are usually thrown away.
|
||||
rm -rf output_ttree/
|
||||
|
||||
# Optional:
|
||||
# Delete the "oplsaa.lt" file:
|
||||
rm -f oplsaa.lt
|
||||
|
||||
|
||||
|
||||
cd ../
|
|
@ -1,36 +0,0 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
||||
|
||||
# Create the "oplsaa.lt" file which moltemplate will need
|
||||
|
||||
cd oplsaa_lt_generator/
|
||||
oplsaa_moltemplate.py oplsaa_subset.prm
|
||||
mv -f oplsaa.lt ..
|
||||
cd ..
|
||||
|
||||
# run moltemplate
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
# This will generate various files with names ending in *.in* and *.data.
|
||||
# Move them to the directory where you plan to run LAMMPS (in this case "../")
|
||||
mv -f system.data system.in* ../
|
||||
|
||||
# Optional:
|
||||
# The "./output_ttree/" directory is full of temporary files generated by
|
||||
# moltemplate. They can be useful for debugging, but are usually thrown away.
|
||||
rm -rf output_ttree/
|
||||
|
||||
# Optional:
|
||||
# Delete the "oplsaa.lt" file:
|
||||
rm -f oplsaa.lt
|
||||
|
||||
|
||||
|
||||
cd ../
|
|
@ -1,3 +0,0 @@
|
|||
|
||||
OPLSAA force-field conversion tools provided by Jason Lambert.
|
||||
|
|
@ -1,104 +0,0 @@
|
|||
# THIS EXAMPLE HAS NOT BEEN RIGOROUSLY TESTED.
|
||||
# (This simulation may fail.
|
||||
# However the "run.in.nvt" example in this directory should work.)
|
||||
#
|
||||
# Requirements:
|
||||
# To run this system at constant pressure, it might help to compile LAMMPS with
|
||||
# the optional RIGID package, and use "fix rigid" on the carbon. (Optional.)
|
||||
# The use of fix rigid is controversial. This method is demonstrated below.
|
||||
|
||||
# ------------------------------- Initialization Section --------------------
|
||||
|
||||
include system.in.init
|
||||
|
||||
# ------------------------------- Atom Definition Section -------------------
|
||||
|
||||
read_data system.data
|
||||
|
||||
# ------------------------------- Settings Section --------------------------
|
||||
|
||||
include system.in.settings
|
||||
|
||||
# ------------------------------- Run Section -------------------------------
|
||||
|
||||
|
||||
# Only the Cgraphene atoms are immobile.
|
||||
group mobile subtract all Cgraphene
|
||||
|
||||
# (Note: The "Cgraphene" group was defined in system.in.settings.)
|
||||
|
||||
|
||||
# Unfortunately you can not use the LAMMPS "minimize" command on this system
|
||||
# because there is no way to immobilize the carbon graphene & nanotube atoms
|
||||
# during minimization. Instead, we can use langevin dynamics with a large
|
||||
# damping parameter and a small timestep.
|
||||
|
||||
print "--------- beginning minimization (using fix langevin) ---------"
|
||||
|
||||
timestep 0.1
|
||||
fix fxlan mobile langevin 1.0 1.0 100.0 48279
|
||||
fix fxnve mobile nve # <-- needed by fix langevin (see lammps documentation)
|
||||
thermo 100
|
||||
run 2500
|
||||
|
||||
unfix fxlan
|
||||
unfix fxnve
|
||||
|
||||
# -- simulation protocol --
|
||||
|
||||
print "--------- beginning simulation (using fix nvt) ---------"
|
||||
|
||||
timestep 0.25
|
||||
dump 1 all custom 1000 traj_npt.lammpstrj id mol type x y z ix iy iz
|
||||
|
||||
thermo_style custom step temp pe etotal press vol epair ebond eangle edihed
|
||||
thermo 1000 # time interval for printing out "thermo" data
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# ------------------------- NPT ---------------------------
|
||||
|
||||
# Set temp=300K, pressure=100bar, and equilibrate volume only in the z direction
|
||||
|
||||
fix fxMoveStuff mobile npt temp 300 300 100 z 100 100 1000.0 dilate mobile
|
||||
|
||||
# ------ QUESTIONABLE (see below): ------
|
||||
|
||||
fix Ffreezestuff Cgraphene rigid/npt single temp 300 300 100 z 100 100 1000.0 force * off off off torque * off off off dilate mobile
|
||||
|
||||
# -- Alternate npt rigid method --
|
||||
# I'm not sure which way is more correct, however
|
||||
# this also seems to behave in a reasonable-looking way:
|
||||
#fix Ffreezestuff Cgraphene rigid single force * off off off torque * off off off
|
||||
#
|
||||
# The use of either "fix rigid" or "fix rigid/npt" to immobilize
|
||||
# an object is somewhat controversial. Feel free to omit it.
|
||||
#(Neither Trung or Steve Plimpton use rigid or rigid/npt for immobilizing
|
||||
#molecules, but I noticed that at NPT, it does a better job of maintaining
|
||||
# the correct volume. However "fix rigid" has changed since then (2011),
|
||||
# so this may no longer be true. Please use this example with caution.)
|
||||
# ----------------------------------------
|
||||
|
||||
# IMPORTANT for NPT: You must use "neigh_modify" to turn off calculation of the
|
||||
# forces between immobilized atoms.
|
||||
neigh_modify exclude group Cgraphene Cgraphene
|
||||
|
||||
# The next two lines recalculate the temperature
|
||||
# using only the mobile degrees of freedom:
|
||||
|
||||
compute tempMobile mobile temp
|
||||
compute pressMobile all pressure tempMobile
|
||||
|
||||
thermo_style custom step c_tempMobile c_pressMobile temp press vol
|
||||
|
||||
fix_modify fxMoveStuff temp tempMobile
|
||||
|
||||
run 100000
|
||||
|
||||
write_data system_after_npt.data
|
||||
|
||||
# (The "write_restart" and "read_restart" commands were buggy in 2012,
|
||||
# but they should work also.)
|
||||
|
|
@ -1,7 +1,3 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
# Create the coordinates of the atoms using PACKMOL
|
||||
cd packmol_files
|
||||
|
|
|
@ -24,7 +24,7 @@ write_once("In Init") {
|
|||
write_once("Data Boundary") {
|
||||
0.0 36.0 xlo xhi
|
||||
0.0 36.0 ylo yhi
|
||||
0.0 36.0 zlo zhi
|
||||
-18.0 18.0 zlo zhi
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,70 +1,120 @@
|
|||
# -- Init Section --
|
||||
# THIS EXAMPLE HAS NOT BEEN RIGOROUSLY TESTED.
|
||||
# (This simulation may fail.
|
||||
# However the "run.in.nvt" example in this directory should work.)
|
||||
#
|
||||
# Requirements:
|
||||
# To run this system at constant pressure, it might help to compile LAMMPS with
|
||||
# the optional RIGID package, and use "fix rigid" on the carbon. (Optional.)
|
||||
# The use of fix rigid is controversial. This method is demonstrated below.
|
||||
|
||||
# ------------------------------- Initialization Section --------------------
|
||||
|
||||
include system.in.init
|
||||
|
||||
# -- Atom Definition Section --
|
||||
# ------------------------------- Atom Definition Section -------------------
|
||||
|
||||
read_data system.data
|
||||
|
||||
# -- Settings Section --
|
||||
# ------------------------------- Settings Section --------------------------
|
||||
|
||||
include system.in.settings
|
||||
|
||||
# -- Run Section --
|
||||
# ------------------------------- Run Section -------------------------------
|
||||
|
||||
|
||||
timestep 1.0
|
||||
dump 1 all custom 500 traj_npt.lammpstrj id mol type x y z ix iy iz
|
||||
|
||||
thermo_style custom step temp pe etotal press vol epair ebond eangle edihed
|
||||
thermo 500 # time interval for printing out "thermo" data
|
||||
|
||||
|
||||
velocity groupB zero angular
|
||||
velocity groupB zero linear
|
||||
# (I'm not sure if the two lines above are necessary, but they don't hurt.)
|
||||
|
||||
# Only the groupB atoms are immobile.
|
||||
|
||||
group mobile subtract all groupB
|
||||
|
||||
# Unfortunately you can not use the LAMMPS "minimize" command on this system
|
||||
# because there is no way to immobilize the wall atoms during minimization.
|
||||
# Instead, we can use langevin dynamics with a fast
|
||||
# damping parameter and a small timestep.
|
||||
|
||||
print "--------- beginning minimization (using fix langevin) ---------"
|
||||
|
||||
timestep 0.1
|
||||
fix fxlan mobile langevin 1.0 1.0 100.0 48279
|
||||
fix fxnve mobile nve # <-- needed by fix langevin (see lammps documentation)
|
||||
thermo 100
|
||||
run 2500
|
||||
|
||||
unfix fxlan
|
||||
unfix fxnve
|
||||
|
||||
# -- simulation protocol --
|
||||
|
||||
print "--------- beginning simulation (using fix nvt) ---------"
|
||||
|
||||
dump 1 all custom 1000 traj_npt.lammpstrj id mol type x y z ix iy iz
|
||||
|
||||
thermo_style custom step temp pe etotal press vol epair ebond eangle edihed
|
||||
thermo 200 # time interval for printing out "thermo" data
|
||||
|
||||
|
||||
# ------------------------- NPT ---------------------------
|
||||
|
||||
# Set temp=300K, pressure=500bar, and equilibrate volume only in the z direction
|
||||
|
||||
fix fMoveStuff mobile npt temp 300 300 100 z 500 500 1000.0 dilate mobile
|
||||
|
||||
# ------ QUESTIONABLE (see below): ------
|
||||
|
||||
fix Ffreezestuff groupB rigid/npt single temp 300 300 100 z 500 500 1000.0 force * off off off torque * off off off dilate mobile
|
||||
fix Ffreezestuff groupB rigid single force * off off off torque * off off off
|
||||
|
||||
# Comment:
|
||||
# The use of "fix rigid" to immobilize an object is somewhat controversial.
|
||||
# Feel free to omit it.
|
||||
# (Neither Trung or Steve Plimpton use fix rigid for immobilizing
|
||||
# molecules, but I noticed that at NPT, it does a better job of maintaining
|
||||
# the correct volume. However "fix rigid" has changed since then (2011),
|
||||
# so this may no longer be true. Please use this example with caution.)
|
||||
|
||||
|
||||
|
||||
# Thermostat+Barostat
|
||||
# Set temp=300K, pressure=200bar, and equilibrate volume only in the z direction
|
||||
|
||||
fix fxMoveStuff mobile npt temp 300 300 100 z 200 200 1000.0 dilate mobile drag 2.0
|
||||
|
||||
# -- Alternate npt rigid method --
|
||||
# I'm not sure which way is more correct, however
|
||||
# this also seems to behave in a reasonable-looking way:
|
||||
#fix Ffreezestuff groupB rigid single force * off off off torque * off off off dilate mobile
|
||||
#
|
||||
# The use of either "fix rigid" or "fix rigid/npt" to immobilize
|
||||
# an object is somewhat controversial. Feel free to omit it.
|
||||
#(Neither Trung or Steve Plimpton use rigid or rigid/npt for immobilizing
|
||||
#molecules, but I noticed that at NPT, it does a better job of maintaining
|
||||
# the correct volume. However "fix rigid" has changed since then (2011),
|
||||
# so this may no longer be true. Please use this example with caution.)
|
||||
# ----------------------------------------
|
||||
|
||||
# IMPORTANT for NPT: You must use "neigh_modify" to turn off calculation of the
|
||||
# forces between immobilized atoms.
|
||||
neigh_modify exclude group groupB groupB
|
||||
|
||||
# The next two lines recalculate the temperature
|
||||
# using only the mobile degrees of freedom:
|
||||
# The next two lines recalculate the temperature using
|
||||
# only the mobile degrees of freedom (ie. water atom velocities):
|
||||
|
||||
compute tempMobile mobile temp
|
||||
compute pressMobile all pressure tempMobile
|
||||
|
||||
thermo_style custom step c_tempMobile c_pressMobile temp press vol
|
||||
|
||||
fix_modify fMoveStuff temp tempMobile
|
||||
fix_modify fxMoveStuff temp tempMobile
|
||||
|
||||
reset_timestep 0
|
||||
|
||||
timestep 0.5
|
||||
|
||||
run 100000
|
||||
|
||||
timestep 1.0
|
||||
|
||||
run 100000
|
||||
|
||||
run 60000
|
||||
|
||||
write_data system_after_npt.data
|
||||
|
||||
# (The "write_restart" and "read_restart" commands were buggy in 2012,
|
||||
# but they should work also.)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# ----- Comment: Avoid using fix rigid/npt on large single rigid objects -----
|
||||
#
|
||||
# Use of the following is not recommended:
|
||||
#
|
||||
# fix Ffreezestuff groupB rigid/npt single temp 300 300 100 z 200 200 1000.0 force * off off off torque * off off off dilate mobile
|
||||
# (temp=300K, pressure=200bar, and equilibrate volume only in the z direction)
|
||||
#
|
||||
# In my experience, the system becomes unstable when applying "fix rigid/npt"
|
||||
# to the immobile atoms, while also applying "fix npt" on the solvent atoms.
|
||||
# (It is probably a bad idea to use two barostats simultaneously.)
|
||||
# ----------------------------------------------------------------------------
|
||||
|
|
|
@ -16,6 +16,10 @@ read_data system.data
|
|||
|
||||
include system.in.settings
|
||||
|
||||
# Use "neigh_modify" to turn off calculation of interactions between immobilized
|
||||
# atoms. (Note: The "groupB" group was defined in the file "system.insettings")
|
||||
neigh_modify exclude group groupB groupB
|
||||
|
||||
# -- Run Section --
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
This example shows how to build a box of benzene molecules using the
|
||||
AMBER/GAFF force-field.
|
||||
|
||||
step 1)
|
||||
To build the files which LAMMPS needs, follow the instructions in:
|
||||
README_setup.sh
|
||||
|
||||
step 2)
|
||||
To run LAMMPS with these files, follow these instructions:
|
||||
README_run.sh
|
|
@ -1,9 +1,3 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
|
@ -1,7 +1,9 @@
|
|||
|
||||
import "gaff.lt"
|
||||
|
||||
# From "gaff.lt":
|
||||
# The "gaff.lt" file is usually located in "src/moltemplate_force_fields".
|
||||
# Excerpt:
|
||||
#
|
||||
# @atom:ca # Sp2 C in pure aromatic systems
|
||||
# @atom:ha # H bonded to aromatic carbon
|
||||
#
|
|
@ -0,0 +1,13 @@
|
|||
This example shows how to simulate a mixture of ethylene and benzene
|
||||
using the AMBER/GAFF force field.
|
||||
|
||||
As of 2016-11-21, this code has not been tested for accuracy.
|
||||
(See the WARNING.TXT file.)
|
||||
|
||||
step 1)
|
||||
To build the files which LAMMPS needs, follow the instructions in:
|
||||
README_setup.sh
|
||||
|
||||
step 2)
|
||||
To run LAMMPS with these files, follow these instructions:
|
||||
README_run.sh
|
|
@ -1,10 +1,3 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
||||
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
@ -1,7 +1,7 @@
|
|||
|
||||
import "gaff.lt"
|
||||
|
||||
# The "gaff.lt" file is usually located in $MOLTEMPLATE_PATH (and is
|
||||
# distributed with moltemplate. See the "Installation" section in the manual.)
|
||||
# The "gaff.lt" file is usually located in "src/moltemplate_force_fields".
|
||||
# It contains definitions of the atoms "ca", "ha", as well as the bonded
|
||||
# and non-bonded interactions between them (and many other atoms).
|
||||
#
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
import "gaff.lt"
|
||||
|
||||
# The "gaff.lt" file is usually located in $MOLTEMPLATE_PATH (and is
|
||||
# distributed with moltemplate. See the "Installation" section in the manual.)
|
||||
# The "gaff.lt" file is usually located in "src/moltemplate_force_fields".
|
||||
# It contains definitions of the atoms "c2", "hc", as well as the bonded
|
||||
# and non-bonded interactions between them (and many other atoms).
|
||||
#
|
|
@ -25,7 +25,7 @@ Both examples use the same force-field parameters.
|
|||
|
||||
1)
|
||||
In this version, the force-field parameters are loaded from the "gaff.lt" file
|
||||
(located in the "common" subdirectory).
|
||||
(located in the "src/moltemplate_force_fields/" subdirectory).
|
||||
This frees the user from the drudgery of manually specifying all of these
|
||||
force-field details for every molecule. (However, the user must be careful
|
||||
to choose @atom-type names which match AMBER GAFF conventions,
|
|
@ -1,9 +1,3 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 35 KiB After Width: | Height: | Size: 35 KiB |
Before Width: | Height: | Size: 5.1 KiB After Width: | Height: | Size: 5.1 KiB |
|
@ -1,16 +1,9 @@
|
|||
This is an example of how to use "canned" force-fields in like GAFF in LAMMPS.
|
||||
In this example, we specify only the atom names, bond connectivity,
|
||||
(and coordinates and charge), and use moltemplate to
|
||||
load the GAFF parameters from an external file (gaff.lt)
|
||||
(...instead of specifying them explicitly in the molecule definition).
|
||||
|
||||
The simulation consists of a mixture of isobutane and water.
|
||||
Over time (less than 1 ns), the two molecules phase-separate.
|
||||
|
||||
The GAFF parameters are applied only to the isobutane molecule.
|
||||
(The water molecule paramters are defined explicitly in common/tip3p_2004.lt)
|
||||
For this to work, make sure you have defined the MOLTEMPLATE_PATH
|
||||
environment variable and set it to "common". See manual for more details.)
|
||||
(The water molecule paramters are defined explicitly in
|
||||
src/moltemplate_force_fields/tip3p_2004.lt)
|
||||
|
||||
WARNING: THIS IS A PRELIMINARY EXAMPLE WHICH USES AMBER'S GAFF FORCE FIELD.
|
||||
AS OF 2014-4-19, these features have not been tested.
|
||||
|
@ -33,13 +26,10 @@ NOTE: The GAFF force-field DOES NOT ASSIGN ATOM CHARGE.
|
|||
|
||||
-------- REQUIREMENTS: ---------
|
||||
|
||||
1) This example requires building LAMMPS with the "USER-MISC" package.
|
||||
(because it makes use of "gaff.lt" which uses dihedral_style fourier)
|
||||
To do this, type "make yes-user-misc" before compiling LAMMPS.
|
||||
http://lammps.sandia.gov/doc/Section_start.html#start_3
|
||||
2) You must define your MOLTEMPLATE_PATH environment variable
|
||||
and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
(See the "Installation" section in the moltemplate manual.)
|
||||
This example requires building LAMMPS with the "USER-MISC" package.
|
||||
(because it makes use of "gaff.lt" which uses dihedral_style fourier)
|
||||
To do this, type "make yes-user-misc" before compiling LAMMPS.
|
||||
http://lammps.sandia.gov/doc/Section_start.html#start_3
|
||||
|
||||
More detailed instructions on how to build LAMMPS input files and
|
||||
run a short simulation are provided in other README files.
|
|
@ -1,9 +1,3 @@
|
|||
# -------- REQUIREMENTS: ---------
|
||||
# You must define your MOLTEMPLATE_PATH environment variable
|
||||
# and set it to the "common" subdirectory of your moltemplate distribution.
|
||||
# (See the "Installation" section in the moltemplate manual.)
|
||||
|
||||
|
||||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 102 KiB |
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 72 KiB |
Before Width: | Height: | Size: 9.8 KiB After Width: | Height: | Size: 9.8 KiB |
|
@ -1,7 +1,7 @@
|
|||
|
||||
import "gaff.lt"
|
||||
|
||||
# The "gaff.lt" file is usually located in $MOLTEMPLATE_PATH (and is
|
||||
# distributed with moltemplate. See the "Installation" section in the manual.)
|
||||
# The "gaff.lt" file is usually located in "src/moltemplate_force_fields".
|
||||
# It contains definitions of the atoms "c3", "h1", as well as the bonded
|
||||
# and non-bonded interactions between them (and many other atoms).
|
||||
#
|
|
@ -1,9 +1,6 @@
|
|||
import "tip3p_2004.lt"
|
||||
# <- This defines the TIP3P water molecule. This file is
|
||||
# located in the "common" directory. You can either copy it
|
||||
# here, or (preferably), you can define a MOLTEMPLATE_PATH
|
||||
# environment variable and point it to "common".
|
||||
# (as explained in the installation section of the manual).
|
||||
# located in the "src/moltemplate_force_fields" directory.
|
||||
|
||||
import "isobutane.lt" # <- defines the "Isobutane" molecule type.
|
||||
|
|
@ -1,8 +1,7 @@
|
|||
# -------- WARNING: --------
|
||||
|
||||
This directory contains some examples of all-atom simulations using the OPLSAA
|
||||
force field, prepared using Jason Lambert's oplsaa_moltemplate.py conversion
|
||||
tool, and moltemplate.
|
||||
force field.
|
||||
|
||||
This software is experimental, and the force-fields and equilbration protocols
|
||||
have not been tested carefully by me. There is no gaurantee that simulations
|
|
@ -0,0 +1,40 @@
|
|||
This example is a simple simulation of a long alkane chain,
|
||||
in a vacuum at room temperature using the OPLSAA force field.
|
||||
|
||||
NOTE: This particular example uses the OPLSAA force-field
|
||||
However, moltemplate is not limited to OPLSAA.
|
||||
|
||||
1) Create the "system.data", "system.in.init", and "system.in.settings"
|
||||
files which LAMMPS will read by running:
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
|
||||
2) Run LAMMPS in this order:
|
||||
|
||||
lmp_mpi -i run.in.min # minimize the energy (to avoid atom overlap) before...
|
||||
lmp_mpi -i run.in.nvt # running the simulation at constant temperature
|
||||
|
||||
(The name of the LAMMPS executable, eg "lmp_mpi", may vary.)
|
||||
|
||||
---- Details ----
|
||||
|
||||
The "Alkane50" molecule, as well as the "CH2", and "CH3" monomers it contains
|
||||
use the OPLSAA force-field. This means that when we define these molecules,
|
||||
we only specify the atom names, bond list, and coordinates.
|
||||
We do not have to list the atom charges, angles, dihedrals, or impropers.
|
||||
The rules for creating atomic charge and angle topology are contained in
|
||||
the "loplsaa.lt" file created by step 3) above. The "ch2group.lt",
|
||||
"ch3group.lt", and "alkane50.lt" files all refer to "loplsaa.lt",
|
||||
(as well as the "OPLSAA" force-field object which it defines). Excerpt:
|
||||
|
||||
import "loplsaa.lt"
|
||||
CH2 inherits OPLSAA { ...
|
||||
CH3 inherits OPLSAA { ...
|
||||
Alkane50 inherits OPLSAA { ...
|
||||
|
||||
Alternatively, you can manually define a list of angles, dihedrals, and
|
||||
improper interactions in these files, instead of asking the force-field
|
||||
to generate them for you. You can also specify some of the angles and
|
||||
dihedrals explicitly, and let the force-field handle the rest.
|
||||
(Many of the examples which come with moltemplate do this.)
|
|
@ -0,0 +1,34 @@
|
|||
# --- Running LAMMPS ---
|
||||
#
|
||||
# The 2 files "run.in.npt", and "run.in.nvt" are LAMMPS
|
||||
# input scripts which link to the input scripts and data files
|
||||
# you hopefully have created earlier with moltemplate.sh:
|
||||
# system.in.init, system.in.settings, system.data
|
||||
# If not, carry out the instructions in "README_setup.sh".
|
||||
#
|
||||
# -- Instructions: --
|
||||
# If "lmp_mpi" is the name of the command you use to invoke lammps,
|
||||
# then you would run lammps on these files this way:
|
||||
|
||||
|
||||
lmp_mpi -i run.in.min # minimization
|
||||
lmp_mpi -i run.in.nvt # minimization and simulation at constant volume
|
||||
|
||||
#(Note: The constant volume simulation lacks pressure equilibration. These are
|
||||
# completely separate simulations. The results of the constant pressure
|
||||
# simulation might be ignored when beginning the simulation at constant
|
||||
# volume. (This is because restart files in LAMMPS don't always work,
|
||||
# and I was spending a lot of time trying to convince people it was a
|
||||
# LAMMPS bug, instead of a moltemplate bug, so I disabled restart files.)
|
||||
# Read the "run.in.nvt" file to find out how to use the "read_restart"
|
||||
# command to load the results of the pressure-equilibration simulation,
|
||||
# before beginning a constant-volume run.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# If you have compiled the MPI version of lammps, you can run lammps in parallel
|
||||
#mpirun -np 4 lmp_mpi -i run.in.npt
|
||||
#mpirun -np 4 lmp_mpi -i run.in.nvt
|
||||
# (assuming you have 4 processors available)
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
||||
|
||||
# run moltemplate
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
# This will generate various files with names ending in *.in* and *.data.
|
||||
# Move them to the directory where you plan to run LAMMPS (in this case "../")
|
||||
mv -f system.data system.in* ../
|
||||
|
||||
# Optional:
|
||||
# The "./output_ttree/" directory is full of temporary files generated by
|
||||
# moltemplate. They can be useful for debugging, but are usually thrown away.
|
||||
rm -rf output_ttree/
|
||||
|
||||
cd ../
|
||||
|
||||
|
||||
# Optional:
|
||||
# Note: The system.data and system.in.settings files contain extra information
|
||||
# for atoms defined in OPLSAA which you are not using in this simulation. This
|
||||
# is harmless, but if you to delete this information from your
|
||||
# system.in.settings and system.in.data files, follow the instructions in
|
||||
# this script: "optional_cleanup/README_remove_irrelevant_info.sh"
|
Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 50 KiB |
Before Width: | Height: | Size: 59 KiB After Width: | Height: | Size: 59 KiB |
|
@ -0,0 +1,82 @@
|
|||
# This file contains a definition for the "CH2" molecular subunit.
|
||||
|
||||
# First, load the OPLS force field parameters we will need.
|
||||
# These 2 files are located in the "src/moltemplate_force_fields/" subdirectory:
|
||||
|
||||
import "oplsaa.lt" # <-- defines the standard "OPLSAA" force field
|
||||
import "loplsaa.lt" # <-- custom parameters for long alkane chains taken from
|
||||
# Sui et al. J.Chem.Theory.Comp (2012), 8, 1459
|
||||
# To use the ordinary OPLSAA force field parameters,
|
||||
# (instead of the Sui et al. parameters), change the
|
||||
# atom types below from "@atom:81L","@atom:85LCH2" to
|
||||
# "@atom:81" and "@atom:85" (defined in "oplsaa.lt")
|
||||
|
||||
|
||||
|
||||
# Then define "CH2":
|
||||
|
||||
|
||||
CH2 inherits OPLSAA {
|
||||
|
||||
# atom-id mol-id atom-type charge x y z
|
||||
|
||||
write("Data Atoms") {
|
||||
$atom:C $mol:... @atom:81L 0.0 0.000000 0.000000 0.000000
|
||||
$atom:H1 $mol:... @atom:85LCH2 0.0 0.000000 0.631044 0.892431
|
||||
$atom:H2 $mol:... @atom:85LCH2 0.0 0.000000 0.631044 -0.892431
|
||||
}
|
||||
|
||||
write('Data Bond List') {
|
||||
$bond:CH1 $atom:C $atom:H1
|
||||
$bond:CH2 $atom:C $atom:H2
|
||||
}
|
||||
|
||||
# Atom type numbers (@atom:80L,@atom:85LCH3) are defined in "loplsaa.lt",
|
||||
# which is usually located in the "src/moltemplate_force_fields/" subdirectory
|
||||
# @atom:80L "Alkane CH3- (LOPLS CT_CH3)"
|
||||
# @atom:81L "Alkane -CH2- (LOPLS CT_CH2)"
|
||||
# @atom:85LCH3 "Alkane H-C CH3 (LOPLS HC_CH3)"
|
||||
# @atom:85LCH2 "Alkane H-C CH2 (LOPLS HC_CH2)"
|
||||
# In this example, atomic charges are generated by atom type (according to the
|
||||
# rules in loplsaa.lt), and can be omitted. Just leave them as "0.00" for now.
|
||||
# The "..." in "$mol:..." tells moltemplate that this molecule may be part
|
||||
# of a larger molecule, and (if so) to use the larger parent object's
|
||||
# molecule id number as it's own.
|
||||
|
||||
} # CH2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Optional: Shift all the coordinates in the +Y direction by 0.4431163.
|
||||
# This way, the carbon atom is no longer located at 0,0,0, but the
|
||||
# axis of an alkane chain containing this monomer is at 0,0,0.
|
||||
# (This makes it more convenient to construct a polymer later.
|
||||
# If this is confusing, then simply add 0.4431163 to the Y
|
||||
# coordinates in the "Data Atoms" section above.)
|
||||
|
||||
CH2.move(0,0.4431163,0)
|
||||
|
||||
|
||||
|
||||
|
||||
######### (scratchwork calculations for the atomic coordinates) #########
|
||||
# Lcc = 1.5350 # length of the C-C bond (Sp3)
|
||||
# Lch = 1.0930 # length of the C-H bond
|
||||
# theta=2*atan(sqrt(2)) # ~= 109.5 degrees = tetrahedronal angle (C-C-C angle)
|
||||
# DeltaXc = Lcc*sin(theta/2) # = 1.2533222517240594
|
||||
# DeltaYc = Lcc*cos(theta/2) # = 0.8862326632060754
|
||||
# # 0.5*DeltaYc = 0.4431163
|
||||
# DeltaZh = Lch*sin(theta/2) # = 0.892431
|
||||
# DeltaYh = Lch*cos(theta/2) # = 0.631044
|
|
@ -0,0 +1,83 @@
|
|||
# This file contains a definition for the "CH3" molecular subunit.
|
||||
|
||||
# First, load the OPLS force field parameters we will need.
|
||||
# These 2 files are located in the "src/moltemplate_force_fields/" subdirectory:
|
||||
|
||||
import "oplsaa.lt" # <-- defines the standard "OPLSAA" force field
|
||||
import "loplsaa.lt" # <-- custom parameters for long alkane chains taken from
|
||||
# Sui et al. J.Chem.Theory.Comp (2012), 8, 1459
|
||||
# To use the ordinary OPLSAA force field parameters,
|
||||
# (instead of the Sui et al. parameters), change the
|
||||
# atom types below from "@atom:80L","@atom:85LCH3" to
|
||||
# "@atom:80" and "@atom:85" (defined in "oplsaa.lt")
|
||||
|
||||
|
||||
|
||||
# Then define "CH3":
|
||||
|
||||
|
||||
CH3 inherits OPLSAA {
|
||||
|
||||
# atom-id mol-id atom-type charge x y z
|
||||
|
||||
write("Data Atoms") {
|
||||
$atom:C $mol:... @atom:80L 0.0 0.000000 0.000000 0.000000
|
||||
$atom:H1 $mol:... @atom:85LCH3 0.0 0.000000 0.631044 0.892431
|
||||
$atom:H2 $mol:... @atom:85LCH3 0.0 0.000000 0.631044 -0.892431
|
||||
$atom:H3 $mol:... @atom:85LCH3 0.0 -0.892431 -0.631044 0.000000
|
||||
}
|
||||
|
||||
write('Data Bond List') {
|
||||
$bond:CH1 $atom:C $atom:H1
|
||||
$bond:CH2 $atom:C $atom:H2
|
||||
$bond:CH3 $atom:C $atom:H3
|
||||
}
|
||||
|
||||
# Atom type numbers (@atom:80L,@atom:85LCH3) are defined in "loplsaa.lt",
|
||||
# @atom:80L "Alkane CH3- (LOPLS CT_CH3)"
|
||||
# @atom:81L "Alkane -CH2- (LOPLS CT_CH2)"
|
||||
# @atom:85LCH3 "Alkane H-C CH3 (LOPLS HC_CH3)"
|
||||
# @atom:85LCH2 "Alkane H-C CH2 (LOPLS HC_CH2)"
|
||||
# In this example, atomic charges are generated by atom type (according to the
|
||||
# rules in loplsaa.lt), and can be omitted. Just leave them as "0.00" for now.
|
||||
# The "..." in "$mol:..." tells moltemplate that this molecule may be part
|
||||
# of a larger molecule, and (if so) to use the larger parent object's
|
||||
# molecule id number as it's own.
|
||||
|
||||
} # CH3
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Optional: Shift all the coordinates in the +Y direction by 0.4431163.
|
||||
# This way, the carbon atom is no longer located at 0,0,0, but the
|
||||
# axis of an alkane chain containing this monomer is at 0,0,0.
|
||||
# (This makes it more convenient to construct a polymer later.
|
||||
# If this is confusing, then simply add 0.4431163 to the Y
|
||||
# coordinates in the "Data Atoms" section above.)
|
||||
|
||||
CH3.move(0,0.4431163,0)
|
||||
|
||||
|
||||
|
||||
|
||||
######### (scratchwork calculations for the atomic coordinates) #########
|
||||
# Lcc = 1.5350 # length of the C-C bond (Sp3)
|
||||
# Lch = 1.0930 # length of the C-H bond
|
||||
# theta=2*atan(sqrt(2)) # ~= 109.5 degrees = tetrahedronal angle (C-C-C angle)
|
||||
# DeltaXc = Lcc*sin(theta/2) # = 1.2533222517240594
|
||||
# DeltaYc = Lcc*cos(theta/2) # = 0.8862326632060754
|
||||
# # 0.5*DeltaYc = 0.4431163
|
||||
# DeltaZh = Lch*sin(theta/2) # = 0.892431
|
||||
# DeltaYh = Lch*cos(theta/2) # = 0.631044
|
|
@ -1,7 +1,6 @@
|
|||
This is an example of how to use the OPLSAA force-field in LAMMPS
|
||||
(using moltemplate.sh and Jason Lambert's oplsaa_moltemplate.py conversion tool)
|
||||
|
||||
As of 2014-12-19, this code has not been tested for accuracy.
|
||||
As of 2016-11-21, this code has not been tested for accuracy.
|
||||
(See the WARNING.TXT file.)
|
||||
|
||||
step 1)
|
|
@ -1,10 +1,5 @@
|
|||
# --- Running LAMMPS ---
|
||||
# -------- REQUIREMENTS: ---------
|
||||
# 1) This example requires building LAMMPS with the "USER-MISC" package.
|
||||
# (because it makes use of "gaff.lt" which uses dihedral_style fourier)
|
||||
# To do this, type "make yes-user-misc" before compiling LAMMPS.
|
||||
# http://lammps.sandia.gov/doc/Section_start.html#start_3
|
||||
# -------- PREREQUISITES: --------
|
||||
#
|
||||
# The 2 files "run.in.npt", and "run.in.nvt" are LAMMPS
|
||||
# input scripts which link to the input scripts and data files
|
||||
# you hopefully have created earlier with moltemplate.sh:
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
# Create LAMMPS input files this way:
|
||||
cd moltemplate_files
|
||||
|
||||
# run moltemplate
|
||||
|
||||
moltemplate.sh system.lt
|
||||
|
||||
# This will generate various files with names ending in *.in* and *.data.
|
||||
# Move them to the directory where you plan to run LAMMPS (in this case "../")
|
||||
mv -f system.data system.in* ../
|
||||
|
||||
# Optional:
|
||||
# The "./output_ttree/" directory is full of temporary files generated by
|
||||
# moltemplate. They can be useful for debugging, but are usually thrown away.
|
||||
rm -rf output_ttree/
|
||||
|
||||
cd ../
|
||||
|
||||
|
||||
# Optional:
|
||||
# Note: The system.data and system.in.settings files contain extra information
|
||||
# for atoms defined in OPLSAA which you are not using in this simulation. This
|
||||
# is harmless, but if you to delete this information from your
|
||||
# system.in.settings and system.in.data files, follow the instructions in
|
||||
# this script: "optional_cleanup/README_remove_irrelevant_info.sh"
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 127 KiB After Width: | Height: | Size: 127 KiB |