This is the main class that declares a Monte Carlo (MC) simulation. The main component of this class is a vector of trial moves, all derived from TrialMove class. It also includes an Interaction, a BoundaryConditions?, a PotentialRoutine? and a RandomNumberGenerator?. Optional components known as McSimulationComponent?s can also be added to the class. The class contains suitable Set/Get functions for setting/retrieving different constituents of the class.
In addition to a default constructor, McSimulation contains a istream-initiated constructor, which can be used to start a simulation from a console or an input file. (Data format for every constituent of the simulation is discussed in its appropriate place.)
----
Synopsis
#include <glotzilla++.h> //declare as an instance ... McSimulation simulation_name; //or derive a new class from it class MySimulation : public McSimulation { //... }; //start from an input-stream McSimulation simulation_name (is);
Note that McSimulation requires the glotzilla++ header file. Deriving from McSimulation is much more powerful than declaring an instance.
EXAMPLES
For example, the following scripts declares an NPT simulation and sets the interaction to LennardJones.
#include <glotzilla++.h> int main(int argc, char **argv) { //some code McSimulation my_simulation; my_simulation.SetInteraction(new LennardJones); my_simulation.AddTrialMove (new TrialTranslation); my_simulation.AddTrialMove (new TrialRotation); my_simulation.AddTrialMove (new TrialVolumeChnage(10.0) ); //some more code return 0; }
Tutorials
- Basic use of McSimulation
- Programming in an Object-Oriented Fashion by inheriting from McSimulation?