ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimInfo.hpp
Revision: 1187
Committed: Sat May 22 18:16:18 2004 UTC (20 years, 1 month ago) by chrisfen
File size: 6955 byte(s)
Log Message:
Fixed Thermodynamic integration code.

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