57 DeclareParameter(Name, std::string);
58 DeclareParameter(vdWtype, std::string);
59 DeclareParameter(DistanceMixingRule, std::string);
60 DeclareParameter(DistanceType, std::string);
61 DeclareParameter(EnergyMixingRule, std::string);
62 DeclareParameter(EnergyUnitScaling, RealType);
63 DeclareParameter(MetallicEnergyUnitScaling, RealType);
64 DeclareParameter(FluctuatingChargeEnergyUnitScaling, RealType);
65 DeclareParameter(DistanceUnitScaling, RealType);
66 DeclareParameter(AngleUnitScaling, RealType);
67 DeclareParameter(ChargeUnitScaling, RealType);
68 DeclareParameter(OxidationStateScaling, RealType);
69 DeclareParameter(TorsionAngleConvention, std::string);
70 DeclareParameter(vdw12scale, RealType);
71 DeclareParameter(vdw13scale, RealType);
72 DeclareParameter(vdw14scale, RealType);
73 DeclareParameter(BondForceConstantScaling, RealType);
74 DeclareParameter(BendForceConstantScaling, RealType);
75 DeclareParameter(electrostatic12scale, RealType);
76 DeclareParameter(electrostatic13scale, RealType);
77 DeclareParameter(electrostatic14scale, RealType);
78 DeclareParameter(GayBerneMu, RealType);
79 DeclareParameter(GayBerneNu, RealType);
80 DeclareParameter(EAMMixingMethod, std::string);
81 DeclareParameter(DelayedParameterCalculation,
bool);
88 void validateOptions() {
89 CheckParameter(vdWtype, isEqualIgnoreCase(std::string(
"Lennard-Jones")));
90 CheckParameter(DistanceMixingRule,
91 isEqualIgnoreCase(std::string(
"arithmetic")) ||
92 isEqualIgnoreCase(std::string(
"geometric")) ||
93 isEqualIgnoreCase(std::string(
"cubic")));
94 CheckParameter(DistanceType, isEqualIgnoreCase(std::string(
"sigma")) ||
95 isEqualIgnoreCase(std::string(
"Rmin")));
96 CheckParameter(EnergyMixingRule,
97 isEqualIgnoreCase(std::string(
"arithmetic")) ||
98 isEqualIgnoreCase(std::string(
"geometric")) ||
99 isEqualIgnoreCase(std::string(
"hhg")));
100 CheckParameter(TorsionAngleConvention,
101 isEqualIgnoreCase(std::string(
"180_is_trans")) ||
102 isEqualIgnoreCase(std::string(
"0_is_trans")));
103 CheckParameter(EAMMixingMethod,
104 isEqualIgnoreCase(std::string(
"Johnson")) ||
105 isEqualIgnoreCase(std::string(
"Daw")) ||
106 isEqualIgnoreCase(std::string(
"DREAM1")) ||
107 isEqualIgnoreCase(std::string(
"DREAM2")));
110 bool setData(
const std::string& keyword,
const std::string& value) {
112 ParamMap::iterator i = parameters_.find(keyword);
113 if (i != parameters_.end()) {
114 if (isInteger(value)) {
115 int ival = lexi_cast<int>(value);
116 result = i->second->setData(ival);
117 }
else if (isType<RealType>(value)) {
118 RealType dval = lexi_cast<RealType>(value);
119 result = i->second->setData(dval);
121 result = i->second->setData(value);
125 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
126 "Unrecognized data type for keyword: %s = %s\n",
127 keyword.c_str(), value.c_str());
128 painCave.isFatal = 1;
132 snprintf(painCave.errMsg, MAX_SIM_ERROR_MSG_LENGTH,
133 "%s is an unrecognized keyword\n", keyword.c_str());
134 painCave.isFatal = 0;
142 using ParamMap = std::map<std::string, ParameterBase*>;
143 ParamMap parameters_;