30 int main (
int argc,
char *argv[]) {
33 time_t start_time = time(NULL);
35 bool wallClockReached =
false;
45 catch(exception& ex) {
46 cerr <<
"error: " << ex.what() <<
"\n";
50 cerr <<
"Exception of unknown type!\n";
59 seed = setup.
seed(seed);
79 boost::ptr_vector<LookupTable> lookupPtrVec;
80 for(
int i=0; i<Npaths; i++){
81 lookupPtrVec.push_back(
89 if ((
constants()->extPotentialType() ==
"graphenelut3dtobinary") ||
90 (
constants()->extPotentialType() ==
"graphenelut3dtotext") ||
91 (
constants()->extPotentialType() ==
"graphenelut3dgenerate") ) {
97 Array<dVec,1> initialPos =
109 boost::ptr_vector<Path> pathPtrVec;
110 for(
int i=0; i<Npaths; i++){
111 pathPtrVec.push_back(
112 new Path(boxPtr,lookupPtrVec[i],
constants()->numTimeSlices(),
120 boost::ptr_vector<ActionBase> actionPtrVec;
121 for(
int i=0; i<Npaths; i++){
122 actionPtrVec.push_back(
123 setup.
action(pathPtrVec[i],lookupPtrVec[i],externalPotentialPtr,
124 interactionPotentialPtr,waveFunctionPtr) );
128 boost::ptr_vector< boost::ptr_vector<MoveBase> > movesPtrVec;
129 for(
int i=0; i<Npaths;i++){
130 movesPtrVec.push_back(
131 setup.
moves(pathPtrVec[i],&actionPtrVec[i],random));
135 boost::ptr_vector< boost::ptr_vector<EstimatorBase> > estimatorsPtrVec;
136 for(
int i=0; i<Npaths;i++){
137 estimatorsPtrVec.push_back(
138 setup.
estimators(pathPtrVec[i],&actionPtrVec[i],random));
142 for(
uint32 j = 0; j < estimatorsPtrVec.back().size(); j++)
143 estimatorsPtrVec.back().at(j).appendLabel(str(format(
"%d") % (i+1)));
149 estimatorsPtrVec.push_back(setup.
estimators(pathPtrVec,actionPtrVec,random));
154 !setup.
params[
"start_with_state"].as<
string>().empty(),
155 setup.
params[
"bin_size"].as<
int>());
160 <<
" _____ _____ _____ _____" << endl
161 <<
"| __ \\ |_ _| / ____| / ____|" << endl
162 <<
"| |__) | | | | | __ | (___" << endl
163 <<
"| ___/ | | | | |_ | \\___ \\" << endl
164 <<
"| | _| |_ | |__| | ____) |" << endl
165 <<
"|_| |_____| \\_____| |_____/" << endl
169 <<
" _____ _____ __ __ _____" << endl
170 <<
" | __ \\ |_ _| | \\/ | / ____|" << endl
171 <<
" | |__) | | | | \\ / | | | " << endl
172 <<
" | ___/ | | | |\\/| | | | " << endl
173 <<
" | | _| |_ | | | | | |____ " << endl
174 <<
" |_| |_____| |_| |_| \\_____|" << endl
181 cout << format(
"[PIMCID: %s] - Pre-Equilibration Stage.") %
constants()->
id() << endl;
187 if (!setup.
params(
"canonical") && setup.
params(
"relaxmu")) {
192 setup.
outputOptions(argc,argv,seed,boxPtr,lookupPtrVec.front().getNumNNGrid());
195 cout << format(
"[PIMCID: %s] - Measurement Stage.") %
constants()->
id() << endl;
198 int oldNumStored = 0;
200 int numOutput = setup.
params[
"output_config"].as<
int>();
206 cout << format(
"[PIMCID: %s] - Bin #%5d stored to disk.") %
constants()->
id()
207 % oldNumStored << endl;
212 if ((numOutput > 0) && ((n % numOutput) == 0)) {
213 pathPtrVec.front().outputConfig(outNum);
219 current_time = time(NULL);
221 wallClockReached =
true;
226 if (wallClockReached)
227 cout << format(
"[PIMCID: %s] - Wall clock limit reached.") %
constants()->
id() << endl;
229 cout << format(
"[PIMCID: %s] - Measurement complete.") %
constants()->
id() << endl;
237 delete interactionPotentialPtr;
238 delete externalPotentialPtr;
240 delete waveFunctionPtr;
Action class definitions.
Pre-equilibration via classical Monte Carlo.
void run(uint32, bool)
Perform the Monte Carlo equilibration.
void updateNames()
Update the data name and rename any existing files.
string id()
Get simulation UUID.
uint32 numEqSteps()
Get the number of equilibration steps.
The base class which holds details on the generalized box that our system will be simulated inside of...
The particle (bead) lookup table.
The main driver class for the entire path integral monte carlo program.
void saveState(const int finalSave=0)
Save the state of the simulation to disk, including all path, worm, move and estimator data.
void equilStep(const uint32, const bool, const bool)
Equilibration.
void finalOutput()
Output simulation statistics to disk.
int numStoredBins
Number of stored estimators.
The space-time trajectories.
The base class from which all specific potentials are derived from.
virtual Array< dVec, 1 > initialConfig(const Container *, MTRand &, const int)
Default Initial configuration of particles.
ActionBase * action(const Path &, LookupTable &, PotentialBase *, PotentialBase *, WaveFunctionBase *)
Setup the action.
uint32 seed(const uint32)
Return the random seed.
bool parseOptions()
Parse the command line options for obvious errors and return values.
PotentialBase * interactionPotential(const Container *)
Setup the interaction potential.
WaveFunctionBase * waveFunction(const Path &, LookupTable &)
Setup the trial wave function.
void setConstants()
Setup the simulation constants.
void outputOptions(int, char *[], const uint32, const Container *, const iVec &)
Output the simulation parameters to a log file.
void communicator()
Setup the communicator.
boost::ptr_vector< EstimatorBase > * estimators(Path &, ActionBase *, MTRand &)
Create a list of estimators to be measured.
void getOptions(int, char *[])
Define all command line options and get them from the command line.
boost::ptr_vector< MoveBase > * moves(Path &, ActionBase *, MTRand &)
Define the Monte Carlo updates that will be performed.
Parameters params
All simulation parameters.
Container * cell()
Setup the simulation cell.
bool worldlines()
Setup the worldlines.
PotentialBase * externalPotential(const Container *)
Setup the external potential.
Holds a base class that all trial wave function classes will be derived from.
ClassicalMonteCarlo class definition.
Global common header with shared dependencies and methods.
unsigned long uint32
Unsigned integer type, at least 32 bits.
Class definitions for all file input/output.
Communicator * communicate()
Global public access to the communcator singleton.
ConstantParameters class definition.
ConstantParameters * constants()
Global public access to the constants.
LookupTable class definition.
int main(int argc, char *argv[])
Main driver.
PathIntegralMonteCarlo class definition.
All possible potential classes.
Parses command line input and sets up the details of the simulation.
Action class definitions.