ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimInfo.hpp
Revision: 1144
Committed: Sat May 1 18:52:38 2004 UTC (20 years, 2 months ago) by tim
File size: 6672 byte(s)
Log Message:
C++ pass groupList to fortran

File Contents

# Content
1 #ifndef __SIMINFO_H__
2 #define __SIMINFO_H__
3
4 #include <map>
5 #include <string>
6 #include <vector>
7
8 #include "Atom.hpp"
9 #include "RigidBody.hpp"
10 #include "Molecule.hpp"
11 #include "Exclude.hpp"
12 #include "SkipList.hpp"
13 #include "AbstractClasses.hpp"
14 #include "MakeStamps.hpp"
15 #include "SimState.hpp"
16
17 #define __C
18 #include "fSimulation.h"
19 #include "fortranWrapDefines.hpp"
20 #include "GenericData.hpp"
21 //#include "Minimizer.hpp"
22 //#include "OOPSEMinimizer.hpp"
23 double roundMe( double x );
24 class OOPSEMinimizer;
25 class SimInfo{
26
27 public:
28
29 SimInfo();
30 ~SimInfo();
31
32 int n_atoms; // the number of atoms
33 Atom **atoms; // the array of atom objects
34
35 vector<RigidBody*> rigidBodies; // A vector of rigid bodies
36 vector<StuntDouble*> integrableObjects;
37
38 double tau[9]; // the stress tensor
39
40 int n_bonds; // number of bends
41 int n_bends; // number of bends
42 int n_torsions; // number of torsions
43 int n_oriented; // number of of atoms with orientation
44 int ndf; // number of actual degrees of freedom
45 int ndfRaw; // number of settable degrees of freedom
46 int ndfTrans; // number of translational degrees of freedom
47 int nZconstraints; // the number of zConstraints
48
49 int setTemp; // boolean to set the temperature at each sampleTime
50 int resetIntegrator; // boolean to reset the integrator
51
52 int n_dipoles; // number of dipoles
53
54 int n_exclude;
55 Exclude* excludes; // the exclude list for ignoring pairs in fortran
56 int nGlobalExcludes;
57 int* globalExcludes; // same as above, but these guys participate in
58 // no long range forces.
59
60 int* identArray; // array of unique identifiers for the atoms
61 int* molMembershipArray; // map of atom numbers onto molecule numbers
62
63 int n_constraints; // the number of constraints on the system
64
65 int n_SRI; // the number of short range interactions
66
67 double lrPot; // the potential energy from the long range calculations.
68
69 double Hmat[3][3]; // the periodic boundry conditions. The Hmat is the
70 // column vectors of the x, y, and z box vectors.
71 // h1 h2 h3
72 // [ Xx Yx Zx ]
73 // [ Xy Yy Zy ]
74 // [ Xz Yz Zz ]
75 //
76 double HmatInv[3][3];
77
78 double boxL[3]; // The Lengths of the 3 column vectors of Hmat
79 double boxVol;
80 int orthoRhombic;
81
82
83 double dielectric; // the dielectric of the medium for reaction field
84
85
86 int usePBC; // whether we use periodic boundry conditions.
87 int useLJ;
88 int useSticky;
89 int useCharges;
90 int useDipoles;
91 int useReactionField;
92 int useGB;
93 int useEAM;
94 int useMolecularCutoffs;
95
96 bool useInitXSstate;
97 double orthoTolerance;
98
99 double dt, run_time; // the time step and total time
100 double sampleTime, statusTime; // the position and energy dump frequencies
101 double target_temp; // the target temperature of the system
102 double thermalTime; // the temp kick interval
103 double currentTime; // Used primarily for correlation Functions
104 double resetTime; // Use to reset the integrator periodically
105
106 int n_mol; // n_molecules;
107 Molecule* molecules; // the array of molecules
108
109 int nComponents; // the number of components in the system
110 int* componentsNmol; // the number of molecules of each component
111 MoleculeStamp** compStamps;// the stamps matching the components
112 LinkedMolStamp* headStamp; // list of stamps used in the simulation
113
114
115 char ensemble[100]; // the enesemble of the simulation (NVT, NVE, etc. )
116 char mixingRule[100]; // the mixing rules for Lennard jones/van der walls
117 BaseIntegrator *the_integrator; // the integrator of the simulation
118
119 OOPSEMinimizer* the_minimizer; // the energy minimizer
120 bool has_minimizer;
121
122 char finalName[300]; // the name of the eor file to be written
123 char sampleName[300]; // the name of the dump file to be written
124 char statusName[300]; // the name of the stat file to be written
125
126 int seed; //seed for random number generator
127
128
129 vector<double> mfact;
130 int ngroup;
131 vector<int> groupList;
132 vector<int> groupStart;
133
134 // refreshes the sim if things get changed (load balanceing, volume
135 // adjustment, etc.)
136
137 void refreshSim( void );
138
139
140 // sets the internal function pointer to fortran.
141
142 void setInternal( setFortranSim_TD fSetup,
143 setFortranBox_TD fBox,
144 notifyFortranCutOff_TD fCut){
145 setFsimulation = fSetup;
146 setFortranBoxSize = fBox;
147 notifyFortranCutOffs = fCut;
148 }
149
150 int getNDF();
151 int getNDFraw();
152 int getNDFtranslational();
153 int getTotIntegrableObjects();
154 void setBox( double newBox[3] );
155 void setBoxM( double newBox[3][3] );
156 void getBoxM( double theBox[3][3] );
157 void scaleBox( double scale );
158
159 void setDefaultRcut( double theRcut );
160 void setDefaultEcr( double theEcr );
161 void setDefaultEcr( double theEcr, double theEst );
162 void checkCutOffs( void );
163
164 double getRcut( void ) { return rCut; }
165 double getRlist( void ) { return rList; }
166 double getEcr( void ) { return ecr; }
167 double getEst( void ) { return est; }
168 double getMaxCutoff( void ) { return maxCutoff; }
169
170 void setTime( double theTime ) { currentTime = theTime; }
171 void incrTime( double the_dt ) { currentTime += the_dt; }
172 void decrTime( double the_dt ) { currentTime -= the_dt; }
173 double getTime( void ) { return currentTime; }
174
175 void wrapVector( double thePos[3] );
176
177 SimState* getConfiguration( void ) { return myConfiguration; }
178
179 void addProperty(GenericData* prop);
180 GenericData* getProperty(const string& propName);
181 //vector<GenericData*>& getProperties() {return properties;}
182
183 int getSeed(void) { return seed; }
184 void setSeed(int theSeed) { seed = theSeed;}
185
186 private:
187
188 SimState* myConfiguration;
189
190 int boxIsInit, haveRcut, haveEcr;
191
192 double rList, rCut; // variables for the neighborlist
193 double ecr; // the electrostatic cutoff radius
194 double est; // the electrostatic skin thickness
195 double maxCutoff;
196
197 double distXY;
198 double distYZ;
199 double distZX;
200
201 void calcHmatInv( void );
202 void calcBoxL();
203 double calcMaxCutOff();
204
205 // private function to initialize the fortran side of the simulation
206 setFortranSim_TD setFsimulation;
207
208 setFortranBox_TD setFortranBoxSize;
209
210 notifyFortranCutOff_TD notifyFortranCutOffs;
211
212 //Addtional Properties of SimInfo
213 map<string, GenericData*> properties;
214
215 };
216
217 void getFortranGroupArray(SimInfo* info, vector<double>& mfact, int& ngroup,
218 vector<int>& groupList, vector<int>& groupStart);
219
220 #endif