| 52 |
|
|
| 53 |
|
#include "io/ParamConstraint.hpp" |
| 54 |
|
|
| 55 |
< |
#define DefineParameter(NAME,KEYWORD) \ |
| 56 |
< |
NAME.setKeyword(KEYWORD); \ |
| 57 |
< |
parameters_.insert(std::make_pair(std::string(KEYWORD), &NAME)); |
| 55 |
> |
using namespace oopse; |
| 56 |
|
|
| 59 |
– |
#define DefineOptionalParameter(NAME,KEYWORD) \ |
| 60 |
– |
NAME.setKeyword(KEYWORD); NAME.setOptional(true); \ |
| 61 |
– |
parameters_.insert(std::make_pair(std::string(KEYWORD), &NAME)); |
| 62 |
– |
|
| 63 |
– |
#define DefineOptionalParameterWithDefaultValue(NAME,KEYWORD, DEFAULTVALUE) \ |
| 64 |
– |
NAME.setKeyword(KEYWORD); NAME.setOptional(true); NAME.setDefaultValue(DEFAULTVALUE); \ |
| 65 |
– |
parameters_.insert(std::make_pair(std::string(KEYWORD), &NAME)); |
| 66 |
– |
|
| 67 |
– |
#define CheckParameter(NAME, CONSTRAINT) \ |
| 68 |
– |
if (!NAME.empty()) { if (!(CONSTRAINT)(NAME.getData())) { sprintf(painCave.errMsg,"Error in checking %s : should be %s\n",NAME.getKeyword().c_str(),(CONSTRAINT).getConstraintDescription().c_str()); painCave.isFatal = 1; painCave.severity = OOPSE_ERROR; simError();} } |
| 69 |
– |
|
| 57 |
|
Globals::Globals(){ |
| 58 |
|
|
| 59 |
|
DefineParameter(ForceField, "forceField") |
| 110 |
|
DefineOptionalParameter(ElectrostaticSummationMethod, "electrostaticSummationMethod"); |
| 111 |
|
DefineOptionalParameter(ElectrostaticScreeningMethod, "electrostaticScreeningMethod"); |
| 112 |
|
DefineOptionalParameter(CutoffPolicy, "cutoffPolicy"); |
| 113 |
< |
|
| 113 |
> |
DefineOptionalParameter(SwitchingFunctionType, "switchingFunctionType"); |
| 114 |
|
DefineOptionalParameterWithDefaultValue(MixingRule, "mixingRule", "standard"); |
| 115 |
|
DefineOptionalParameterWithDefaultValue(UsePeriodicBoundaryConditions, "usePeriodicBoundaryConditions", true); |
| 116 |
|
DefineOptionalParameterWithDefaultValue(UseInitalTime, "useInitialTime", false); |
| 123 |
|
DefineOptionalParameterWithDefaultValue(ThermIntOmegaSpringConst, "thermIntOmegaSpringConst", 13.5); |
| 124 |
|
DefineOptionalParameterWithDefaultValue(DampingAlpha, "dampingAlpha", 0.2); |
| 125 |
|
DefineOptionalParameterWithDefaultValue(CompressDumpFile, "compressDumpFile", 0); |
| 126 |
+ |
DefineOptionalParameterWithDefaultValue(OutputForceVector, "outputForceVector", 0); |
| 127 |
|
DefineOptionalParameterWithDefaultValue(SkinThickness, "skinThickness", 1.0); |
| 128 |
|
DefineOptionalParameterWithDefaultValue(StatFileFormat, "statFileFormat", "TIME|TOTAL_ENERGY|POTENTIAL_ENERGY|KINETIC_ENERGY|TEMPERATURE|PRESSURE|VOLUME|CONSERVED_QUANTITY"); |
| 129 |
|
|
| 130 |
+ |
|
| 131 |
+ |
} |
| 132 |
+ |
|
| 133 |
+ |
Globals::~Globals(){ |
| 134 |
+ |
int i; |
| 135 |
+ |
if( components != NULL ){ |
| 136 |
+ |
for( i=0; i< getNComponents(); i++ ) delete components[i]; |
| 137 |
+ |
delete[] components; |
| 138 |
+ |
} |
| 139 |
+ |
|
| 140 |
+ |
if( zConstraints != NULL ){ |
| 141 |
+ |
for( i=0; i< getNZconstraints(); i++ ) delete zConstraints[i]; |
| 142 |
+ |
delete[] zConstraints; |
| 143 |
+ |
} |
| 144 |
|
|
| 145 |
|
} |
| 146 |
|
|
| 342 |
|
CheckParameter(ForceField, isNotEmpty()); |
| 343 |
|
CheckParameter(NComponents,isPositive()); |
| 344 |
|
CheckParameter(TargetTemp, isPositive()); |
| 345 |
< |
CheckParameter(Ensemble, isEqualIgnoreCase(std::string("NVE")) || isEqualIgnoreCase(std::string("NVT")) || |
| 346 |
< |
isEqualIgnoreCase(std::string("NPTi")) || isEqualIgnoreCase(std::string("NPTf"))|| |
| 347 |
< |
isEqualIgnoreCase(std::string("NPTxyz")) ); |
| 345 |
> |
CheckParameter(Ensemble, isEqualIgnoreCase(std::string("NVE")) || |
| 346 |
> |
isEqualIgnoreCase(std::string("NVT")) || |
| 347 |
> |
isEqualIgnoreCase(std::string("NPTi")) || |
| 348 |
> |
isEqualIgnoreCase(std::string("NPTf")) || |
| 349 |
> |
isEqualIgnoreCase(std::string("NPTxyz")) ); |
| 350 |
|
CheckParameter(Dt, isPositive()); |
| 351 |
|
CheckParameter(RunTime, isPositive()); |
| 352 |
|
CheckParameter(InitialConfig, isNotEmpty()); |
| 372 |
|
CheckParameter(ZconsTol, isPositive()); |
| 373 |
|
//CheckParameter(ZconsForcePolicy,); |
| 374 |
|
CheckParameter(Seed, isPositive()); |
| 375 |
< |
CheckParameter(Minimizer, isEqualIgnoreCase(std::string("SD")) || isEqualIgnoreCase(std::string("CG"))); |
| 375 |
> |
CheckParameter(Minimizer, isEqualIgnoreCase(std::string("SD")) || |
| 376 |
> |
isEqualIgnoreCase(std::string("CG"))); |
| 377 |
|
CheckParameter(MinimizerMaxIter, isPositive()); |
| 378 |
|
CheckParameter(MinimizerWriteFrq, isPositive()); |
| 379 |
|
CheckParameter(MinimizerStepSize, isPositive()); |
| 391 |
|
CheckParameter(ThermIntThetaSpringConst, isPositive()); |
| 392 |
|
CheckParameter(ThermIntOmegaSpringConst, isPositive()); |
| 393 |
|
CheckParameter(SurfaceTension, isPositive()); |
| 394 |
< |
CheckParameter(ElectrostaticSummationMethod, isEqualIgnoreCase(std::string("NONE")) || isEqualIgnoreCase(std::string("SHIFTED_POTENTIAL")) || isEqualIgnoreCase(std::string("SHIFTED_FORCE")) || isEqualIgnoreCase(std::string("REACTION_FIELD"))); |
| 395 |
< |
CheckParameter(ElectrostaticScreeningMethod, isEqualIgnoreCase(std::string("UNDAMPED")) || isEqualIgnoreCase(std::string("DAMPED"))); |
| 396 |
< |
CheckParameter(CutoffPolicy, isEqualIgnoreCase(std::string("MIX")) || isEqualIgnoreCase(std::string("MAX")) || isEqualIgnoreCase(std::string("TRADITIONAL"))); |
| 394 |
> |
CheckParameter(ElectrostaticSummationMethod, |
| 395 |
> |
isEqualIgnoreCase(std::string("NONE")) || |
| 396 |
> |
isEqualIgnoreCase(std::string("SHIFTED_POTENTIAL")) || |
| 397 |
> |
isEqualIgnoreCase(std::string("SHIFTED_FORCE")) || |
| 398 |
> |
isEqualIgnoreCase(std::string("REACTION_FIELD"))); |
| 399 |
> |
CheckParameter(ElectrostaticScreeningMethod, |
| 400 |
> |
isEqualIgnoreCase(std::string("UNDAMPED")) || |
| 401 |
> |
isEqualIgnoreCase(std::string("DAMPED"))); |
| 402 |
> |
CheckParameter(CutoffPolicy, isEqualIgnoreCase(std::string("MIX")) || |
| 403 |
> |
isEqualIgnoreCase(std::string("MAX")) || |
| 404 |
> |
isEqualIgnoreCase(std::string("TRADITIONAL"))); |
| 405 |
> |
CheckParameter(SwitchingFunctionType, |
| 406 |
> |
isEqualIgnoreCase(std::string("CUBIC")) || |
| 407 |
> |
isEqualIgnoreCase(std::string("FIFTH_ORDER_POLYNOMIAL"))); |
| 408 |
|
//CheckParameter(StatFileFormat,); |
| 409 |
|
//CheckParameter(MixingRule,); |
| 410 |
|
CheckParameter(OrthoBoxTolerance, isPositive()); |