ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-1.0/libmdtools/SimInfo.hpp
Revision: 1334
Committed: Fri Jul 16 18:58:03 2004 UTC (19 years, 11 months ago) by gezelter
File size: 7030 byte(s)
Log Message:
Initial import of OOPSE-1.0 source tree

File Contents

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