Amber does not use simple rules to assign charges to each atom.
Instead AmberTools perform a quantum calculation to estimate what
these partial charges should be. This is becoming increasingly
common. (The tools which come with BOSS to prepare simulations using
the OPLSAA3 force field typically do this as well.) This is one of
the obstacles you must overcome.
If you want to use AMBER, then there are two choices that I'm aware of:
1) Use AmberTools to build your system, and convert them into LAMMPS
format using "amber2lmp". (You may encounter bugs in this script. It
is no longer actively maintained.)
http://lammps.sandia.gov/doc/Section_tools.html#amber2lmp-tool
2) Moltemplate is a general molecule builder program which supports a
relatively large number of force field formats including GAFF and
GAFF2. But it does not understand quantum chemistry and cannot assign
atomic charges this way.
You can use moltemplate to build the LAMMPS input and data files (see
below), but you will have to determine the atomic partial charges of
your atoms by other means. Ideally you should use AmberTools to
generate the atomic charges. Once you have the list of atomic
charges, you can write a for-loop to generate file containing a list
of "set" commands with the following format:
set atom 1 charge -0.18
set atom 2 charge 0.06
set atom 3 charge 0.06
set atom 4 charge 0.06
:
http://lammps.sandia.gov/doc/set.html
This would be a useful script. If you are able to figure out
AmberTools, and you are able to figure out which of the files it
creates contain the atomic charges, then I can help you write this
for-loop, and we can included it in moltemplate.
---- how to build a molecular system using GAFF/GAFF2 force field ---
There are several examples of molecules using the AMBER/GAFF force
field located in the "examples" subdirectory included with
moltemplate. Currently, you can browse these examples at the link
below (which may change in the future):
https://github.com/jewettaij/moltemplate/tree/master/examples/all_atom/force_field_AMBER
Here is an example of how you define a simple molecule using
moltemplate using the GAFF (or GAFF2) force field:
---- ethylene.lt ----
import "gaff.lt" # or "gaff2.lt"
# The "gaff.lt" and "gaff2.lt" files are usually located in "force_fields"
# subdirectory of the moltemplate distribution.
# It contains definitions of the atoms "c2", "hc", as well as the bonded
# and non-bonded interactions between them (and many other atoms).
Ethylene inherits GAFF { # or GAFF2
# atom-id mol-id atom-type charge X Y Z
write('Data Atoms') {
$atom:C1 $mol @atom:c2 -0.23 -0.6695 0.000000 0.000
$atom:C2 $mol @atom:c2 -0.23 0.6695 0.000000 0.000
$atom:H11 $mol @atom:hc 0.115 -1.234217 -0.854458 0.000
$atom:H12 $mol @atom:hc 0.115 -1.234217 0.854458 0.000
$atom:H21 $mol @atom:hc 0.115 1.234217 -0.854458 0.000
$atom:H22 $mol @atom:hc 0.115 1.234217 0.854458 0.000
}
write('Data Bond List') {
$bond:C12 $atom:C1 $atom:C2
$bond:C1H1 $atom:C1 $atom:H11
$bond:C1H2 $atom:C1 $atom:H12
$bond:C2H1 $atom:C2 $atom:H21
$bond:C2H2 $atom:C2 $atom:H22
}
} # Ethylene
---- system.lt ----
import "ethylene.lt" # <- defines the "Ethylene" molecule type.
# Create a 3-dimensional array of 1000 ethylenes (10x10x10)
ethylenes = new Ethylene[10].move(8.0, 0, 0)
[10].move(0, 8.0, 0)
[10].move(0, 0, 8.0)
# Periodic boundary conditions:
write_once("Data Boundary") {
0.0 80.00 xlo xhi
0.0 80.00 ylo yhi
0.0 80.00 zlo zhi
}