ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimInfo.hpp
Revision: 1031
Committed: Fri Feb 6 18:58:06 2004 UTC (20 years, 5 months ago) by tim
File size: 6611 byte(s)
Log Message:
Add some lines into global.cpp to make it work with energy minimization

File Contents

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