| 1 |
mmeineke |
270 |
#ifndef __FORCEFIELDS_H__ |
| 2 |
|
|
#define __FORCEFIELDS_H__ |
| 3 |
|
|
|
| 4 |
|
|
#include <cstdio> |
| 5 |
|
|
#include <cstdlib> |
| 6 |
|
|
|
| 7 |
|
|
#include "Atom.hpp" |
| 8 |
|
|
#include "SimInfo.hpp" |
| 9 |
|
|
|
| 10 |
|
|
#ifdef IS_MPI |
| 11 |
|
|
#include "mpiForceField.h" |
| 12 |
|
|
#endif |
| 13 |
|
|
|
| 14 |
|
|
class bond_pair{ |
| 15 |
|
|
public: |
| 16 |
|
|
bond_pair(){} |
| 17 |
|
|
~bond_pair(){} |
| 18 |
|
|
|
| 19 |
|
|
int a; |
| 20 |
|
|
int b; |
| 21 |
|
|
}; |
| 22 |
|
|
|
| 23 |
|
|
class bend_set{ |
| 24 |
|
|
public: |
| 25 |
|
|
bend_set(){} |
| 26 |
|
|
~bend_set(){} |
| 27 |
|
|
|
| 28 |
|
|
int a; |
| 29 |
|
|
int b; |
| 30 |
|
|
int c; |
| 31 |
|
|
}; |
| 32 |
|
|
|
| 33 |
|
|
class torsion_set{ |
| 34 |
|
|
public: |
| 35 |
|
|
torsion_set(){} |
| 36 |
|
|
~torsion_set(){} |
| 37 |
|
|
|
| 38 |
|
|
int a; |
| 39 |
|
|
int b; |
| 40 |
|
|
int c; |
| 41 |
|
|
int d; |
| 42 |
|
|
}; |
| 43 |
|
|
|
| 44 |
|
|
|
| 45 |
|
|
|
| 46 |
|
|
class ForceFields{ |
| 47 |
|
|
|
| 48 |
|
|
public: |
| 49 |
|
|
ForceFields(){ frcFile = NULL; entry_plug = NULL; } |
| 50 |
|
|
virtual ~ForceFields(){} |
| 51 |
|
|
|
| 52 |
|
|
void setSimInfo( SimInfo* the_entry_plug ) { entry_plug = the_entry_plug; } |
| 53 |
|
|
virtual void initializeAtoms( void ) = 0; |
| 54 |
|
|
virtual void initializeBonds( bond_pair* the_bonds ) = 0; |
| 55 |
|
|
virtual void initializeBends( bend_set* the_bends ) = 0; |
| 56 |
|
|
virtual void initializeTorsions( torsion_set* the_torsions ) = 0; |
| 57 |
|
|
virtual void doForces( int calcPot ) = 0; |
| 58 |
|
|
|
| 59 |
|
|
protected: |
| 60 |
|
|
|
| 61 |
|
|
FILE *frcFile; |
| 62 |
|
|
SimInfo* entry_plug; |
| 63 |
|
|
|
| 64 |
|
|
int lineNum; |
| 65 |
|
|
char readLine[500]; |
| 66 |
|
|
char* eof_test; |
| 67 |
|
|
|
| 68 |
|
|
}; |
| 69 |
|
|
|
| 70 |
|
|
class TraPPEFF : public ForceFields{ |
| 71 |
|
|
|
| 72 |
|
|
public: |
| 73 |
|
|
TraPPEFF(); |
| 74 |
|
|
virtual ~TraPPEFF(); |
| 75 |
|
|
|
| 76 |
|
|
void initializeAtoms( void ); |
| 77 |
|
|
void initializeBonds( bond_pair* the_bonds ); |
| 78 |
|
|
void initializeBends( bend_set* the_bends ); |
| 79 |
|
|
void initializeTorsions( torsion_set* the_torsions ); |
| 80 |
|
|
void doForces( int ) {} |
| 81 |
|
|
}; |
| 82 |
|
|
|
| 83 |
|
|
|
| 84 |
|
|
class DipoleTestFF : public ForceFields{ |
| 85 |
|
|
|
| 86 |
|
|
public: |
| 87 |
|
|
DipoleTestFF(); |
| 88 |
|
|
virtual ~DipoleTestFF(); |
| 89 |
|
|
|
| 90 |
|
|
void initializeAtoms( void ); |
| 91 |
|
|
void initializeBonds( bond_pair* the_bonds ); |
| 92 |
|
|
void initializeBends( bend_set* the_bends ); |
| 93 |
|
|
void initializeTorsions( torsion_set* the_torsions ); |
| 94 |
|
|
void doForces( int ) {} |
| 95 |
|
|
}; |
| 96 |
|
|
|
| 97 |
|
|
class TraPPE_ExFF : public ForceFields{ |
| 98 |
|
|
|
| 99 |
|
|
public: |
| 100 |
|
|
TraPPE_ExFF(); |
| 101 |
|
|
virtual ~TraPPE_ExFF(); |
| 102 |
|
|
|
| 103 |
|
|
void initializeAtoms( void ); |
| 104 |
|
|
void initializeBonds( bond_pair* the_bonds ); |
| 105 |
|
|
void initializeBends( bend_set* the_bends ); |
| 106 |
|
|
void initializeTorsions( torsion_set* the_torsions ); |
| 107 |
mmeineke |
291 |
void doForces( int ); |
| 108 |
|
|
|
| 109 |
|
|
void setTPEfortran( void (*fortranSub)( double* positionArray, |
| 110 |
|
|
double* forceArray, |
| 111 |
|
|
double* potentialEnergy, |
| 112 |
|
|
double* tau, |
| 113 |
|
|
short int* doPotentialCalc, |
| 114 |
|
|
int* isError ) ){ |
| 115 |
|
|
doTPEfortran = fortranSub; |
| 116 |
|
|
} |
| 117 |
|
|
|
| 118 |
|
|
private: |
| 119 |
|
|
|
| 120 |
|
|
void fastForward( char* stopText, char* searchOwner ); |
| 121 |
|
|
|
| 122 |
|
|
// set our sister fortran module's function to be our own. |
| 123 |
|
|
void wrapMe( void ); |
| 124 |
|
|
void (*doTPEfortran)( double* positionArray, |
| 125 |
|
|
double* forceArray, |
| 126 |
|
|
double* potentialEnergy, |
| 127 |
|
|
double* tau, |
| 128 |
|
|
short int* doPotentialCalc, |
| 129 |
|
|
int* isError ); |
| 130 |
|
|
void initFortran( void ); |
| 131 |
|
|
|
| 132 |
mmeineke |
270 |
}; |
| 133 |
|
|
|
| 134 |
|
|
class LJ_FF : public ForceFields{ |
| 135 |
|
|
|
| 136 |
|
|
public: |
| 137 |
|
|
LJ_FF(); |
| 138 |
|
|
virtual ~LJ_FF(); |
| 139 |
|
|
|
| 140 |
|
|
void initializeAtoms( void ); |
| 141 |
|
|
void initializeBonds( bond_pair* the_bonds ); |
| 142 |
|
|
void initializeBends( bend_set* the_bends ); |
| 143 |
|
|
void initializeTorsions( torsion_set* the_torsions ); |
| 144 |
|
|
void setLJfortran( void (*fortranSub)( double* positionArray, |
| 145 |
|
|
double* forceArray, |
| 146 |
|
|
double* potentialEnergy, |
| 147 |
chuckv |
290 |
double* tau, |
| 148 |
|
|
short int* doPotentialCalc, |
| 149 |
|
|
int* isError ) ){ |
| 150 |
mmeineke |
270 |
doLJfortran = fortranSub; |
| 151 |
|
|
} |
| 152 |
|
|
void doForces( int ); |
| 153 |
|
|
|
| 154 |
|
|
private: |
| 155 |
|
|
|
| 156 |
|
|
void fastForward( char* stopText, char* searchOwner ); |
| 157 |
|
|
|
| 158 |
|
|
// set our sister fortran module's function to be our own. |
| 159 |
|
|
void wrapMe( void ); |
| 160 |
|
|
void (*doLJfortran)( double* positionArray, |
| 161 |
|
|
double* forceArray, |
| 162 |
|
|
double* potentialEnergy, |
| 163 |
chuckv |
290 |
double* tau, |
| 164 |
|
|
short int* doPotentialCalc, |
| 165 |
|
|
int* isError ); |
| 166 |
mmeineke |
270 |
void initFortran( void ); |
| 167 |
|
|
}; |
| 168 |
|
|
|
| 169 |
mmeineke |
291 |
// class SSD_FF : public ForceFields{ |
| 170 |
mmeineke |
287 |
|
| 171 |
mmeineke |
291 |
// public: |
| 172 |
|
|
// SSD_FF(); |
| 173 |
|
|
// virtual ~SSD_FF(); |
| 174 |
mmeineke |
287 |
|
| 175 |
mmeineke |
291 |
// void initializeAtoms( void ); |
| 176 |
|
|
// void initializeBonds( bond_pair* the_bonds ); |
| 177 |
|
|
// void initializeBends( bend_set* the_bends ); |
| 178 |
|
|
// void initializeTorsions( torsion_set* the_torsions ); |
| 179 |
|
|
// void setSSDfortran( void (*fortranSub)( double* positionArray, |
| 180 |
|
|
// double* forceArray, |
| 181 |
|
|
// double* potentialEnergy, |
| 182 |
|
|
// short int* doPotentialCalc ) ){ |
| 183 |
|
|
// doSSDfortran = fortranSub; |
| 184 |
|
|
// } |
| 185 |
|
|
// void doForces( int ); |
| 186 |
mmeineke |
287 |
|
| 187 |
mmeineke |
291 |
// private: |
| 188 |
mmeineke |
287 |
|
| 189 |
mmeineke |
291 |
// void fastForward( char* stopText, char* searchOwner ); |
| 190 |
mmeineke |
287 |
|
| 191 |
mmeineke |
291 |
// // set our sister fortran module's function to be our own. |
| 192 |
|
|
// void wrapMe( void ); |
| 193 |
|
|
// void (*doSSDfortran)( double* positionArray, |
| 194 |
|
|
// double* forceArray, |
| 195 |
|
|
// double* potentialEnergy, |
| 196 |
|
|
// short int* doPotentialCalc ); |
| 197 |
|
|
// void initFortran( void ); |
| 198 |
|
|
// }; |
| 199 |
mmeineke |
287 |
|
| 200 |
mmeineke |
270 |
#endif |