ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE_old/src/mdtools/libmdCode/ForceFields.hpp
Revision: 290
Committed: Thu Feb 27 21:25:47 2003 UTC (21 years, 6 months ago) by chuckv
File size: 3663 byte(s)
Log Message:
Made changes to lj_FF.cpp to pass stress tensor.

File Contents

# Content
1 #ifndef __FORCEFIELDS_H__
2 #define __FORCEFIELDS_H__
3
4 #include <cstdio>
5 #include <cstdlib>
6
7 #include "Atom.hpp"
8 #include "SimInfo.hpp"
9
10 #ifdef IS_MPI
11 #include "mpiForceField.h"
12 #endif
13
14 class bond_pair{
15 public:
16 bond_pair(){}
17 ~bond_pair(){}
18
19 int a;
20 int b;
21 };
22
23 class bend_set{
24 public:
25 bend_set(){}
26 ~bend_set(){}
27
28 int a;
29 int b;
30 int c;
31 };
32
33 class torsion_set{
34 public:
35 torsion_set(){}
36 ~torsion_set(){}
37
38 int a;
39 int b;
40 int c;
41 int d;
42 };
43
44
45
46 class ForceFields{
47
48 public:
49 ForceFields(){ frcFile = NULL; entry_plug = NULL; }
50 virtual ~ForceFields(){}
51
52 void setSimInfo( SimInfo* the_entry_plug ) { entry_plug = the_entry_plug; }
53 virtual void initializeAtoms( void ) = 0;
54 virtual void initializeBonds( bond_pair* the_bonds ) = 0;
55 virtual void initializeBends( bend_set* the_bends ) = 0;
56 virtual void initializeTorsions( torsion_set* the_torsions ) = 0;
57 virtual void doForces( int calcPot ) = 0;
58
59 protected:
60
61 FILE *frcFile;
62 SimInfo* entry_plug;
63
64 int lineNum;
65 char readLine[500];
66 char* eof_test;
67
68 };
69
70 class TraPPEFF : public ForceFields{
71
72 public:
73 TraPPEFF();
74 virtual ~TraPPEFF();
75
76 void initializeAtoms( void );
77 void initializeBonds( bond_pair* the_bonds );
78 void initializeBends( bend_set* the_bends );
79 void initializeTorsions( torsion_set* the_torsions );
80 void doForces( int ) {}
81 };
82
83
84 class DipoleTestFF : public ForceFields{
85
86 public:
87 DipoleTestFF();
88 virtual ~DipoleTestFF();
89
90 void initializeAtoms( void );
91 void initializeBonds( bond_pair* the_bonds );
92 void initializeBends( bend_set* the_bends );
93 void initializeTorsions( torsion_set* the_torsions );
94 void doForces( int ) {}
95 };
96
97 class TraPPE_ExFF : public ForceFields{
98
99 public:
100 TraPPE_ExFF();
101 virtual ~TraPPE_ExFF();
102
103 void initializeAtoms( void );
104 void initializeBonds( bond_pair* the_bonds );
105 void initializeBends( bend_set* the_bends );
106 void initializeTorsions( torsion_set* the_torsions );
107 void doForces( int ) {}
108 };
109
110 class LJ_FF : public ForceFields{
111
112 public:
113 LJ_FF();
114 virtual ~LJ_FF();
115
116 void initializeAtoms( void );
117 void initializeBonds( bond_pair* the_bonds );
118 void initializeBends( bend_set* the_bends );
119 void initializeTorsions( torsion_set* the_torsions );
120 void setLJfortran( void (*fortranSub)( double* positionArray,
121 double* forceArray,
122 double* potentialEnergy,
123 double* tau,
124 short int* doPotentialCalc,
125 int* isError ) ){
126 doLJfortran = fortranSub;
127 }
128 void doForces( int );
129
130 private:
131
132 void fastForward( char* stopText, char* searchOwner );
133
134 // set our sister fortran module's function to be our own.
135 void wrapMe( void );
136 void (*doLJfortran)( double* positionArray,
137 double* forceArray,
138 double* potentialEnergy,
139 double* tau,
140 short int* doPotentialCalc,
141 int* isError );
142 void initFortran( void );
143 };
144
145 class LJ_FF : public ForceFields{
146
147 public:
148 SSD_FF();
149 virtual ~SSD_FF();
150
151 void initializeAtoms( void );
152 void initializeBonds( bond_pair* the_bonds );
153 void initializeBends( bend_set* the_bends );
154 void initializeTorsions( torsion_set* the_torsions );
155 void setSSDfortran( void (*fortranSub)( double* positionArray,
156 double* forceArray,
157 double* potentialEnergy,
158 short int* doPotentialCalc ) ){
159 doSSDfortran = fortranSub;
160 }
161 void doForces( int );
162
163 private:
164
165 void fastForward( char* stopText, char* searchOwner );
166
167 // set our sister fortran module's function to be our own.
168 void wrapMe( void );
169 void (*doSSDfortran)( double* positionArray,
170 double* forceArray,
171 double* potentialEnergy,
172 short int* doPotentialCalc );
173 void initFortran( void );
174 };
175
176 #endif