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 |
mmeineke |
377 |
|
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 |
mmeineke |
420 |
|
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 |
mmeineke |
377 |
virtual void initForceField( int ljMixRule ) = 0; |
76 |
mmeineke |
420 |
|
77 |
|
|
virtual void calcRcut( void ); |
78 |
gezelter |
1097 |
virtual void setRcut( double LJrcut ); |
79 |
mmeineke |
377 |
virtual void doForces( int calcPot, int calcStress ); |
80 |
|
|
|
81 |
mmeineke |
836 |
void setFortranForceLoop( doForceLoop_TD fsub ){ |
82 |
mmeineke |
377 |
fortranForceLoop = fsub; |
83 |
|
|
} |
84 |
|
|
|
85 |
|
|
protected: |
86 |
|
|
|
87 |
|
|
void initFortran( int ljMixPolicy, int useReactionField ); |
88 |
mmeineke |
836 |
doForceLoop_TD fortranForceLoop; |
89 |
mmeineke |
377 |
|
90 |
|
|
FILE *frcFile; |
91 |
|
|
SimInfo* entry_plug; |
92 |
|
|
|
93 |
|
|
int lineNum; |
94 |
|
|
char readLine[500]; |
95 |
|
|
char* eof_test; |
96 |
mmeineke |
420 |
double bigSigma; |
97 |
mmeineke |
377 |
|
98 |
|
|
}; |
99 |
|
|
|
100 |
|
|
|
101 |
mmeineke |
559 |
class DUFF : public ForceFields{ |
102 |
mmeineke |
377 |
|
103 |
|
|
public: |
104 |
mmeineke |
559 |
DUFF(); |
105 |
|
|
virtual ~DUFF(); |
106 |
mmeineke |
377 |
|
107 |
mmeineke |
420 |
void readParams(); |
108 |
|
|
void cleanMe( void ); |
109 |
|
|
|
110 |
|
|
void initializeAtoms( int nAtoms, Atom** atomArray ); |
111 |
|
|
void initializeBonds( int nBonds, Bond** bondArray, |
112 |
|
|
bond_pair* the_bonds ); |
113 |
|
|
void initializeBends( int nBends, Bend** bendArray, |
114 |
|
|
bend_set* the_bends ); |
115 |
|
|
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
116 |
|
|
torsion_set* the_torsions ); |
117 |
|
|
|
118 |
mmeineke |
424 |
void initForceField( int ljMixRule ); |
119 |
|
|
|
120 |
mmeineke |
377 |
private: |
121 |
|
|
|
122 |
|
|
void fastForward( char* stopText, char* searchOwner ); |
123 |
|
|
}; |
124 |
|
|
|
125 |
mmeineke |
559 |
class LJFF : public ForceFields{ |
126 |
mmeineke |
377 |
|
127 |
|
|
public: |
128 |
mmeineke |
559 |
LJFF(); |
129 |
|
|
virtual ~LJFF(); |
130 |
mmeineke |
377 |
|
131 |
|
|
|
132 |
mmeineke |
420 |
void readParams(); |
133 |
|
|
void cleanMe( void ); |
134 |
|
|
|
135 |
|
|
void initializeAtoms( int nAtoms, Atom** atomArray ); |
136 |
|
|
void initializeBonds( int nBonds, Bond** bondArray, |
137 |
|
|
bond_pair* the_bonds ); |
138 |
|
|
void initializeBends( int nBends, Bend** bendArray, |
139 |
|
|
bend_set* the_bends ); |
140 |
|
|
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
141 |
|
|
torsion_set* the_torsions ); |
142 |
mmeineke |
424 |
|
143 |
|
|
void initForceField( int ljMixRule ); |
144 |
|
|
|
145 |
mmeineke |
377 |
private: |
146 |
|
|
|
147 |
|
|
void fastForward( char* stopText, char* searchOwner ); |
148 |
mmeineke |
420 |
|
149 |
mmeineke |
377 |
}; |
150 |
mmeineke |
559 |
|
151 |
chuckv |
500 |
class EAM_FF : public ForceFields{ |
152 |
mmeineke |
377 |
|
153 |
chuckv |
500 |
public: |
154 |
|
|
EAM_FF(); |
155 |
|
|
virtual ~EAM_FF(); |
156 |
|
|
|
157 |
|
|
|
158 |
|
|
void readParams(); |
159 |
|
|
void cleanMe( void ); |
160 |
|
|
|
161 |
|
|
void initializeAtoms( int nAtoms, Atom** atomArray ); |
162 |
|
|
void initializeBonds( int nBonds, Bond** bondArray, |
163 |
|
|
bond_pair* the_bonds ); |
164 |
|
|
void initializeBends( int nBends, Bend** bendArray, |
165 |
|
|
bend_set* the_bends ); |
166 |
|
|
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
167 |
|
|
torsion_set* the_torsions ); |
168 |
|
|
|
169 |
|
|
void initForceField( int ljMixRule ); |
170 |
|
|
|
171 |
chuckv |
657 |
void calcRcut( void ); |
172 |
chuckv |
500 |
private: |
173 |
|
|
|
174 |
|
|
void fastForward( char* stopText, char* searchOwner ); |
175 |
chuckv |
657 |
|
176 |
|
|
double eamRcut; |
177 |
chuckv |
500 |
}; |
178 |
|
|
|
179 |
chrisfen |
976 |
class WATER : public ForceFields{ |
180 |
|
|
|
181 |
|
|
public: |
182 |
|
|
WATER(); |
183 |
|
|
virtual ~WATER(); |
184 |
|
|
|
185 |
|
|
void readParams(); |
186 |
|
|
void cleanMe( void ); |
187 |
|
|
void initializeAtoms( int nAtoms, Atom** atomArray ); |
188 |
|
|
void initializeBonds( int nBonds, Bond** bondArray, |
189 |
|
|
bond_pair* the_bonds ); |
190 |
|
|
void initializeBends( int nBends, Bend** bendArray, |
191 |
|
|
bend_set* the_bends ); |
192 |
|
|
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
193 |
|
|
torsion_set* the_torsions ); |
194 |
|
|
void initForceField( int ljMixRule ); |
195 |
|
|
|
196 |
|
|
private: |
197 |
|
|
|
198 |
|
|
void fastForward( char* stopText, char* searchOwner ); |
199 |
chrisfen |
999 |
void sectionSearch( char* secHead, char* stopText, char* searchOwner ); |
200 |
|
|
|
201 |
chrisfen |
976 |
}; |
202 |
|
|
|
203 |
mmeineke |
377 |
#endif |
204 |
|
|
|