ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-3.0/src/io/Globals.hpp
Revision: 2109
Committed: Thu Mar 10 20:28:17 2005 UTC (19 years, 4 months ago) by tim
File size: 12734 byte(s)
Log Message:
using map to replace link list

File Contents

# Content
1 /*
2 * Copyright (c) 2005 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
19 * notice, this list of conditions and the following disclaimer.
20 *
21 * 3. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the
24 * distribution.
25 *
26 * This software is provided "AS IS," without a warranty of any
27 * kind. All express or implied conditions, representations and
28 * warranties, including any implied warranty of merchantability,
29 * fitness for a particular purpose or non-infringement, are hereby
30 * excluded. The University of Notre Dame and its licensors shall not
31 * be liable for any damages suffered by licensee as a result of
32 * using, modifying or distributing the software or its
33 * derivatives. In no event will the University of Notre Dame or its
34 * licensors be liable for any lost revenue, profit or data, or for
35 * direct, indirect, special, consequential, incidental or punitive
36 * damages, however caused and regardless of the theory of liability,
37 * arising out of the use of or inability to use software, even if the
38 * University of Notre Dame has been advised of the possibility of
39 * such damages.
40 */
41
42 #ifndef IO_GLOBALS_HPP
43 #define IO_GLOBALS_HPP
44
45 #include <iostream>
46
47 #include <stdlib.h>
48 #include <vector>
49 #include <string>
50 #include <map>
51
52 #include "io/BASS_interface.h"
53 #include "types/Component.hpp"
54 #include "io/LinkedCommand.hpp"
55 #include "types/MakeStamps.hpp"
56 #include "types/ZconStamp.hpp"
57
58
59
60 /**
61 * @class Globals Globals.hpp "io/Globals.hpp"
62 * @brief parsing and storing global parameters for simulation
63 * @todo need refactorying
64 */
65 class Globals{
66
67 public:
68
69 Globals();
70 ~Globals();
71
72 void initalize();
73
74 int newComponent( event* the_event );
75 int componentAssign( event* the_event );
76 int componentEnd( event* the_event );
77
78 int newZconstraint( event* the_event );
79 int zConstraintAssign( event* the_event );
80 int zConstraintEnd( event* the_event );
81
82 int globalAssign( event* the_event );
83 int globalEnd( event* the_event );
84
85 char* getForceField( void ) { return force_field; }
86 int getNComponents( void ) { return n_components; }
87 double getTargetTemp( void ) { return target_temp; }
88 double getTargetPressure( void ) { return target_pressure; }
89 double getQmass( void ) { return q_mass; }
90 double getTauThermostat( void ) { return tau_thermostat; }
91 double getTauBarostat( void ) { return tau_barostat; }
92 char* getEnsemble( void ) { return ensemble; }
93 double getDt( void ) { return dt; }
94 double getRunTime( void ) { return run_time; }
95
96 int getNzConstraints( void ) { return n_zConstraints; }
97 char* getInitialConfig( void ) { return initial_config; }
98 char* getFinalConfig( void ) { return final_config; }
99 int getNMol( void ) { return n_mol; }
100 double getDensity( void ) { return density; }
101 double getBox( void ) { return box; }
102 double getBoxX( void ) { return box_x; }
103 double getBoxY( void ) { return box_y; }
104 double getBoxZ( void ) { return box_z; }
105 double getSampleTime( void ) { return sample_time; }
106 double getStatusTime( void ) { return status_time; }
107 double getResetTime( void ) { return resetTime; }
108 double getThermalTime( void ) { return thermal_time; }
109 double getDielectric( void ) { return dielectric; }
110 double getRcut( void ) { return rcut; }
111 double getRsw( void ) { return rsw; }
112 int getTempSet( void ) { return tempSet; }
113 int getUseInitTime( void ) { return useInitTime; }
114 int getUseInitXSstate( void ) { return useInitXSstate; }
115 double getOrthoBoxTolerance(void) { return orthoBoxTolerance; }
116 int getPBC( void ) { return usePBC; }
117 int getUseRF( void ) { return useRF; }
118 char* getMixingRule( void) { return mixingRule; }
119 double getZconsTime(void) { return zcons_time; }
120 double getZconsTol(void) { return zcons_tol; }
121 char* getZconsForcePolicy(void) { return zconsForcePolicy; }
122 double getZconsGap(void) { return zcons_gap; }
123 double getZconsFixtime(void) { return zcons_fixtime; }
124 int getZconsUsingSMD(void) { return zcons_using_smd; }
125 int getSeed(void) { return seed; }
126 char* getMinimizer(void) { return minimizer_name; }
127 int getMinMaxIter(void) { return minimizer_maxiteration; }
128 int getMinWriteFrq(void) { return minimizer_writefrq; }
129 double getMinStepSize(void) { return minimizer_stepsize; }
130 double getMinFTol(void) { return minimizer_ftol; }
131 double getMinGTol(void) { return minimizer_gtol; }
132 double getMinLSTol(void) { return minimizer_ls_tol; }
133 int getMinLSMaxIter(void) { return minimizer_ls_maxiteration; }
134 int getUseSolidThermInt(void) { return useSolidThermInt; }
135 int getUseLiquidThermInt(void) { return useLiquidThermInt; }
136 double getThermIntLambda(void) { return thermodynamic_integration_lambda; }
137 double getThermIntK(void) { return thermodynamic_integration_k; }
138 char* getForceFieldVariant( void ) { return forcefield_variant; }
139 char* getForceFieldFileName() { return forcefield_filename;}
140 double getDistSpringConst(void) { return therm_int_dist_spring; }
141 double getThetaSpringConst(void) { return therm_int_theta_spring; }
142 double getOmegaSpringConst(void) { return therm_int_omega_spring; }
143 short int haveDt( void ) { return have_dt; }
144 short int haveRunTime( void ) { return have_run_time; }
145 short int haveEnsemble( void ) { return have_ensemble; }
146 short int haveTargetTemp( void ) { return have_target_temp; }
147 short int haveInitialConfig( void ) { return have_initial_config; }
148 short int haveFinalConfig( void ) { return have_final_config; }
149 short int haveNMol( void ) { return have_n_mol; }
150 short int haveDensity( void ) { return have_density; }
151 short int haveBox( void ) { return have_box; }
152 short int haveBoxX( void ) { return have_box_x; }
153 short int haveBoxY( void ) { return have_box_y; }
154 short int haveBoxZ( void ) { return have_box_z; }
155 short int haveSampleTime( void ) { return have_sample_time; }
156 short int haveResetTime( void ) { return have_reset_time; }
157 short int haveStatusTime( void ) { return have_status_time; }
158 short int haveThermalTime( void ) { return have_thermal_time; }
159 short int haveRcut( void ) { return have_rcut; }
160 short int haveRsw( void ) { return have_rsw; }
161 short int haveDielectric( void ) { return have_dielectric; }
162 short int haveTempSet( void ) { return have_tempSet; }
163 short int haveTargetPressure( void ){ return have_target_pressure; }
164 short int haveQmass( void ) { return have_q_mass; }
165 short int haveTauThermostat( void ) { return have_tau_thermostat; }
166 short int haveTauBarostat( void ) { return have_tau_barostat; }
167 short int haveZconstraintTime(void) { return have_zcons_time; }
168 short int haveZconstraints( void ) { return have_zConstraints; }
169 short int haveZconsTol(void) { return have_zcons_tol; }
170 short int haveZconsForcePolicy(void){ return have_zcons_force_policy; }
171 short int haveZConsGap(void) { return have_zcons_gap; }
172 short int haveZConsFixTime(void) { return have_zcons_fixtime; }
173 short int haveZConsUsingSMD(void) { return have_zcons_using_smd; }
174 short int haveSeed(void) { return have_seed; }
175 short int haveMinimizer(void) { return have_minimizer; }
176 short int haveMinMaxIter(void) { return have_minimizer_maxiteration; }
177 short int haveMinWriteFrq(void) { return have_minimizer_writefrq; }
178 short int haveMinStepSize(void) { return have_minimizer_stepsize; }
179 short int haveMinFTol(void) { return have_minimizer_ftol; }
180 short int haveMinGTol(void) { return have_minimizer_gtol; }
181 short int haveMinLSTol(void) { return have_minimizer_ls_tol; }
182 short int haveMinLSMaxIter(void) { return have_minimizer_ls_maxiteration;}
183 short int haveThermIntLambda(void) { return have_thermodynamic_integration_lambda; }
184 short int haveThermIntK(void) { return have_thermodynamic_integration_k; }
185 short int haveForceFieldVariant(void) { return have_forcefield_variant; }
186 short int haveForceFieldFileName(void) { return have_forcefield_filename; }
187 short int haveDistSpringConst(void) { return have_dist_spring_constant; }
188 short int haveThetaSpringConst(void) { return have_theta_spring_constant; }
189 short int haveOmegaSpringConst(void) { return have_omega_spring_constant; }
190 /* other accessors */
191 Component** getComponents( void ) { return components; }
192 ZconStamp** getZconStamp( void ) { return zConstraints; }
193
194 private:
195
196
197 typedef std::map<std::string, int> CommandMapType;
198 CommandMapType command_table;
199
200
201 char* checkMe( void );
202
203 Component* current_component;
204 Component** components; // the array of components
205
206 ZconStamp* current_zConstraint;
207 ZconStamp** zConstraints; // the array of zConstraints
208
209 char force_field[100];
210 int n_components;
211 int n_zConstraints;
212 double target_temp;
213 double target_pressure;
214 char ensemble[100];
215 char mixingRule[100];
216 double dt;
217 double run_time;
218 char initial_config[120];
219 char final_config[120];
220 int n_mol;
221 double density;
222 double box;
223 double box_x, box_y, box_z;
224 double sample_time;
225 double status_time;
226 double resetTime;
227 double orthoBoxTolerance;
228 double thermal_time;
229 double rcut;
230 double rsw;
231 double dielectric;
232 int tempSet;
233 int useInitTime;
234 int useInitXSstate;
235 int usePBC;
236 int useRF;
237 double q_mass;
238 double tau_thermostat;
239 double tau_barostat;
240 double zcons_time;
241 double zcons_tol;
242 char zconsForcePolicy[100];
243 double zcons_gap;
244 double zcons_fixtime;
245 int zcons_using_smd;
246
247 int seed;
248 char minimizer_name[100];
249 int minimizer_maxiteration;
250 int minimizer_writefrq;
251 double minimizer_stepsize;
252 double minimizer_ftol;
253 double minimizer_gtol;
254 double minimizer_ls_tol;
255 int minimizer_ls_maxiteration;
256 int useSolidThermInt;
257 int useLiquidThermInt;
258 double thermodynamic_integration_lambda;
259 double thermodynamic_integration_k;
260 char forcefield_variant[100];
261 char forcefield_filename[100];
262 double therm_int_dist_spring;
263 double therm_int_theta_spring;
264 double therm_int_omega_spring;
265 //required arguments
266 short int have_force_field, have_n_components, have_target_temp;
267 short int have_target_pressure, have_ensemble, have_dt, have_run_time;
268
269 // optional arguments
270 short int have_initial_config, have_final_config, have_n_mol;
271 short int have_density, have_box, have_box_x, have_box_y, have_box_z;
272 short int have_sample_time, have_status_time, have_rcut, have_dielectric;
273 short int have_tempSet, have_thermal_time, have_rsw, have_q_mass;
274 short int have_tau_thermostat, have_tau_barostat;
275 short int have_zcons_time, have_zConstraints, have_n_zConstraints;
276 short int have_zcons_tol, have_seed;
277 short int have_zcons_force_policy, have_reset_time;
278 short int have_zcons_gap, have_zcons_fixtime;
279 short int have_zcons_using_smd;
280 short int have_minimizer, have_minimizer_maxiteration;
281 short int have_minimizer_writefrq, have_minimizer_stepsize;
282 short int have_minimizer_ftol, have_minimizer_gtol;
283 short int have_minimizer_ls_tol, have_minimizer_ls_maxiteration;
284 short int have_thermodynamic_integration_lambda;
285 short int have_thermodynamic_integration_k;
286 short int have_forcefield_variant;
287 short int have_forcefield_filename;
288 short int have_dist_spring_constant;
289 short int have_theta_spring_constant;
290 short int have_omega_spring_constant;
291 };
292
293 #endif