ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimInfo.hpp
Revision: 1180
Committed: Thu May 20 20:24:07 2004 UTC (20 years, 1 month ago) by chrisfen
File size: 6732 byte(s)
Log Message:
Several additions... Restraints.cpp and .hpp were included for restraining particles in thermodynamic integration.  By including these, changes were made in Integrator, SimInfo, ForceFeilds, SimSetup, StatWriter, and possibly some other files.  Two bass keywords were also added for performing thermodynamic integration: a lambda value one and a k power one.

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 bool useThermInt;
133 double thermIntLambda;
134 double thermIntK;
135
136 double vRaw;
137 double vHarm;
138
139
140 vector<double> mfact;
141 int ngroup;
142 vector<int> groupList;
143 vector<int> groupStart;
144
145 // refreshes the sim if things get changed (load balanceing, volume
146 // adjustment, etc.)
147
148 void refreshSim( void );
149
150
151 // sets the internal function pointer to fortran.
152
153 void setInternal( setFortranSim_TD fSetup,
154 setFortranBox_TD fBox,
155 notifyFortranCutOff_TD fCut){
156 setFsimulation = fSetup;
157 setFortranBoxSize = fBox;
158 notifyFortranCutOffs = fCut;
159 }
160
161 int getNDF();
162 int getNDFraw();
163 int getNDFtranslational();
164 int getTotIntegrableObjects();
165 void setBox( double newBox[3] );
166 void setBoxM( double newBox[3][3] );
167 void getBoxM( double theBox[3][3] );
168 void scaleBox( double scale );
169
170 void setDefaultRcut( double theRcut );
171 void setDefaultRcut( double theRcut, double theRsw );
172 void checkCutOffs( void );
173
174 double getRcut( void ) { return rCut; }
175 double getRlist( void ) { return rList; }
176 double getRsw( void ) { return rSw; }
177 double getMaxCutoff( void ) { return maxCutoff; }
178
179 void setTime( double theTime ) { currentTime = theTime; }
180 void incrTime( double the_dt ) { currentTime += the_dt; }
181 void decrTime( double the_dt ) { currentTime -= the_dt; }
182 double getTime( void ) { return currentTime; }
183
184 void wrapVector( double thePos[3] );
185
186 SimState* getConfiguration( void ) { return myConfiguration; }
187
188 void addProperty(GenericData* prop);
189 GenericData* getProperty(const string& propName);
190 //vector<GenericData*>& getProperties() {return properties;}
191
192 int getSeed(void) { return seed; }
193 void setSeed(int theSeed) { seed = theSeed;}
194
195 private:
196
197 SimState* myConfiguration;
198
199 int boxIsInit, haveRcut, haveRsw;
200
201 double rList, rCut; // variables for the neighborlist
202 double rSw; // the switching radius
203
204 double maxCutoff;
205
206 double distXY;
207 double distYZ;
208 double distZX;
209
210 void calcHmatInv( void );
211 void calcBoxL();
212 double calcMaxCutOff();
213
214 // private function to initialize the fortran side of the simulation
215 setFortranSim_TD setFsimulation;
216
217 setFortranBox_TD setFortranBoxSize;
218
219 notifyFortranCutOff_TD notifyFortranCutOffs;
220
221 //Addtional Properties of SimInfo
222 map<string, GenericData*> properties;
223
224 };
225
226 void getFortranGroupArray(SimInfo* info, vector<double>& mfact, int& ngroup,
227 vector<int>& groupList, vector<int>& groupStart);
228
229 #endif