ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-3.0/src/UseTheForce/ForceFields.hpp
(Generate patch)

Comparing trunk/OOPSE-3.0/src/UseTheForce/ForceFields.hpp (file contents):
Revision 1628 by gezelter, Thu Oct 21 20:15:31 2004 UTC vs.
Revision 1655 by gezelter, Wed Oct 27 02:20:29 2004 UTC

# Line 4 | Line 4
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(){}
# Line 55 | Line 61 | class ForceFields{ (public)
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 = getenv("FORCE_PARAM_PATH");
69 >    if( ffPath.empty() ) {
70 >      STR_DEFINE(ffPath, FRC_PATH );
71 >    }  
72 >  }
73 >  ForceFields(string theVariant){
74 >    frcFile = NULL;
75 >    entry_plug = NULL;
76 >    has_variant=1;
77 >    variant = theVariant;
78 >    ffPath = getenv("FORCE_PARAM_PATH");
79 >    if( ffPath.empty() ) {
80 >      STR_DEFINE(ffPath, FRC_PATH );
81 >    }  
82 >  }
83    virtual ~ForceFields(){}
84    
85    void setSimInfo( SimInfo* the_entry_plug ) { entry_plug = the_entry_plug; }
# Line 81 | Line 104 | class ForceFields{ (public)
104    virtual void setRcut( double LJrcut );
105    virtual void doForces( int calcPot, int calcStress );
106  
84  virtual double getAtomTypeMass(char* atomType) = 0;
85
86
107   protected:
108    
109    void initFortran( int useReactionField );
110    
91
111    FILE *frcFile;
112    SimInfo* entry_plug;
113    
114    int lineNum;
115    char readLine[500];
116    char* eof_test;
98  char variant[100];
117    short int has_variant;
118    double bigSigma;
119  
120 +  string ffPath;
121 +  ifstrstream forceFile;
122 +  bool hasVariant;
123 +  string variant;
124 +  map<string, AtomType*> atomTypeMap;
125 +  // map<pair<string,string>, BondType*> bondTypeMap;
126 +  // map<tuple3<string,string,string>, BendType*> bendTypeMap;
127 +  // map<tuple4<string,string,string,string>, TorsionType*> torsionTypeMap;
128 +
129   };
130  
131  
132   class DUFF : public ForceFields{
133  
134   public:
135 <  DUFF();
135 >  DUFF() : ForceFields() {};
136    virtual ~DUFF();
137  
138    void readParams();
# Line 120 | Line 147 | class DUFF : public ForceFields{ (public)
147                             torsion_set* the_torsions );
148  
149    void initForceField();
123  double getAtomTypeMass(char* atomType);
150  
151   private:
152    
# Line 130 | Line 156 | class LJFF : public ForceFields{ (public)
156   class LJFF : public ForceFields{
157  
158   public:
159 <  LJFF();
159 >  LJFF() : ForceFields() {};
160    virtual ~LJFF();
161    
162  
# Line 146 | Line 172 | class LJFF : public ForceFields{ (public)
172                             torsion_set* the_torsions );
173  
174    void initForceField( );
149  double getAtomTypeMass(char* atomType);
175  
176 +
177   private:
178  
179    void fastForward( char* stopText, char* searchOwner );
# Line 157 | Line 183 | class EAM_FF : public ForceFields{ (public)
183   class EAM_FF : public ForceFields{
184  
185   public:
186 <  EAM_FF();
187 <  EAM_FF(char* the_variant);
186 >  EAM_FF() : ForceFields();
187 >  EAM_FF(string the_variant) : ForceFields(the_variant);
188    virtual ~EAM_FF();
189    
190  
# Line 176 | Line 202 | class EAM_FF : public ForceFields{ (public)
202    void initForceField();
203  
204    void calcRcut( void );
205 <  double getAtomTypeMass(char* atomType);
205 >
206   private:
207  
208    void fastForward( char* stopText, char* searchOwner );
# Line 187 | Line 213 | class WATER : public ForceFields{ (public)
213   class WATER : public ForceFields{
214  
215   public:
216 <  WATER();
216 >  WATER() : ForceFields() {};
217    virtual ~WATER();
218  
219    void readParams();
# Line 200 | Line 226 | class WATER : public ForceFields{ (public)
226    void initializeTorsions( int nTorsions, Torsion** torsionArray,
227                             torsion_set* the_torsions );
228    void initForceField();
203  double getAtomTypeMass(char* atomType);
229  
230 +
231   private:
232    
233    void fastForward( char* stopText, char* searchOwner );
# Line 212 | Line 238 | class Shapes_FF : public ForceFields{ (public)
238   class Shapes_FF : public ForceFields{
239  
240   public:
241 <  Shapes_FF();
242 <  Shapes_FF(char* the_variant);
241 >  Shapes_FF() : ForceFields() {};
242 >  Shapes_FF(char* the_variant) : ForceFields(the_variant) {};
243    virtual ~Shapes_FF();
244    
219
245    void readParams();
246    void cleanMe( void );
247  
# Line 230 | Line 255 | class Shapes_FF : public ForceFields{ (public)
255  
256    void initForceField();
257  
258 +  void parseShapeFile(string shapeFileName, ShapeAtomType* st);
259 +
260    void calcRcut( void );
261 <  double getAtomTypeMass(char* atomType);
261 >
262   private:
263  
264 <  void fastForward( char* stopText, char* searchOwner );
238 <  
264 >  double findLargestContactDistance(ShapeAtomType* st);
265    double shapesRcut;
266 +
267   };
268  
269  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines