ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/io/Globals.hpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/io/Globals.hpp (file contents):
Revision 1492 by tim, Fri Sep 24 16:27:58 2004 UTC vs.
Revision 2469 by tim, Fri Dec 2 15:38:03 2005 UTC

# Line 1 | Line 1
1 < #ifndef __GLOBALS_H__
2 < #define __GLOBALS_H__
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  
9 #include "io/BASS_interface.h"
52   #include "types/Component.hpp"
53 < #include "io/LinkedCommand.hpp"
54 < #include "types/MakeStamps.hpp"
55 < #include "types/ZconStamp.hpp"
53 > #include "types/ZconsStamp.hpp"
54 > #include "types/MoleculeStamp.hpp"
55 > #include "utils/ParameterManager.hpp"
56  
57 < using namespace std;
57 > namespace oopse {
58 > class Globals : public DataHolder {
59 >  public:
60 >    Globals();
61 >    virtual ~Globals();
62 >    
63 >  DeclareParameter(ForceField, std::string);
64 >  DeclareParameter(TargetTemp, double);
65 >  DeclareParameter(Ensemble, std::string);
66 >  DeclareParameter(Dt, double);
67 >  DeclareParameter(RunTime, double);
68 >  DeclareParameter(InitialConfig, std::string);
69 >  DeclareParameter(FinalConfig, std::string);
70 >  DeclareParameter(SampleTime, double);
71 >  DeclareParameter(ResetTime, double);
72 >  DeclareParameter(StatusTime, double);
73 >  DeclareParameter(CutoffRadius, double);
74 >  DeclareParameter(SwitchingRadius, double);
75 >  DeclareParameter(Dielectric, double);
76 >  DeclareParameter(TempSet, bool);
77 >  DeclareParameter(ThermalTime, double);
78 >  DeclareParameter(MixingRule, std::string);
79 >  DeclareParameter(UsePeriodicBoundaryConditions, bool);
80 >  DeclareParameter(TargetPressure, double);
81 >  DeclareParameter(TauThermostat, double);
82 >  DeclareParameter(TauBarostat, double);
83 >  DeclareParameter(ZconsTime, double);
84 >  DeclareParameter(ZconsTol, double);
85 >  DeclareParameter(ZconsForcePolicy, std::string);
86 >  DeclareParameter(Seed, int);
87 >  DeclareParameter(UseInitalTime, bool);
88 >  DeclareParameter(UseIntialExtendedSystemState, bool);
89 >  DeclareParameter(OrthoBoxTolerance, double);
90 >  DeclareParameter(Minimizer, std::string);
91 >  DeclareParameter(MinimizerMaxIter, double);
92 >  DeclareParameter(MinimizerWriteFrq, int);
93 >  DeclareParameter(MinimizerStepSize, double);
94 >  DeclareParameter(MinimizerFTol, double);
95 >  DeclareParameter(MinimizerGTol, double);
96 >  DeclareParameter(MinimizerLSTol, double);
97 >  DeclareParameter(MinimizerLSMaxIter, int);
98 >  DeclareParameter(ZconsGap, double);
99 >  DeclareParameter(ZconsFixtime, double);
100 >  DeclareParameter(ZconsUsingSMD, bool);
101 >  DeclareParameter(UseSolidThermInt, bool);
102 >  DeclareParameter(UseLiquidThermInt, bool);
103 >  DeclareParameter(ThermodynamicIntegrationLambda, double);
104 >  DeclareParameter(ThermodynamicIntegrationK, double);
105 >  DeclareParameter(ForceFieldVariant, std::string);
106 >  DeclareParameter(ForceFieldFileName, std::string);
107 >  DeclareParameter(ThermIntDistSpringConst, double);
108 >  DeclareParameter(ThermIntThetaSpringConst, double);
109 >  DeclareParameter(ThermIntOmegaSpringConst, double);
110 >  DeclareParameter(SurfaceTension, double);
111 >  DeclareParameter(PrintPressureTensor, bool);
112 >  DeclareParameter(ElectrostaticSummationMethod, std::string);
113 >  DeclareParameter(ElectrostaticScreeningMethod, std::string);
114 >  DeclareParameter(DampingAlpha, double);
115 >  DeclareParameter(CutoffPolicy, std::string);
116 >  DeclareParameter(SwitchingFunctionType, std::string);
117 >  DeclareParameter(CompressDumpFile, bool);
118 >  DeclareParameter(OutputForceVector, bool);
119 >  DeclareParameter(SkinThickness, double);
120 >  DeclareParameter(StatFileFormat, std::string);    
121  
122 < class Globals{
123 <  
124 < public:
125 <  
126 <  Globals();
127 <  ~Globals();
122 >  public:
123 >    bool addComponent(Component* comp);
124 >    bool addZConsStamp(ZConsStamp* zcons);
125 >    bool addMoleculeStamp(MoleculeStamp* molStamp);
126 >    int getNComponents() {return components_.size();}
127 >    std::vector<Component*> getComponents() {return components_;}
128 >    Component* getComponentAt(int index) {return components_.at(index);}    
129  
130 <  void initalize();
131 <  
132 <  int newComponent( event* the_event );
27 <  int componentAssign( event* the_event );
28 <  int componentEnd( event* the_event );
130 >    int getNZconsStamps() {return zconstraints_.size();}
131 >    std::vector<ZConsStamp*> getZconsStamps() {return zconstraints_;}
132 >    ZConsStamp* getZconsStampAt(int index) {return zconstraints_.at(index);}    
133  
134 <  int newZconstraint( event* the_event );
135 <  int zConstraintAssign( event* the_event );
136 <  int zConstraintEnd( event* the_event );
137 <  
138 <  int globalAssign( event* the_event );
35 <  int globalEnd( event* the_event );
36 <
37 <  char*  getForceField( void )      { return force_field; }
38 <  int    getNComponents( void )     { return n_components; }
39 <  double getTargetTemp( void )      { return target_temp; }
40 <  double getTargetPressure( void )  { return target_pressure; }
41 <  double getQmass( void )           { return q_mass; }
42 <  double getTauThermostat( void )   { return tau_thermostat; }
43 <  double getTauBarostat( void )     { return tau_barostat; }
44 <  char*  getEnsemble( void )        { return ensemble; }
45 <  double getDt( void )              { return dt; }
46 <  double getRunTime( void )         { return run_time; }
47 <
48 <  int    getNzConstraints( void )   { return n_zConstraints; }
49 <  char*  getInitialConfig( void )   { return initial_config; }
50 <  char*  getFinalConfig( void )     { return final_config; }
51 <  int    getNMol( void )            { return n_mol; }
52 <  double getDensity( void )         { return density; }
53 <  double getBox( void )             { return box; }
54 <  double getBoxX( void )            { return box_x; }
55 <  double getBoxY( void )            { return box_y; }
56 <  double getBoxZ( void )            { return box_z; }
57 <  double getSampleTime( void )      { return sample_time; }
58 <  double getStatusTime( void )      { return status_time; }
59 <  double getResetTime( void )       { return resetTime; }
60 <  double getThermalTime( void )     { return thermal_time; }
61 <  double getDielectric( void )      { return dielectric; }
62 <  double getRcut( void )            { return rcut; }
63 <  double getRsw( void )             { return rsw; }
64 <  int    getTempSet( void )         { return tempSet; }
65 <  int    getUseInitTime( void )     { return useInitTime; }
66 <  int    getUseInitXSstate( void )  { return useInitXSstate; }
67 <  double getOrthoBoxTolerance(void) { return orthoBoxTolerance; }
68 <  int    getPBC( void )             { return usePBC; }
69 <  int    getUseRF( void )           { return useRF; }
70 <  char*  getMixingRule( void)       { return mixingRule; }
71 <  double getZconsTime(void)         { return zcons_time; }
72 <  double getZconsTol(void)          { return zcons_tol; }
73 <  char*  getZconsForcePolicy(void)  { return zconsForcePolicy; }
74 <  double getZconsGap(void)          { return zcons_gap; }
75 <  double getZconsFixtime(void)      { return zcons_fixtime; }
76 <  int    getZconsUsingSMD(void)     { return zcons_using_smd; }
77 <  int    getSeed(void)              { return seed; }
78 <  char*  getMinimizer(void)         { return minimizer_name; }
79 <  int    getMinMaxIter(void)        { return minimizer_maxiteration; }
80 <  int    getMinWriteFrq(void)       { return minimizer_writefrq; }
81 <  double getMinStepSize(void)       { return minimizer_stepsize; }
82 <  double getMinFTol(void)           { return minimizer_ftol; }
83 <  double getMinGTol(void)           { return minimizer_gtol; }
84 <  double getMinLSTol(void)          { return minimizer_ls_tol; }
85 <  int    getMinLSMaxIter(void)      { return minimizer_ls_maxiteration; }
86 <  int    getUseSolidThermInt(void)  { return useSolidThermInt; }
87 <  int    getUseLiquidThermInt(void) { return useLiquidThermInt; }
88 <  double getThermIntLambda(void)    { return thermodynamic_integration_lambda; }
89 <  double getThermIntK(void)         { return thermodynamic_integration_k; }
90 <  char*  getForceFieldVariant( void ) { return forcefield_variant; }
134 >    virtual void validate();
135 >  private:
136 >    std::vector<Component*> components_;
137 >    std::vector<ZConsStamp*> zconstraints_;    
138 >    std::map<std::string, MoleculeStamp*> moleculeStamps_;
139  
92  short int haveDt( void )            { return have_dt; }
93  short int haveRunTime( void )       { return have_run_time; }
94  short int haveEnsemble( void )      { return have_ensemble; }
95  short int haveTargetTemp( void )    { return have_target_temp; }
96  short int haveInitialConfig( void ) { return have_initial_config; }
97  short int haveFinalConfig( void )   { return have_final_config; }
98  short int haveNMol( void )          { return have_n_mol; }
99  short int haveDensity( void )       { return have_density; }
100  short int haveBox( void )           { return have_box; }
101  short int haveBoxX( void )          { return have_box_x; }
102  short int haveBoxY( void )          { return have_box_y; }
103  short int haveBoxZ( void )          { return have_box_z; }
104  short int haveSampleTime( void )    { return have_sample_time; }
105  short int haveResetTime( void )     { return have_reset_time; }
106  short int haveStatusTime( void )    { return have_status_time; }
107  short int haveThermalTime( void )   { return have_thermal_time; }
108  short int haveRcut( void )          { return have_rcut; }
109  short int haveRsw( void )           { return have_rsw; }
110  short int haveDielectric( void )    { return have_dielectric; }
111  short int haveTempSet( void )       { return have_tempSet; }
112  short int haveTargetPressure( void ){ return have_target_pressure; }
113  short int haveQmass( void )         { return have_q_mass; }
114  short int haveTauThermostat( void ) { return have_tau_thermostat; }
115  short int haveTauBarostat( void )   { return have_tau_barostat; }
116  short int haveZconstraintTime(void) { return have_zcons_time; }
117  short int haveZconstraints( void )  { return have_zConstraints; }
118  short int haveZconsTol(void)        { return have_zcons_tol; }
119  short int haveZconsForcePolicy(void){ return have_zcons_force_policy; }
120  short int haveZConsGap(void)        { return have_zcons_gap; }
121  short int haveZConsFixTime(void)    { return have_zcons_fixtime; }
122  short int haveZConsUsingSMD(void)   { return have_zcons_using_smd; }  
123  short int haveSeed(void)            { return have_seed; }
124  short int haveMinimizer(void)       { return have_minimizer; }
125  short int haveMinMaxIter(void)      { return have_minimizer_maxiteration; }
126  short int haveMinWriteFrq(void)     { return have_minimizer_writefrq; }
127  short int haveMinStepSize(void)     { return have_minimizer_stepsize; }
128  short int haveMinFTol(void)         { return have_minimizer_ftol; }
129  short int haveMinGTol(void)         { return have_minimizer_gtol; }
130  short int haveMinLSTol(void)        { return have_minimizer_ls_tol; }
131  short int haveMinLSMaxIter(void)    { return have_minimizer_ls_maxiteration;}
132  short int haveThermIntLambda(void)  { return have_thermodynamic_integration_lambda; }
133  short int haveThermIntK(void)       { return have_thermodynamic_integration_k; }
134  short int haveForceFieldVariant(void) { return have_forcefield_variant; }
135
136  /* other accessors */
137  Component** getComponents( void )   { return components; }
138  ZconStamp** getZconStamp( void )    { return zConstraints; }
139  
140 private:
141  
142  int hash_size;
143  int hash_shift;
144  int hash( char* text );
145  void addHash( char* text, int token );
146  LinkedCommand** command_table;
147  
148  char* checkMe( void );
149  
150  Component* current_component;
151  Component** components; // the array of components
152
153  ZconStamp* current_zConstraint;
154  ZconStamp** zConstraints; // the array of zConstraints
155
156  char force_field[100];
157  int n_components;
158  int n_zConstraints;
159  double target_temp;
160  double target_pressure;
161  char ensemble[100];
162  char mixingRule[100];
163  double dt;
164  double run_time;
165  char initial_config[120];
166  char final_config[120];
167  int n_mol;
168  double density;
169  double box;
170  double box_x, box_y, box_z;
171  double sample_time;
172  double status_time;
173  double resetTime;
174  double orthoBoxTolerance;
175  double thermal_time;
176  double rcut;
177  double rsw;
178  double dielectric;
179  int tempSet;
180  int useInitTime;
181  int useInitXSstate;
182  int usePBC;
183  int useRF;
184  double q_mass;
185  double tau_thermostat;
186  double tau_barostat;
187  double zcons_time;    
188  double zcons_tol;
189  char zconsForcePolicy[100];
190  double zcons_gap;
191  double zcons_fixtime;
192  int zcons_using_smd;
193  
194  int seed;
195  char minimizer_name[100];
196  int minimizer_maxiteration;
197  int minimizer_writefrq;
198  double minimizer_stepsize;
199  double minimizer_ftol;
200  double minimizer_gtol;
201  double minimizer_ls_tol;
202  int minimizer_ls_maxiteration;
203  int useSolidThermInt;
204  int useLiquidThermInt;
205  double thermodynamic_integration_lambda;
206  double thermodynamic_integration_k;
207  char forcefield_variant[100];
208
209  //required arguments
210  short int have_force_field, have_n_components, have_target_temp;
211  short int have_target_pressure, have_ensemble, have_dt, have_run_time;
212  
213  // optional arguments
214  short int have_initial_config, have_final_config, have_n_mol;
215  short int have_density, have_box, have_box_x, have_box_y, have_box_z;
216  short int have_sample_time, have_status_time, have_rcut, have_dielectric;
217  short int have_tempSet, have_thermal_time, have_rsw, have_q_mass;
218  short int have_tau_thermostat, have_tau_barostat;
219  short int have_zcons_time, have_zConstraints, have_n_zConstraints;
220  short int have_zcons_tol, have_seed;
221  short int have_zcons_force_policy, have_reset_time;
222  short int have_zcons_gap, have_zcons_fixtime;
223  short int have_zcons_using_smd;
224  short int have_minimizer, have_minimizer_maxiteration;
225  short int have_minimizer_writefrq, have_minimizer_stepsize;
226  short int have_minimizer_ftol, have_minimizer_gtol;
227  short int have_minimizer_ls_tol, have_minimizer_ls_maxiteration;
228  short int have_thermodynamic_integration_lambda;
229  short int have_thermodynamic_integration_k;
230  short int have_forcefield_variant;
140   };
141 <
141 > }
142   #endif
143 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines