| 1 |
< |
#ifndef __FORCEFIELDS_H__ |
| 1 |
> |
\#ifndef __FORCEFIELDS_H__ |
| 2 |
|
#define __FORCEFIELDS_H__ |
| 3 |
|
|
| 4 |
|
#include <cstdio> |
| 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(){} |
| 41 |
|
int d; |
| 42 |
|
}; |
| 43 |
|
|
| 40 |
– |
// typedef struct{ |
| 41 |
– |
// int a, b; |
| 42 |
– |
// } bond_pair; |
| 44 |
|
|
| 44 |
– |
// typedef struct{ |
| 45 |
– |
// int a, b, c; |
| 46 |
– |
// } bend_set; |
| 45 |
|
|
| 48 |
– |
// typedef struct{ |
| 49 |
– |
// int a, b, c, d; |
| 50 |
– |
// } torsion_set; |
| 51 |
– |
|
| 52 |
– |
|
| 46 |
|
class ForceFields{ |
| 47 |
|
|
| 48 |
|
public: |
| 49 |
|
ForceFields(){ frcFile = NULL; entry_plug = NULL; } |
| 50 |
< |
~ForceFields(){} |
| 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( void ) = 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 |
|
|
| 71 |
|
|
| 72 |
|
public: |
| 73 |
|
TraPPEFF(); |
| 74 |
< |
~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( void ) {} |
| 81 |
|
}; |
| 82 |
|
|
| 83 |
|
|
| 85 |
|
|
| 86 |
|
public: |
| 87 |
|
DipoleTestFF(); |
| 88 |
< |
~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( void ) {} |
| 95 |
|
}; |
| 96 |
|
|
| 97 |
|
class TraPPE_ExFF : public ForceFields{ |
| 98 |
|
|
| 99 |
|
public: |
| 100 |
|
TraPPE_ExFF(); |
| 101 |
< |
~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 |
+ |
void doForces( void ) {} |
| 108 |
|
}; |
| 109 |
|
|
| 110 |
+ |
class LJ_FF : public ForceFields{ |
| 111 |
+ |
|
| 112 |
+ |
public: |
| 113 |
+ |
LJ_FF(); |
| 114 |
+ |
virtual ~LJ_FF(); |
| 115 |
+ |
|
| 116 |
+ |
void initializeAtoms( void ); |
| 117 |
+ |
void initializeBonds( bond_pair* the_bonds ); |
| 118 |
+ |
void initializeBends( bend_set* the_bends ); |
| 119 |
+ |
void initializeTorsions( torsion_set* the_torsions ); |
| 120 |
+ |
void setLJfortran( void (*fortranSub)( double* positionArray, |
| 121 |
+ |
double* forceArray, |
| 122 |
+ |
double* potentialEnergy, |
| 123 |
+ |
short int* doPotentialCalc ) ){ |
| 124 |
+ |
doLJfortran = fortranSub; |
| 125 |
+ |
} |
| 126 |
+ |
void doForces( void ); |
| 127 |
+ |
|
| 128 |
+ |
private: |
| 129 |
+ |
|
| 130 |
+ |
void fastForward( char* stopText, char* searchOwner ); |
| 131 |
+ |
|
| 132 |
+ |
// set our sister fortran module's function to be our own. |
| 133 |
+ |
void wrapMe( void ); |
| 134 |
+ |
void (*doLJfortran)( double* positionArray, |
| 135 |
+ |
double* forceArray, |
| 136 |
+ |
double* potentialEnergy, |
| 137 |
+ |
short int* doPotentialCalc ); |
| 138 |
+ |
void initFortran( void ); |
| 139 |
+ |
}; |
| 140 |
+ |
|
| 141 |
|
#endif |