35 if (params[
"restart"].empty()) {
37 id_ = boost::uuids::to_string(boost::uuids::random_generator()());
40 string label_ = params[
"label"].as<
string>();
41 if (label_.length() > 12)
42 label_ = label_.substr(0,12);
44 id_.replace(id_.end()-label_.length(),id_.end(),label_);
48 id_ = params[
"restart"].as<
string>();
53 startWithState_ = !params[
"start_with_state"].as<
string>().empty();
56 if (params[
"wall_clock"].empty()) {
63 wallClock_ =
uint32( floor(params[
"wall_clock"].as<double>()*3600));
67 canonical_ = !params[
"canonical"].empty();
70 saveStateFiles_ = params[
"no_save_state"].empty();
73 varUpdates_ = params[
"var_updates"].empty();
76 window_ = canonical_ && !params[
"window"].empty();
78 windowWidth_ = params[
"window"].as<
int>();
83 gaussianEnsemble_ = canonical_ && !params[
"gaussian_window_width"].empty();
84 if (gaussianEnsemble_)
85 gaussianEnsembleSD_ = params[
"gaussian_window_width"].as<
double>();
87 gaussianEnsembleSD_ = 0.0;
90 maxWind_ = params[
"max_winding"].as<
int>();
93 b_ = int (ceil(log(1.0*params[
"update_length"].as<int>()) / log(2.0)-
EPS));
96 while (
ipow(2,b_) >= params[
"number_time_slices"].as<int>())
100 Mbar_ = params[
"update_length"].as<
int>();
101 T_ = params[
"temperature"].as<
double>();
102 imagTimeLength_ = params[
"imaginary_time_length"].as<
double>();
103 mu_ = params[
"chemical_potential"].as<
double>();
104 m_ = params[
"mass"].as<
double>();
105 lambda_ = 24.24 / m_;
106 rc_ = params[
"potential_cutoff"].as<
double>();
108 C0_ = params[
"worm_constant"].as<
double>();
109 numTimeSlices_ = params[
"number_time_slices"].as<
int>();
111 tau_ = 1.0/((numTimeSlices_-1)*T_);
113 tau_ = 1.0/(numTimeSlices_*T_);
114 V_ = params[
"volume"].as<
double>();
115 L_ = params[
"side"].as<
dVec>()[
NDIM-1];
116 numEqSteps_ = params[
"number_eq_steps"].as<
uint32>();
118 graphenelut3d_file_prefix_ = params[
"graphenelut3d_file_prefix"].as<
string>();
119 virialWindow_ = params[
"virial_window"].as<
int>();
121 initialNumParticles_ = params[
"number_particles"].as<
int>();
122 numBroken_ = params[
"number_broken"].as<
int>();
124 spatialSubregionOn_ = !params[
"spatial_subregion"].empty();
125 if (spatialSubregionOn_)
126 spatialSubregion_ = params[
"spatial_subregion"].as<
double>();
128 endFactor_ = params[
"end_factor"].as<
double>();
129 Npaths_ = params[
"number_paths"].as<
int>();
131 intPotentialType_ = params[
"interaction"].as<
string>();
132 extPotentialType_ = params[
"external"].as<
string>();
133 waveFunctionType_ = params[
"wavefunction"].as<
string>();
134 actionType_ = params[
"action"].as<
string>();
137 dBWavelength_ = 2.0*sqrt(M_PI * lambda_ / T_);
138 comDelta_ = 0.04*dBWavelength_;
139 displaceDelta_ = 0.04*dBWavelength_;
146 attemptProb_[
"open"] = 0.0;
147 attemptProb_[
"insert"] = 0.0;
148 attemptProb_[
"close"] = 0.0;
149 attemptProb_[
"advance head"] = 0.0;
150 attemptProb_[
"recede head"] = 0.0;
151 attemptProb_[
"advance tail"] = 0.0;
152 attemptProb_[
"recede tail"] = 0.0;
153 attemptProb_[
"remove"] = 0.0;
154 attemptProb_[
"swap head"] = 0.0;
155 attemptProb_[
"swap tail"] = 0.0;
156 attemptProb_[
"diagonal"] = 0.6;
157 attemptProb_[
"center of mass"] = 0.1;
158 attemptProb_[
"displace"] = 0.0;
159 attemptProb_[
"end staging"] = 0.3;
160 attemptProb_[
"mid staging"] = 0.0;
161 attemptProb_[
"swap break"] = 0.0;
164 attemptProb_[
"open"] = 0.4;
165 attemptProb_[
"insert"] = 0.4;
166 attemptProb_[
"close"] = 0.15;
167 attemptProb_[
"advance head"] = 0.075;
168 attemptProb_[
"recede head"] = 0.075;
169 attemptProb_[
"advance tail"] = 0.075;
170 attemptProb_[
"recede tail"] = 0.075;
171 attemptProb_[
"remove"] = 0.15;
172 attemptProb_[
"swap head"] = 0.10;
173 attemptProb_[
"swap tail"] = 0.10;
174 attemptProb_[
"diagonal"] = 0.19;
175 attemptProb_[
"center of mass"] = 0.01;
176 attemptProb_[
"displace"] = 0.0;
177 attemptProb_[
"end staging"] = 0.0;
178 attemptProb_[
"swap break"] = 0.0;
179 attemptProb_[
"mid staging"] = 0.0;
182 double totProb = attemptProb_[
"close"] + attemptProb_[
"advance head"] + attemptProb_[
"recede head"]
183 + attemptProb_[
"advance tail"] + attemptProb_[
"recede tail"] + attemptProb_[
"remove"]
184 + attemptProb_[
"swap head"] + attemptProb_[
"swap tail"] + attemptProb_[
"diagonal"]
185 + attemptProb_[
"center of mass"] + attemptProb_[
"displace"] + attemptProb_[
"end staging"]
186 + attemptProb_[
"mid staging"]+attemptProb_[
"swap break"];
188 if (abs(totProb - 1.0) >
EPS) {
189 cout <<
"Close + AdvanceHead + RecedeHead + AdvanceTail + RecedeTail + Remove + SwapHead "
190 <<
"+ SwapTail + Diagonal + CoM Probability != 1" << endl;
191 cout << totProb << endl;
196 totProb = attemptProb_[
"open"] + attemptProb_[
"insert"] + attemptProb_[
"diagonal"]
197 + attemptProb_[
"center of mass"] + attemptProb_[
"displace"] + attemptProb_[
"swap break"]
198 + attemptProb_[
"end staging"] + attemptProb_[
"mid staging"];
200 if (abs(totProb - 1.0) >
EPS) {
201 cout <<
"Open + Insert + Diagonal + CoM Probability != 1" << endl;
202 cout << totProb << endl;
Constant simulation parameters.
ConstantParameters()
An empty constructor which simply sets all constants to null.
static ConstantParameters * getInstance()
This public method returns an instance of the constant object, Only one can ever exist at a time.
void initConstants(po::variables_map &)
Initialize all constants from command line, XMl and defaults.
void getC()
Get the value of the worm constant.
#define NDIM
Number of spatial dimnsions.
int ipow(int base, int power)
Return the integer value of a number raised to a power.
unsigned long uint32
Unsigned integer type, at least 32 bits.
#define EPS
A small number.
TinyVector< double, NDIM > dVec
A NDIM-vector of type double.
#define PIMC_ASSERT(X)
Rename assert method.
ConstantParameters class definition.