Skip to content

Script Interface and Running a Simulation

Troy Loeffler edited this page Feb 4, 2022 · 6 revisions

Running a simulation

To begin running a ClassyMC simulation, one must provide an simulation script that will provide the control parameters for the simulation. In order to have a valid simulation script a set of requirements must be met.

  1. The type of Sampling must be defined. This controls how to accept/reject Monte Carlo moves in order to obtain the desired statistical distribution.
  2. The forcefield/energy calculator must be specified. This also includes molecular topologies which are defined in the forcefield input file.
  3. A set of Monte Carlo moves must be used to actually move the system.

Once these have been defined, a simulation can be carried out by issuing the "Run" command.

Script Format

The input script allows users to use a slightly more free form format. Blank lines are ignored by default so the user may use white space at their discretion. In addition comments can be used either at the beginning of a line or after a command using the # symbol. For example both of these are valid comments.

# This is a comment
set moves 1000 #This also is a comment

ClassyMC will ignore anything past the # symbol. This is applies to input scripts, configuration files, and forcefield files. So feel free to use comments and white space where appropriate.

Defining Objects

ClassyMC makes use of a command block system to define various simulation objects. This is similar to open and close statements in regular programming languages for objects such as do or if statements. For example to create the simulation boxes for a dual box ensemble

  Create Boxes
     fromfile "MyStructure.clssy" #This creates Box 1 by reading MyStructure.clssy
     fromfile "MyOtherFile.clssy" #This creates Box 2 by reading MyOtherFile.clssy
  End_Create

This style of block is used to create the Moves, Boxes, Analysis, Trajectory, etc. objects used to define the simulation environment.

Modifying Object Parameters.

To set things such as the temperature, pressure, chemical potential, or other simulation parameters one can use the modify key word to

  modify box 1 temperature 300 #Sets the temperature variable of box 1 to 300 Kelvin
  modify box 1 chempotential 1 -12.02375108  #Sets the chemical potential variable of box 1
Clone this wiki locally