ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/io/Globals.cpp
(Generate patch)

Comparing:
trunk/src/io/Globals.cpp (file contents), Revision 1354 by gezelter, Mon Jun 15 20:12:09 2009 UTC vs.
branches/development/src/io/Globals.cpp (file contents), Revision 1723 by gezelter, Thu May 24 20:59:54 2012 UTC

# Line 1 | Line 1
1   /*
2 < * Copyright (c) 2005 The University of Notre Dame. All Rights Reserved.
2 > * Copyright (c) 2005, 2010 The University of Notre Dame. All Rights Reserved.
3   *
4   * The University of Notre Dame grants you ("Licensee") a
5   * non-exclusive, royalty free, license to use, modify and
6   * redistribute this software in source and binary code form, provided
7   * that the following conditions are met:
8   *
9 < * 1. Acknowledgement of the program authors must be made in any
10 < *    publication of scientific results based in part on use of the
11 < *    program.  An acceptable form of acknowledgement is citation of
12 < *    the article in which the program was described (Matthew
13 < *    A. Meineke, Charles F. Vardeman II, Teng Lin, Christopher
14 < *    J. Fennell and J. Daniel Gezelter, "OOPSE: An Object-Oriented
15 < *    Parallel Simulation Engine for Molecular Dynamics,"
16 < *    J. Comput. Chem. 26, pp. 252-271 (2005))
17 < *
18 < * 2. Redistributions of source code must retain the above copyright
9 > * 1. Redistributions of source code must retain the above copyright
10   *    notice, this list of conditions and the following disclaimer.
11   *
12 < * 3. Redistributions in binary form must reproduce the above copyright
12 > * 2. Redistributions in binary form must reproduce the above copyright
13   *    notice, this list of conditions and the following disclaimer in the
14   *    documentation and/or other materials provided with the
15   *    distribution.
# Line 37 | Line 28
28   * arising out of the use of or inability to use software, even if the
29   * University of Notre Dame has been advised of the possibility of
30   * such damages.
31 + *
32 + * SUPPORT OPEN SCIENCE!  If you use OpenMD or its source code in your
33 + * research, please cite the appropriate papers when you publish your
34 + * work.  Good starting points are:
35 + *                                                                      
36 + * [1]  Meineke, et al., J. Comp. Chem. 26, 252-271 (2005).            
37 + * [2]  Fennell & Gezelter, J. Chem. Phys. 124, 234104 (2006).          
38 + * [3]  Sun, Lin & Gezelter, J. Chem. Phys. 128, 24107 (2008).          
39 + * [4]  Kuang & Gezelter,  J. Chem. Phys. 133, 164101 (2010).
40 + * [5]  Vardeman, Stocker & Gezelter, J. Chem. Theory Comput. 7, 834 (2011).
41   */
42  
43   #include <stdlib.h>
# Line 49 | Line 50
50   #include "utils/MemoryUtils.hpp"
51   #include "utils/simError.h"
52  
53 < namespace oopse {
53 > namespace OpenMD {
54   Globals::Globals() {
55    DefineParameter(ForceField, "forceField")
56  
# Line 74 | Line 75 | Globals::Globals() {
75    DefineOptionalParameter(Seed, "seed");
76    DefineOptionalParameter(Minimizer, "minimizer");
77    DefineOptionalParameter(MinimizerMaxIter,"minimizerMaxIter");
78 <  DefineOptionalParameter(MinimizerWriteFrq, "minimizerWriteFrq");
78 >  DefineOptionalParameter(MinimizerWriteFreq, "minimizerWriteFreq");
79    DefineOptionalParameter(MinimizerStepSize, "minimizerStepSize");
80    DefineOptionalParameter(MinimizerFTol, "minimizerFTol");
81    DefineOptionalParameter(MinimizerGTol, "minimizerGTol");
# Line 88 | Line 89 | Globals::Globals() {
89    DefineOptionalParameter(ForceFieldVariant, "forceFieldVariant");
90    DefineOptionalParameter(ForceFieldFileName, "forceFieldFileName");
91    DefineOptionalParameter(DampingAlpha, "dampingAlpha");
91  DefineOptionalParameter(ThermIntDistSpringConst, "thermIntDistSpringConst");
92  DefineOptionalParameter(ThermIntThetaSpringConst, "thermIntThetaSpringConst");
93  DefineOptionalParameter(ThermIntOmegaSpringConst, "thermIntOmegaSpringConst");
92    DefineOptionalParameter(SurfaceTension, "surfaceTension");
93    DefineOptionalParameter(PrintPressureTensor, "printPressureTensor");
94 +  DefineOptionalParameter(PrintHeatFlux, "printHeatFlux");
95    DefineOptionalParameter(TaggedAtomPair, "taggedAtomPair");
96    DefineOptionalParameter(PrintTaggedPairDistance, "printTaggedPairDistance");
98  DefineOptionalParameter(CutoffPolicy, "cutoffPolicy");
97    DefineOptionalParameter(SwitchingFunctionType, "switchingFunctionType");
98    DefineOptionalParameter(HydroPropFile, "HydroPropFile");
99    DefineOptionalParameter(Viscosity, "viscosity");
# Line 104 | Line 102 | Globals::Globals() {
102    DefineOptionalParameter(LangevinBufferRadius, "langevinBufferRadius");
103    DefineOptionalParameter(NeighborListNeighbors,"NeighborListNeighbors");
104    DefineOptionalParameter(UseMultipleTemperatureMethod, "useMultipleTemperatureMethod");
105 +  DefineOptionalParameter(ElectrostaticSummationMethod, "electrostaticSummationMethod");
106    DefineOptionalParameter(MTM_Ce, "MTM_Ce");
107    DefineOptionalParameter(MTM_G, "MTM_G");
108    DefineOptionalParameter(MTM_Io, "MTM_Io");
109    DefineOptionalParameter(MTM_Sigma, "MTM_Sigma");
110    DefineOptionalParameter(MTM_R, "MTM_R");
111 <  
111 >  DefineOptionalParameter(Alpha, "alpha");
112  
113    
114    DefineOptionalParameterWithDefaultValue(UsePeriodicBoundaryConditions, "usePeriodicBoundaryConditions", true);
# Line 117 | Line 116 | Globals::Globals() {
116    DefineOptionalParameterWithDefaultValue(UseInitalTime, "useInitialTime", false);
117    DefineOptionalParameterWithDefaultValue(UseIntialExtendedSystemState, "useInitialExtendedSystemState", false);
118    DefineOptionalParameterWithDefaultValue(OrthoBoxTolerance, "orthoBoxTolerance", 1E-6);  
119 <  DefineOptionalParameterWithDefaultValue(UseSolidThermInt, "useSolidThermInt", false);
121 <  DefineOptionalParameterWithDefaultValue(UseLiquidThermInt, "useLiquidThermInt", false);
122 <  DefineOptionalParameterWithDefaultValue(ThermIntDistSpringConst, "thermIntDistSpringConst", 6.0);
123 <  DefineOptionalParameterWithDefaultValue(ThermIntThetaSpringConst, "thermIntThetaSpringConst", 7.5);
124 <  DefineOptionalParameterWithDefaultValue(ThermIntOmegaSpringConst, "thermIntOmegaSpringConst", 13.5);
125 <  DefineOptionalParameterWithDefaultValue(ElectrostaticSummationMethod, "electrostaticSummationMethod", "SHIFTED_FORCE");
119 >  DefineOptionalParameterWithDefaultValue(CutoffMethod, "cutoffMethod", "SHIFTED_FORCE");
120    DefineOptionalParameterWithDefaultValue(ElectrostaticScreeningMethod, "electrostaticScreeningMethod", "DAMPED");
121 <  DefineOptionalParameterWithDefaultValue(Dielectric, "dielectric", 78.5);
122 <  DefineOptionalParameterWithDefaultValue(CompressDumpFile, "compressDumpFile", 0);
123 <  DefineOptionalParameterWithDefaultValue(OutputForceVector, "outputForceVector", 0);
121 >  DefineOptionalParameterWithDefaultValue(Dielectric, "dielectric", 80.0);
122 >  DefineOptionalParameterWithDefaultValue(CompressDumpFile, "compressDumpFile", false);
123 >  DefineOptionalParameterWithDefaultValue(OutputForceVector, "outputForceVector", false);
124 >  DefineOptionalParameterWithDefaultValue(OutputParticlePotential, "outputParticlePotential", false);
125 >  DefineOptionalParameterWithDefaultValue(OutputElectricField, "outputElectricField", false);
126 >  DefineOptionalParameterWithDefaultValue(OutputFluctuatingCharges, "outputFluctuatingCharges", false);
127    DefineOptionalParameterWithDefaultValue(SkinThickness, "skinThickness", 1.0);
128    DefineOptionalParameterWithDefaultValue(StatFileFormat, "statFileFormat", "TIME|TOTAL_ENERGY|POTENTIAL_ENERGY|KINETIC_ENERGY|TEMPERATURE|PRESSURE|VOLUME|CONSERVED_QUANTITY");    
129    DefineOptionalParameterWithDefaultValue(UseSphericalBoundaryConditions, "useSphericalBoundaryConditions", false);
130    DefineOptionalParameterWithDefaultValue(AccumulateBoxDipole, "accumulateBoxDipole", false);
131  
132    DefineOptionalParameterWithDefaultValue(UseRNEMD, "useRNEMD", false);
133 <  DefineOptionalParameterWithDefaultValue(RNEMD_swapTime, "RNEMD_swapTime", 100.0);
133 >  DefineOptionalParameterWithDefaultValue(RNEMD_exchangeTime, "RNEMD_exchangeTime", 100.0);
134    DefineOptionalParameterWithDefaultValue(RNEMD_nBins, "RNEMD_nBins", 16);
135 <  DefineOptionalParameterWithDefaultValue(RNEMD_swapType, "RNEMD_swapType", "Kinetic");
135 >  DefineOptionalParameterWithDefaultValue(RNEMD_logWidth, "RNEMD_logWidth", 16);
136 >  DefineOptionalParameterWithDefaultValue(RNEMD_exchangeType, "RNEMD_exchangeType", "KineticScale");
137 >  DefineOptionalParameterWithDefaultValue(RNEMD_targetFlux, "RNEMD_targetFlux", 0.0);
138 >  DefineOptionalParameterWithDefaultValue(RNEMD_targetJzKE, "RNEMD_targetJzKE", 0.0);
139 >  DefineOptionalParameterWithDefaultValue(RNEMD_targetJzpx, "RNEMD_targetJzpx", 0.0);
140 >  DefineOptionalParameterWithDefaultValue(RNEMD_targetJzpy, "RNEMD_targetJzpy", 0.0);
141 >  DefineOptionalParameterWithDefaultValue(RNEMD_targetJzpz, "RNEMD_targetJzpz", 0.0);
142    DefineOptionalParameterWithDefaultValue(RNEMD_objectSelection, "RNEMD_objectSelection", "select all");
143 <  DefineOptionalParameterWithDefaultValue(UseRestraints, "UseRestraints", false);
144 <  DefineOptionalParameterWithDefaultValue(Restraint_objectSelection, "Restraint_objectSelection", "select all");
145 <  DefineOptionalParameterWithDefaultValue(Restraint_type, "Restraint_type", "positional");
143 >  DefineOptionalParameterWithDefaultValue(RNEMD_binShift, "RNEMD_binShift", false);
144 >  DefineOptionalParameterWithDefaultValue(RNEMD_outputTemperature, "RNEMD_outputTemperature", false);
145 >  DefineOptionalParameterWithDefaultValue(RNEMD_outputVx, "RNEMD_outputVx", false);
146 >  DefineOptionalParameterWithDefaultValue(RNEMD_outputVy, "RNEMD_outputVy", false);
147 >  DefineOptionalParameterWithDefaultValue(RNEMD_outputXyzTemperature, "RNEMD_outputXyzTemperature", false);
148 >  DefineOptionalParameterWithDefaultValue(RNEMD_outputRotTemperature, "RNEMD_outputRotTemperature", false);
149 >
150 >  DefineOptionalParameterWithDefaultValue(UseRestraints, "useRestraints", false);
151    DefineOptionalParameterWithDefaultValue(Restraint_file, "Restraint_file", "idealCrystal.in");
152 <  DefineOptionalParameterWithDefaultValue(Restraint_DisplacementSpringConstant, "Restraint_DisplacementSpringConstant", 0.0);
153 <  DefineOptionalParameterWithDefaultValue(Restraint_RollSpringConstant, "Restraint_RollSpringConstant", 0.0);   // phi
154 <  DefineOptionalParameterWithDefaultValue(Restraint_PitchSpringConstant, "Restraint_PitchSpringConstant", 0.0); // theta
155 <  DefineOptionalParameterWithDefaultValue(Restraint_YawSpringConstant, "Restraint_YawSpringConstant", 0.0);     // psi
156 <  
152 >  DefineOptionalParameterWithDefaultValue(UseThermodynamicIntegration, "useThermodynamicIntegration", false);
153 >  DefineOptionalParameterWithDefaultValue(HULL_Method,"HULL_Method","Convex");
154 >  DefineOptionalParameterWithDefaultValue(FlucQPropagator, "flucQ.propagator", "NVT");
155 >  DefineOptionalParameterWithDefaultValue(FlucQFriction, "flucQ.friction", 1600.0);    
156 >  DefineOptionalParameterWithDefaultValue(FlucQTolerance, "flucQ.tolerance", 1.0e-6);    
157 >  DefineOptionalParameterWithDefaultValue(FlucQMaxIterations, "flucQ.maxIterations", 100);    
158 >  DefineOptionalParameterWithDefaultValue(FlucQTargetTemp, "flucQ.targetTemp", 1.0e-6);
159 >  DefineOptionalParameterWithDefaultValue(FlucQtauThermostat, "flucQ.tauThermostat", 10.0);
160  
161    deprecatedKeywords_.insert("nComponents");
162    deprecatedKeywords_.insert("nZconstraints");
163    deprecatedKeywords_.insert("initialConfig");
164 +  deprecatedKeywords_.insert("thermIntDistSpringConst");
165 +  deprecatedKeywords_.insert("thermIntThetaSpringConst");
166 +  deprecatedKeywords_.insert("thermIntOmegaSpringConst");
167 +  deprecatedKeywords_.insert("useSolidThermInt");  
168 +  deprecatedKeywords_.insert("useLiquidThermInt");
169      
170   }
171  
172   Globals::~Globals() {
173      MemoryUtils::deletePointers(components_);
174      MemoryUtils::deletePointers(zconstraints_);
175 +    MemoryUtils::deletePointers(restraints_);
176   }
177  
178   void Globals::validate() {
# Line 163 | Line 180 | void Globals::validate() {
180  
181    CheckParameter(ForceField, isNotEmpty());
182    CheckParameter(TargetTemp, isPositive());
183 <  CheckParameter(Ensemble, isEqualIgnoreCase("NVE") || isEqualIgnoreCase("NVT") || isEqualIgnoreCase("NPTi") || isEqualIgnoreCase("NPTf") || isEqualIgnoreCase("NPTxyz") || isEqualIgnoreCase("NPAT")  || isEqualIgnoreCase("LANGEVINDYNAMICS") || isEqualIgnoreCase("LD") || isEqualIgnoreCase("NPRT") || isEqualIgnoreCase("NPGT") || isEqualIgnoreCase("NGammaT") || isEqualIgnoreCase("NGT") || isEqualIgnoreCase("SMIPD"));
183 >  CheckParameter(Ensemble, isEqualIgnoreCase("NVE") || isEqualIgnoreCase("NVT") || isEqualIgnoreCase("NPTi") || isEqualIgnoreCase("NPTf") || isEqualIgnoreCase("NPTxyz") || isEqualIgnoreCase("NPTsz") || isEqualIgnoreCase("NPAT")  || isEqualIgnoreCase("LANGEVINDYNAMICS") || isEqualIgnoreCase("LD") || isEqualIgnoreCase("NPRT") || isEqualIgnoreCase("NPGT") || isEqualIgnoreCase("NGammaT") || isEqualIgnoreCase("NGT") || isEqualIgnoreCase("LANGEVINHULL") || isEqualIgnoreCase("LHULL") || isEqualIgnoreCase("SMIPD"));
184    CheckParameter(Dt, isPositive());
185    CheckParameter(RunTime, isPositive());
186    CheckParameter(FinalConfig, isNotEmpty());
# Line 181 | Line 198 | void Globals::validate() {
198    CheckParameter(Seed, isPositive());
199    CheckParameter(Minimizer, isEqualIgnoreCase("SD") || isEqualIgnoreCase("CG"));
200    CheckParameter(MinimizerMaxIter, isPositive());
201 <  CheckParameter(MinimizerWriteFrq, isPositive());
201 >  CheckParameter(MinimizerWriteFreq, isPositive());
202    CheckParameter(MinimizerStepSize, isPositive());
203    CheckParameter(MinimizerFTol, isPositive());
204    CheckParameter(MinimizerGTol, isPositive());
# Line 193 | Line 210 | void Globals::validate() {
210    CheckParameter(ThermodynamicIntegrationK, isPositive());
211    CheckParameter(ForceFieldVariant, isNotEmpty());
212    CheckParameter(ForceFieldFileName, isNotEmpty());
213 <  CheckParameter(ThermIntDistSpringConst, isPositive());
197 <  CheckParameter(ThermIntThetaSpringConst, isPositive());
198 <  CheckParameter(ThermIntOmegaSpringConst, isPositive());
199 <  CheckParameter(ElectrostaticSummationMethod, isEqualIgnoreCase("NONE") || isEqualIgnoreCase("SHIFTED_POTENTIAL") || isEqualIgnoreCase("SHIFTED_FORCE") || isEqualIgnoreCase("REACTION_FIELD"));
200 <  CheckParameter(ElectrostaticScreeningMethod, isEqualIgnoreCase("UNDAMPED") || isEqualIgnoreCase("DAMPED"));
213 >  CheckParameter(CutoffMethod, isEqualIgnoreCase("HARD") || isEqualIgnoreCase("SWITCHED") || isEqualIgnoreCase("SHIFTED_POTENTIAL") || isEqualIgnoreCase("SHIFTED_FORCE"));
214    CheckParameter(CutoffPolicy, isEqualIgnoreCase("MIX") || isEqualIgnoreCase("MAX") || isEqualIgnoreCase("TRADITIONAL"));
215 +  CheckParameter(ElectrostaticSummationMethod, isEqualIgnoreCase("NONE") || isEqualIgnoreCase("HARD") || isEqualIgnoreCase("SWITCHED") || isEqualIgnoreCase("SHIFTED_POTENTIAL") || isEqualIgnoreCase("SHIFTED_FORCE") || isEqualIgnoreCase("REACTION_FIELD"));
216 +  CheckParameter(ElectrostaticScreeningMethod, isEqualIgnoreCase("UNDAMPED") || isEqualIgnoreCase("DAMPED"));
217    CheckParameter(SwitchingFunctionType, isEqualIgnoreCase("CUBIC") || isEqualIgnoreCase("FIFTH_ORDER_POLYNOMIAL"));
203  //CheckParameter(StatFileFormat,);    
218    CheckParameter(OrthoBoxTolerance, isPositive());  
205  CheckParameter(ThermIntDistSpringConst, isPositive());
206  CheckParameter(ThermIntThetaSpringConst, isPositive());
207  CheckParameter(ThermIntOmegaSpringConst, isPositive());
219    CheckParameter(DampingAlpha,isNonNegative());
220    CheckParameter(SkinThickness, isPositive());
221    CheckParameter(Viscosity, isNonNegative());
# Line 212 | Line 223 | void Globals::validate() {
223    CheckParameter(FrozenBufferRadius, isPositive());
224    CheckParameter(LangevinBufferRadius, isPositive());
225    CheckParameter(NeighborListNeighbors, isPositive());
226 <  CheckParameter(RNEMD_swapTime, isPositive());
226 >  CheckParameter(RNEMD_exchangeTime, isPositive());
227    CheckParameter(RNEMD_nBins, isPositive() && isEven());
228 <  CheckParameter(RNEMD_swapType, isEqualIgnoreCase("Kinetic") || isEqualIgnoreCase("Px") || isEqualIgnoreCase("Py") || isEqualIgnoreCase("Pz"));
229 <  CheckParameter(Restraint_DisplacementSpringConstant, isNonNegative());
230 <  CheckParameter(Restraint_RollSpringConstant, isNonNegative());
231 <  CheckParameter(Restraint_PitchSpringConstant, isNonNegative());
232 <  CheckParameter(Restraint_YawSpringConstant, isNonNegative());
233 <  CheckParameter(Restraint_type, isEqualIgnoreCase("P") || isEqualIgnoreCase("O") || isEqualIgnoreCase("P+O") || isEqualIgnoreCase("RMSD_P") || isEqualIgnoreCase("RMSD_O") || isEqualIgnoreCase("RMSD_P+RMSD_O"));
234 <
228 >  CheckParameter(RNEMD_exchangeType, isEqualIgnoreCase("KineticSwap") || isEqualIgnoreCase("KineticScale") || isEqualIgnoreCase("KineticScaleVAM") || isEqualIgnoreCase("KineticScaleAM") || isEqualIgnoreCase("Px") || isEqualIgnoreCase("Py") || isEqualIgnoreCase("Pz") || isEqualIgnoreCase("PxScale") || isEqualIgnoreCase("PyScale") || isEqualIgnoreCase("PzScale") || isEqualIgnoreCase("ShiftScaleV") || isEqualIgnoreCase("ShiftScaleVAM"));
229 >  CheckParameter(HULL_Method, isEqualIgnoreCase("Convex") || isEqualIgnoreCase("AlphaShape"));
230 >  CheckParameter(Alpha, isPositive());
231 >  CheckParameter(FlucQPropagator, isEqualIgnoreCase("NVT") || isEqualIgnoreCase("Langevin") || isEqualIgnoreCase("Minimizer") || isEqualIgnoreCase("Exact") );
232 >  CheckParameter(FlucQFriction, isNonNegative());    
233 >  CheckParameter(FlucQTolerance, isPositive());    
234 >  CheckParameter(FlucQMaxIterations, isPositive());    
235 >  CheckParameter(FlucQTargetTemp,  isNonNegative());
236 >  CheckParameter(FlucQtauThermostat, isPositive());
237 >  
238    for(std::vector<Component*>::iterator i = components_.begin(); i != components_.end(); ++i) {
239      if (!(*i)->findMoleculeStamp(moleculeStamps_)) {
240          std::ostringstream oss;
241          oss << "Globals Error: can not find molecule stamp for component " << (*i)->getType() << std::endl;
242 <        throw OOPSEException(oss.str());          
242 >        throw OpenMDException(oss.str());          
243      }
244    }
245   }
246 <    
246 >
247   bool Globals::addComponent(Component* comp) {
248      components_.push_back(comp);
249      return true;
# Line 240 | Line 254 | bool Globals::addZConsStamp(ZConsStamp* zcons) {
254      return true;
255   }
256  
257 + bool Globals::addRestraintStamp(RestraintStamp* rest) {
258 +    restraints_.push_back(rest);
259 +    return true;
260 + }
261 +
262   bool Globals::addMoleculeStamp(MoleculeStamp* molStamp) {
263      std::string molStampName = molStamp->getName();
264      std::map<std::string, MoleculeStamp*>::iterator i;
# Line 251 | Line 270 | bool Globals::addMoleculeStamp(MoleculeStamp* molStamp
270      } else {
271          std::ostringstream oss;
272          oss << "Globals Error: Molecule Stamp " << molStamp->getName() << "appears multiple times\n";
273 <        throw OOPSEException(oss.str());  
273 >        throw OpenMDException(oss.str());  
274      }
275      return ret;
276   }

Comparing:
trunk/src/io/Globals.cpp (property svn:keywords), Revision 1354 by gezelter, Mon Jun 15 20:12:09 2009 UTC vs.
branches/development/src/io/Globals.cpp (property svn:keywords), Revision 1723 by gezelter, Thu May 24 20:59:54 2012 UTC

# Line 0 | Line 1
1 + Author Id Revision Date

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines