ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimInfo.hpp
Revision: 763
Committed: Mon Sep 15 16:52:02 2003 UTC (20 years, 9 months ago) by tim
File size: 6265 byte(s)
Log Message:
add conserved quantity to statWriter
fix bug of vector wrapping at NPTi

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 mmeineke 377
19    
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     unsigned int n_bonds; // number of bends
34     unsigned int n_bends; // number of bends
35     unsigned int n_torsions; // number of torsions
36     unsigned int n_oriented; // number of of atoms with orientation
37 gezelter 458 unsigned int ndf; // number of actual degrees of freedom
38     unsigned int ndfRaw; // number of settable degrees of freedom
39 mmeineke 675 unsigned int nZconstraints; // the number of zConstraints
40 mmeineke 377
41     unsigned int setTemp; // boolean to set the temperature at each sampleTime
42 mmeineke 746 unsigned int resetIntegrator; // boolean to reset the integrator
43 mmeineke 377
44     unsigned int n_dipoles; // number of dipoles
45    
46 mmeineke 626
47 mmeineke 377 int n_exclude; // the # of pairs excluded from long range forces
48 mmeineke 427 Exclude** excludes; // the pairs themselves
49 mmeineke 377
50     int nGlobalExcludes;
51     int* globalExcludes; // same as above, but these guys participate in
52     // no long range forces.
53    
54     int* identArray; // array of unique identifiers for the atoms
55 gezelter 483 int* molMembershipArray; // map of atom numbers onto molecule numbers
56 mmeineke 377
57     int n_constraints; // the number of constraints on the system
58    
59     unsigned int n_SRI; // the number of short range interactions
60    
61     double lrPot; // the potential energy from the long range calculations.
62    
63 gezelter 588 double Hmat[3][3]; // the periodic boundry conditions. The Hmat is the
64     // column vectors of the x, y, and z box vectors.
65     // h1 h2 h3
66     // [ Xx Yx Zx ]
67     // [ Xy Yy Zy ]
68     // [ Xz Yz Zz ]
69     //
70     double HmatInv[3][3];
71 mmeineke 568
72 gezelter 621 double boxL[3]; // The Lengths of the 3 column vectors of Hmat
73 mmeineke 572 double boxVol;
74     int orthoRhombic;
75 mmeineke 568
76    
77 mmeineke 626 double dielectric; // the dielectric of the medium for reaction field
78 mmeineke 568
79 mmeineke 377
80     int usePBC; // whether we use periodic boundry conditions.
81     int useLJ;
82     int useSticky;
83     int useDipole;
84     int useReactionField;
85     int useGB;
86     int useEAM;
87    
88    
89     double dt, run_time; // the time step and total time
90     double sampleTime, statusTime; // the position and energy dump frequencies
91     double target_temp; // the target temperature of the system
92     double thermalTime; // the temp kick interval
93 gezelter 637 double currentTime; // Used primarily for correlation Functions
94 mmeineke 746 double resetTime; // Use to reset the integrator periodically
95 mmeineke 377
96     int n_mol; // n_molecules;
97     Molecule* molecules; // the array of molecules
98    
99     int nComponents; // the number of componentsin the system
100     int* componentsNmol; // the number of molecules of each component
101     MoleculeStamp** compStamps;// the stamps matching the components
102     LinkedMolStamp* headStamp; // list of stamps used in the simulation
103    
104    
105     char ensemble[100]; // the enesemble of the simulation (NVT, NVE, etc. )
106     char mixingRule[100]; // the mixing rules for Lennard jones/van der walls
107 mmeineke 542 BaseIntegrator *the_integrator; // the integrator of the simulation
108 mmeineke 377
109     char finalName[300]; // the name of the eor file to be written
110     char sampleName[300]; // the name of the dump file to be written
111     char statusName[300]; // the name of the stat file to be written
112    
113 tim 708 int seed; //seed for random number generator
114 mmeineke 377 // refreshes the sim if things get changed (load balanceing, volume
115     // adjustment, etc.)
116    
117     void refreshSim( void );
118    
119    
120     // sets the internal function pointer to fortran.
121    
122     void setInternal( void (*fSetup) setFortranSimList,
123 mmeineke 626 void (*fBox) setFortranBoxList,
124     void (*fCut) notifyFortranCutOffList ){
125 mmeineke 377 setFsimulation = fSetup;
126     setFortranBoxSize = fBox;
127 mmeineke 626 notifyFortranCutOffs = fCut;
128 mmeineke 377 }
129    
130 gezelter 458 int getNDF();
131     int getNDFraw();
132    
133 gezelter 457 void setBox( double newBox[3] );
134 gezelter 588 void setBoxM( double newBox[3][3] );
135     void getBoxM( double theBox[3][3] );
136 gezelter 574 void scaleBox( double scale );
137 mmeineke 626
138     void setRcut( double theRcut );
139     void setEcr( double theEcr );
140     void setEcr( double theEcr, double theEst );
141 gezelter 457
142 mmeineke 626 double getRcut( void ) { return rCut; }
143     double getRlist( void ) { return rList; }
144     double getEcr( void ) { return ecr; }
145     double getEst( void ) { return est; }
146    
147 mmeineke 644 void setTime( double theTime ) { currentTime = theTime; }
148 mmeineke 643 void incrTime( double dt ) { currentTime += dt; }
149     void decrTime( double dt ) { currentTime -= dt; }
150 mmeineke 644 double getTime( void ) { return currentTime; }
151 mmeineke 626
152 mmeineke 568 void wrapVector( double thePos[3] );
153    
154 gezelter 588 void matMul3(double a[3][3], double b[3][3], double out[3][3]);
155     void matVecMul3(double m[3][3], double inVec[3], double outVec[3]);
156     void invertMat3(double in[3][3], double out[3][3]);
157 mmeineke 597 void transposeMat3(double in[3][3], double out[3][3]);
158     void printMat3(double A[3][3]);
159     void printMat9(double A[9]);
160 gezelter 588 double matDet3(double m[3][3]);
161 tim 763 double matTrace3(double m[3][3]);
162 mmeineke 670
163     SimState* getConfiguration( void ) { return myConfiguration; }
164 gezelter 588
165 tim 658 void addProperty(GenericData* prop);
166     GenericData* getProperty(const string& propName);
167     vector<GenericData*> getProperties();
168 mmeineke 670
169 tim 708 int getSeed(void) { return seed; }
170     void setSeed(int theSeed) { seed = theSeed;}
171    
172 mmeineke 377 private:
173 mmeineke 626
174 mmeineke 670 SimState* myConfiguration;
175    
176 mmeineke 626 double origRcut, origEcr;
177     int boxIsInit, haveOrigRcut, haveOrigEcr;
178    
179     double oldEcr;
180     double oldRcut;
181    
182     double rList, rCut; // variables for the neighborlist
183     double ecr; // the electrostatic cutoff radius
184     double est; // the electrostatic skin thickness
185     double maxCutoff;
186 mmeineke 377
187 gezelter 588 void calcHmatInv( void );
188 mmeineke 568 void calcBoxL();
189 mmeineke 626 void checkCutOffs( void );
190 mmeineke 568
191 mmeineke 377 // private function to initialize the fortran side of the simulation
192     void (*setFsimulation) setFortranSimList;
193    
194     void (*setFortranBoxSize) setFortranBoxList;
195 mmeineke 626
196     void (*notifyFortranCutOffs) notifyFortranCutOffList;
197 tim 658
198     //Addtional Properties of SimInfo
199     map<string, GenericData*> properties;
200 mmeineke 626
201 mmeineke 377 };
202    
203    
204    
205     #endif