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