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 1646 by chrisfen, Tue Oct 26 18:02:46 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 + 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_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 81 | Line 106 | class ForceFields{ (public)
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    
# Line 99 | 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 120 | Line 146 | class DUFF : public ForceFields{ (public)
146                             torsion_set* the_torsions );
147  
148    void initForceField();
123  double getAtomTypeMass(char* atomType);
149  
150   private:
151    
# Line 146 | Line 171 | class LJFF : public ForceFields{ (public)
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 );
# Line 176 | Line 201 | class EAM_FF : public ForceFields{ (public)
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 200 | Line 225 | class WATER : public ForceFields{ (public)
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 );
# Line 212 | 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    
244 <  void readForceFile();
244 >  void readParams();
245    void cleanMe( void );
246  
247    void initializeAtoms( int nAtoms, Atom** atomArray );
# Line 229 | Line 254 | class Shapes_FF : public ForceFields{ (public)
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   };

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines