#
# Script to create disordered [dmim]Cl system
#

# Define number of ion pairs and required density
int npairs = 100;
double density = 1.1016;  # g/cm3 at 450 K

# Load Canongia Lopes ionic liquids forcefield (giving it a nickname of 'ilff')
# This will become the current forcefield (used by the 'ff' commands later on)
loadFF("data/ff/cldp-il.ff", "ilff");

# Prepare first component to add in - [dmim] cation
# Load model from file
loadModel("data/test/siesta-dmim.xyz");
setupComponent("both", 1, npairs, density);

# Create a forcefield expression for the model (determine atom types, bond types, etc.)
createExpression();

# Print out the model data 
info();

# Prepare second component - chloride anion
# Create a new model (naming it 'chloride') and draw a chloride atom
newModel("chloride");
newAtom(Cl);
setupComponent("both", 1, npairs, density);

# Create the forcefield expression
createExpression();

# Print the data
info();

# New we're ready to use these two components to create a new system.
# First, create another empty model (called 'box') and create a cubic
# cell in it. The disorder builder will adjust its size to suit.
newModel("box");
cell(1.0,1.0,1.0,90,90,90);

# Print out the current component list for the disordered builder
listComponents();

# Begin! Run the Monte Carlo for 10 cycles
disorder("None", FALSE);

# Request the Ewald sum for electrostatics (or none for just VDW intermolecular energies)
#elec ewald 0.256 10 10 10
#elec none

# Save out the current model (will be 'box', since it was the last created) as a DL_POLY config file
saveModel("dlpoly2", "dmimcl.CONFIG");
saveModel("mopac", "dmimcl.mop");

# Done.
quit();
