| 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 |  |  |  | 
| 13 |  |  | #define __C | 
| 14 |  |  | #include "fSimulation.h" | 
| 15 |  |  | #include "fortranWrapDefines.hpp" | 
| 16 | tim | 658 | #include "GenericData.hpp" | 
| 17 | mmeineke | 377 |  | 
| 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 | gezelter | 458 | unsigned int ndf;        // number of actual degrees of freedom | 
| 37 |  |  | unsigned int ndfRaw;     // number of settable degrees of freedom | 
| 38 | mmeineke | 377 |  | 
| 39 |  |  | unsigned int setTemp;   // boolean to set the temperature at each sampleTime | 
| 40 |  |  |  | 
| 41 |  |  | unsigned int n_dipoles; // number of dipoles | 
| 42 |  |  |  | 
| 43 | mmeineke | 626 |  | 
| 44 | mmeineke | 377 | int n_exclude;  // the # of pairs excluded from long range forces | 
| 45 | mmeineke | 427 | Exclude** excludes;       // the pairs themselves | 
| 46 | mmeineke | 377 |  | 
| 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 | gezelter | 483 | int* molMembershipArray;  // map of atom numbers onto molecule numbers | 
| 53 | mmeineke | 377 |  | 
| 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 | gezelter | 588 | 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 | mmeineke | 568 |  | 
| 69 | gezelter | 621 | double boxL[3]; // The Lengths of the 3 column vectors of Hmat | 
| 70 | mmeineke | 572 | double boxVol; | 
| 71 |  |  | int orthoRhombic; | 
| 72 | mmeineke | 568 |  | 
| 73 |  |  |  | 
| 74 | mmeineke | 626 | double dielectric;      // the dielectric of the medium for reaction field | 
| 75 | mmeineke | 568 |  | 
| 76 | mmeineke | 377 |  | 
| 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 | gezelter | 637 | double currentTime;            // Used primarily for correlation Functions | 
| 91 | mmeineke | 377 |  | 
| 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 | mmeineke | 542 | BaseIntegrator *the_integrator; // the integrator of the simulation | 
| 104 | mmeineke | 377 |  | 
| 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 | mmeineke | 626 | void (*fBox) setFortranBoxList, | 
| 120 |  |  | void (*fCut) notifyFortranCutOffList ){ | 
| 121 | mmeineke | 377 | setFsimulation = fSetup; | 
| 122 |  |  | setFortranBoxSize = fBox; | 
| 123 | mmeineke | 626 | notifyFortranCutOffs = fCut; | 
| 124 | mmeineke | 377 | } | 
| 125 |  |  |  | 
| 126 | gezelter | 458 | int getNDF(); | 
| 127 |  |  | int getNDFraw(); | 
| 128 |  |  |  | 
| 129 | gezelter | 457 | void setBox( double newBox[3] ); | 
| 130 | gezelter | 588 | void setBoxM( double newBox[3][3] ); | 
| 131 |  |  | void getBoxM( double theBox[3][3] ); | 
| 132 | gezelter | 574 | void scaleBox( double scale ); | 
| 133 | mmeineke | 626 |  | 
| 134 |  |  | void setRcut( double theRcut ); | 
| 135 |  |  | void setEcr( double theEcr ); | 
| 136 |  |  | void setEcr( double theEcr, double theEst ); | 
| 137 | gezelter | 457 |  | 
| 138 | mmeineke | 626 | 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 | mmeineke | 644 | void setTime( double theTime ) { currentTime = theTime; } | 
| 144 | mmeineke | 643 | void incrTime( double dt ) { currentTime += dt; } | 
| 145 |  |  | void decrTime( double dt ) { currentTime -= dt; } | 
| 146 | mmeineke | 644 | double getTime( void ) { return currentTime; } | 
| 147 | mmeineke | 626 |  | 
| 148 | mmeineke | 568 | void wrapVector( double thePos[3] ); | 
| 149 |  |  |  | 
| 150 | gezelter | 588 | 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 | mmeineke | 597 | void transposeMat3(double in[3][3], double out[3][3]); | 
| 154 |  |  | void printMat3(double A[3][3]); | 
| 155 |  |  | void printMat9(double A[9]); | 
| 156 | gezelter | 588 | double matDet3(double m[3][3]); | 
| 157 |  |  |  | 
| 158 | tim | 658 |  | 
| 159 |  |  | void addProperty(GenericData* prop); | 
| 160 |  |  | GenericData* getProperty(const string& propName); | 
| 161 |  |  | vector<GenericData*> getProperties(); | 
| 162 |  |  |  | 
| 163 | mmeineke | 377 | private: | 
| 164 | mmeineke | 626 |  | 
| 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 | mmeineke | 377 |  | 
| 176 | gezelter | 588 | void calcHmatInv( void ); | 
| 177 | mmeineke | 568 | void calcBoxL(); | 
| 178 | mmeineke | 626 | void checkCutOffs( void ); | 
| 179 | mmeineke | 568 |  | 
| 180 | mmeineke | 377 | // private function to initialize the fortran side of the simulation | 
| 181 |  |  | void (*setFsimulation) setFortranSimList; | 
| 182 |  |  |  | 
| 183 |  |  | void (*setFortranBoxSize) setFortranBoxList; | 
| 184 | mmeineke | 626 |  | 
| 185 |  |  | void (*notifyFortranCutOffs) notifyFortranCutOffList; | 
| 186 | tim | 658 |  | 
| 187 |  |  | //Addtional Properties of SimInfo | 
| 188 |  |  | map<string, GenericData*> properties; | 
| 189 | mmeineke | 626 |  | 
| 190 | mmeineke | 377 | }; | 
| 191 |  |  |  | 
| 192 |  |  |  | 
| 193 |  |  |  | 
| 194 |  |  | #endif |