| 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 | #include "SimState.hpp" | 
| 13 |  | 
| 14 | #define __C | 
| 15 | #include "fSimulation.h" | 
| 16 | #include "fortranWrapDefines.hpp" | 
| 17 | #include "GenericData.hpp" | 
| 18 |  | 
| 19 |  | 
| 20 |  | 
| 21 | class SimInfo{ | 
| 22 |  | 
| 23 | public: | 
| 24 |  | 
| 25 | SimInfo(); | 
| 26 | ~SimInfo(); | 
| 27 |  | 
| 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 | 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 |  | 
| 42 | int setTemp;   // boolean to set the temperature at each sampleTime | 
| 43 | int resetIntegrator; // boolean to reset the integrator | 
| 44 |  | 
| 45 | int n_dipoles; // number of dipoles | 
| 46 |  | 
| 47 |  | 
| 48 | int n_exclude;  // the # of pairs excluded from long range forces | 
| 49 | Exclude** excludes;       // the pairs themselves | 
| 50 |  | 
| 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 | int* molMembershipArray;  // map of atom numbers onto molecule numbers | 
| 57 |  | 
| 58 | int n_constraints; // the number of constraints on the system | 
| 59 |  | 
| 60 | int n_SRI;   // the number of short range interactions | 
| 61 |  | 
| 62 | double lrPot; // the potential energy from the long range calculations. | 
| 63 |  | 
| 64 | 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 |  | 
| 73 | double boxL[3]; // The Lengths of the 3 column vectors of Hmat | 
| 74 | double boxVol; | 
| 75 | int orthoRhombic; | 
| 76 |  | 
| 77 |  | 
| 78 | double dielectric;      // the dielectric of the medium for reaction field | 
| 79 |  | 
| 80 |  | 
| 81 | int usePBC; // whether we use periodic boundry conditions. | 
| 82 | int useLJ; | 
| 83 | int useSticky; | 
| 84 | int useDipole; | 
| 85 | int useReactionField; | 
| 86 | int useGB; | 
| 87 | int useEAM; | 
| 88 |  | 
| 89 |  | 
| 90 | double dt, run_time;           // the time step and total time | 
| 91 | double sampleTime, statusTime; // the position and energy dump frequencies | 
| 92 | double target_temp;            // the target temperature of the system | 
| 93 | double thermalTime;            // the temp kick interval | 
| 94 | double currentTime;            // Used primarily for correlation Functions | 
| 95 | double resetTime;              // Use to reset the integrator periodically | 
| 96 |  | 
| 97 | int n_mol;           // n_molecules; | 
| 98 | Molecule* molecules; // the array of molecules | 
| 99 |  | 
| 100 | int nComponents;           // the number of componentsin the system | 
| 101 | int* componentsNmol;       // the number of molecules of each component | 
| 102 | MoleculeStamp** compStamps;// the stamps matching the components | 
| 103 | LinkedMolStamp* headStamp; // list of stamps used in the simulation | 
| 104 |  | 
| 105 |  | 
| 106 | char ensemble[100]; // the enesemble of the simulation (NVT, NVE, etc. ) | 
| 107 | char mixingRule[100]; // the mixing rules for Lennard jones/van der walls | 
| 108 | BaseIntegrator *the_integrator; // the integrator of the simulation | 
| 109 |  | 
| 110 | char finalName[300];  // the name of the eor file to be written | 
| 111 | char sampleName[300]; // the name of the dump file to be written | 
| 112 | char statusName[300]; // the name of the stat file to be written | 
| 113 |  | 
| 114 | int seed;                    //seed for random number generator | 
| 115 | // refreshes the sim if things get changed (load balanceing, volume | 
| 116 | // adjustment, etc.) | 
| 117 |  | 
| 118 | void refreshSim( void ); | 
| 119 |  | 
| 120 |  | 
| 121 | // sets the internal function pointer to fortran. | 
| 122 |  | 
| 123 | void setInternal( void (*fSetup) setFortranSimList, | 
| 124 | void (*fBox) setFortranBoxList, | 
| 125 | void (*fCut) notifyFortranCutOffList ){ | 
| 126 | setFsimulation = fSetup; | 
| 127 | setFortranBoxSize = fBox; | 
| 128 | notifyFortranCutOffs = fCut; | 
| 129 | } | 
| 130 |  | 
| 131 | int getNDF(); | 
| 132 | int getNDFraw(); | 
| 133 | int getNDFtranslational(); | 
| 134 |  | 
| 135 | void setBox( double newBox[3] ); | 
| 136 | void setBoxM( double newBox[3][3] ); | 
| 137 | void getBoxM( double theBox[3][3] ); | 
| 138 | void scaleBox( double scale ); | 
| 139 |  | 
| 140 | void setRcut( double theRcut ); | 
| 141 | void setEcr( double theEcr ); | 
| 142 | void setEcr( double theEcr, double theEst ); | 
| 143 |  | 
| 144 | double getRcut( void )  { return rCut; } | 
| 145 | double getRlist( void ) { return rList; } | 
| 146 | double getEcr( void )   { return ecr; } | 
| 147 | double getEst( void )   { return est; } | 
| 148 | double getMaxCutoff( void ) { return maxCutoff; } | 
| 149 |  | 
| 150 | void setTime( double theTime ) { currentTime = theTime; } | 
| 151 | void incrTime( double the_dt ) { currentTime += the_dt; } | 
| 152 | void decrTime( double the_dt ) { currentTime -= the_dt; } | 
| 153 | double getTime( void ) { return currentTime; } | 
| 154 |  | 
| 155 | void wrapVector( double thePos[3] ); | 
| 156 |  | 
| 157 | void matMul3(double a[3][3], double b[3][3], double out[3][3]); | 
| 158 | void matVecMul3(double m[3][3], double inVec[3], double outVec[3]); | 
| 159 | void invertMat3(double in[3][3], double out[3][3]); | 
| 160 | void transposeMat3(double in[3][3], double out[3][3]); | 
| 161 | void printMat3(double A[3][3]); | 
| 162 | void printMat9(double A[9]); | 
| 163 | double matDet3(double m[3][3]); | 
| 164 | double matTrace3(double m[3][3]); | 
| 165 |  | 
| 166 | void crossProduct3(double a[3],double b[3], double out[3]); | 
| 167 | double dotProduct3(double a[3], double b[3]); | 
| 168 | double length3(double a[3]); | 
| 169 |  | 
| 170 | SimState* getConfiguration( void ) { return myConfiguration; } | 
| 171 |  | 
| 172 | void addProperty(GenericData* prop); | 
| 173 | GenericData* getProperty(const string& propName); | 
| 174 | vector<GenericData*> getProperties(); | 
| 175 |  | 
| 176 | int getSeed(void) {  return seed; } | 
| 177 | void setSeed(int theSeed) {  seed = theSeed;} | 
| 178 |  | 
| 179 | private: | 
| 180 |  | 
| 181 | SimState* myConfiguration; | 
| 182 |  | 
| 183 | double origRcut, origEcr; | 
| 184 | int boxIsInit, haveOrigRcut, haveOrigEcr; | 
| 185 |  | 
| 186 | double oldEcr; | 
| 187 | double oldRcut; | 
| 188 |  | 
| 189 | double rList, rCut; // variables for the neighborlist | 
| 190 | double ecr;             // the electrostatic cutoff radius | 
| 191 | double est;             // the electrostatic skin thickness | 
| 192 | double maxCutoff; | 
| 193 |  | 
| 194 | double distXY; | 
| 195 | double distYZ; | 
| 196 | double distZX; | 
| 197 |  | 
| 198 | void calcHmatInv( void ); | 
| 199 | void calcBoxL(); | 
| 200 | double calcMaxCutOff(); | 
| 201 | void checkCutOffs( void ); | 
| 202 |  | 
| 203 | // private function to initialize the fortran side of the simulation | 
| 204 | void (*setFsimulation) setFortranSimList; | 
| 205 |  | 
| 206 | void (*setFortranBoxSize) setFortranBoxList; | 
| 207 |  | 
| 208 | void (*notifyFortranCutOffs) notifyFortranCutOffList; | 
| 209 |  | 
| 210 | //Addtional Properties of SimInfo | 
| 211 | map<string, GenericData*> properties; | 
| 212 |  | 
| 213 | }; | 
| 214 |  | 
| 215 |  | 
| 216 |  | 
| 217 | #endif |