Path Integral Quantum Monte Carlo
 All Classes Files Functions Variables Typedefs Enumerations Defines
Public Member Functions | Public Attributes
Setup Class Reference

Setup the simulation. More...

#include <setup.h>

List of all members.

Public Member Functions

 Setup ()
 Setup the program_options variables.
void getOptions (int, char *[])
 Define all command line options and get them from the command line.
bool parseOptions ()
 Parse the command line options for obvious errors and return values.
bool worldlines ()
 Setup the worldlines.
Containercell ()
 Setup the simulation cell.
void setConstants ()
 Setup the simulation constants.
void communicator ()
 Setup the communicator.
uint32 seed (const uint32)
 Return the random seed.
void outputOptions (int, char *[], const uint32, const Container *, const iVec &)
 Output the simulation parameters to a log file.
PotentialBaseinteractionPotential ()
 Setup the interaction potential.
PotentialBaseexternalPotential (const Container *)
 Setup the external potential.
WaveFunctionBasewaveFunction (const Path &, LookupTable &)
 Setup the trial wave function.
ActionBaseaction (const Path &, LookupTable &, PotentialBase *, PotentialBase *, WaveFunctionBase *)
 Setup the action.
boost::ptr_vector< MoveBase > * moves (Path &, ActionBase *, MTRand &)
 Define the Monte Carlo updates that will be performed.
boost::ptr_vector
< EstimatorBase > * 
estimators (Path &, ActionBase *, MTRand &)
 Create a list of estimators to be measured.
boost::ptr_vector
< EstimatorBase > * 
estimators (boost::ptr_vector< Path > &, boost::ptr_vector< ActionBase > &, MTRand &)
 Create a list of double path estimators to be measured.

Public Attributes

Parameters params
 All simulation parameters.

Detailed Description

Setup the simulation.

This class uses boost::program_options to parse command line input specifying all possible simulation options. In the future I would like to implement the use of configuration files for static options as well. We then parse the options, checking for correctness, and define all simulation constants. We setup the container and potential pointers and finally provide a method to output all the parameters to a log file on disk.

See also:
http://www.boost.org/doc/libs/release/doc/html/program_options.html

Definition at line 255 of file setup.h.


Constructor & Destructor Documentation

Setup the program_options variables.

We initialize all variables and define the names of all allowed interaction and external potentials.

Definition at line 263 of file setup.cpp.


Member Function Documentation

ActionBase * Setup::action ( const Path path,
LookupTable lookup,
PotentialBase externalPotentialPtr,
PotentialBase interactionPotentialPtr,
WaveFunctionBase waveFunctionPtr 
)

Setup the action.

Based on the user's choices we create a new action pointer which is returned to the main program.

Definition at line 1105 of file setup.cpp.

Setup the simulation cell.

We setup the simulation cell, and return a pointer to a container opject with a type that depends on the specified simulation cell.

Definition at line 758 of file setup.cpp.

Setup the communicator.

Initialize the communicator, we need to know if we are outputting any config files to disk. The files are labelled differently depending on whether we are in the canonical or grand-canonical ensemble. We also need to initialize a possible initial state file and a fixed position file. Also, since the value of tau we might specifiy at the command line is not the actual one used in the simulation (since the number of time slices must be an integer) we pass it to the communicator for propper labelling of output files.

Definition at line 991 of file setup.cpp.

boost::ptr_vector< EstimatorBase > * Setup::estimators ( Path path,
ActionBase actionPtr,
MTRand &  random 
)

Create a list of estimators to be measured.

Parameters:
pathA reference to the paths
actionPtrThe action in use
randomThe random number generator
Returns:
a list of estimators

Definition at line 1228 of file setup.cpp.

boost::ptr_vector< EstimatorBase > * Setup::estimators ( boost::ptr_vector< Path > &  pathPtrVec,
boost::ptr_vector< ActionBase > &  actionPtrVec,
MTRand &  random 
)

Create a list of double path estimators to be measured.

Parameters:
pathA reference to the paths
actionPtrThe action in use
Returns:
a list of double path estimators

Definition at line 1252 of file setup.cpp.

Setup the external potential.

Based on the user's choice we create a new external potential pointer which is returned to the main program.

Definition at line 1039 of file setup.cpp.

void Setup::getOptions ( int  argc,
char *  argv[] 
)

Define all command line options and get them from the command line.

We use boost::program options to get simulation parameters from the command line.

Parameters:
argcnumber of command line arguments
argvcommand line string

Definition at line 453 of file setup.cpp.

Setup the interaction potential.

Based on the user's choice we create a new interaction potential pointer which is returned to the main program.

Definition at line 1004 of file setup.cpp.

boost::ptr_vector< MoveBase > * Setup::moves ( Path path,
ActionBase actionPtr,
MTRand &  random 
)

Define the Monte Carlo updates that will be performed.

Parameters:
pathA reference to the paths
actionPtrThe action in use
randomThe random number generator
Returns:
a list of Monte Carlo updates

Definition at line 1160 of file setup.cpp.

void Setup::outputOptions ( int  argc,
char *  argv[],
const uint32  _seed,
const Container boxPtr,
const iVec nnGrid 
)

Output the simulation parameters to a log file.

After we have finished equilibrating, we output all the simulation parameters to disk in addition to a command that can be used to restart the simulation.

Parameters:
argcThe number of command line arguments
argvThe commmand line string
_seedThe random seed
boxPtrA pointer to the container
nnGridThe lookup table nearest neighbor grid

Definition at line 1305 of file setup.cpp.

Parse the command line options for obvious errors and return values.

Here we go through the commmand line options and test for any problems. This probably needs more work to test all possible outcomes.

Returns:
true if we exit, false if we continue

Definition at line 477 of file setup.cpp.

uint32 Setup::seed ( const uint32  startSeed)

Return the random seed.

We add the process number to a fixed initial random seed.

Parameters:
startSeedThe fixed initial seed
Returns:
A seed shifted by the process number

Definition at line 748 of file setup.cpp.

Setup the simulation constants.

Fix all simulation constants.

Definition at line 954 of file setup.cpp.

WaveFunctionBase * Setup::waveFunction ( const Path path,
LookupTable lookup 
)

Setup the trial wave function.

Based on the user's choice we create a new trial wave function pointer which is returned to the main program.

Definition at line 1080 of file setup.cpp.

Setup the worldlines.

Depending on whether we have defined the size of the imaginary time step tau or the number of time slices we setup the imaginary time extent of the worldlines.

Definition at line 811 of file setup.cpp.


The documentation for this class was generated from the following files: