ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimInfo.hpp
Revision: 658
Committed: Thu Jul 31 15:35:07 2003 UTC (20 years, 11 months ago) by tim
File size: 5759 byte(s)
Log Message:
 Added Z constraint.

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