4 |
|
#define MK_STR(s) # s |
5 |
|
#define STR_DEFINE(t, s) t = MK_STR(s) |
6 |
|
|
7 |
– |
|
7 |
|
#include <stdio.h> |
8 |
|
#include <stdlib.h> |
9 |
|
#include <math.h> |
10 |
+ |
#include <string> |
11 |
+ |
#include <map> |
12 |
|
|
13 |
|
#include "primitives/Atom.hpp" |
14 |
|
#include "brains/SimInfo.hpp" |
15 |
|
#include "primitives/StuntDouble.hpp" |
16 |
+ |
#include "types/ShapeAtomType.hpp" |
17 |
+ |
#include "io/basic_ifstrstream.hpp" |
18 |
|
|
19 |
|
#ifdef IS_MPI |
20 |
|
#include "UseTheForce/mpiForceField.h" |
21 |
|
#endif |
22 |
|
|
23 |
+ |
using namespace std; |
24 |
+ |
using namespace oopse; |
25 |
+ |
|
26 |
|
class bond_pair{ |
27 |
|
public: |
28 |
|
bond_pair(){} |
61 |
|
class ForceFields{ |
62 |
|
|
63 |
|
public: |
64 |
< |
ForceFields(){ frcFile = NULL; entry_plug = NULL; has_variant=0;} |
65 |
< |
ForceFields(char * theVariant ){ frcFile = NULL; entry_plug = NULL; has_variant=1; strcpy(variant, theVariant); } |
64 |
> |
ForceFields(){ |
65 |
> |
frcFile = NULL; |
66 |
> |
entry_plug = NULL; |
67 |
> |
has_variant=0; |
68 |
> |
ffPath_env = "FORCE_PARAM_PATH"; |
69 |
> |
ffPath = getenv( ffPath_env ); |
70 |
> |
if( ffPath == NULL ) { |
71 |
> |
STR_DEFINE(ffPath, FRC_PATH ); |
72 |
> |
} |
73 |
> |
} |
74 |
> |
ForceFields(char * theVariant){ |
75 |
> |
frcFile = NULL; |
76 |
> |
entry_plug = NULL; |
77 |
> |
has_variant=1; |
78 |
> |
strcpy(variant, theVariant); |
79 |
> |
ffPath_env = "FORCE_PARAM_PATH"; |
80 |
> |
ffPath = getenv( ffPath_env ); |
81 |
> |
if( ffPath == NULL ) { |
82 |
> |
STR_DEFINE(ffPath, FRC_PATH ); |
83 |
> |
} |
84 |
> |
} |
85 |
|
virtual ~ForceFields(){} |
86 |
|
|
87 |
|
void setSimInfo( SimInfo* the_entry_plug ) { entry_plug = the_entry_plug; } |
106 |
|
virtual void setRcut( double LJrcut ); |
107 |
|
virtual void doForces( int calcPot, int calcStress ); |
108 |
|
|
84 |
– |
virtual double getAtomTypeMass(char* atomType) = 0; |
85 |
– |
|
86 |
– |
|
109 |
|
protected: |
110 |
|
|
111 |
|
void initFortran( int useReactionField ); |
112 |
|
|
91 |
– |
|
113 |
|
FILE *frcFile; |
114 |
|
SimInfo* entry_plug; |
115 |
|
|
120 |
|
short int has_variant; |
121 |
|
double bigSigma; |
122 |
|
|
123 |
+ |
ifstrstream forceFile; |
124 |
+ |
map<string, AtomType*> atomTypeMap; |
125 |
+ |
char* ffPath_env; |
126 |
+ |
char* ffPath; |
127 |
+ |
|
128 |
|
}; |
129 |
|
|
130 |
|
|
146 |
|
torsion_set* the_torsions ); |
147 |
|
|
148 |
|
void initForceField(); |
123 |
– |
double getAtomTypeMass(char* atomType); |
149 |
|
|
150 |
|
private: |
151 |
|
|
171 |
|
torsion_set* the_torsions ); |
172 |
|
|
173 |
|
void initForceField( ); |
149 |
– |
double getAtomTypeMass(char* atomType); |
174 |
|
|
175 |
+ |
|
176 |
|
private: |
177 |
|
|
178 |
|
void fastForward( char* stopText, char* searchOwner ); |
201 |
|
void initForceField(); |
202 |
|
|
203 |
|
void calcRcut( void ); |
204 |
< |
double getAtomTypeMass(char* atomType); |
204 |
> |
|
205 |
|
private: |
206 |
|
|
207 |
|
void fastForward( char* stopText, char* searchOwner ); |
225 |
|
void initializeTorsions( int nTorsions, Torsion** torsionArray, |
226 |
|
torsion_set* the_torsions ); |
227 |
|
void initForceField(); |
203 |
– |
double getAtomTypeMass(char* atomType); |
228 |
|
|
229 |
+ |
|
230 |
|
private: |
231 |
|
|
232 |
|
void fastForward( char* stopText, char* searchOwner ); |
237 |
|
class Shapes_FF : public ForceFields{ |
238 |
|
|
239 |
|
public: |
240 |
< |
Shapes_FF(); |
241 |
< |
Shapes_FF(char* the_variant); |
240 |
> |
Shapes_FF() : ForceFields() {}; |
241 |
> |
Shapes_FF(char* the_variant) : ForceFields(the_variant) {}; |
242 |
|
virtual ~Shapes_FF(); |
243 |
|
|
244 |
< |
void readForceFile(); |
244 |
> |
void readParams(); |
245 |
|
void cleanMe( void ); |
246 |
|
|
247 |
|
void initializeAtoms( int nAtoms, Atom** atomArray ); |
254 |
|
|
255 |
|
void initForceField(); |
256 |
|
|
257 |
+ |
void parseShapeFile(string shapeFileName, ShapeAtomType* st); |
258 |
+ |
|
259 |
|
void calcRcut( void ); |
233 |
– |
double getAtomTypeMass(char* atomType); |
260 |
|
|
261 |
|
private: |
262 |
< |
char* ffPath_env; |
262 |
> |
|
263 |
> |
double findLargestContactDistance(ShapeAtomType* st); |
264 |
|
double shapesRcut; |
265 |
|
|
266 |
|
}; |