| 1 |
#ifndef __FORCEFIELDS_H__ |
| 2 |
#define __FORCEFIELDS_H__ |
| 3 |
|
| 4 |
#define MK_STR(s) # s |
| 5 |
#define STR_DEFINE(t, s) t = MK_STR(s) |
| 6 |
|
| 7 |
|
| 8 |
#include <stdio.h> |
| 9 |
#include <stdlib.h> |
| 10 |
|
| 11 |
#include "Atom.hpp" |
| 12 |
#include "SimInfo.hpp" |
| 13 |
|
| 14 |
#ifdef IS_MPI |
| 15 |
#include "mpiForceField.h" |
| 16 |
#endif |
| 17 |
|
| 18 |
#include "fForceField.h" |
| 19 |
#include "fortranWrapDefines.hpp" |
| 20 |
|
| 21 |
class bond_pair{ |
| 22 |
public: |
| 23 |
bond_pair(){} |
| 24 |
~bond_pair(){} |
| 25 |
|
| 26 |
int a; |
| 27 |
int b; |
| 28 |
}; |
| 29 |
|
| 30 |
class bend_set{ |
| 31 |
public: |
| 32 |
bend_set(){ isGhost = 0; } |
| 33 |
~bend_set(){} |
| 34 |
|
| 35 |
int ghost; |
| 36 |
int isGhost; |
| 37 |
|
| 38 |
int a; |
| 39 |
int b; |
| 40 |
int c; |
| 41 |
}; |
| 42 |
|
| 43 |
class torsion_set{ |
| 44 |
public: |
| 45 |
torsion_set(){} |
| 46 |
~torsion_set(){} |
| 47 |
|
| 48 |
int a; |
| 49 |
int b; |
| 50 |
int c; |
| 51 |
int d; |
| 52 |
}; |
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
class ForceFields{ |
| 57 |
|
| 58 |
public: |
| 59 |
ForceFields(){ frcFile = NULL; entry_plug = NULL; } |
| 60 |
virtual ~ForceFields(){} |
| 61 |
|
| 62 |
void setSimInfo( SimInfo* the_entry_plug ) { entry_plug = the_entry_plug; } |
| 63 |
|
| 64 |
virtual void readParams( void ) = 0; |
| 65 |
virtual void cleanMe( void ) = 0; |
| 66 |
|
| 67 |
|
| 68 |
virtual void initializeAtoms( int nAtoms, Atom** atomArray ) = 0; |
| 69 |
virtual void initializeBonds( int nBonds, Bond** bondArray, |
| 70 |
bond_pair* the_bonds ) = 0; |
| 71 |
virtual void initializeBends( int nBends, Bend** bendArray, |
| 72 |
bend_set* the_bends ) = 0; |
| 73 |
virtual void initializeTorsions( int nTorsions, Torsion** torsionArray, |
| 74 |
torsion_set* the_torsions ) = 0; |
| 75 |
virtual void initForceField( int ljMixRule ) = 0; |
| 76 |
|
| 77 |
virtual void calcRcut( void ); |
| 78 |
virtual void doForces( int calcPot, int calcStress ); |
| 79 |
|
| 80 |
void setFortranForceLoop( doForceLoop_TD fsub ){ |
| 81 |
fortranForceLoop = fsub; |
| 82 |
} |
| 83 |
|
| 84 |
protected: |
| 85 |
|
| 86 |
void initFortran( int ljMixPolicy, int useReactionField ); |
| 87 |
doForceLoop_TD fortranForceLoop; |
| 88 |
|
| 89 |
FILE *frcFile; |
| 90 |
SimInfo* entry_plug; |
| 91 |
|
| 92 |
int lineNum; |
| 93 |
char readLine[500]; |
| 94 |
char* eof_test; |
| 95 |
double bigSigma; |
| 96 |
|
| 97 |
}; |
| 98 |
|
| 99 |
|
| 100 |
class DUFF : public ForceFields{ |
| 101 |
|
| 102 |
public: |
| 103 |
DUFF(); |
| 104 |
virtual ~DUFF(); |
| 105 |
|
| 106 |
void readParams(); |
| 107 |
void cleanMe( void ); |
| 108 |
|
| 109 |
void initializeAtoms( int nAtoms, Atom** atomArray ); |
| 110 |
void initializeBonds( int nBonds, Bond** bondArray, |
| 111 |
bond_pair* the_bonds ); |
| 112 |
void initializeBends( int nBends, Bend** bendArray, |
| 113 |
bend_set* the_bends ); |
| 114 |
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
| 115 |
torsion_set* the_torsions ); |
| 116 |
|
| 117 |
void initForceField( int ljMixRule ); |
| 118 |
|
| 119 |
private: |
| 120 |
|
| 121 |
void fastForward( char* stopText, char* searchOwner ); |
| 122 |
}; |
| 123 |
|
| 124 |
class LJFF : public ForceFields{ |
| 125 |
|
| 126 |
public: |
| 127 |
LJFF(); |
| 128 |
virtual ~LJFF(); |
| 129 |
|
| 130 |
|
| 131 |
void readParams(); |
| 132 |
void cleanMe( void ); |
| 133 |
|
| 134 |
void initializeAtoms( int nAtoms, Atom** atomArray ); |
| 135 |
void initializeBonds( int nBonds, Bond** bondArray, |
| 136 |
bond_pair* the_bonds ); |
| 137 |
void initializeBends( int nBends, Bend** bendArray, |
| 138 |
bend_set* the_bends ); |
| 139 |
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
| 140 |
torsion_set* the_torsions ); |
| 141 |
|
| 142 |
void initForceField( int ljMixRule ); |
| 143 |
|
| 144 |
private: |
| 145 |
|
| 146 |
void fastForward( char* stopText, char* searchOwner ); |
| 147 |
|
| 148 |
}; |
| 149 |
|
| 150 |
class EAM_FF : public ForceFields{ |
| 151 |
|
| 152 |
public: |
| 153 |
EAM_FF(); |
| 154 |
virtual ~EAM_FF(); |
| 155 |
|
| 156 |
|
| 157 |
void readParams(); |
| 158 |
void cleanMe( void ); |
| 159 |
|
| 160 |
void initializeAtoms( int nAtoms, Atom** atomArray ); |
| 161 |
void initializeBonds( int nBonds, Bond** bondArray, |
| 162 |
bond_pair* the_bonds ); |
| 163 |
void initializeBends( int nBends, Bend** bendArray, |
| 164 |
bend_set* the_bends ); |
| 165 |
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
| 166 |
torsion_set* the_torsions ); |
| 167 |
|
| 168 |
void initForceField( int ljMixRule ); |
| 169 |
|
| 170 |
void calcRcut( void ); |
| 171 |
private: |
| 172 |
|
| 173 |
void fastForward( char* stopText, char* searchOwner ); |
| 174 |
|
| 175 |
double eamRcut; |
| 176 |
}; |
| 177 |
|
| 178 |
#endif |
| 179 |
|