ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/headers/ForceFields.hpp
Revision: 240
Committed: Wed Jan 22 21:45:20 2003 UTC (22 years, 3 months ago) by chuckv
File size: 2939 byte(s)
Log Message:
Added init function to c++ force module.

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 // typedef struct{
45 // int a, b;
46 // } bond_pair;
47
48 // typedef struct{
49 // int a, b, c;
50 // } bend_set;
51
52 // typedef struct{
53 // int a, b, c, d;
54 // } torsion_set;
55
56
57 class ForceFields{
58
59 public:
60 ForceFields(){ frcFile = NULL; entry_plug = NULL; }
61 virtual ~ForceFields(){}
62
63 void setSimInfo( SimInfo* the_entry_plug ) { entry_plug = the_entry_plug; }
64 virtual void initializeAtoms( void ) = 0;
65 virtual void initializeBonds( bond_pair* the_bonds ) = 0;
66 virtual void initializeBends( bend_set* the_bends ) = 0;
67 virtual void initializeTorsions( torsion_set* the_torsions ) = 0;
68 virtual void doForces( void ) = 0;
69
70 protected:
71
72 FILE *frcFile;
73 SimInfo* entry_plug;
74
75 int lineNum;
76 char readLine[500];
77 char* eof_test;
78
79 };
80
81 class TraPPEFF : public ForceFields{
82
83 public:
84 TraPPEFF();
85 virtual ~TraPPEFF();
86
87 void initializeAtoms( void );
88 void initializeBonds( bond_pair* the_bonds );
89 void initializeBends( bend_set* the_bends );
90 void initializeTorsions( torsion_set* the_torsions );
91 void doForces( void ) {}
92 };
93
94
95 class DipoleTestFF : public ForceFields{
96
97 public:
98 DipoleTestFF();
99 virtual ~DipoleTestFF();
100
101 void initializeAtoms( void );
102 void initializeBonds( bond_pair* the_bonds );
103 void initializeBends( bend_set* the_bends );
104 void initializeTorsions( torsion_set* the_torsions );
105 void doForces( void ) {}
106 };
107
108 class TraPPE_ExFF : public ForceFields{
109
110 public:
111 TraPPE_ExFF();
112 virtual ~TraPPE_ExFF();
113
114 void initializeAtoms( void );
115 void initializeBonds( bond_pair* the_bonds );
116 void initializeBends( bend_set* the_bends );
117 void initializeTorsions( torsion_set* the_torsions );
118 void doForces( void ) {}
119 };
120
121 class LJ_FF : public ForceFields{
122
123 public:
124 LJ_FF();
125 virtual ~LJ_FF();
126
127 void initializeAtoms( void );
128 void initializeBonds( bond_pair* the_bonds );
129 void initializeBends( bend_set* the_bends );
130 void initializeTorsions( torsion_set* the_torsions );
131 void setLJfortran( void (*fortranSub)( double* positionArray,
132 double* forceArray,
133 double* potentialEnergy,
134 short int* doPotentialCalc ) ){
135 doLJfortran = fortranSub;
136 }
137 void doForces( void );
138
139 private:
140
141 void fastForward( char* stopText, char* searchOwner );
142
143 // set our sister fortran module's function to be our own.
144 void wrapMe( void );
145 void (*doLJfortran)( double* positionArray,
146 double* forceArray,
147 double* potentialEnergy,
148 short int* doPotentialCalc );
149 void initFortran( void );
150 };
151
152 #endif