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 1520 by gezelter, Mon Oct 4 15:27:35 2004 UTC vs.
Revision 1650 by gezelter, Tue Oct 26 22:24:52 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 < #include "UseTheForce/fForceField.h"
24 < #include "UseTheForce/fortranWrapDefines.hpp"
23 > using namespace std;
24 > using namespace oopse;
25  
26   class bond_pair{
27   public:
# Line 58 | 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_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; }
# Line 76 | Line 98 | class ForceFields{ (public)
98                                  bend_set* the_bends ) = 0;
99    virtual void initializeTorsions( int nTorsions, Torsion** torsionArray,
100                                     torsion_set* the_torsions ) = 0;
101 <  virtual void initForceField( int ljMixRule ) = 0;
101 >  virtual void initForceField() = 0;
102    virtual void initRestraints();
103    virtual void dumpzAngle();
104  
# Line 84 | Line 106 | class ForceFields{ (public)
106    virtual void setRcut( double LJrcut );
107    virtual void doForces( int calcPot, int calcStress );
108  
87  virtual double getAtomTypeMass(char* atomType) = 0;
88
89  void setFortranForceLoop( doForceLoop_TD fsub ){
90    fortranForceLoop = fsub;
91  }
92
109   protected:
110    
111 <  void initFortran( int ljMixPolicy, int useReactionField );
112 <  doForceLoop_TD fortranForceLoop;
97 <
111 >  void initFortran( int useReactionField );
112 >  
113    FILE *frcFile;
114    SimInfo* entry_plug;
115    
# Line 105 | Line 120 | class ForceFields{ (public)
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  
# Line 125 | Line 145 | class DUFF : public ForceFields{ (public)
145    void initializeTorsions( int nTorsions, Torsion** torsionArray,
146                             torsion_set* the_torsions );
147  
148 <  void initForceField( int ljMixRule );
129 <  double getAtomTypeMass(char* atomType);
148 >  void initForceField();
149  
150   private:
151    
# Line 151 | Line 170 | class LJFF : public ForceFields{ (public)
170    void initializeTorsions( int nTorsions, Torsion** torsionArray,
171                             torsion_set* the_torsions );
172  
173 <  void initForceField( int ljMixRule );
155 <  double getAtomTypeMass(char* atomType);
173 >  void initForceField( );
174  
175 +
176   private:
177  
178    void fastForward( char* stopText, char* searchOwner );
# Line 179 | Line 198 | class EAM_FF : public ForceFields{ (public)
198    void initializeTorsions( int nTorsions, Torsion** torsionArray,
199                             torsion_set* the_torsions );
200  
201 <  void initForceField( int ljMixRule );
201 >  void initForceField();
202  
203    void calcRcut( void );
204 <  double getAtomTypeMass(char* atomType);
204 >
205   private:
206  
207    void fastForward( char* stopText, char* searchOwner );
# Line 205 | Line 224 | class WATER : public ForceFields{ (public)
224                          bend_set* the_bends );
225    void initializeTorsions( int nTorsions, Torsion** torsionArray,
226                             torsion_set* the_torsions );
227 <  void initForceField( int ljMixRule );
209 <  double getAtomTypeMass(char* atomType);
227 >  void initForceField();
228  
229 +
230   private:
231    
232    void fastForward( char* stopText, char* searchOwner );
# Line 218 | Line 237 | class Shapes_FF : public ForceFields{ (public)
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    
225
244    void readParams();
245    void cleanMe( void );
246  
# Line 234 | Line 252 | class Shapes_FF : public ForceFields{ (public)
252    void initializeTorsions( int nTorsions, Torsion** torsionArray,
253                             torsion_set* the_torsions );
254  
255 <  void initForceField( int ljMixRule );
255 >  void initForceField();
256  
257 +  void parseShapeFile(string shapeFileName, ShapeAtomType* st);
258 +
259    void calcRcut( void );
260 <  double getAtomTypeMass(char* atomType);
260 >
261   private:
262  
263 <  void fastForward( char* stopText, char* searchOwner );
244 <  
263 >  double findLargestContactDistance(ShapeAtomType* st);
264    double shapesRcut;
265 +
266   };
267  
268  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines