1 |
mmeineke |
377 |
#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 |
gezelter |
829 |
#include <stdio.h> |
9 |
|
|
#include <stdlib.h> |
10 |
chrisfen |
1180 |
#include <math.h> |
11 |
mmeineke |
377 |
|
12 |
|
|
#include "Atom.hpp" |
13 |
|
|
#include "SimInfo.hpp" |
14 |
chrisfen |
1180 |
#include "StuntDouble.hpp" |
15 |
mmeineke |
377 |
|
16 |
|
|
#ifdef IS_MPI |
17 |
|
|
#include "mpiForceField.h" |
18 |
|
|
#endif |
19 |
|
|
|
20 |
|
|
#include "fForceField.h" |
21 |
|
|
#include "fortranWrapDefines.hpp" |
22 |
|
|
|
23 |
|
|
class bond_pair{ |
24 |
|
|
public: |
25 |
|
|
bond_pair(){} |
26 |
|
|
~bond_pair(){} |
27 |
|
|
|
28 |
|
|
int a; |
29 |
|
|
int b; |
30 |
|
|
}; |
31 |
|
|
|
32 |
|
|
class bend_set{ |
33 |
|
|
public: |
34 |
|
|
bend_set(){ isGhost = 0; } |
35 |
|
|
~bend_set(){} |
36 |
|
|
|
37 |
|
|
int ghost; |
38 |
|
|
int isGhost; |
39 |
|
|
|
40 |
|
|
int a; |
41 |
|
|
int b; |
42 |
|
|
int c; |
43 |
|
|
}; |
44 |
|
|
|
45 |
|
|
class torsion_set{ |
46 |
|
|
public: |
47 |
|
|
torsion_set(){} |
48 |
|
|
~torsion_set(){} |
49 |
|
|
|
50 |
|
|
int a; |
51 |
|
|
int b; |
52 |
|
|
int c; |
53 |
|
|
int d; |
54 |
|
|
}; |
55 |
|
|
|
56 |
|
|
|
57 |
|
|
|
58 |
|
|
class ForceFields{ |
59 |
|
|
|
60 |
|
|
public: |
61 |
|
|
ForceFields(){ frcFile = NULL; entry_plug = NULL; } |
62 |
|
|
virtual ~ForceFields(){} |
63 |
|
|
|
64 |
|
|
void setSimInfo( SimInfo* the_entry_plug ) { entry_plug = the_entry_plug; } |
65 |
mmeineke |
420 |
|
66 |
|
|
virtual void readParams( void ) = 0; |
67 |
|
|
virtual void cleanMe( void ) = 0; |
68 |
|
|
|
69 |
|
|
|
70 |
|
|
virtual void initializeAtoms( int nAtoms, Atom** atomArray ) = 0; |
71 |
|
|
virtual void initializeBonds( int nBonds, Bond** bondArray, |
72 |
|
|
bond_pair* the_bonds ) = 0; |
73 |
|
|
virtual void initializeBends( int nBends, Bend** bendArray, |
74 |
|
|
bend_set* the_bends ) = 0; |
75 |
|
|
virtual void initializeTorsions( int nTorsions, Torsion** torsionArray, |
76 |
|
|
torsion_set* the_torsions ) = 0; |
77 |
mmeineke |
377 |
virtual void initForceField( int ljMixRule ) = 0; |
78 |
chrisfen |
1180 |
virtual void initRestraints(); |
79 |
|
|
virtual void dumpzAngle(); |
80 |
mmeineke |
420 |
|
81 |
|
|
virtual void calcRcut( void ); |
82 |
gezelter |
1097 |
virtual void setRcut( double LJrcut ); |
83 |
mmeineke |
377 |
virtual void doForces( int calcPot, int calcStress ); |
84 |
|
|
|
85 |
mmeineke |
836 |
void setFortranForceLoop( doForceLoop_TD fsub ){ |
86 |
mmeineke |
377 |
fortranForceLoop = fsub; |
87 |
|
|
} |
88 |
|
|
|
89 |
|
|
protected: |
90 |
|
|
|
91 |
|
|
void initFortran( int ljMixPolicy, int useReactionField ); |
92 |
mmeineke |
836 |
doForceLoop_TD fortranForceLoop; |
93 |
mmeineke |
377 |
|
94 |
|
|
FILE *frcFile; |
95 |
|
|
SimInfo* entry_plug; |
96 |
|
|
|
97 |
|
|
int lineNum; |
98 |
|
|
char readLine[500]; |
99 |
|
|
char* eof_test; |
100 |
mmeineke |
420 |
double bigSigma; |
101 |
mmeineke |
377 |
|
102 |
chrisfen |
1180 |
vector<StuntDouble*> myStunts; |
103 |
|
|
|
104 |
mmeineke |
377 |
}; |
105 |
|
|
|
106 |
|
|
|
107 |
mmeineke |
559 |
class DUFF : public ForceFields{ |
108 |
mmeineke |
377 |
|
109 |
|
|
public: |
110 |
mmeineke |
559 |
DUFF(); |
111 |
|
|
virtual ~DUFF(); |
112 |
mmeineke |
377 |
|
113 |
mmeineke |
420 |
void readParams(); |
114 |
|
|
void cleanMe( void ); |
115 |
|
|
|
116 |
|
|
void initializeAtoms( int nAtoms, Atom** atomArray ); |
117 |
|
|
void initializeBonds( int nBonds, Bond** bondArray, |
118 |
|
|
bond_pair* the_bonds ); |
119 |
|
|
void initializeBends( int nBends, Bend** bendArray, |
120 |
|
|
bend_set* the_bends ); |
121 |
|
|
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
122 |
|
|
torsion_set* the_torsions ); |
123 |
|
|
|
124 |
mmeineke |
424 |
void initForceField( int ljMixRule ); |
125 |
|
|
|
126 |
mmeineke |
377 |
private: |
127 |
|
|
|
128 |
|
|
void fastForward( char* stopText, char* searchOwner ); |
129 |
|
|
}; |
130 |
|
|
|
131 |
mmeineke |
559 |
class LJFF : public ForceFields{ |
132 |
mmeineke |
377 |
|
133 |
|
|
public: |
134 |
mmeineke |
559 |
LJFF(); |
135 |
|
|
virtual ~LJFF(); |
136 |
mmeineke |
377 |
|
137 |
|
|
|
138 |
mmeineke |
420 |
void readParams(); |
139 |
|
|
void cleanMe( void ); |
140 |
|
|
|
141 |
|
|
void initializeAtoms( int nAtoms, Atom** atomArray ); |
142 |
|
|
void initializeBonds( int nBonds, Bond** bondArray, |
143 |
|
|
bond_pair* the_bonds ); |
144 |
|
|
void initializeBends( int nBends, Bend** bendArray, |
145 |
|
|
bend_set* the_bends ); |
146 |
|
|
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
147 |
|
|
torsion_set* the_torsions ); |
148 |
mmeineke |
424 |
|
149 |
|
|
void initForceField( int ljMixRule ); |
150 |
|
|
|
151 |
mmeineke |
377 |
private: |
152 |
|
|
|
153 |
|
|
void fastForward( char* stopText, char* searchOwner ); |
154 |
mmeineke |
420 |
|
155 |
mmeineke |
377 |
}; |
156 |
mmeineke |
559 |
|
157 |
chuckv |
500 |
class EAM_FF : public ForceFields{ |
158 |
mmeineke |
377 |
|
159 |
chuckv |
500 |
public: |
160 |
|
|
EAM_FF(); |
161 |
|
|
virtual ~EAM_FF(); |
162 |
|
|
|
163 |
|
|
|
164 |
|
|
void readParams(); |
165 |
|
|
void cleanMe( void ); |
166 |
|
|
|
167 |
|
|
void initializeAtoms( int nAtoms, Atom** atomArray ); |
168 |
|
|
void initializeBonds( int nBonds, Bond** bondArray, |
169 |
|
|
bond_pair* the_bonds ); |
170 |
|
|
void initializeBends( int nBends, Bend** bendArray, |
171 |
|
|
bend_set* the_bends ); |
172 |
|
|
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
173 |
|
|
torsion_set* the_torsions ); |
174 |
|
|
|
175 |
|
|
void initForceField( int ljMixRule ); |
176 |
|
|
|
177 |
chuckv |
657 |
void calcRcut( void ); |
178 |
chuckv |
500 |
private: |
179 |
|
|
|
180 |
|
|
void fastForward( char* stopText, char* searchOwner ); |
181 |
chuckv |
657 |
|
182 |
|
|
double eamRcut; |
183 |
chuckv |
500 |
}; |
184 |
|
|
|
185 |
chrisfen |
976 |
class WATER : public ForceFields{ |
186 |
|
|
|
187 |
|
|
public: |
188 |
|
|
WATER(); |
189 |
|
|
virtual ~WATER(); |
190 |
|
|
|
191 |
|
|
void readParams(); |
192 |
|
|
void cleanMe( void ); |
193 |
|
|
void initializeAtoms( int nAtoms, Atom** atomArray ); |
194 |
|
|
void initializeBonds( int nBonds, Bond** bondArray, |
195 |
|
|
bond_pair* the_bonds ); |
196 |
|
|
void initializeBends( int nBends, Bend** bendArray, |
197 |
|
|
bend_set* the_bends ); |
198 |
|
|
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
199 |
|
|
torsion_set* the_torsions ); |
200 |
|
|
void initForceField( int ljMixRule ); |
201 |
|
|
|
202 |
|
|
private: |
203 |
|
|
|
204 |
|
|
void fastForward( char* stopText, char* searchOwner ); |
205 |
chrisfen |
999 |
void sectionSearch( char* secHead, char* stopText, char* searchOwner ); |
206 |
|
|
|
207 |
chrisfen |
976 |
}; |
208 |
|
|
|
209 |
mmeineke |
377 |
#endif |
210 |
|
|
|