1 |
|
#ifndef __SIMINFO_H__ |
2 |
|
#define __SIMINFO_H__ |
3 |
|
|
4 |
+ |
#include <map> |
5 |
+ |
#include <string> |
6 |
+ |
#include <vector> |
7 |
|
|
5 |
– |
|
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 |
|
|
17 |
|
#define __C |
18 |
|
#include "fSimulation.h" |
19 |
|
#include "fortranWrapDefines.hpp" |
20 |
< |
|
21 |
< |
|
22 |
< |
|
20 |
> |
#include "GenericData.hpp" |
21 |
> |
//#include "Minimizer.hpp" |
22 |
> |
//#include "OOPSEMinimizer.hpp" |
23 |
> |
double roundMe( double x ); |
24 |
> |
class OOPSEMinimizer; |
25 |
|
class SimInfo{ |
26 |
|
|
27 |
|
public: |
28 |
|
|
29 |
|
SimInfo(); |
30 |
< |
~SimInfo(){} |
30 |
> |
~SimInfo(); |
31 |
|
|
32 |
|
int n_atoms; // the number of atoms |
33 |
|
Atom **atoms; // the array of atom objects |
34 |
+ |
|
35 |
+ |
vector<RigidBody*> rigidBodies; // A vector of rigid bodies |
36 |
+ |
vector<StuntDouble*> integrableObjects; |
37 |
|
|
38 |
|
double tau[9]; // the stress tensor |
39 |
|
|
40 |
< |
unsigned int n_bonds; // number of bends |
41 |
< |
unsigned int n_bends; // number of bends |
42 |
< |
unsigned int n_torsions; // number of torsions |
43 |
< |
unsigned int n_oriented; // number of of atoms with orientation |
44 |
< |
unsigned int ndf; // number of actual degrees of freedom |
45 |
< |
unsigned int ndfRaw; // number of settable degrees of freedom |
40 |
> |
int n_bonds; // number of bends |
41 |
> |
int n_bends; // number of bends |
42 |
> |
int n_torsions; // number of torsions |
43 |
> |
int n_oriented; // number of of atoms with orientation |
44 |
> |
int ndf; // number of actual degrees of freedom |
45 |
> |
int ndfRaw; // number of settable degrees of freedom |
46 |
> |
int ndfTrans; // number of translational degrees of freedom |
47 |
> |
int nZconstraints; // the number of zConstraints |
48 |
|
|
49 |
< |
unsigned int setTemp; // boolean to set the temperature at each sampleTime |
49 |
> |
int setTemp; // boolean to set the temperature at each sampleTime |
50 |
> |
int resetIntegrator; // boolean to reset the integrator |
51 |
|
|
52 |
< |
unsigned int n_dipoles; // number of dipoles |
52 |
> |
int n_dipoles; // number of dipoles |
53 |
|
|
54 |
< |
|
55 |
< |
int n_exclude; // the # of pairs excluded from long range forces |
42 |
< |
Exclude** excludes; // the pairs themselves |
43 |
< |
|
54 |
> |
int n_exclude; |
55 |
> |
Exclude* excludes; // the exclude list for ignoring pairs in fortran |
56 |
|
int nGlobalExcludes; |
57 |
|
int* globalExcludes; // same as above, but these guys participate in |
58 |
|
// no long range forces. |
62 |
|
|
63 |
|
int n_constraints; // the number of constraints on the system |
64 |
|
|
65 |
< |
unsigned int n_SRI; // the number of short range interactions |
65 |
> |
int n_SRI; // the number of short range interactions |
66 |
|
|
67 |
|
double lrPot; // the potential energy from the long range calculations. |
68 |
|
|
86 |
|
int usePBC; // whether we use periodic boundry conditions. |
87 |
|
int useLJ; |
88 |
|
int useSticky; |
89 |
< |
int useDipole; |
89 |
> |
int useCharges; |
90 |
> |
int useDipoles; |
91 |
|
int useReactionField; |
92 |
|
int useGB; |
93 |
|
int useEAM; |
94 |
|
|
95 |
+ |
bool useInitXSstate; |
96 |
+ |
double orthoTolerance; |
97 |
|
|
98 |
|
double dt, run_time; // the time step and total time |
99 |
|
double sampleTime, statusTime; // the position and energy dump frequencies |
100 |
|
double target_temp; // the target temperature of the system |
101 |
|
double thermalTime; // the temp kick interval |
102 |
|
double currentTime; // Used primarily for correlation Functions |
103 |
+ |
double resetTime; // Use to reset the integrator periodically |
104 |
|
|
105 |
|
int n_mol; // n_molecules; |
106 |
|
Molecule* molecules; // the array of molecules |
107 |
|
|
108 |
< |
int nComponents; // the number of componentsin the system |
108 |
> |
int nComponents; // the number of components in the system |
109 |
|
int* componentsNmol; // the number of molecules of each component |
110 |
|
MoleculeStamp** compStamps;// the stamps matching the components |
111 |
|
LinkedMolStamp* headStamp; // list of stamps used in the simulation |
115 |
|
char mixingRule[100]; // the mixing rules for Lennard jones/van der walls |
116 |
|
BaseIntegrator *the_integrator; // the integrator of the simulation |
117 |
|
|
118 |
+ |
OOPSEMinimizer* the_minimizer; // the energy minimizer |
119 |
+ |
bool has_minimizer; |
120 |
+ |
|
121 |
|
char finalName[300]; // the name of the eor file to be written |
122 |
|
char sampleName[300]; // the name of the dump file to be written |
123 |
|
char statusName[300]; // the name of the stat file to be written |
124 |
|
|
125 |
< |
|
125 |
> |
int seed; //seed for random number generator |
126 |
|
// refreshes the sim if things get changed (load balanceing, volume |
127 |
|
// adjustment, etc.) |
128 |
|
|
131 |
|
|
132 |
|
// sets the internal function pointer to fortran. |
133 |
|
|
134 |
< |
void setInternal( void (*fSetup) setFortranSimList, |
135 |
< |
void (*fBox) setFortranBoxList, |
136 |
< |
void (*fCut) notifyFortranCutOffList ){ |
134 |
> |
void setInternal( setFortranSim_TD fSetup, |
135 |
> |
setFortranBox_TD fBox, |
136 |
> |
notifyFortranCutOff_TD fCut){ |
137 |
|
setFsimulation = fSetup; |
138 |
|
setFortranBoxSize = fBox; |
139 |
|
notifyFortranCutOffs = fCut; |
141 |
|
|
142 |
|
int getNDF(); |
143 |
|
int getNDFraw(); |
144 |
< |
|
144 |
> |
int getNDFtranslational(); |
145 |
> |
int getTotIntegrableObjects(); |
146 |
|
void setBox( double newBox[3] ); |
147 |
|
void setBoxM( double newBox[3][3] ); |
148 |
|
void getBoxM( double theBox[3][3] ); |
149 |
|
void scaleBox( double scale ); |
150 |
|
|
151 |
< |
void setRcut( double theRcut ); |
152 |
< |
void setEcr( double theEcr ); |
153 |
< |
void setEcr( double theEcr, double theEst ); |
151 |
> |
void setDefaultRcut( double theRcut ); |
152 |
> |
void setDefaultEcr( double theEcr ); |
153 |
> |
void setDefaultEcr( double theEcr, double theEst ); |
154 |
> |
void checkCutOffs( void ); |
155 |
|
|
156 |
|
double getRcut( void ) { return rCut; } |
157 |
|
double getRlist( void ) { return rList; } |
158 |
|
double getEcr( void ) { return ecr; } |
159 |
|
double getEst( void ) { return est; } |
160 |
+ |
double getMaxCutoff( void ) { return maxCutoff; } |
161 |
|
|
162 |
< |
void setTime( double theTime ) { currentTime = theTime }; |
163 |
< |
void incrTime( double dt ) { currentTime += dt; } |
164 |
< |
void decrTime( double dt ) { currentTime -= dt; } |
165 |
< |
double getTime( void ) { return currentTime }; |
162 |
> |
void setTime( double theTime ) { currentTime = theTime; } |
163 |
> |
void incrTime( double the_dt ) { currentTime += the_dt; } |
164 |
> |
void decrTime( double the_dt ) { currentTime -= the_dt; } |
165 |
> |
double getTime( void ) { return currentTime; } |
166 |
|
|
167 |
|
void wrapVector( double thePos[3] ); |
168 |
|
|
169 |
< |
void matMul3(double a[3][3], double b[3][3], double out[3][3]); |
148 |
< |
void matVecMul3(double m[3][3], double inVec[3], double outVec[3]); |
149 |
< |
void invertMat3(double in[3][3], double out[3][3]); |
150 |
< |
void transposeMat3(double in[3][3], double out[3][3]); |
151 |
< |
void printMat3(double A[3][3]); |
152 |
< |
void printMat9(double A[9]); |
153 |
< |
double matDet3(double m[3][3]); |
169 |
> |
SimState* getConfiguration( void ) { return myConfiguration; } |
170 |
|
|
171 |
+ |
void addProperty(GenericData* prop); |
172 |
+ |
GenericData* getProperty(const string& propName); |
173 |
+ |
//vector<GenericData*>& getProperties() {return properties;} |
174 |
+ |
|
175 |
+ |
int getSeed(void) { return seed; } |
176 |
+ |
void setSeed(int theSeed) { seed = theSeed;} |
177 |
+ |
|
178 |
|
private: |
179 |
|
|
180 |
< |
double origRcut, origEcr; |
158 |
< |
int boxIsInit, haveOrigRcut, haveOrigEcr; |
180 |
> |
SimState* myConfiguration; |
181 |
|
|
182 |
< |
double oldEcr; |
161 |
< |
double oldRcut; |
182 |
> |
int boxIsInit, haveRcut, haveEcr; |
183 |
|
|
184 |
|
double rList, rCut; // variables for the neighborlist |
185 |
|
double ecr; // the electrostatic cutoff radius |
186 |
|
double est; // the electrostatic skin thickness |
187 |
|
double maxCutoff; |
188 |
+ |
|
189 |
+ |
double distXY; |
190 |
+ |
double distYZ; |
191 |
+ |
double distZX; |
192 |
|
|
193 |
|
void calcHmatInv( void ); |
194 |
|
void calcBoxL(); |
195 |
< |
void checkCutOffs( void ); |
195 |
> |
double calcMaxCutOff(); |
196 |
|
|
197 |
|
// private function to initialize the fortran side of the simulation |
198 |
< |
void (*setFsimulation) setFortranSimList; |
198 |
> |
setFortranSim_TD setFsimulation; |
199 |
|
|
200 |
< |
void (*setFortranBoxSize) setFortranBoxList; |
200 |
> |
setFortranBox_TD setFortranBoxSize; |
201 |
|
|
202 |
< |
void (*notifyFortranCutOffs) notifyFortranCutOffList; |
202 |
> |
notifyFortranCutOff_TD notifyFortranCutOffs; |
203 |
> |
|
204 |
> |
//Addtional Properties of SimInfo |
205 |
> |
map<string, GenericData*> properties; |
206 |
|
|
207 |
|
}; |
208 |
|
|
181 |
– |
|
182 |
– |
|
209 |
|
#endif |