Skip to content

Commit

Permalink
OPLSAA 2023 water models were tested and are working. Numerous exampl…
Browse files Browse the repository at this point in the history
…es were debugged and updated. File names and atom type names have changed (for water models, and some examples).
  • Loading branch information
jewettaij committed Dec 8, 2024
1 parent f027da1 commit 87122bc
Show file tree
Hide file tree
Showing 56 changed files with 265 additions and 152 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "ethylene.lt" # <- defines the "Ethylene" molecule type.
import "benzene.lt" # <- defines the "Benzene" molecule type.
import "benzene.lt" # <- defines the "Benzene" molecule type.


# Periodic boundary conditions:
Expand Down Expand Up @@ -28,7 +28,13 @@ benzenes = new Benzene[6].move(8.0, 0, 0)

benzenes[*][*][*].move(4.0, 4.0, 4.0)

# Note: There is also an example which shows how to generate the coordinates
# using PACKMOL. (That allows us to omit the coordinates and .move() commands
# and allows you to specify the number of molecules you want more precisely.
# It is one of the OPLSAA examples.)


# Note1: You can use the "new random" command to create mixtures of different
# molecule types containing an arbitrary number of molecules arranged on
# a periodic lattice. (This works if all molecules have similar size.)
# See manual (ch8.9.1): https://moltemplate.org/doc/moltemplate_manual.pdf
# Note2: More generally you can use PACKMOL to create mixtures of molecules.
# It allows us to omit the coordinates and .move() commands. And you can
# specify the number of molecules you want more precisely. See example:
# https://github.com/jewettaij/moltemplate/tree/master/examples/all_atom/force_field_OPLSAA/ethylene+benzene_PACKMOL/
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ cd moltemplate_files
# 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/
rm -rf output_ttree/
rm -f run.in.EXAMPLE # <- not needed. Use "run.in.npt/nvt" instead.

cd ../

Expand All @@ -31,5 +32,5 @@ cd ../
# 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, run this script:
#
# cleanup_moltemplate.sh

cleanup_moltemplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import "gaff.lt" # <-- defines the "GAFF" force field

# The "gaff.lt" file is usually located in $MOLTEMPLATE_PATH (and is
# distributed with moltemplate. See the "Installation" section in the manual.)
# It contains definitions of the atoms "c3", "hc", as well as the force-field
# parameters for bonded and non-bonded interactions between them
# It contains definitions of the "@atom:c3", "@atom:hc", atoms as well as the
# force-field parameters for bonded and non-bonded interactions between them
# (and many other atoms).

# WARNING: CHARGES ARE INCORRECT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import "gaff.lt" # <-- defines the "GAFF" force field

# The "gaff.lt" file is usually located in $MOLTEMPLATE_PATH (and is
# distributed with moltemplate. See the "Installation" section in the manual.)
# It contains definitions of the atoms "c3", "hc", as well as the force-field
# parameters for bonded and non-bonded interactions between them
# It contains definitions of the "@atom:c3", "@atom:hc", atoms as well as the
# force-field parameters for bonded and non-bonded interactions between them
# (and many other atoms).
#
# WARNING: CHARGES ARE INCORRECT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@


import "gaff.lt" # load the "GAFF" force-field information
import "ch2group.lt" # load the definition of the "CH2" object
import "ch3group.lt" # load the definition of the "CH3" object
import "ch2.lt" # load the definition of the "CH2" object
import "ch3.lt" # load the definition of the "CH3" object



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ molecules = new Hexadecane [12].move(0, 0, 5.2)
[2].move(31.2, 0, 0)



# NOTE: The spacing between molecules is large. There should be extra room to
# move during the initial stages of equilibration. However, you will have to
# run the simulation at NPT conditions later to compress the system to a
Expand Down
11 changes: 11 additions & 0 deletions examples/all_atom/force_field_AMBER/hexadecane/run.in.npt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@

include system.in.init


# Weird LAMMPS issue:
# The "system.in.init" file contains definitions for bond, angle, dihedral,
# and improper interactions that were defined in the AMBER/GAFF force-field.
# But since the molecules in this example do not have any improper interactions,
# LAMMPS will crash. To get around this, tell LAMMPS to disable all
# improper interactions:

improper_style none


# ------------------------------- Atom Definition Section -------------------

read_data system.data
Expand Down
12 changes: 12 additions & 0 deletions examples/all_atom/force_field_AMBER/hexadecane/run.in.nvt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,18 @@

include system.in.init


# Weird LAMMPS issue:
# The "system.in.init" file contains definitions for bond, angle, dihedral,
# and improper interactions that were defined in the AMBER/GAFF force-field.
# But since the molecules in this example do not have any improper interactions,
# LAMMPS will crash. To get around this, tell LAMMPS to disable all
# improper interactions:

improper_style none



# ------------------------------- Atom Definition Section -------------------


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ cd moltemplate_files
# 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/
rm -f run.in.EXAMPLE # <- not needed. Use "run.in.npt/nvt" instead.

cd ../

Expand All @@ -25,5 +26,5 @@ cd ../
# 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, run this script:
#
# cleanup_moltemplate.sh

cleanup_moltemplate.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@

import "tip3p_2004_hybrid.lt" # This defines the TIP3P water molecule.
# This file is located in the "force_fields"
# subdirectory of the moltemplate distribution.
import "isobutane.lt" # <- defines the "Isobutane" molecule type.
import "tip3p_2004_hybrid.lt" # <- defines the TIP3P water molecule.

# Note: The "tip3p_2004_hybrid.lt" file is located at:
# https://github.com/jewettaij/moltemplate/tree/master/moltemplate/force_fields/
# (If you want to customize it, you can download it and copy it to this folder.)

import "isobutane.lt" # <- defines the "Isobutane" molecule type.


# Periodic boundary conditions:
Expand All @@ -14,6 +16,7 @@ write_once("Data Boundary") {
}



# The next command generates a (rather dense) cubic lattice with
# spacing 3.45 Angstroms. (The pressure must be equilibrated later.)

Expand All @@ -25,6 +28,16 @@ isobutane = new Isobutane [3].move(0, 0, 10.35)
[3].move(0, 10.35, 0)
[3].move(10.35, 0, 0)

# move the isobutane molecules slightly to reduce overlap with the water
# Move the isobutane molecules slightly to reduce overlap with the water
isobutane[*][*][*].move(1.725, 1.725, 1.725)



# Note1: You can use the "new random" command to create mixtures of different
# molecule types containing an arbitrary number of molecules arranged on
# a periodic lattice. (This works if all molecules have similar size.)
# See manual (ch8.9.1): https://moltemplate.org/doc/moltemplate_manual.pdf
# Note2: More generally you can use PACKMOL to create mixtures of molecules.
# It allows us to omit the coordinates and .move() commands. And you can
# specify the number of molecules you want more precisely. See example:
# https://github.com/jewettaij/moltemplate/tree/master/examples/all_atom/force_field_OPLSAA/ethylene+benzene_PACKMOL/
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ include "system.in.init" # specify the style of force field used
# The "system.in.init" file contains definitions for bond, angle, dihedral,
# and improper interactions that were defined in the AMBER/GAFF force-field.
# But since the molecules in this example do not have any improper interactions,
# LAMMPS will object and not allow us to run the simulation.
# To get around this, tell LAMMPS to disable improper interactions:
# LAMMPS will crash. To get around this, tell LAMMPS to disable all
# improper interactions:

improper_style none


# ------------------------------- Atom Definition Section -------------------

read_data "system.data" # load atom coordinates and topology
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ include "system.in.init" # specify the style of force field used
# The "system.in.init" file contains definitions for bond, angle, dihedral,
# and improper interactions that were defined in the AMBER/GAFF force-field.
# But since the molecules in this example do not have any improper interactions,
# LAMMPS will object and not allow us to run the simulation.
# To get around this, tell LAMMPS to disable improper interactions:
# LAMMPS will crash. To get around this, tell LAMMPS to disable all
# improper interactions:

improper_style none

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
# it to change the length of the alkane chain.


import "ch2group.lt" # load the definition of the "CH2" object
import "ch3group.lt" # load the definition of the "CH3" object
import "compass_published.lt" # load the "COMPASS" force-field
import "ch2.lt" # load the definition of the "CH2" object
import "ch3.lt" # load the definition of the "CH3" object



Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

import "ch2group.lt" # load the definition of the "CH2" object
import "ch3group.lt" # load the definition of the "CH3" object
import "compass_published.lt" # <-- defines the "COMPASS" force field
import "ch2.lt" # <-- defines the "CH2" object
import "ch3.lt" # <-- defines the "CH3" object


Butane inherits COMPASS {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import "compass_published.lt" # <-- defines the "COMPASS" force field

# (The "compass_published.lt" file is located in the "force_fields"
# subdirectory distributed with moltemplate.)
# Then define "CH2":




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import "compass_published.lt" # <-- defines the "COMPASS" force field

# (The "compass_published.lt" file is located in the "force_fields"
# subdirectory distributed with moltemplate.)
# Then define "CH3":




Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# it to change the length of the alkane chain.


import "compass_published.lt" # load the "COMPASS" force-field information
import "ch2group.lt" # load the definition of the "CH2" object
import "ch3group.lt" # load the definition of the "CH3" object
import "compass_published.lt" # load the "COMPASS" force-field
import "ch2.lt" # load the definition of the "CH2" object
import "ch3.lt" # load the definition of the "CH3" object



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# it to change the length of the alkane chain.


import "ch2group.lt" # load the definition of the "CH2" object
import "ch3group.lt" # load the definition of the "CH3" object
import "ch2.lt" # load the definition of the "CH2" object
import "ch3.lt" # load the definition of the "CH3" object

# This is a long polymer consisting of 48 CH2 groups and 2 CH3 end-caps.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ import "loplsaa.lt" # <-- defines the standard "OPLSAA" force field as well as
# atom types below from "@atom:57L","@atom:60LCH2" to
# "@atom:57" and "@atom:60" (defined in "oplsaa.lt")

# The "loplsaa.lt" and "oplsaa.lt" files are located at:
# https://github.com/jewettaij/moltemplate/tree/master/moltemplate/force_fields/
# If you want to customize these files, download them and copy them to this folder.


# Then define "CH2":


CH2 inherits OPLSAA {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import "loplsaa.lt" # <-- defines the standard "OPLSAA" force field as well as
# To use the ordinary OPLSAA force field parameters,
# (instead of the Sui et al. parameters), change the
# atom types below from "@atom:54L","@atom:60LCH3" to
# "@atom:54" and "@atom:85" (defined in "oplsaa.lt")
# "@atom:54" and "@atom:60" (defined in "oplsaa.lt")

# The "loplsaa.lt" and "oplsaa.lt" files are located at:
# https://github.com/jewettaij/moltemplate/tree/master/moltemplate/force_fields/
# If you want to customize these files, download them and copy them to this folder.


# Then define "CH3":


CH3 inherits OPLSAA {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import "oplsaa.lt"

# The "oplsaa.lt" file contains force-field parameters, atom type definitions,
# partial charges, masses and bond-angle rules for the atoms in your system.
# Note:
# Atom type @atom:145 corresponds to "C - CA | Benzene C"
# Atom type @atom:146 corresponds to "H - HA | Benzene H"

# The "oplsaa.lt" file defines these atom types:
# @atom:145 "C - CA | Benzene C"
# @atom:146 "H - HA | Benzene H"
# The "oplsaa.lt" file is located at:
# https://github.com/jewettaij/moltemplate/tree/master/moltemplate/force_fields/
# If you want to customize oplsaa.lt, download it and copy it to this folder.



Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
import "oplsaa.lt"

# The "oplsaa.lt" file contains force-field parameters, atom type definitions,
# partial charges, masses and bond-angle rules for the atoms in your system.


# Atom type choices:
#
# For this simple molecule, most of the atom types from OPLSAA were easy to guess:
#
# See the "oplsaa.lt" file for explanation of atom types. Excerpt:
# The "oplsaa.lt" file defines these atom types:
# Atom type @atom:145 corresponds to "C - CA | Benzene C"
# Atom type @atom:146 corresponds to "H - HA | Benzene H"
# Atom type @atom:165 corresponds to "C - CA | Cipso in styrene"
Expand All @@ -17,6 +10,9 @@ import "oplsaa.lt"
# Atom type @atom:268 corresponds to "O - OH | Oh in CCOOH R in RCOOH is"
# Atom type @atom:269 corresponds to "O - O~ | Oc in CCOOH neutral; use 135-140"
# Atom type @atom:270 corresponds to "H - HO | H in CCOOH"
# The "oplsaa.lt" file is located at:
# https://github.com/jewettaij/moltemplate/tree/master/moltemplate/force_fields/
# If you want to customize oplsaa.lt, download it and copy it to this folder.


BenzoicAcid inherits OPLSAA {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ benzoic_acids[*][*][*].move(4.0, 4.0, 6.0)



# Note1: You can use the new_random command to create random mixtures of different
# molecule types containing any number of molecules (and vacancies)
# arranged on a periodic lattice.
#
# Note2: You can also use PACKMOL to create mixtures of molecules, and import the
# coordinates into moltemplate using the "-xyz" or "-pdb" command-line argument.

# Note1: You can use the "new random" command to create mixtures of different
# molecule types containing an arbitrary number of molecules arranged on
# a periodic lattice. (This works if all molecules have similar size.)
# See manual (ch8.9.1): https://moltemplate.org/doc/moltemplate_manual.pdf
# Note2: More generally you can use PACKMOL to create mixtures of molecules.
# It allows us to omit the coordinates and .move() commands. And you can
# specify the number of molecules you want more precisely. See example:
# https://github.com/jewettaij/moltemplate/tree/master/examples/all_atom/force_field_OPLSAA/ethylene+benzene_PACKMOL/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import "ch2group.lt" # load the definition of the "CH2" object
import "ch3group.lt" # load the definition of the "CH3" object
import "ch2.lt" # load the definition of the "CH2" object
import "ch3.lt" # load the definition of the "CH3" object


Butane inherits OPLSAA {
Expand Down
Loading

0 comments on commit 87122bc

Please sign in to comment.