Path Integral Quantum Monte Carlo
|
#include <setup.h>
Public Member Functions | |
Setup () | |
Setup the program_options variables. More... | |
void | getOptions (int, char *[]) |
Define all command line options and get them from the command line. More... | |
bool | parseOptions () |
Parse the command line options for obvious errors and return values. More... | |
bool | worldlines () |
Setup the worldlines. More... | |
Container * | cell () |
Setup the simulation cell. More... | |
void | setConstants () |
Setup the simulation constants. More... | |
void | communicator () |
Setup the communicator. More... | |
uint32 | seed (const uint32) |
Return the random seed. More... | |
void | outputOptions (int, char *[], const uint32, const Container *, const iVec &) |
Output the simulation parameters to a log file. More... | |
PotentialBase * | interactionPotential (const Container *) |
Setup the interaction potential. More... | |
PotentialBase * | externalPotential (const Container *) |
Setup the external potential. More... | |
WaveFunctionBase * | waveFunction (const Path &, LookupTable &) |
Setup the trial wave function. More... | |
ActionBase * | action (const Path &, LookupTable &, PotentialBase *, PotentialBase *, WaveFunctionBase *) |
Setup the action. More... | |
boost::ptr_vector< MoveBase > * | moves (Path &, ActionBase *, MTRand &) |
Define the Monte Carlo updates that will be performed. More... | |
boost::ptr_vector< EstimatorBase > * | estimators (Path &, ActionBase *, MTRand &) |
Create a list of estimators to be measured. More... | |
boost::ptr_vector< EstimatorBase > * | estimators (boost::ptr_vector< Path > &, boost::ptr_vector< ActionBase > &, MTRand &) |
Create a list of double path estimators to be measured. More... | |
Data Fields | |
Parameters | params |
All simulation parameters. | |
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.
Setup::Setup | ( | ) |
Setup the program_options variables.
We initialize all variables and define the names of all allowed interaction and external potentials.
Definition at line 262 of file setup.cpp.
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 1168 of file setup.cpp.
Container * Setup::cell | ( | ) |
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 771 of file setup.cpp.
void Setup::communicator | ( | ) |
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 1013 of file setup.cpp.
boost::ptr_vector< EstimatorBase > * Setup::estimators | ( | boost::ptr_vector< Path > & | pathPtrVec, |
boost::ptr_vector< ActionBase > & | actionPtrVec, | ||
MTRand & | random | ||
) |
boost::ptr_vector< EstimatorBase > * Setup::estimators | ( | Path & | path, |
ActionBase * | actionPtr, | ||
MTRand & | random | ||
) |
Create a list of estimators to be measured.
path | A reference to the paths |
actionPtr | The action in use |
random | The random number generator |
Definition at line 1296 of file setup.cpp.
PotentialBase * Setup::externalPotential | ( | const Container * | boxPtr | ) |
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 1063 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.
argc | number of command line arguments |
argv | command line string |
Definition at line 464 of file setup.cpp.
PotentialBase * Setup::interactionPotential | ( | const Container * | boxPtr | ) |
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 1026 of file setup.cpp.
boost::ptr_vector< MoveBase > * Setup::moves | ( | Path & | path, |
ActionBase * | actionPtr, | ||
MTRand & | random | ||
) |
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.
argc | The number of command line arguments |
argv | The commmand line string |
_seed | The random seed |
boxPtr | A pointer to the container |
nnGrid | The lookup table nearest neighbor grid |
Definition at line 1451 of file setup.cpp.
bool Setup::parseOptions | ( | ) |
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.
Definition at line 488 of file setup.cpp.
void Setup::setConstants | ( | ) |
Setup the simulation constants.
Fix all simulation constants.
Definition at line 976 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 1143 of file setup.cpp.
bool Setup::worldlines | ( | ) |