42 |
|
#include <stdlib.h> |
43 |
|
#include <stdio.h> |
44 |
|
#include <string.h> |
45 |
+ |
#include <string> |
46 |
|
|
47 |
|
#include "io/Globals.hpp" |
48 |
|
#include "utils/simError.h" |
48 |
– |
#ifdef IS_MPI |
49 |
– |
#include "io/mpiBASS.h" |
50 |
– |
#endif // is_mpi |
49 |
|
|
50 |
< |
/* |
53 |
< |
* The following section lists all of the defined tokens for the |
54 |
< |
* global assignment statements. All are prefixed with a G_ to avoid |
55 |
< |
* stepping on any previously defined enumerations. |
56 |
< |
* |
57 |
< |
* NOTE: tokens start at 1, 0 is a resrved token number |
58 |
< |
*/ |
50 |
> |
#include "io/ParamConstraint.hpp" |
51 |
|
|
52 |
< |
//required parameters |
53 |
< |
#define G_FORCEFIELD 1 |
54 |
< |
#define G_NCOMPONENTS 2 |
63 |
< |
#define G_TARGETTEMP 3 |
64 |
< |
#define G_ENSEMBLE 4 |
65 |
< |
#define G_DT 5 |
66 |
< |
#define G_RUNTIME 6 |
67 |
< |
|
68 |
< |
//optional parameters |
69 |
< |
#define G_INITIALCONFIG 7 |
70 |
< |
#define G_FINALCONFIG 8 |
71 |
< |
#define G_NMOL 9 |
72 |
< |
#define G_DENSITY 10 |
73 |
< |
#define G_BOX 11 |
74 |
< |
#define G_BOXX 12 |
75 |
< |
#define G_BOXY 13 |
76 |
< |
#define G_BOXZ 14 |
77 |
< |
#define G_SAMPLETIME 15 |
78 |
< |
#define G_STATUSTIME 16 |
79 |
< |
#define G_RCUT 17 |
80 |
< |
#define G_RSW 18 |
81 |
< |
#define G_DIELECTRIC 19 |
82 |
< |
#define G_TEMPSET 20 |
83 |
< |
#define G_THERMALTIME 21 |
84 |
< |
#define G_USEPBC 22 |
85 |
< |
#define G_MIXINGRULE 23 |
86 |
< |
#define G_USERF 24 |
87 |
< |
#define G_TARGETPRESSURE 25 |
88 |
< |
#define G_TAUTHERMOSTAT 26 |
89 |
< |
#define G_TAUBAROSTAT 27 |
90 |
< |
#define G_ZCONSTIME 28 |
91 |
< |
#define G_NZCONSTRAINTS 29 |
92 |
< |
#define G_ZCONSTOL 30 |
93 |
< |
#define G_ZCONSFORCEPOLICY 31 |
94 |
< |
#define G_SEED 32 |
95 |
< |
#define G_RESETTIME 33 |
96 |
< |
#define G_USEINITTIME 34 |
97 |
< |
#define G_USEINIT_XS_STATE 35 |
98 |
< |
#define G_ORTHOBOXTOLERANCE 36 |
99 |
< |
#define G_MINIMIZER 37 |
100 |
< |
#define G_MIN_MAXITER 38 |
101 |
< |
#define G_MIN_WRITEFRQ 39 |
102 |
< |
#define G_MIN_STEPSIZE 40 |
103 |
< |
#define G_MIN_FTOL 41 |
104 |
< |
#define G_MIN_GTOL 42 |
105 |
< |
#define G_MIN_LSTOL 43 |
106 |
< |
#define G_MIN_LSMAXITER 44 |
107 |
< |
#define G_ZCONSGAP 45 |
108 |
< |
#define G_ZCONSFIXTIME 46 |
109 |
< |
#define G_ZCONSUSINGSMD 47 |
110 |
< |
#define G_USE_SOLID_THERM_INT 48 |
111 |
< |
#define G_USE_LIQUID_THERM_INT 49 |
112 |
< |
#define G_THERM_INT_LAMBDA 50 |
113 |
< |
#define G_THERM_INT_K 51 |
114 |
< |
#define G_FORCEFIELD_VARIANT 52 |
115 |
< |
#define G_FORCEFIELD_FILENAME 53 |
116 |
< |
#define G_THERM_INT_DIST_SPRING 54 |
117 |
< |
#define G_THERM_INT_THETA_SPRING 55 |
118 |
< |
#define G_THERM_INT_OMEGA_SPRING 56 |
119 |
< |
#define G_TARGETSTRESS 57 |
120 |
< |
|
121 |
< |
Globals::Globals(){ |
122 |
< |
initalize(); |
123 |
< |
} |
124 |
< |
|
125 |
< |
Globals::~Globals(){ |
126 |
< |
int i; |
127 |
< |
if( components != NULL ){ |
128 |
< |
for( i=0; i<n_components; i++ ) delete components[i]; |
129 |
< |
delete[] components; |
130 |
< |
} |
131 |
< |
} |
132 |
< |
|
133 |
< |
void Globals::initalize(){ |
134 |
< |
int i; |
135 |
< |
|
136 |
< |
components = NULL; |
137 |
< |
|
138 |
< |
command_table.insert(CommandMapType::value_type("forceField", G_FORCEFIELD)); |
139 |
< |
command_table.insert(CommandMapType::value_type("nComponents", G_NCOMPONENTS)); |
140 |
< |
command_table.insert(CommandMapType::value_type("targetTemp", G_TARGETTEMP)); |
141 |
< |
command_table.insert(CommandMapType::value_type("ensemble", G_ENSEMBLE)); |
142 |
< |
command_table.insert(CommandMapType::value_type("dt", G_DT)); |
143 |
< |
command_table.insert(CommandMapType::value_type("runTime", G_RUNTIME)); |
144 |
< |
command_table.insert(CommandMapType::value_type("initialConfig", G_INITIALCONFIG)); |
145 |
< |
command_table.insert(CommandMapType::value_type("finalConfig", G_FINALCONFIG)); |
146 |
< |
command_table.insert(CommandMapType::value_type("nMol", G_NMOL)); |
147 |
< |
command_table.insert(CommandMapType::value_type("density", G_DENSITY)); |
148 |
< |
command_table.insert(CommandMapType::value_type("box", G_BOX)); |
149 |
< |
command_table.insert(CommandMapType::value_type("boxX", G_BOXX)); |
150 |
< |
command_table.insert(CommandMapType::value_type("boxY", G_BOXY)); |
151 |
< |
command_table.insert(CommandMapType::value_type("boxZ", G_BOXZ)); |
152 |
< |
command_table.insert(CommandMapType::value_type("sampleTime", G_SAMPLETIME)); |
153 |
< |
command_table.insert(CommandMapType::value_type("resetTime", G_RESETTIME)); |
154 |
< |
command_table.insert(CommandMapType::value_type("statusTime", G_STATUSTIME)); |
155 |
< |
command_table.insert(CommandMapType::value_type("cutoffRadius", G_RCUT)); |
156 |
< |
command_table.insert(CommandMapType::value_type("switchingRadius", G_RSW)); |
157 |
< |
command_table.insert(CommandMapType::value_type("dielectric", G_DIELECTRIC)); |
158 |
< |
command_table.insert(CommandMapType::value_type("tempSet", G_TEMPSET)); |
159 |
< |
command_table.insert(CommandMapType::value_type("thermalTime", G_THERMALTIME)); |
160 |
< |
command_table.insert(CommandMapType::value_type("mixingRule", G_MIXINGRULE)); |
161 |
< |
command_table.insert(CommandMapType::value_type("usePeriodicBoundaryConditions", G_USEPBC)); |
162 |
< |
command_table.insert(CommandMapType::value_type("useReactionField", G_USERF)); |
163 |
< |
command_table.insert(CommandMapType::value_type("targetPressure", G_TARGETPRESSURE)); |
164 |
< |
command_table.insert(CommandMapType::value_type("tauThermostat", G_TAUTHERMOSTAT)); |
165 |
< |
command_table.insert(CommandMapType::value_type("tauBarostat", G_TAUBAROSTAT)); |
166 |
< |
command_table.insert(CommandMapType::value_type("zconsTime", G_ZCONSTIME)); |
167 |
< |
command_table.insert(CommandMapType::value_type("nZconstraints", G_NZCONSTRAINTS)); |
168 |
< |
command_table.insert(CommandMapType::value_type("zconsTol", G_ZCONSTOL)); |
169 |
< |
command_table.insert(CommandMapType::value_type("zconsForcePolicy", G_ZCONSFORCEPOLICY)); |
170 |
< |
command_table.insert(CommandMapType::value_type("seed", G_SEED)); |
171 |
< |
command_table.insert(CommandMapType::value_type("useInitialTime", G_USEINITTIME)); |
172 |
< |
command_table.insert(CommandMapType::value_type("useInitialExtendedSystemState", G_USEINIT_XS_STATE)); |
173 |
< |
command_table.insert(CommandMapType::value_type("orthoBoxTolerance", G_ORTHOBOXTOLERANCE)); |
174 |
< |
command_table.insert(CommandMapType::value_type("minimizer", G_MINIMIZER)); |
175 |
< |
command_table.insert(CommandMapType::value_type("minimizerMaxIter", G_MIN_MAXITER)); |
176 |
< |
command_table.insert(CommandMapType::value_type("minimizerWriteFrq", G_MIN_WRITEFRQ)); |
177 |
< |
command_table.insert(CommandMapType::value_type("minimizerStepSize", G_MIN_STEPSIZE)); |
178 |
< |
command_table.insert(CommandMapType::value_type("minimizerFTol", G_MIN_FTOL)); |
179 |
< |
command_table.insert(CommandMapType::value_type("minimizerGTol", G_MIN_GTOL)); |
180 |
< |
command_table.insert(CommandMapType::value_type("minimizerLSTol", G_MIN_LSTOL)); |
181 |
< |
command_table.insert(CommandMapType::value_type("minimizerLSMaxIter", G_MIN_LSMAXITER)); |
182 |
< |
command_table.insert(CommandMapType::value_type("zconsGap", G_ZCONSGAP)); |
183 |
< |
command_table.insert(CommandMapType::value_type("zconsFixtime", G_ZCONSFIXTIME)); |
184 |
< |
command_table.insert(CommandMapType::value_type("zconsUsingSMD", G_ZCONSUSINGSMD)); |
185 |
< |
command_table.insert(CommandMapType::value_type("useSolidThermInt", G_USE_SOLID_THERM_INT)); |
186 |
< |
command_table.insert(CommandMapType::value_type("useLiquidThermInt", G_USE_LIQUID_THERM_INT)); |
187 |
< |
command_table.insert(CommandMapType::value_type("thermodynamicIntegrationLambda", G_THERM_INT_LAMBDA)); |
188 |
< |
command_table.insert(CommandMapType::value_type("thermodynamicIntegrationK", G_THERM_INT_K)); |
189 |
< |
command_table.insert(CommandMapType::value_type("forceFieldVariant", G_FORCEFIELD_VARIANT)); |
190 |
< |
command_table.insert(CommandMapType::value_type("forceFieldFileName", G_FORCEFIELD_FILENAME)); |
191 |
< |
command_table.insert(CommandMapType::value_type("thermIntDistSpringConst", G_THERM_INT_DIST_SPRING)); |
192 |
< |
command_table.insert(CommandMapType::value_type("thermIntThetaSpringConst", G_THERM_INT_THETA_SPRING)); |
193 |
< |
command_table.insert(CommandMapType::value_type("thermIntOmegaSpringConst", G_THERM_INT_OMEGA_SPRING)); |
194 |
< |
command_table.insert(CommandMapType::value_type("targetStress", G_TARGETSTRESS)); |
195 |
< |
|
196 |
< |
|
197 |
< |
strcpy( mixingRule,"standard"); //default mixing rules to standard. |
198 |
< |
usePBC = 1; //default periodic boundry conditions to on |
199 |
< |
useRF = 0; |
200 |
< |
useInitTime = 0; // default to pull init time from the init file |
201 |
< |
useInitXSstate = 0; // default to pull the extended state from the init file |
202 |
< |
orthoBoxTolerance = 1E-6; |
203 |
< |
useSolidThermInt = 0; // default solid-state thermodynamic integration to off |
204 |
< |
useLiquidThermInt = 0; // default liquid thermodynamic integration to off |
205 |
< |
|
206 |
< |
have_force_field = 0; |
207 |
< |
have_n_components = 0; |
208 |
< |
have_target_temp = 0; |
209 |
< |
have_ensemble = 0; |
210 |
< |
have_dt = 0; |
211 |
< |
have_run_time = 0; |
212 |
< |
|
213 |
< |
have_initial_config = 0; |
214 |
< |
have_final_config = 0; |
215 |
< |
have_n_mol = 0; |
216 |
< |
have_density = 0; |
217 |
< |
have_box = 0; |
218 |
< |
have_box_x = 0; |
219 |
< |
have_box_y = 0; |
220 |
< |
have_box_y = 0; |
221 |
< |
have_box_z = 0; |
222 |
< |
have_sample_time = 0; |
223 |
< |
have_status_time = 0; |
224 |
< |
have_reset_time = 0; |
225 |
< |
have_thermal_time = 0; |
226 |
< |
have_rcut = 0; |
227 |
< |
have_rsw = 0; |
228 |
< |
have_dielectric = 0; |
229 |
< |
have_tempSet = 0; |
230 |
< |
have_target_pressure =0; |
231 |
< |
have_q_mass = 0; |
232 |
< |
have_tau_thermostat = 0; |
233 |
< |
have_tau_barostat = 0; |
234 |
< |
have_zcons_time = 0; |
235 |
< |
have_n_zConstraints = 0; |
236 |
< |
have_zConstraints = 0; |
237 |
< |
have_zcons_tol = 0; |
238 |
< |
have_zcons_gap = 0; |
239 |
< |
have_zcons_fixtime = 0; |
240 |
< |
have_zcons_using_smd = 0; |
241 |
< |
have_seed = 0; |
242 |
< |
have_minimizer = 0; |
243 |
< |
have_minimizer_maxiteration = 0; |
244 |
< |
have_minimizer_writefrq = 0; |
245 |
< |
have_minimizer_stepsize = 0; |
246 |
< |
have_minimizer_ftol = 0; |
247 |
< |
have_minimizer_gtol = 0; |
248 |
< |
have_minimizer_ls_tol = 0; |
249 |
< |
have_minimizer_ls_maxiteration = 0; |
250 |
< |
have_thermodynamic_integration_lambda = 0; |
251 |
< |
have_thermodynamic_integration_k = 0; |
252 |
< |
have_forcefield_variant = 0; |
253 |
< |
have_forcefield_filename = 0; |
254 |
< |
have_dist_spring_constant = 0; |
255 |
< |
have_theta_spring_constant = 0; |
256 |
< |
have_omega_spring_constant = 0; |
257 |
< |
have_targetstress = 0; |
258 |
< |
} |
259 |
< |
|
260 |
< |
int Globals::newComponent( event* the_event ){ |
261 |
< |
|
262 |
< |
current_component = new Component; |
263 |
< |
int index = the_event->evt.blk_index; |
264 |
< |
char err[200]; |
265 |
< |
|
266 |
< |
if( have_n_components && index < n_components ) |
267 |
< |
components[index] = current_component; |
268 |
< |
else{ |
269 |
< |
if( have_n_components ){ |
270 |
< |
sprintf( err, "meta-data parsing error: %d out of nComponents range", |
271 |
< |
index ); |
272 |
< |
the_event->err_msg = strdup( err ); |
273 |
< |
return 0; |
274 |
< |
} |
275 |
< |
else{ |
276 |
< |
the_event->err_msg = strdup("meta-data parsing error: nComponents not given before" |
277 |
< |
" first component declaration." ); |
278 |
< |
return 0; |
279 |
< |
} |
280 |
< |
} |
52 |
> |
namespace oopse { |
53 |
> |
Globals::Globals() { |
54 |
> |
DefineParameter(ForceField, "forceField") |
55 |
|
|
56 |
< |
return 1; |
57 |
< |
} |
58 |
< |
|
56 |
> |
DefineOptionalParameter(TargetTemp, "targetTemp"); |
57 |
> |
DefineOptionalParameter(Ensemble, "ensemble"); |
58 |
> |
DefineOptionalParameter(Dt, "dt"); |
59 |
> |
DefineOptionalParameter(RunTime, "runTime"); |
60 |
> |
DefineOptionalParameter(InitialConfig, "initialConfig"); |
61 |
> |
DefineOptionalParameter(FinalConfig, "finalConfig"); |
62 |
> |
DefineOptionalParameter(SampleTime, "sampleTime"); |
63 |
> |
DefineOptionalParameter(ResetTime, "resetTime"); |
64 |
> |
DefineOptionalParameter(StatusTime, "statusTime"); |
65 |
> |
DefineOptionalParameter(CutoffRadius, "cutoffRadius"); |
66 |
> |
DefineOptionalParameter(SwitchingRadius, "switchingRadius"); |
67 |
> |
DefineOptionalParameter(Dielectric, "dielectric"); |
68 |
> |
DefineOptionalParameter(TempSet, "tempSet"); |
69 |
> |
DefineOptionalParameter(ThermalTime, "thermalTime"); |
70 |
> |
DefineOptionalParameter(TargetPressure, "targetPressure"); |
71 |
> |
DefineOptionalParameter(TauThermostat, "tauThermostat"); |
72 |
> |
DefineOptionalParameter(TauBarostat, "tauBarostat"); |
73 |
> |
DefineOptionalParameter(ZconsTime, "zconsTime"); |
74 |
> |
DefineOptionalParameter(ZconsTol, "zconsTol"); |
75 |
> |
DefineOptionalParameter(ZconsForcePolicy, "zconsForcePolicy"); |
76 |
> |
DefineOptionalParameter(Seed, "seed"); |
77 |
> |
DefineOptionalParameter(Minimizer, "minimizer"); |
78 |
> |
DefineOptionalParameter(MinimizerMaxIter,"minimizerMaxIter"); |
79 |
> |
DefineOptionalParameter(MinimizerWriteFrq, "minimizerWriteFrq"); |
80 |
> |
DefineOptionalParameter(MinimizerStepSize, "minimizerStepSize"); |
81 |
> |
DefineOptionalParameter(MinimizerFTol, "minimizerFTol"); |
82 |
> |
DefineOptionalParameter(MinimizerGTol, "minimizerGTol"); |
83 |
> |
DefineOptionalParameter(MinimizerLSTol, "minimizerLSTol"); |
84 |
> |
DefineOptionalParameter(MinimizerLSMaxIter, "minimizerLSMaxIter"); |
85 |
> |
DefineOptionalParameter(ZconsGap, "zconsGap"); |
86 |
> |
DefineOptionalParameter(ZconsFixtime, "zconsFixtime"); |
87 |
> |
DefineOptionalParameter(ZconsUsingSMD, "zconsUsingSMD"); |
88 |
> |
DefineOptionalParameter(ThermodynamicIntegrationLambda, "thermodynamicIntegrationLambda"); |
89 |
> |
DefineOptionalParameter(ThermodynamicIntegrationK, "thermodynamicIntegrationK"); |
90 |
> |
DefineOptionalParameter(ForceFieldVariant, "forceFieldVariant"); |
91 |
> |
DefineOptionalParameter(ForceFieldFileName, "forceFieldFileName"); |
92 |
> |
DefineOptionalParameter(ThermIntDistSpringConst, "thermIntDistSpringConst"); |
93 |
> |
DefineOptionalParameter(ThermIntThetaSpringConst, "thermIntThetaSpringConst"); |
94 |
> |
DefineOptionalParameter(ThermIntOmegaSpringConst, "thermIntOmegaSpringConst"); |
95 |
> |
DefineOptionalParameter(SurfaceTension, "surfaceTension"); |
96 |
> |
DefineOptionalParameter(PrintPressureTensor, "printPressureTensor"); |
97 |
> |
DefineOptionalParameter(ElectrostaticSummationMethod, "electrostaticSummationMethod"); |
98 |
> |
DefineOptionalParameter(ElectrostaticScreeningMethod, "electrostaticScreeningMethod"); |
99 |
> |
DefineOptionalParameter(CutoffPolicy, "cutoffPolicy"); |
100 |
> |
DefineOptionalParameter(SwitchingFunctionType, "switchingFunctionType"); |
101 |
> |
DefineOptionalParameterWithDefaultValue(MixingRule, "mixingRule", "standard"); |
102 |
> |
DefineOptionalParameterWithDefaultValue(UsePeriodicBoundaryConditions, "usePeriodicBoundaryConditions", true); |
103 |
> |
DefineOptionalParameterWithDefaultValue(UseInitalTime, "useInitialTime", false); |
104 |
> |
DefineOptionalParameterWithDefaultValue(UseIntialExtendedSystemState, "useInitialExtendedSystemState", false); |
105 |
> |
DefineOptionalParameterWithDefaultValue(OrthoBoxTolerance, "orthoBoxTolerance", 1E-6); |
106 |
> |
DefineOptionalParameterWithDefaultValue(UseSolidThermInt, "useSolidThermInt", false); |
107 |
> |
DefineOptionalParameterWithDefaultValue(UseLiquidThermInt, "useLiquidThermInt", false); |
108 |
> |
DefineOptionalParameterWithDefaultValue(ThermIntDistSpringConst, "thermIntDistSpringConst", 6.0); |
109 |
> |
DefineOptionalParameterWithDefaultValue(ThermIntThetaSpringConst, "thermIntThetaSpringConst", 7.5); |
110 |
> |
DefineOptionalParameterWithDefaultValue(ThermIntOmegaSpringConst, "thermIntOmegaSpringConst", 13.5); |
111 |
> |
DefineOptionalParameterWithDefaultValue(DampingAlpha, "dampingAlpha", 0.2); |
112 |
> |
DefineOptionalParameterWithDefaultValue(CompressDumpFile, "compressDumpFile", 0); |
113 |
> |
DefineOptionalParameterWithDefaultValue(OutputForceVector, "outputForceVector", 0); |
114 |
> |
DefineOptionalParameterWithDefaultValue(SkinThickness, "skinThickness", 1.0); |
115 |
> |
DefineOptionalParameterWithDefaultValue(StatFileFormat, "statFileFormat", "TIME|TOTAL_ENERGY|POTENTIAL_ENERGY|KINETIC_ENERGY|TEMPERATURE|PRESSURE|VOLUME|CONSERVED_QUANTITY"); |
116 |
|
|
117 |
|
|
118 |
< |
int Globals::componentAssign( event* the_event ){ |
119 |
< |
|
289 |
< |
switch( the_event->evt.asmt.asmt_type ){ |
118 |
> |
deprecatedKeywords_.insert("nComponents"); |
119 |
> |
deprecatedKeywords_.insert("nZconstraints"); |
120 |
|
|
291 |
– |
case STRING: |
292 |
– |
return current_component->assignString( the_event->evt.asmt.lhs, |
293 |
– |
the_event->evt.asmt.rhs.sval, |
294 |
– |
&(the_event->err_msg)); |
295 |
– |
break; |
296 |
– |
|
297 |
– |
case DOUBLE: |
298 |
– |
return current_component->assignDouble( the_event->evt.asmt.lhs, |
299 |
– |
the_event->evt.asmt.rhs.dval, |
300 |
– |
&(the_event->err_msg)); |
301 |
– |
break; |
302 |
– |
|
303 |
– |
case INT: |
304 |
– |
return current_component->assignInt( the_event->evt.asmt.lhs, |
305 |
– |
the_event->evt.asmt.rhs.ival, |
306 |
– |
&(the_event->err_msg)); |
307 |
– |
break; |
308 |
– |
|
309 |
– |
default: |
310 |
– |
the_event->err_msg = strdup( "Globals error. Invalid component" |
311 |
– |
" assignment type" ); |
312 |
– |
return 0; |
313 |
– |
break; |
314 |
– |
} |
315 |
– |
return 0; |
121 |
|
} |
122 |
|
|
123 |
< |
int Globals::componentEnd( event* the_event ){ |
123 |
> |
Globals::~Globals() { |
124 |
|
|
320 |
– |
the_event->err_msg = current_component->checkMe(); |
321 |
– |
if( the_event->err_msg != NULL ) return 0; |
125 |
|
|
323 |
– |
return 1; |
126 |
|
} |
127 |
|
|
128 |
< |
int Globals::newZconstraint( event* the_event ){ |
129 |
< |
|
128 |
> |
void Globals::validate() { |
129 |
> |
DataHolder::validate(); |
130 |
|
|
131 |
< |
int index = the_event->evt.blk_index; |
132 |
< |
char err[200]; |
133 |
< |
current_zConstraint = new ZconStamp( index ); |
134 |
< |
|
135 |
< |
have_zConstraints = 1; |
131 |
> |
CheckParameter(ForceField, isNotEmpty()); |
132 |
> |
CheckParameter(TargetTemp, isPositive()); |
133 |
> |
CheckParameter(Ensemble, isEqualIgnoreCase(std::string("NVE")) || isEqualIgnoreCase(std::string("NVT")) || isEqualIgnoreCase(std::string("NPTi")) || isEqualIgnoreCase(std::string("NPTf")) || isEqualIgnoreCase(std::string("NPTxyz")) ); |
134 |
> |
CheckParameter(Dt, isPositive()); |
135 |
> |
CheckParameter(RunTime, isPositive()); |
136 |
> |
CheckParameter(InitialConfig, isNotEmpty()); |
137 |
> |
CheckParameter(FinalConfig, isNotEmpty()); |
138 |
> |
CheckParameter(SampleTime, isNonNegative()); |
139 |
> |
CheckParameter(ResetTime, isNonNegative()); |
140 |
> |
CheckParameter(StatusTime, isNonNegative()); |
141 |
> |
CheckParameter(CutoffRadius, isPositive()); |
142 |
> |
CheckParameter(SwitchingRadius, isNonNegative()); |
143 |
> |
CheckParameter(Dielectric, isPositive()); |
144 |
> |
CheckParameter(ThermalTime, isNonNegative()); |
145 |
> |
CheckParameter(TargetPressure, isPositive()); |
146 |
> |
CheckParameter(TauThermostat, isPositive()); |
147 |
> |
CheckParameter(TauBarostat, isPositive()); |
148 |
> |
CheckParameter(ZconsTime, isPositive()); |
149 |
> |
CheckParameter(ZconsTol, isPositive()); |
150 |
> |
CheckParameter(Seed, isPositive()); |
151 |
> |
CheckParameter(Minimizer, isEqualIgnoreCase(std::string("SD")) || isEqualIgnoreCase(std::string("CG"))); |
152 |
> |
CheckParameter(MinimizerMaxIter, isPositive()); |
153 |
> |
CheckParameter(MinimizerWriteFrq, isPositive()); |
154 |
> |
CheckParameter(MinimizerStepSize, isPositive()); |
155 |
> |
CheckParameter(MinimizerFTol, isPositive()); |
156 |
> |
CheckParameter(MinimizerGTol, isPositive()); |
157 |
> |
CheckParameter(MinimizerLSTol, isPositive()); |
158 |
> |
CheckParameter(MinimizerLSMaxIter, isPositive()); |
159 |
> |
CheckParameter(ZconsGap, isPositive()); |
160 |
> |
CheckParameter(ZconsFixtime, isPositive()); |
161 |
> |
CheckParameter(ThermodynamicIntegrationLambda, isPositive()); |
162 |
> |
CheckParameter(ThermodynamicIntegrationK, isPositive()); |
163 |
> |
CheckParameter(ForceFieldVariant, isNotEmpty()); |
164 |
> |
CheckParameter(ForceFieldFileName, isNotEmpty()); |
165 |
> |
CheckParameter(ThermIntDistSpringConst, isPositive()); |
166 |
> |
CheckParameter(ThermIntThetaSpringConst, isPositive()); |
167 |
> |
CheckParameter(ThermIntOmegaSpringConst, isPositive()); |
168 |
> |
CheckParameter(SurfaceTension, isPositive()); |
169 |
> |
CheckParameter(ElectrostaticSummationMethod, isEqualIgnoreCase(std::string("NONE")) || isEqualIgnoreCase(std::string("SHIFTED_POTENTIAL")) || isEqualIgnoreCase(std::string("SHIFTED_FORCE")) || isEqualIgnoreCase(std::string("REACTION_FIELD"))); |
170 |
> |
CheckParameter(ElectrostaticScreeningMethod, isEqualIgnoreCase(std::string("UNDAMPED")) || isEqualIgnoreCase(std::string("DAMPED"))); |
171 |
> |
CheckParameter(CutoffPolicy, isEqualIgnoreCase(std::string("MIX")) || isEqualIgnoreCase(std::string("MAX")) || isEqualIgnoreCase(std::string("TRADITIONAL"))); |
172 |
> |
CheckParameter(SwitchingFunctionType, isEqualIgnoreCase(std::string("CUBIC")) || isEqualIgnoreCase(std::string("FIFTH_ORDER_POLYNOMIAL"))); |
173 |
> |
//CheckParameter(StatFileFormat,); |
174 |
> |
//CheckParameter(MixingRule,); |
175 |
> |
CheckParameter(OrthoBoxTolerance, isPositive()); |
176 |
> |
CheckParameter(ThermIntDistSpringConst, isPositive()); |
177 |
> |
CheckParameter(ThermIntThetaSpringConst, isPositive()); |
178 |
> |
CheckParameter(ThermIntOmegaSpringConst, isPositive()); |
179 |
> |
CheckParameter(DampingAlpha,isNonNegative()); |
180 |
> |
CheckParameter(SkinThickness, isPositive()); |
181 |
|
|
182 |
< |
if( have_n_zConstraints && index < n_zConstraints ) |
183 |
< |
zConstraints[index] = current_zConstraint; |
184 |
< |
else{ |
338 |
< |
if( have_n_zConstraints ){ |
339 |
< |
sprintf( err, "meta-data parsing error: %d out of nZconstraints range", |
340 |
< |
index ); |
341 |
< |
the_event->err_msg = strdup( err ); |
342 |
< |
return 0; |
182 |
> |
for(std::vector<Component*>::iterator i = components_.begin(); i != components_.end(); ++i) { |
183 |
> |
if (!(*i)->findMoleculeStamp(moleculeStamps_)) { |
184 |
> |
std::cout << "Globals Error: can not find molecule stamp for component" << std::endl; |
185 |
|
} |
186 |
< |
else{ |
345 |
< |
the_event->err_msg = strdup("meta-data parsing error: nZconstraints" |
346 |
< |
" not given before" |
347 |
< |
" first zConstraint declaration." ); |
348 |
< |
return 0; |
349 |
< |
} |
350 |
< |
} |
351 |
< |
|
352 |
< |
return 1; |
186 |
> |
} |
187 |
|
} |
354 |
– |
|
355 |
– |
|
356 |
– |
|
357 |
– |
int Globals::zConstraintAssign( event* the_event ){ |
358 |
– |
|
359 |
– |
switch( the_event->evt.asmt.asmt_type ){ |
188 |
|
|
189 |
< |
case STRING: |
190 |
< |
return current_zConstraint->assignString( the_event->evt.asmt.lhs, |
191 |
< |
the_event->evt.asmt.rhs.sval, |
364 |
< |
&(the_event->err_msg)); |
365 |
< |
break; |
366 |
< |
|
367 |
< |
case DOUBLE: |
368 |
< |
return current_zConstraint->assignDouble( the_event->evt.asmt.lhs, |
369 |
< |
the_event->evt.asmt.rhs.dval, |
370 |
< |
&(the_event->err_msg)); |
371 |
< |
break; |
372 |
< |
|
373 |
< |
case INT: |
374 |
< |
return current_zConstraint->assignInt( the_event->evt.asmt.lhs, |
375 |
< |
the_event->evt.asmt.rhs.ival, |
376 |
< |
&(the_event->err_msg)); |
377 |
< |
break; |
378 |
< |
|
379 |
< |
default: |
380 |
< |
the_event->err_msg = strdup( "Globals error. Invalid zConstraint" |
381 |
< |
" assignment type" ); |
382 |
< |
return 0; |
383 |
< |
break; |
384 |
< |
} |
385 |
< |
return 0; |
189 |
> |
bool Globals::addComponent(Component* comp) { |
190 |
> |
components_.push_back(comp); |
191 |
> |
return true; |
192 |
|
} |
193 |
|
|
194 |
< |
int Globals::zConstraintEnd( event* the_event ){ |
195 |
< |
|
196 |
< |
the_event->err_msg = current_zConstraint->checkMe(); |
391 |
< |
if( the_event->err_msg != NULL ) return 0; |
392 |
< |
|
393 |
< |
return 1; |
194 |
> |
bool Globals::addZConsStamp(ZConsStamp* zcons) { |
195 |
> |
zconstraints_.push_back(zcons); |
196 |
> |
return true; |
197 |
|
} |
198 |
|
|
199 |
< |
int Globals::globalAssign( event* the_event ){ |
200 |
< |
|
201 |
< |
int key; |
202 |
< |
int token; |
203 |
< |
interface_assign_type the_type = the_event->evt.asmt.asmt_type; |
204 |
< |
char* lhs = the_event->evt.asmt.lhs; |
205 |
< |
char err[300]; |
206 |
< |
|
207 |
< |
token = 0; |
405 |
< |
|
406 |
< |
CommandMapType::iterator iter; |
407 |
< |
std::string keyword(lhs); |
408 |
< |
iter = command_table.find(keyword); |
409 |
< |
if (iter != command_table.end()) { |
410 |
< |
token = iter->second; |
411 |
< |
} |
412 |
< |
|
413 |
< |
if( token ){ |
414 |
< |
|
415 |
< |
switch( token ){ |
416 |
< |
|
417 |
< |
case G_FORCEFIELD: |
418 |
< |
if( the_type == STRING ){ |
419 |
< |
strcpy( force_field, the_event->evt.asmt.rhs.sval ); |
420 |
< |
have_force_field = 1; |
421 |
< |
return 1; |
422 |
< |
} |
423 |
< |
|
424 |
< |
the_event->err_msg = |
425 |
< |
strdup( "Error in parsing meta-data file!\n\tforceField was not a string assignment.\n" ); |
426 |
< |
return 0; |
427 |
< |
break; |
428 |
< |
|
429 |
< |
case G_NCOMPONENTS: |
430 |
< |
if( the_type == STRING ){ |
431 |
< |
the_event->err_msg = |
432 |
< |
strdup("Error in parsing meta-data file!\n\tnComponents is not a double or an int.\n" ); |
433 |
< |
return 0; |
434 |
< |
} |
435 |
< |
|
436 |
< |
else if( the_type == DOUBLE ){ |
437 |
< |
n_components = (int)the_event->evt.asmt.rhs.dval; |
438 |
< |
components = new Component*[n_components]; |
439 |
< |
have_n_components = 1; |
440 |
< |
return 1; |
441 |
< |
} |
442 |
< |
|
443 |
< |
else{ |
444 |
< |
n_components = the_event->evt.asmt.rhs.ival; |
445 |
< |
components = new Component*[n_components]; |
446 |
< |
have_n_components = 1; |
447 |
< |
return 1; |
448 |
< |
} |
449 |
< |
break; |
450 |
< |
|
451 |
< |
case G_NZCONSTRAINTS: |
452 |
< |
if( the_type == STRING ){ |
453 |
< |
the_event->err_msg = |
454 |
< |
strdup("Error in parsing meta-data file!\n\tnZconstraints is not a double or an int.\n" ); |
455 |
< |
return 0; |
456 |
< |
} |
457 |
< |
|
458 |
< |
else if( the_type == DOUBLE ){ |
459 |
< |
n_zConstraints = (int)the_event->evt.asmt.rhs.dval; |
460 |
< |
zConstraints = new ZconStamp*[n_zConstraints]; |
461 |
< |
have_n_zConstraints = 1; |
462 |
< |
return 1; |
463 |
< |
} |
464 |
< |
|
465 |
< |
else{ |
466 |
< |
n_zConstraints = the_event->evt.asmt.rhs.ival; |
467 |
< |
zConstraints = new ZconStamp*[n_zConstraints]; |
468 |
< |
have_n_zConstraints = 1; |
469 |
< |
return 1; |
470 |
< |
} |
471 |
< |
break; |
472 |
< |
|
473 |
< |
case G_TARGETTEMP: |
474 |
< |
switch( the_type ){ |
475 |
< |
|
476 |
< |
case STRING: |
477 |
< |
the_event->err_msg = |
478 |
< |
strdup( "Error in parsing meta-data file!\n\ttargetTemp is not a double or int.\n" ); |
479 |
< |
return 0; |
480 |
< |
break; |
481 |
< |
|
482 |
< |
case DOUBLE: |
483 |
< |
target_temp = the_event->evt.asmt.rhs.dval; |
484 |
< |
have_target_temp = 1; |
485 |
< |
return 1; |
486 |
< |
break; |
487 |
< |
|
488 |
< |
case INT: |
489 |
< |
target_temp = (double)the_event->evt.asmt.rhs.ival; |
490 |
< |
have_target_temp = 1; |
491 |
< |
return 1; |
492 |
< |
break; |
493 |
< |
|
494 |
< |
default: |
495 |
< |
the_event->err_msg = |
496 |
< |
strdup( "Error in parsing meta-data file!\n\ttargetTemp unrecognized.\n" ); |
497 |
< |
return 0; |
498 |
< |
break; |
499 |
< |
} |
500 |
< |
break; |
501 |
< |
|
502 |
< |
case G_ORTHOBOXTOLERANCE: |
503 |
< |
switch( the_type ){ |
504 |
< |
|
505 |
< |
case STRING: |
506 |
< |
the_event->err_msg = |
507 |
< |
strdup( "Error in parsing meta-data file!\n\torthoBoxTolerance is not a double or int.\n" ); |
508 |
< |
return 0; |
509 |
< |
break; |
510 |
< |
|
511 |
< |
case DOUBLE: |
512 |
< |
orthoBoxTolerance = the_event->evt.asmt.rhs.dval; |
513 |
< |
have_target_temp = 1; |
514 |
< |
return 1; |
515 |
< |
break; |
516 |
< |
|
517 |
< |
case INT: |
518 |
< |
orthoBoxTolerance = (double)the_event->evt.asmt.rhs.ival; |
519 |
< |
have_target_temp = 1; |
520 |
< |
return 1; |
521 |
< |
break; |
522 |
< |
|
523 |
< |
default: |
524 |
< |
the_event->err_msg = |
525 |
< |
strdup( "Global error.orthoBoxTolerance unrecognized.\n" ); |
526 |
< |
return 0; |
527 |
< |
break; |
528 |
< |
} |
529 |
< |
break; |
530 |
< |
|
531 |
< |
case G_ENSEMBLE: |
532 |
< |
if( the_type == STRING ){ |
533 |
< |
strcpy( ensemble, the_event->evt.asmt.rhs.sval ); |
534 |
< |
have_ensemble = 1; |
535 |
< |
return 1; |
536 |
< |
} |
537 |
< |
|
538 |
< |
the_event->err_msg = |
539 |
< |
strdup( "Error in parsing meta-data file!\n\tensemble was not assigned to a string\n" ); |
540 |
< |
return 0; |
541 |
< |
break; |
542 |
< |
|
543 |
< |
case G_MIXINGRULE: |
544 |
< |
if( the_type == STRING ){ |
545 |
< |
strcpy( mixingRule, the_event->evt.asmt.rhs.sval ); |
546 |
< |
return 1; |
547 |
< |
} |
548 |
< |
|
549 |
< |
the_event->err_msg = |
550 |
< |
strdup( "Error in parsing meta-data file!\n\tmixing rule was not assigned to a string\n" ); |
551 |
< |
return 0; |
552 |
< |
break; |
553 |
< |
|
554 |
< |
case G_DT: |
555 |
< |
switch( the_type ){ |
556 |
< |
|
557 |
< |
case STRING: |
558 |
< |
the_event->err_msg = |
559 |
< |
strdup( "Error in parsing meta-data file!\n\tdt is not a double or int.\n" ); |
560 |
< |
return 0; |
561 |
< |
break; |
562 |
< |
|
563 |
< |
case DOUBLE: |
564 |
< |
dt = the_event->evt.asmt.rhs.dval; |
565 |
< |
have_dt = 1; |
566 |
< |
return 1; |
567 |
< |
break; |
568 |
< |
|
569 |
< |
case INT: |
570 |
< |
dt = (double)the_event->evt.asmt.rhs.ival; |
571 |
< |
have_dt = 1; |
572 |
< |
return 1; |
573 |
< |
break; |
574 |
< |
|
575 |
< |
default: |
576 |
< |
the_event->err_msg = |
577 |
< |
strdup( "Error in parsing meta-data file!\n\tdt unrecognized.\n" ); |
578 |
< |
return 0; |
579 |
< |
break; |
580 |
< |
} |
581 |
< |
break; |
582 |
< |
|
583 |
< |
case G_RUNTIME: |
584 |
< |
switch( the_type ){ |
585 |
< |
|
586 |
< |
case STRING: |
587 |
< |
the_event->err_msg = |
588 |
< |
strdup( "Error in parsing meta-data file!\n\trunTime is not a double or int.\n" ); |
589 |
< |
return 0; |
590 |
< |
break; |
591 |
< |
|
592 |
< |
case DOUBLE: |
593 |
< |
run_time = the_event->evt.asmt.rhs.dval; |
594 |
< |
have_run_time = 1; |
595 |
< |
return 1; |
596 |
< |
break; |
597 |
< |
|
598 |
< |
case INT: |
599 |
< |
run_time = (double)the_event->evt.asmt.rhs.ival; |
600 |
< |
have_run_time = 1; |
601 |
< |
return 1; |
602 |
< |
break; |
603 |
< |
|
604 |
< |
default: |
605 |
< |
the_event->err_msg = |
606 |
< |
strdup( "Error in parsing meta-data file!\n\trunTime unrecognized.\n" ); |
607 |
< |
return 0; |
608 |
< |
break; |
609 |
< |
} |
610 |
< |
break; |
611 |
< |
|
612 |
< |
case G_INITIALCONFIG: |
613 |
< |
if( the_type == STRING ){ |
614 |
< |
strcpy( initial_config, the_event->evt.asmt.rhs.sval ); |
615 |
< |
have_initial_config = 1; |
616 |
< |
return 1; |
617 |
< |
} |
618 |
< |
|
619 |
< |
the_event->err_msg = |
620 |
< |
strdup( "Error in parsing meta-data file!\n\tinitialConfig was not a string assignment.\n" ); |
621 |
< |
return 0; |
622 |
< |
break; |
623 |
< |
|
624 |
< |
case G_FINALCONFIG: |
625 |
< |
if( the_type == STRING ){ |
626 |
< |
strcpy( final_config, the_event->evt.asmt.rhs.sval ); |
627 |
< |
have_final_config = 1; |
628 |
< |
return 1; |
629 |
< |
} |
630 |
< |
|
631 |
< |
the_event->err_msg = |
632 |
< |
strdup( "Error in parsing meta-data file!\n\tfinalConfig was not a string assignment.\n" ); |
633 |
< |
return 0; |
634 |
< |
break; |
635 |
< |
|
636 |
< |
case G_NMOL: |
637 |
< |
switch( the_type ){ |
638 |
< |
|
639 |
< |
case STRING: |
640 |
< |
the_event->err_msg = |
641 |
< |
strdup( "Error in parsing meta-data file!\n\tnMol is not a double or int.\n" ); |
642 |
< |
return 0; |
643 |
< |
break; |
644 |
< |
|
645 |
< |
case DOUBLE: |
646 |
< |
n_mol = (int)the_event->evt.asmt.rhs.dval; |
647 |
< |
have_n_mol = 1; |
648 |
< |
return 1; |
649 |
< |
break; |
650 |
< |
|
651 |
< |
case INT: |
652 |
< |
n_mol = the_event->evt.asmt.rhs.ival; |
653 |
< |
have_n_mol = 1; |
654 |
< |
return 1; |
655 |
< |
break; |
656 |
< |
|
657 |
< |
default: |
658 |
< |
the_event->err_msg = |
659 |
< |
strdup( "Error in parsing meta-data file!\n\tnMol unrecognized.\n" ); |
660 |
< |
return 0; |
661 |
< |
break; |
662 |
< |
} |
663 |
< |
break; |
664 |
< |
|
665 |
< |
case G_DENSITY: |
666 |
< |
switch( the_type ){ |
667 |
< |
|
668 |
< |
case STRING: |
669 |
< |
the_event->err_msg = |
670 |
< |
strdup( "Error in parsing meta-data file!\n\tdensity is not a double or int.\n" ); |
671 |
< |
return 0; |
672 |
< |
break; |
673 |
< |
|
674 |
< |
case DOUBLE: |
675 |
< |
density = the_event->evt.asmt.rhs.dval; |
676 |
< |
have_density = 1; |
677 |
< |
return 1; |
678 |
< |
break; |
679 |
< |
|
680 |
< |
case INT: |
681 |
< |
density = (double)the_event->evt.asmt.rhs.ival; |
682 |
< |
have_density = 1; |
683 |
< |
return 1; |
684 |
< |
break; |
685 |
< |
|
686 |
< |
default: |
687 |
< |
the_event->err_msg = |
688 |
< |
strdup( "Error in parsing meta-data file!\n\tdensity unrecognized.\n" ); |
689 |
< |
return 0; |
690 |
< |
break; |
691 |
< |
} |
692 |
< |
break; |
693 |
< |
|
694 |
< |
case G_BOX: |
695 |
< |
switch( the_type ){ |
696 |
< |
|
697 |
< |
case STRING: |
698 |
< |
the_event->err_msg = |
699 |
< |
strdup( "Error in parsing meta-data file!\n\tbox is not a double or int.\n" ); |
700 |
< |
return 0; |
701 |
< |
break; |
702 |
< |
|
703 |
< |
case DOUBLE: |
704 |
< |
box = the_event->evt.asmt.rhs.dval; |
705 |
< |
have_box = 1; |
706 |
< |
return 1; |
707 |
< |
break; |
708 |
< |
|
709 |
< |
case INT: |
710 |
< |
box = (double)the_event->evt.asmt.rhs.ival; |
711 |
< |
have_box = 1; |
712 |
< |
return 1; |
713 |
< |
break; |
714 |
< |
|
715 |
< |
default: |
716 |
< |
the_event->err_msg = |
717 |
< |
strdup( "Error in parsing meta-data file!\n\tbox unrecognized.\n" ); |
718 |
< |
return 0; |
719 |
< |
break; |
720 |
< |
} |
721 |
< |
break; |
722 |
< |
|
723 |
< |
case G_BOXX: |
724 |
< |
switch( the_type ){ |
725 |
< |
|
726 |
< |
case STRING: |
727 |
< |
the_event->err_msg = |
728 |
< |
strdup( "Error in parsing meta-data file!\n\tboxX is not a double or int.\n" ); |
729 |
< |
return 0; |
730 |
< |
break; |
731 |
< |
|
732 |
< |
case DOUBLE: |
733 |
< |
box_x = the_event->evt.asmt.rhs.dval; |
734 |
< |
have_box_x = 1; |
735 |
< |
return 1; |
736 |
< |
break; |
737 |
< |
|
738 |
< |
case INT: |
739 |
< |
box_x = (double)the_event->evt.asmt.rhs.ival; |
740 |
< |
have_box_x = 1; |
741 |
< |
return 1; |
742 |
< |
break; |
743 |
< |
|
744 |
< |
default: |
745 |
< |
the_event->err_msg = |
746 |
< |
strdup( "Error in parsing meta-data file!\n\tboxX unrecognized.\n" ); |
747 |
< |
return 0; |
748 |
< |
break; |
749 |
< |
} |
750 |
< |
break; |
751 |
< |
|
752 |
< |
case G_BOXY: |
753 |
< |
switch( the_type ){ |
754 |
< |
|
755 |
< |
case STRING: |
756 |
< |
the_event->err_msg = |
757 |
< |
strdup( "Error in parsing meta-data file!\n\tboxY is not a double or int.\n" ); |
758 |
< |
return 0; |
759 |
< |
break; |
760 |
< |
|
761 |
< |
case DOUBLE: |
762 |
< |
box_y = the_event->evt.asmt.rhs.dval; |
763 |
< |
have_box_y = 1; |
764 |
< |
return 1; |
765 |
< |
break; |
766 |
< |
|
767 |
< |
case INT: |
768 |
< |
box_y = (double)the_event->evt.asmt.rhs.ival; |
769 |
< |
have_box_y = 1; |
770 |
< |
return 1; |
771 |
< |
break; |
772 |
< |
|
773 |
< |
default: |
774 |
< |
the_event->err_msg = |
775 |
< |
strdup( "Error in parsing meta-data file!\n\tboxY unrecognized.\n" ); |
776 |
< |
return 0; |
777 |
< |
break; |
778 |
< |
} |
779 |
< |
break; |
780 |
< |
|
781 |
< |
case G_BOXZ: |
782 |
< |
switch( the_type ){ |
783 |
< |
|
784 |
< |
case STRING: |
785 |
< |
the_event->err_msg = |
786 |
< |
strdup( "Error in parsing meta-data file!\n\tboxZ is not a double or int.\n" ); |
787 |
< |
return 0; |
788 |
< |
break; |
789 |
< |
|
790 |
< |
case DOUBLE: |
791 |
< |
box_z = the_event->evt.asmt.rhs.dval; |
792 |
< |
have_box_z = 1; |
793 |
< |
return 1; |
794 |
< |
break; |
795 |
< |
|
796 |
< |
case INT: |
797 |
< |
box_z = (double)the_event->evt.asmt.rhs.ival; |
798 |
< |
have_box_z = 1; |
799 |
< |
return 1; |
800 |
< |
break; |
801 |
< |
|
802 |
< |
default: |
803 |
< |
the_event->err_msg = |
804 |
< |
strdup( "Error in parsing meta-data file!\n\tboxZ unrecognized.\n" ); |
805 |
< |
return 0; |
806 |
< |
break; |
807 |
< |
} |
808 |
< |
break; |
809 |
< |
|
810 |
< |
case G_SAMPLETIME: |
811 |
< |
switch( the_type ){ |
812 |
< |
|
813 |
< |
case STRING: |
814 |
< |
the_event->err_msg = |
815 |
< |
strdup( "Error in parsing meta-data file!\n\tsampleTime is not a double or int.\n" ); |
816 |
< |
return 0; |
817 |
< |
break; |
818 |
< |
|
819 |
< |
case DOUBLE: |
820 |
< |
sample_time = the_event->evt.asmt.rhs.dval; |
821 |
< |
have_sample_time = 1; |
822 |
< |
return 1; |
823 |
< |
break; |
824 |
< |
|
825 |
< |
case INT: |
826 |
< |
sample_time = (double)the_event->evt.asmt.rhs.ival; |
827 |
< |
have_sample_time = 1; |
828 |
< |
return 1; |
829 |
< |
break; |
830 |
< |
|
831 |
< |
default: |
832 |
< |
the_event->err_msg = |
833 |
< |
strdup( "Error in parsing meta-data file!\n\tsampleTime unrecognized.\n" ); |
834 |
< |
return 0; |
835 |
< |
break; |
836 |
< |
} |
837 |
< |
break; |
838 |
< |
|
839 |
< |
case G_STATUSTIME: |
840 |
< |
switch( the_type ){ |
841 |
< |
|
842 |
< |
case STRING: |
843 |
< |
the_event->err_msg = |
844 |
< |
strdup( "Error in parsing meta-data file!\n\tstatusTime is not a double or int.\n" ); |
845 |
< |
return 0; |
846 |
< |
break; |
847 |
< |
|
848 |
< |
case DOUBLE: |
849 |
< |
status_time = the_event->evt.asmt.rhs.dval; |
850 |
< |
have_status_time = 1; |
851 |
< |
return 1; |
852 |
< |
break; |
853 |
< |
|
854 |
< |
case INT: |
855 |
< |
status_time = (double)the_event->evt.asmt.rhs.ival; |
856 |
< |
have_status_time = 1; |
857 |
< |
return 1; |
858 |
< |
break; |
859 |
< |
|
860 |
< |
default: |
861 |
< |
the_event->err_msg = |
862 |
< |
strdup( "Error in parsing meta-data file!\n\tstatusTime unrecognized.\n" ); |
863 |
< |
return 0; |
864 |
< |
break; |
865 |
< |
} |
866 |
< |
break; |
867 |
< |
|
868 |
< |
case G_RESETTIME: |
869 |
< |
switch( the_type ){ |
870 |
< |
|
871 |
< |
case STRING: |
872 |
< |
the_event->err_msg = |
873 |
< |
strdup( "Error in parsing meta-data file!\n\tresetTime is not a double or int.\n" ); |
874 |
< |
return 0; |
875 |
< |
break; |
876 |
< |
|
877 |
< |
case DOUBLE: |
878 |
< |
resetTime = the_event->evt.asmt.rhs.dval; |
879 |
< |
have_reset_time = 1; |
880 |
< |
return 1; |
881 |
< |
break; |
882 |
< |
|
883 |
< |
case INT: |
884 |
< |
resetTime = (double)the_event->evt.asmt.rhs.ival; |
885 |
< |
have_reset_time = 1; |
886 |
< |
return 1; |
887 |
< |
break; |
888 |
< |
|
889 |
< |
default: |
890 |
< |
the_event->err_msg = |
891 |
< |
strdup( "Error in parsing meta-data file!\n\tresetTime unrecognized.\n" ); |
892 |
< |
return 0; |
893 |
< |
break; |
894 |
< |
} |
895 |
< |
break; |
896 |
< |
|
897 |
< |
case G_THERMALTIME: |
898 |
< |
switch( the_type ){ |
899 |
< |
|
900 |
< |
case STRING: |
901 |
< |
the_event->err_msg = |
902 |
< |
strdup( "Error in parsing meta-data file!\n\tthermalTime is not a double or int.\n" ); |
903 |
< |
return 0; |
904 |
< |
break; |
905 |
< |
|
906 |
< |
case DOUBLE: |
907 |
< |
thermal_time = the_event->evt.asmt.rhs.dval; |
908 |
< |
have_thermal_time = 1; |
909 |
< |
return 1; |
910 |
< |
break; |
911 |
< |
|
912 |
< |
case INT: |
913 |
< |
thermal_time = (double)the_event->evt.asmt.rhs.ival; |
914 |
< |
have_thermal_time = 1; |
915 |
< |
return 1; |
916 |
< |
break; |
917 |
< |
|
918 |
< |
default: |
919 |
< |
the_event->err_msg = |
920 |
< |
strdup( "Error in parsing meta-data file!\n\tthermalTime unrecognized.\n" ); |
921 |
< |
return 0; |
922 |
< |
break; |
923 |
< |
} |
924 |
< |
break; |
925 |
< |
|
926 |
< |
case G_RCUT: |
927 |
< |
switch( the_type ){ |
928 |
< |
|
929 |
< |
case STRING: |
930 |
< |
the_event->err_msg = |
931 |
< |
strdup( "Error in parsing meta-data file!\n\tcutoffRadius is not a double or int.\n" ); |
932 |
< |
return 0; |
933 |
< |
break; |
934 |
< |
|
935 |
< |
case DOUBLE: |
936 |
< |
rcut = the_event->evt.asmt.rhs.dval; |
937 |
< |
have_rcut = 1; |
938 |
< |
return 1; |
939 |
< |
break; |
940 |
< |
|
941 |
< |
case INT: |
942 |
< |
rcut = (double)the_event->evt.asmt.rhs.ival; |
943 |
< |
have_rcut = 1; |
944 |
< |
return 1; |
945 |
< |
break; |
946 |
< |
|
947 |
< |
default: |
948 |
< |
the_event->err_msg = |
949 |
< |
strdup( "Error in parsing meta-data file!\n\tcutoffRadius unrecognized.\n" ); |
950 |
< |
return 0; |
951 |
< |
break; |
952 |
< |
} |
953 |
< |
break; |
954 |
< |
|
955 |
< |
case G_RSW: |
956 |
< |
switch( the_type ){ |
957 |
< |
|
958 |
< |
case STRING: |
959 |
< |
the_event->err_msg = |
960 |
< |
strdup( "Error in parsing meta-data file!\n\tswitchingRadius is not a double or int.\n" ); |
961 |
< |
return 0; |
962 |
< |
break; |
963 |
< |
|
964 |
< |
case DOUBLE: |
965 |
< |
rsw = the_event->evt.asmt.rhs.dval; |
966 |
< |
have_rsw = 1; |
967 |
< |
return 1; |
968 |
< |
break; |
969 |
< |
|
970 |
< |
case INT: |
971 |
< |
rsw = (double)the_event->evt.asmt.rhs.ival; |
972 |
< |
have_rsw = 1; |
973 |
< |
return 1; |
974 |
< |
break; |
975 |
< |
|
976 |
< |
default: |
977 |
< |
the_event->err_msg = |
978 |
< |
strdup( "Error in parsing meta-data file!\n\tswitchingRadius unrecognized.\n" ); |
979 |
< |
return 0; |
980 |
< |
break; |
981 |
< |
} |
982 |
< |
break; |
983 |
< |
|
984 |
< |
case G_DIELECTRIC: |
985 |
< |
switch( the_type ){ |
986 |
< |
|
987 |
< |
case STRING: |
988 |
< |
the_event->err_msg = |
989 |
< |
strdup( "Error in parsing meta-data file!\n\tdielectric is not a double or int.\n" ); |
990 |
< |
return 0; |
991 |
< |
break; |
992 |
< |
|
993 |
< |
case DOUBLE: |
994 |
< |
dielectric = the_event->evt.asmt.rhs.dval; |
995 |
< |
have_dielectric = 1; |
996 |
< |
return 1; |
997 |
< |
break; |
998 |
< |
|
999 |
< |
case INT: |
1000 |
< |
dielectric = (double)the_event->evt.asmt.rhs.ival; |
1001 |
< |
have_dielectric = 1; |
1002 |
< |
return 1; |
1003 |
< |
break; |
1004 |
< |
|
1005 |
< |
default: |
1006 |
< |
the_event->err_msg = |
1007 |
< |
strdup( "Error in parsing meta-data file!\n\tdielectric unrecognized.\n" ); |
1008 |
< |
return 0; |
1009 |
< |
break; |
1010 |
< |
} |
1011 |
< |
break; |
1012 |
< |
|
1013 |
< |
case G_TEMPSET: |
1014 |
< |
if( the_type == STRING ){ |
1015 |
< |
|
1016 |
< |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) tempSet = 1; |
1017 |
< |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) tempSet = 0; |
1018 |
< |
else{ |
1019 |
< |
the_event->err_msg = |
1020 |
< |
strdup( "Error in parsing meta-data file!\n\ttempSet was not \"true\" or \"false\".\n" ); |
1021 |
< |
return 0; |
1022 |
< |
} |
1023 |
< |
have_tempSet = 1; |
1024 |
< |
return 1; |
1025 |
< |
} |
1026 |
< |
|
1027 |
< |
the_event->err_msg = |
1028 |
< |
strdup( "Error in parsing meta-data file!\n\ttempSet was not \"true\" or \"false\".\n" ); |
1029 |
< |
return 0; |
1030 |
< |
break; |
1031 |
< |
|
1032 |
< |
case G_USEINITTIME: |
1033 |
< |
if( the_type == STRING ){ |
1034 |
< |
|
1035 |
< |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useInitTime = 1; |
1036 |
< |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useInitTime = 0; |
1037 |
< |
else{ |
1038 |
< |
the_event->err_msg = |
1039 |
< |
strdup( "Error in parsing meta-data file!\n\tuseInitTime was not \"true\" or \"false\".\n" ); |
1040 |
< |
return 0; |
1041 |
< |
} |
1042 |
< |
return 1; |
1043 |
< |
} |
1044 |
< |
|
1045 |
< |
the_event->err_msg = |
1046 |
< |
strdup( "Error in parsing meta-data file!\n\tuseInitTime was not \"true\" or \"false\".\n" ); |
1047 |
< |
return 0; |
1048 |
< |
break; |
1049 |
< |
|
1050 |
< |
case G_USEINIT_XS_STATE: |
1051 |
< |
if( the_type == STRING ){ |
1052 |
< |
|
1053 |
< |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) |
1054 |
< |
useInitXSstate = 1; |
1055 |
< |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) |
1056 |
< |
useInitXSstate = 0; |
1057 |
< |
else{ |
1058 |
< |
the_event->err_msg = |
1059 |
< |
strdup( "Error in parsing meta-data file!\n\tuseInitExtendedSystemState was not \"true\" or \"false\".\n" ); |
1060 |
< |
return 0; |
1061 |
< |
} |
1062 |
< |
return 1; |
1063 |
< |
} |
1064 |
< |
|
1065 |
< |
the_event->err_msg = |
1066 |
< |
strdup( "Error in parsing meta-data file!\n\tuseInitExtendedSystemState was not \"true\" or \"false\".\n" ); |
1067 |
< |
return 0; |
1068 |
< |
break; |
1069 |
< |
|
1070 |
< |
case G_USEPBC: |
1071 |
< |
if( the_type == STRING ){ |
1072 |
< |
|
1073 |
< |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) usePBC = 1; |
1074 |
< |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) usePBC = 0; |
1075 |
< |
else{ |
1076 |
< |
the_event->err_msg = |
1077 |
< |
strdup( "Error in parsing meta-data file!\n\tusePeriodicBoundaryConditions was not \"true\" or \"false\".\n" ); |
1078 |
< |
return 0; |
1079 |
< |
} |
1080 |
< |
return 1; |
1081 |
< |
} |
1082 |
< |
|
1083 |
< |
the_event->err_msg = |
1084 |
< |
strdup( "Error in parsing meta-data file!\n\tusePeriodicBoundaryConditions was not \"true\" or \"false\".\n" ); |
1085 |
< |
return 0; |
1086 |
< |
break; |
1087 |
< |
|
1088 |
< |
case G_USERF: |
1089 |
< |
if( the_type == STRING ){ |
1090 |
< |
|
1091 |
< |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useRF = 1; |
1092 |
< |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useRF = 0; |
1093 |
< |
else{ |
1094 |
< |
the_event->err_msg = |
1095 |
< |
strdup( "Error in parsing meta-data file!\n\tuseReactionField was not \"true\" or \"false\".\n" ); |
1096 |
< |
return 0; |
1097 |
< |
} |
1098 |
< |
return 1; |
1099 |
< |
} |
1100 |
< |
|
1101 |
< |
the_event->err_msg = |
1102 |
< |
strdup( "Error in parsing meta-data file!\n\tuseReactionField was not \"true\" or \"false\".\n" ); |
1103 |
< |
return 0; |
1104 |
< |
break; |
1105 |
< |
|
1106 |
< |
case G_TARGETPRESSURE: |
1107 |
< |
switch( the_type ){ |
1108 |
< |
|
1109 |
< |
case STRING: |
1110 |
< |
the_event->err_msg = |
1111 |
< |
strdup( "Error in parsing meta-data file!\n\ttargetPressure is not a double or int.\n" ); |
1112 |
< |
return 0; |
1113 |
< |
break; |
1114 |
< |
|
1115 |
< |
case DOUBLE: |
1116 |
< |
target_pressure = the_event->evt.asmt.rhs.dval; |
1117 |
< |
have_target_pressure = 1; |
1118 |
< |
return 1; |
1119 |
< |
break; |
1120 |
< |
|
1121 |
< |
case INT: |
1122 |
< |
target_pressure = (double)the_event->evt.asmt.rhs.ival; |
1123 |
< |
have_target_pressure = 1; |
1124 |
< |
return 1; |
1125 |
< |
break; |
1126 |
< |
|
1127 |
< |
default: |
1128 |
< |
the_event->err_msg = |
1129 |
< |
strdup( "Error in parsing meta-data file!\n\ttargetPressure unrecognized.\n" ); |
1130 |
< |
return 0; |
1131 |
< |
break; |
1132 |
< |
} |
1133 |
< |
break; |
1134 |
< |
|
1135 |
< |
case G_TAUTHERMOSTAT: |
1136 |
< |
switch( the_type ){ |
1137 |
< |
|
1138 |
< |
case STRING: |
1139 |
< |
the_event->err_msg = |
1140 |
< |
strdup( "Error in parsing meta-data file!\n\ttauThermostat is not a double or int.\n" ); |
1141 |
< |
return 0; |
1142 |
< |
break; |
1143 |
< |
|
1144 |
< |
case DOUBLE: |
1145 |
< |
tau_thermostat = the_event->evt.asmt.rhs.dval; |
1146 |
< |
have_tau_thermostat = 1; |
1147 |
< |
return 1; |
1148 |
< |
break; |
1149 |
< |
|
1150 |
< |
case INT: |
1151 |
< |
tau_thermostat = (double)the_event->evt.asmt.rhs.ival; |
1152 |
< |
have_tau_thermostat = 1; |
1153 |
< |
return 1; |
1154 |
< |
break; |
1155 |
< |
|
1156 |
< |
default: |
1157 |
< |
the_event->err_msg = |
1158 |
< |
strdup( "Error in parsing meta-data file!\n\ttauThermostat unrecognized.\n" ); |
1159 |
< |
return 0; |
1160 |
< |
break; |
1161 |
< |
} |
1162 |
< |
break; |
1163 |
< |
|
1164 |
< |
case G_TAUBAROSTAT: |
1165 |
< |
switch( the_type ){ |
1166 |
< |
|
1167 |
< |
case STRING: |
1168 |
< |
the_event->err_msg = |
1169 |
< |
strdup( "Error in parsing meta-data file!\n\ttauBarostat is not a double or int.\n" ); |
1170 |
< |
return 0; |
1171 |
< |
break; |
1172 |
< |
|
1173 |
< |
case DOUBLE: |
1174 |
< |
tau_barostat = the_event->evt.asmt.rhs.dval; |
1175 |
< |
have_tau_barostat = 1; |
1176 |
< |
return 1; |
1177 |
< |
break; |
1178 |
< |
|
1179 |
< |
case INT: |
1180 |
< |
tau_barostat = (double)the_event->evt.asmt.rhs.ival; |
1181 |
< |
have_tau_barostat = 1; |
1182 |
< |
return 1; |
1183 |
< |
break; |
1184 |
< |
|
1185 |
< |
default: |
1186 |
< |
the_event->err_msg = |
1187 |
< |
strdup( "Error in parsing meta-data file!\n\ttauBarostat unrecognized.\n" ); |
1188 |
< |
return 0; |
1189 |
< |
break; |
1190 |
< |
} |
1191 |
< |
break; |
1192 |
< |
|
1193 |
< |
case G_ZCONSTIME: |
1194 |
< |
switch( the_type ){ |
1195 |
< |
|
1196 |
< |
case STRING: |
1197 |
< |
the_event->err_msg = |
1198 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_time is not a double or int.\n" ); |
1199 |
< |
return 0; |
1200 |
< |
break; |
1201 |
< |
|
1202 |
< |
case DOUBLE: |
1203 |
< |
zcons_time = the_event->evt.asmt.rhs.dval; |
1204 |
< |
have_zcons_time = 1; |
1205 |
< |
return 1; |
1206 |
< |
break; |
1207 |
< |
|
1208 |
< |
case INT: |
1209 |
< |
zcons_time = (double)the_event->evt.asmt.rhs.ival; |
1210 |
< |
have_zcons_time = 1; |
1211 |
< |
return 1; |
1212 |
< |
break; |
1213 |
< |
|
1214 |
< |
default: |
1215 |
< |
the_event->err_msg = |
1216 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_time unrecognized.\n" ); |
1217 |
< |
return 0; |
1218 |
< |
break; |
1219 |
< |
} |
1220 |
< |
break; |
1221 |
< |
|
1222 |
< |
case G_ZCONSTOL: |
1223 |
< |
switch( the_type ){ |
1224 |
< |
|
1225 |
< |
case STRING: |
1226 |
< |
the_event->err_msg = |
1227 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_tol is not a double or int.\n" ); |
1228 |
< |
return 0; |
1229 |
< |
break; |
1230 |
< |
|
1231 |
< |
case DOUBLE: |
1232 |
< |
zcons_tol = the_event->evt.asmt.rhs.dval; |
1233 |
< |
have_zcons_tol = 1; |
1234 |
< |
return 1; |
1235 |
< |
break; |
1236 |
< |
|
1237 |
< |
case INT: |
1238 |
< |
zcons_tol = (double)the_event->evt.asmt.rhs.ival; |
1239 |
< |
have_zcons_tol = 1; |
1240 |
< |
return 1; |
1241 |
< |
break; |
1242 |
< |
|
1243 |
< |
default: |
1244 |
< |
the_event->err_msg = |
1245 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_ol unrecognized.\n" ); |
1246 |
< |
return 0; |
1247 |
< |
break; |
1248 |
< |
} |
1249 |
< |
break; |
1250 |
< |
|
1251 |
< |
case G_ZCONSFORCEPOLICY: |
1252 |
< |
switch( the_type ){ |
1253 |
< |
|
1254 |
< |
case STRING: |
1255 |
< |
strcpy(zconsForcePolicy, the_event->evt.asmt.rhs.sval); |
1256 |
< |
|
1257 |
< |
for(int i = 0; zconsForcePolicy[i] != '\0'; i++) |
1258 |
< |
{ |
1259 |
< |
zconsForcePolicy[i] = toupper(zconsForcePolicy[i]); |
1260 |
< |
} |
1261 |
< |
have_zcons_force_policy = 1; |
1262 |
< |
return 1; |
1263 |
< |
break; |
1264 |
< |
|
1265 |
< |
case DOUBLE: |
1266 |
< |
the_event->err_msg = |
1267 |
< |
strdup( "Error in parsing meta-data file!\n\tzconsForcePolicy is not a double or int.\n" ); |
1268 |
< |
return 0; |
1269 |
< |
break; |
1270 |
< |
|
1271 |
< |
case INT: |
1272 |
< |
the_event->err_msg = |
1273 |
< |
strdup( "Error in parsing meta-data file!\n\tzconsForcePolicy is not a double or int.\n" ); |
1274 |
< |
return 0; |
1275 |
< |
break; |
1276 |
< |
|
1277 |
< |
default: |
1278 |
< |
the_event->err_msg = |
1279 |
< |
strdup( "Error in parsing meta-data file!\n\tzconsForcePolicy unrecognized.\n" ); |
1280 |
< |
return 0; |
1281 |
< |
break; |
1282 |
< |
} |
1283 |
< |
break; |
1284 |
< |
|
1285 |
< |
case G_ZCONSGAP: |
1286 |
< |
switch( the_type ){ |
1287 |
< |
|
1288 |
< |
case STRING: |
1289 |
< |
the_event->err_msg = |
1290 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_gap is not a double or int.\n" ); |
1291 |
< |
return 0; |
1292 |
< |
break; |
1293 |
< |
|
1294 |
< |
case DOUBLE: |
1295 |
< |
zcons_gap = the_event->evt.asmt.rhs.dval; |
1296 |
< |
have_zcons_gap= 1; |
1297 |
< |
return 1; |
1298 |
< |
break; |
1299 |
< |
|
1300 |
< |
case INT: |
1301 |
< |
zcons_gap= (double)the_event->evt.asmt.rhs.ival; |
1302 |
< |
have_zcons_gap= 1; |
1303 |
< |
return 1; |
1304 |
< |
break; |
1305 |
< |
|
1306 |
< |
default: |
1307 |
< |
the_event->err_msg = |
1308 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_gap unrecognized.\n" ); |
1309 |
< |
return 0; |
1310 |
< |
break; |
1311 |
< |
} |
1312 |
< |
break; |
1313 |
< |
|
1314 |
< |
case G_ZCONSFIXTIME: |
1315 |
< |
switch( the_type ){ |
1316 |
< |
|
1317 |
< |
case STRING: |
1318 |
< |
the_event->err_msg = |
1319 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_fixtime is not a double or int.\n" ); |
1320 |
< |
return 0; |
1321 |
< |
break; |
1322 |
< |
|
1323 |
< |
case DOUBLE: |
1324 |
< |
zcons_fixtime= the_event->evt.asmt.rhs.dval; |
1325 |
< |
have_zcons_fixtime= 1; |
1326 |
< |
return 1; |
1327 |
< |
break; |
1328 |
< |
|
1329 |
< |
case INT: |
1330 |
< |
zcons_fixtime= (double)the_event->evt.asmt.rhs.ival; |
1331 |
< |
have_zcons_fixtime= 1; |
1332 |
< |
return 1; |
1333 |
< |
break; |
1334 |
< |
|
1335 |
< |
default: |
1336 |
< |
the_event->err_msg = |
1337 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_fixtime unrecognized.\n" ); |
1338 |
< |
return 0; |
1339 |
< |
break; |
1340 |
< |
} |
1341 |
< |
break; |
1342 |
< |
|
1343 |
< |
case G_ZCONSUSINGSMD: |
1344 |
< |
switch( the_type ){ |
1345 |
< |
|
1346 |
< |
case STRING: |
1347 |
< |
the_event->err_msg = |
1348 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_fixtime is not an int.\n" ); |
1349 |
< |
return 0; |
1350 |
< |
break; |
1351 |
< |
|
1352 |
< |
case DOUBLE: |
1353 |
< |
the_event->err_msg = |
1354 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_fixtime is not an int.\n" ); |
1355 |
< |
return 0; |
1356 |
< |
break; |
1357 |
< |
|
1358 |
< |
case INT: |
1359 |
< |
zcons_using_smd= the_event->evt.asmt.rhs.ival; |
1360 |
< |
have_zcons_using_smd= 1; |
1361 |
< |
return 1; |
1362 |
< |
break; |
1363 |
< |
|
1364 |
< |
default: |
1365 |
< |
the_event->err_msg = |
1366 |
< |
strdup( "Error in parsing meta-data file!\n\tzcons_usingsmd unrecognized.\n" ); |
1367 |
< |
return 0; |
1368 |
< |
break; |
1369 |
< |
} |
1370 |
< |
break; |
1371 |
< |
|
1372 |
< |
case G_MINIMIZER: |
1373 |
< |
switch( the_type ){ |
1374 |
< |
|
1375 |
< |
case STRING: |
1376 |
< |
strcpy(minimizer_name, the_event->evt.asmt.rhs.sval); |
1377 |
< |
|
1378 |
< |
for(int i = 0; zconsForcePolicy[i] != '\0'; i++){ |
1379 |
< |
zconsForcePolicy[i] = toupper(zconsForcePolicy[i]); |
1380 |
< |
} |
1381 |
< |
have_minimizer= 1; |
1382 |
< |
return 1; |
1383 |
< |
break; |
1384 |
< |
|
1385 |
< |
case DOUBLE: |
1386 |
< |
the_event->err_msg = |
1387 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_name is not a double or int.\n" ); |
1388 |
< |
return 0; |
1389 |
< |
break; |
1390 |
< |
|
1391 |
< |
case INT: |
1392 |
< |
the_event->err_msg = |
1393 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_name is not a double or int.\n" ); |
1394 |
< |
return 0; |
1395 |
< |
break; |
1396 |
< |
|
1397 |
< |
default: |
1398 |
< |
the_event->err_msg = |
1399 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_name unrecognized.\n" ); |
1400 |
< |
return 0; |
1401 |
< |
break; |
1402 |
< |
} |
1403 |
< |
break; |
1404 |
< |
|
1405 |
< |
case G_MIN_MAXITER: |
1406 |
< |
switch( the_type ){ |
1407 |
< |
|
1408 |
< |
case STRING: |
1409 |
< |
the_event->err_msg = |
1410 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_maxiteration is not a double or int.\n" ); |
1411 |
< |
return 1; |
1412 |
< |
break; |
1413 |
< |
|
1414 |
< |
case DOUBLE: |
1415 |
< |
minimizer_maxiteration = (int)the_event->evt.asmt.rhs.dval; |
1416 |
< |
have_minimizer_maxiteration = 1; |
1417 |
< |
return 1; |
1418 |
< |
break; |
1419 |
< |
|
1420 |
< |
case INT: |
1421 |
< |
minimizer_maxiteration = the_event->evt.asmt.rhs.ival; |
1422 |
< |
have_minimizer_maxiteration = 1; |
1423 |
< |
return 1; |
1424 |
< |
break; |
1425 |
< |
|
1426 |
< |
default: |
1427 |
< |
the_event->err_msg = |
1428 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_maxiteration unrecognized.\n" ); |
1429 |
< |
return 0; |
1430 |
< |
break; |
1431 |
< |
} |
1432 |
< |
break; |
1433 |
< |
|
1434 |
< |
case G_MIN_WRITEFRQ: |
1435 |
< |
switch( the_type ){ |
1436 |
< |
|
1437 |
< |
case STRING: |
1438 |
< |
the_event->err_msg = |
1439 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_writefrq is not an int.\n" ); |
1440 |
< |
return 1; |
1441 |
< |
break; |
1442 |
< |
|
1443 |
< |
case DOUBLE: |
1444 |
< |
the_event->err_msg = |
1445 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_writefrq is not an int.\n" ); |
1446 |
< |
return 1; |
1447 |
< |
break; |
1448 |
< |
|
1449 |
< |
case INT: |
1450 |
< |
minimizer_writefrq= the_event->evt.asmt.rhs.ival; |
1451 |
< |
have_minimizer_writefrq = 1; |
1452 |
< |
return 1; |
1453 |
< |
break; |
1454 |
< |
|
1455 |
< |
default: |
1456 |
< |
the_event->err_msg = |
1457 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_writefrq unrecognized.\n" ); |
1458 |
< |
return 0; |
1459 |
< |
break; |
1460 |
< |
} |
1461 |
< |
break; |
1462 |
< |
|
1463 |
< |
case G_MIN_STEPSIZE: |
1464 |
< |
switch( the_type ){ |
1465 |
< |
|
1466 |
< |
case STRING: |
1467 |
< |
the_event->err_msg = |
1468 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_resetfrq is not a double or int.\n" ); |
1469 |
< |
return 1; |
1470 |
< |
break; |
1471 |
< |
|
1472 |
< |
case DOUBLE: |
1473 |
< |
minimizer_stepsize= the_event->evt.asmt.rhs.dval; |
1474 |
< |
have_minimizer_stepsize = 1; |
1475 |
< |
return 1; |
1476 |
< |
break; |
1477 |
< |
|
1478 |
< |
case INT: |
1479 |
< |
minimizer_stepsize= the_event->evt.asmt.rhs.ival; |
1480 |
< |
have_minimizer_stepsize = 1; |
1481 |
< |
return 1; |
1482 |
< |
break; |
1483 |
< |
|
1484 |
< |
default: |
1485 |
< |
the_event->err_msg = |
1486 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_resetfrq unrecognized.\n" ); |
1487 |
< |
return 0; |
1488 |
< |
break; |
1489 |
< |
} |
1490 |
< |
break; |
1491 |
< |
|
1492 |
< |
case G_MIN_FTOL: |
1493 |
< |
switch( the_type ){ |
1494 |
< |
|
1495 |
< |
case STRING: |
1496 |
< |
the_event->err_msg = |
1497 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_ftol is not a double or int.\n" ); |
1498 |
< |
return 1; |
1499 |
< |
break; |
1500 |
< |
|
1501 |
< |
case DOUBLE: |
1502 |
< |
minimizer_ftol= the_event->evt.asmt.rhs.dval; |
1503 |
< |
have_minimizer_ftol = 1; |
1504 |
< |
return 1; |
1505 |
< |
break; |
1506 |
< |
|
1507 |
< |
case INT: |
1508 |
< |
minimizer_ftol= the_event->evt.asmt.rhs.ival; |
1509 |
< |
have_minimizer_ftol = 1; |
1510 |
< |
return 1; |
1511 |
< |
break; |
1512 |
< |
|
1513 |
< |
default: |
1514 |
< |
the_event->err_msg = |
1515 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_ftol unrecognized.\n" ); |
1516 |
< |
return 0; |
1517 |
< |
break; |
1518 |
< |
} |
1519 |
< |
break; |
1520 |
< |
|
1521 |
< |
case G_MIN_GTOL: |
1522 |
< |
switch( the_type ){ |
1523 |
< |
|
1524 |
< |
case STRING: |
1525 |
< |
the_event->err_msg = |
1526 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_gtol is not a double or int.\n" ); |
1527 |
< |
return 1; |
1528 |
< |
break; |
1529 |
< |
|
1530 |
< |
case DOUBLE: |
1531 |
< |
minimizer_gtol= the_event->evt.asmt.rhs.dval; |
1532 |
< |
have_minimizer_gtol = 1; |
1533 |
< |
return 1; |
1534 |
< |
break; |
1535 |
< |
|
1536 |
< |
case INT: |
1537 |
< |
minimizer_gtol= the_event->evt.asmt.rhs.ival; |
1538 |
< |
have_minimizer_gtol = 1; |
1539 |
< |
return 1; |
1540 |
< |
break; |
1541 |
< |
|
1542 |
< |
default: |
1543 |
< |
the_event->err_msg = |
1544 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_gtol unrecognized.\n" ); |
1545 |
< |
return 0; |
1546 |
< |
break; |
1547 |
< |
} |
1548 |
< |
break; |
1549 |
< |
|
1550 |
< |
case G_MIN_LSMAXITER: |
1551 |
< |
switch( the_type ){ |
1552 |
< |
|
1553 |
< |
case STRING: |
1554 |
< |
the_event->err_msg = |
1555 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_ls_maxiteration is not an int.\n" ); |
1556 |
< |
return 1; |
1557 |
< |
break; |
1558 |
< |
|
1559 |
< |
case DOUBLE: |
1560 |
< |
the_event->err_msg = |
1561 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_ls_maxiteration is not an int.\n" ); |
1562 |
< |
return 1; |
1563 |
< |
break; |
1564 |
< |
|
1565 |
< |
case INT: |
1566 |
< |
minimizer_ls_maxiteration = the_event->evt.asmt.rhs.ival; |
1567 |
< |
have_minimizer_ls_maxiteration = 1; |
1568 |
< |
return 1; |
1569 |
< |
break; |
1570 |
< |
|
1571 |
< |
default: |
1572 |
< |
the_event->err_msg = |
1573 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_ls_maxiteration unrecognized.\n" ); |
1574 |
< |
return 0; |
1575 |
< |
break; |
1576 |
< |
} |
1577 |
< |
break; |
1578 |
< |
|
1579 |
< |
case G_MIN_LSTOL: |
1580 |
< |
switch( the_type ){ |
1581 |
< |
|
1582 |
< |
case STRING: |
1583 |
< |
the_event->err_msg = |
1584 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_ls_tol is not a double or int.\n" ); |
1585 |
< |
return 1; |
1586 |
< |
break; |
1587 |
< |
|
1588 |
< |
case DOUBLE: |
1589 |
< |
minimizer_ls_tol= the_event->evt.asmt.rhs.dval; |
1590 |
< |
have_minimizer_ls_tol = 1; |
1591 |
< |
return 1; |
1592 |
< |
break; |
1593 |
< |
|
1594 |
< |
case INT: |
1595 |
< |
minimizer_ls_tol= the_event->evt.asmt.rhs.ival; |
1596 |
< |
have_minimizer_ls_tol = 1; |
1597 |
< |
return 1; |
1598 |
< |
break; |
1599 |
< |
|
1600 |
< |
default: |
1601 |
< |
the_event->err_msg = |
1602 |
< |
strdup( "Error in parsing meta-data file!\n\tminimizer_ls_tol unrecognized.\n" ); |
1603 |
< |
return 0; |
1604 |
< |
break; |
1605 |
< |
} |
1606 |
< |
break; |
1607 |
< |
|
1608 |
< |
// add more token cases here. |
1609 |
< |
case G_SEED: |
1610 |
< |
switch( the_type ){ |
1611 |
< |
|
1612 |
< |
case STRING: |
1613 |
< |
the_event->err_msg = |
1614 |
< |
strdup( "Error in parsing meta-data file!\n\tseed is not a string.\n" ); |
1615 |
< |
return 0; |
1616 |
< |
return 0; |
1617 |
< |
break; |
1618 |
< |
|
1619 |
< |
case DOUBLE: |
1620 |
< |
have_seed = 1; |
1621 |
< |
seed = (int)the_event->evt.asmt.rhs.dval; |
1622 |
< |
return 1; |
1623 |
< |
break; |
1624 |
< |
|
1625 |
< |
case INT: |
1626 |
< |
have_seed = 1; |
1627 |
< |
seed = the_event->evt.asmt.rhs.ival ; |
1628 |
< |
return 1; |
1629 |
< |
break; |
1630 |
< |
|
1631 |
< |
default: |
1632 |
< |
the_event->err_msg = |
1633 |
< |
strdup( "Error in parsing meta-data file!\n\tseed unrecognized.\n" ); |
1634 |
< |
return 0; |
1635 |
< |
break; |
1636 |
< |
} |
1637 |
< |
break; |
1638 |
< |
|
1639 |
< |
case G_USE_SOLID_THERM_INT: |
1640 |
< |
if( the_type == STRING ){ |
1641 |
< |
|
1642 |
< |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useSolidThermInt = 1; |
1643 |
< |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useSolidThermInt = 0; |
1644 |
< |
else{ |
1645 |
< |
the_event->err_msg = |
1646 |
< |
strdup( "Error in parsing meta-data file!\n\tuseSolidThermInt was not \"true\" or \"false\".\n" ); |
1647 |
< |
return 0; |
1648 |
< |
} |
1649 |
< |
return 1; |
1650 |
< |
} |
1651 |
< |
|
1652 |
< |
the_event->err_msg = |
1653 |
< |
strdup( "Error in parsing meta-data file!\n\tuseSolidThermInt was not \"true\" or \"false\".\n" ); |
1654 |
< |
return 0; |
1655 |
< |
break; |
1656 |
< |
|
1657 |
< |
case G_USE_LIQUID_THERM_INT: |
1658 |
< |
if( the_type == STRING ){ |
1659 |
< |
|
1660 |
< |
if( !strcasecmp( "true", the_event->evt.asmt.rhs.sval )) useLiquidThermInt = 1; |
1661 |
< |
else if( !strcasecmp( "false", the_event->evt.asmt.rhs.sval )) useLiquidThermInt = 0; |
1662 |
< |
else{ |
1663 |
< |
the_event->err_msg = |
1664 |
< |
strdup( "Error in parsing meta-data file!\n\tuseLiquidThermInt was not \"true\" or \"false\".\n" ); |
1665 |
< |
return 0; |
1666 |
< |
} |
1667 |
< |
return 1; |
1668 |
< |
} |
1669 |
< |
|
1670 |
< |
the_event->err_msg = |
1671 |
< |
strdup( "Error in parsing meta-data file!\n\tuseLiquidThermInt was not \"true\" or \"false\".\n" ); |
1672 |
< |
return 0; |
1673 |
< |
break; |
1674 |
< |
|
1675 |
< |
case G_THERM_INT_LAMBDA: |
1676 |
< |
switch( the_type ){ |
1677 |
< |
|
1678 |
< |
case STRING: |
1679 |
< |
the_event->err_msg = |
1680 |
< |
strdup( "Error in parsing meta-data file!\n\tthermodynamicIntegrationLambda is not a double or int.\n" ); |
1681 |
< |
return 1; |
1682 |
< |
break; |
1683 |
< |
|
1684 |
< |
case DOUBLE: |
1685 |
< |
thermodynamic_integration_lambda = the_event->evt.asmt.rhs.dval; |
1686 |
< |
have_thermodynamic_integration_lambda = 1; |
1687 |
< |
return 1; |
1688 |
< |
break; |
1689 |
< |
|
1690 |
< |
case INT: |
1691 |
< |
thermodynamic_integration_lambda = (double)the_event->evt.asmt.rhs.dval; |
1692 |
< |
have_thermodynamic_integration_lambda = 1; |
1693 |
< |
return 1; |
1694 |
< |
break; |
1695 |
< |
|
1696 |
< |
default: |
1697 |
< |
the_event->err_msg = |
1698 |
< |
strdup( "Error in parsing meta-data file!\n\tthermodynamicIntegrationLambda unrecognized.\n" ); |
1699 |
< |
return 0; |
1700 |
< |
break; |
1701 |
< |
} |
1702 |
< |
break; |
1703 |
< |
|
1704 |
< |
case G_THERM_INT_K: |
1705 |
< |
switch( the_type ){ |
1706 |
< |
|
1707 |
< |
case STRING: |
1708 |
< |
the_event->err_msg = |
1709 |
< |
strdup( "Error in parsing meta-data file!\n\tthermodynamicIntegrationK is not a double or int.\n" ); |
1710 |
< |
return 1; |
1711 |
< |
break; |
1712 |
< |
|
1713 |
< |
case DOUBLE: |
1714 |
< |
thermodynamic_integration_k = the_event->evt.asmt.rhs.dval; |
1715 |
< |
have_thermodynamic_integration_k = 1; |
1716 |
< |
return 1; |
1717 |
< |
break; |
1718 |
< |
|
1719 |
< |
case INT: |
1720 |
< |
thermodynamic_integration_k = (double)the_event->evt.asmt.rhs.dval; |
1721 |
< |
have_thermodynamic_integration_k = 1; |
1722 |
< |
return 1; |
1723 |
< |
break; |
1724 |
< |
|
1725 |
< |
default: |
1726 |
< |
the_event->err_msg = |
1727 |
< |
strdup( "Error in parsing meta-data file!\n\tthermodynamicIntegrationK unrecognized.\n" ); |
1728 |
< |
return 0; |
1729 |
< |
break; |
1730 |
< |
} |
1731 |
< |
break; |
1732 |
< |
|
1733 |
< |
case G_FORCEFIELD_VARIANT: |
1734 |
< |
if( the_type == STRING ){ |
1735 |
< |
strcpy( forcefield_variant, the_event->evt.asmt.rhs.sval ); |
1736 |
< |
have_forcefield_variant = 1; |
1737 |
< |
return 1; |
1738 |
< |
} |
1739 |
< |
|
1740 |
< |
the_event->err_msg = |
1741 |
< |
strdup( "Error in parsing meta-data file!\n\tforceFieldVariant was not a string assignment.\n" ); |
1742 |
< |
return 0; |
1743 |
< |
break; |
1744 |
< |
// add more token cases here. |
199 |
> |
bool Globals::addMoleculeStamp(MoleculeStamp* molStamp) { |
200 |
> |
std::string molStampName = molStamp->getName(); |
201 |
> |
std::map<std::string, MoleculeStamp*>::iterator i; |
202 |
> |
bool ret = false; |
203 |
> |
i = moleculeStamps_.find(molStampName); |
204 |
> |
if (i == moleculeStamps_.end()) { |
205 |
> |
moleculeStamps_.insert(std::map<std::string, MoleculeStamp*>::value_type(molStampName, molStamp)); |
206 |
> |
ret = true; |
207 |
> |
} else { |
208 |
|
|
1746 |
– |
case G_FORCEFIELD_FILENAME: |
1747 |
– |
if( the_type == STRING ){ |
1748 |
– |
strcpy( forcefield_filename, the_event->evt.asmt.rhs.sval ); |
1749 |
– |
have_forcefield_filename = 1; |
1750 |
– |
return 1; |
1751 |
– |
} |
1752 |
– |
|
1753 |
– |
the_event->err_msg = |
1754 |
– |
strdup( "Error in parsing meta-data file!\n\tforceFieldFileName was not a string assignment.\n" ); |
1755 |
– |
return 0; |
1756 |
– |
break; |
1757 |
– |
|
1758 |
– |
case G_THERM_INT_DIST_SPRING: |
1759 |
– |
switch( the_type ){ |
1760 |
– |
|
1761 |
– |
case STRING: |
1762 |
– |
the_event->err_msg = |
1763 |
– |
strdup( "Error in parsing meta-data file!\n\tthermIntDistSpringConst is not a double or int.\n" ); |
1764 |
– |
return 1; |
1765 |
– |
break; |
1766 |
– |
|
1767 |
– |
case DOUBLE: |
1768 |
– |
therm_int_dist_spring = the_event->evt.asmt.rhs.dval; |
1769 |
– |
have_dist_spring_constant = 1; |
1770 |
– |
return 1; |
1771 |
– |
break; |
1772 |
– |
|
1773 |
– |
case INT: |
1774 |
– |
therm_int_dist_spring = (double)the_event->evt.asmt.rhs.dval; |
1775 |
– |
have_dist_spring_constant = 1; |
1776 |
– |
return 1; |
1777 |
– |
break; |
1778 |
– |
|
1779 |
– |
default: |
1780 |
– |
the_event->err_msg = |
1781 |
– |
strdup( "Error in parsing meta-data file!\n\tthermIntDistSpringConst unrecognized.\n" ); |
1782 |
– |
return 0; |
1783 |
– |
break; |
1784 |
– |
} |
1785 |
– |
break; |
1786 |
– |
|
1787 |
– |
case G_THERM_INT_THETA_SPRING: |
1788 |
– |
switch( the_type ){ |
1789 |
– |
|
1790 |
– |
case STRING: |
1791 |
– |
the_event->err_msg = |
1792 |
– |
strdup( "Error in parsing meta-data file!\n\tthermIntThetaSpringConst is not a double or int.\n" ); |
1793 |
– |
return 1; |
1794 |
– |
break; |
1795 |
– |
|
1796 |
– |
case DOUBLE: |
1797 |
– |
therm_int_theta_spring = the_event->evt.asmt.rhs.dval; |
1798 |
– |
have_theta_spring_constant = 1; |
1799 |
– |
return 1; |
1800 |
– |
break; |
1801 |
– |
|
1802 |
– |
case INT: |
1803 |
– |
therm_int_theta_spring = (double)the_event->evt.asmt.rhs.dval; |
1804 |
– |
have_theta_spring_constant = 1; |
1805 |
– |
return 1; |
1806 |
– |
break; |
1807 |
– |
|
1808 |
– |
default: |
1809 |
– |
the_event->err_msg = |
1810 |
– |
strdup( "Error in parsing meta-data file!\n\tthermIntThetaSpringConst unrecognized.\n" ); |
1811 |
– |
return 0; |
1812 |
– |
break; |
1813 |
– |
} |
1814 |
– |
break; |
1815 |
– |
|
1816 |
– |
case G_THERM_INT_OMEGA_SPRING: |
1817 |
– |
switch( the_type ){ |
1818 |
– |
|
1819 |
– |
case STRING: |
1820 |
– |
the_event->err_msg = |
1821 |
– |
strdup( "Error in parsing meta-data file!\n\tthermIntOmegaSpringConst is not a double or int.\n" ); |
1822 |
– |
return 1; |
1823 |
– |
break; |
1824 |
– |
|
1825 |
– |
case DOUBLE: |
1826 |
– |
therm_int_omega_spring = the_event->evt.asmt.rhs.dval; |
1827 |
– |
have_omega_spring_constant = 1; |
1828 |
– |
return 1; |
1829 |
– |
break; |
1830 |
– |
|
1831 |
– |
case INT: |
1832 |
– |
therm_int_omega_spring = (double)the_event->evt.asmt.rhs.dval; |
1833 |
– |
have_omega_spring_constant = 1; |
1834 |
– |
return 1; |
1835 |
– |
break; |
1836 |
– |
|
1837 |
– |
default: |
1838 |
– |
the_event->err_msg = |
1839 |
– |
strdup( "Error in parsing meta-data file!\n\tthermIntOmegaSpringConst unrecognized.\n" ); |
1840 |
– |
return 0; |
1841 |
– |
break; |
1842 |
– |
} |
1843 |
– |
break; |
1844 |
– |
|
1845 |
– |
case G_TARGETSTRESS: |
1846 |
– |
switch( the_type ){ |
1847 |
– |
|
1848 |
– |
case STRING: |
1849 |
– |
the_event->err_msg = |
1850 |
– |
strdup( "Error in parsing meta-data file!\n\ttargetStress is not a double or int.\n" ); |
1851 |
– |
return 1; |
1852 |
– |
break; |
1853 |
– |
|
1854 |
– |
case DOUBLE: |
1855 |
– |
target_stress= the_event->evt.asmt.rhs.dval; |
1856 |
– |
have_targetstress = 1; |
1857 |
– |
return 1; |
1858 |
– |
break; |
1859 |
– |
|
1860 |
– |
case INT: |
1861 |
– |
target_stress = (double)the_event->evt.asmt.rhs.dval; |
1862 |
– |
have_targetstress = 1; |
1863 |
– |
return 1; |
1864 |
– |
break; |
1865 |
– |
|
1866 |
– |
default: |
1867 |
– |
the_event->err_msg = |
1868 |
– |
strdup( "Error in parsing meta-data file!\n\tttargetStress unrecognized.\n" ); |
1869 |
– |
return 0; |
1870 |
– |
break; |
1871 |
– |
} |
1872 |
– |
break; |
1873 |
– |
|
1874 |
– |
|
1875 |
– |
|
1876 |
– |
// add more token cases here. |
209 |
|
} |
210 |
< |
} |
1879 |
< |
|
1880 |
< |
switch( the_type ){ |
1881 |
< |
|
1882 |
< |
case STRING: |
1883 |
< |
sprintf( err, |
1884 |
< |
"\tUnrecognized assignment:\n" |
1885 |
< |
"\t\t-> %s = %s\n", |
1886 |
< |
lhs, the_event->evt.asmt.rhs.sval ); |
1887 |
< |
break; |
1888 |
< |
|
1889 |
< |
case DOUBLE: |
1890 |
< |
sprintf( err, |
1891 |
< |
"\tUnrecognized assignment:\n" |
1892 |
< |
"\t\t-> %s = %lf\n", |
1893 |
< |
lhs, the_event->evt.asmt.rhs.dval ); |
1894 |
< |
break; |
1895 |
< |
|
1896 |
< |
case INT: |
1897 |
< |
sprintf( err, |
1898 |
< |
"\tUnrecognized assignment:\n" |
1899 |
< |
"\t\t-> %s = %d\n", |
1900 |
< |
lhs, the_event->evt.asmt.rhs.ival ); |
1901 |
< |
break; |
1902 |
< |
|
1903 |
< |
default: |
1904 |
< |
sprintf( err, |
1905 |
< |
"\tUnrecognized assignment:\n" |
1906 |
< |
"\t\t-> %s = ?\n", |
1907 |
< |
lhs ); |
1908 |
< |
break; |
1909 |
< |
} |
1910 |
< |
|
1911 |
< |
the_event->err_msg = strdup( err ); |
1912 |
< |
return 0; |
210 |
> |
return ret; |
211 |
|
} |
212 |
+ |
|
213 |
|
|
1915 |
– |
char* Globals::checkMe( void ){ |
1916 |
– |
|
1917 |
– |
char err[300]; |
1918 |
– |
short int have_err = 0; |
1919 |
– |
|
1920 |
– |
strcpy( err, "The following required keywords are missing:\n" ); |
1921 |
– |
|
1922 |
– |
if( !have_force_field ){ |
1923 |
– |
strcat( err, "\t\t->forceField\n" ); |
1924 |
– |
have_err= 1; |
1925 |
– |
} |
1926 |
– |
|
1927 |
– |
if( !have_n_components ){ |
1928 |
– |
strcat( err, "\t\t->nComponents\n" ); |
1929 |
– |
have_err= 1; |
1930 |
– |
} |
1931 |
– |
|
1932 |
– |
|
1933 |
– |
if ( !have_ensemble ) { |
1934 |
– |
// I'm not doing MD: |
1935 |
– |
if ( !have_minimizer ) { |
1936 |
– |
// I'm not doing MD or minimization: |
1937 |
– |
strcat( err, "\t\t->either ensemble or minimizer must be set!\n" ); |
1938 |
– |
have_err = 1; |
1939 |
– |
} else { |
1940 |
– |
// I'm a minimizer: |
1941 |
– |
} |
1942 |
– |
} else { |
1943 |
– |
// I *am* doing MD: |
1944 |
– |
if( !have_dt ){ |
1945 |
– |
strcat( err, "\t\t->dt (timestep in fs)\n" ); |
1946 |
– |
have_err= 1; |
1947 |
– |
} |
1948 |
– |
if( !have_run_time ){ |
1949 |
– |
strcat( err, "\t\t->runTime (total run time in fs)\n" ); |
1950 |
– |
have_err= 1; |
1951 |
– |
} |
1952 |
– |
} |
1953 |
– |
|
1954 |
– |
if( have_err ) return strdup( err ); |
1955 |
– |
|
1956 |
– |
return NULL; |
214 |
|
} |
1958 |
– |
|
1959 |
– |
int Globals::globalEnd( event* the_event ){ |
1960 |
– |
|
1961 |
– |
the_event->err_msg = checkMe(); |
1962 |
– |
if( the_event->err_msg != NULL ) return 0; |
1963 |
– |
|
1964 |
– |
return 1; |
1965 |
– |
} |
1966 |
– |
|