import "spce.lt"  # <- This defines the SPCE 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).

import "ions.lt"  # <- This defines the ions "NaIon" and "ClIon".

# Periodic boundary conditions:
write_once("Data Boundary") {
   0.0  34.50  xlo xhi
   0.0  34.50  ylo yhi
   0.0  34.50  zlo zhi
}


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

wat  = new SPCE [10].move(0.00, 0.00, 3.45) 
                [10].move(0.00, 3.45, 0.00) 
                [10].move(3.45, 0.00, 0.00)

# We now create a 2x2x2 lattice of Na+ and Cl- ions:

na = new NaIon [2].move(0,0,17.25) 
               [2].move(0,17.25,0)
               [2].move(17.25,0,0)


cl = new ClIon [2].move(0,0,17.25) 
               [2].move(0,17.25,0)
               [2].move(17.25,0,0)

na[*][*][*].move(5.175,5.175,5.6)
cl[*][*][*].move(12.075,12.075,12.5)

# (The (5.175,5.175,5.175) and (12.075,12.075,12.075) translational shifts
#  prevent the Na and Cl ions from overlapping
#  with the water molecules or each other.)


# Comment:  Fortunately the ions and the water in this example share the 
# same force-field styles (so their was no need to use "hybrid" styles).
# If this were not the case, you might need to add something like this.
#
# write_once("In Init") {
#   # -- Styles for the combined system (overrides earlier settings) --
#   pair_style   hybrid lj/charmm/coul/long 9.0 10.0 10.0 NEWPAIRSTYLE
#   bond_style   hybrid harmonic NEWBONDSTYLE
#   angle_style  hybrid harmonic NEWANGLESTYLE
# }
