ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimInfo.hpp
Revision: 670
Committed: Thu Aug 7 21:47:18 2003 UTC (20 years, 11 months ago) by mmeineke
File size: 5873 byte(s)
Log Message:
switched SimInfo to use a system configuration from SimState rather than arrays from Atom

File Contents

# User Rev Content
1 mmeineke 377 #ifndef __SIMINFO_H__
2     #define __SIMINFO_H__
3    
4 tim 658 #include <map>
5     #include <string>
6     #include <vector>
7 mmeineke 377
8     #include "Atom.hpp"
9     #include "Molecule.hpp"
10     #include "AbstractClasses.hpp"
11     #include "MakeStamps.hpp"
12 mmeineke 670 #include "SimState.hpp"
13 mmeineke 377
14     #define __C
15     #include "fSimulation.h"
16     #include "fortranWrapDefines.hpp"
17 tim 658 #include "GenericData.hpp"
18 mmeineke 377
19    
20    
21     class SimInfo{
22    
23     public:
24    
25     SimInfo();
26 tim 660 ~SimInfo();
27 mmeineke 377
28     int n_atoms; // the number of atoms
29     Atom **atoms; // the array of atom objects
30    
31     double tau[9]; // the stress tensor
32    
33     unsigned int n_bonds; // number of bends
34     unsigned int n_bends; // number of bends
35     unsigned int n_torsions; // number of torsions
36     unsigned int n_oriented; // number of of atoms with orientation
37 gezelter 458 unsigned int ndf; // number of actual degrees of freedom
38     unsigned int ndfRaw; // number of settable degrees of freedom
39 mmeineke 377
40     unsigned int setTemp; // boolean to set the temperature at each sampleTime
41    
42     unsigned int n_dipoles; // number of dipoles
43    
44 mmeineke 626
45 mmeineke 377 int n_exclude; // the # of pairs excluded from long range forces
46 mmeineke 427 Exclude** excludes; // the pairs themselves
47 mmeineke 377
48     int nGlobalExcludes;
49     int* globalExcludes; // same as above, but these guys participate in
50     // no long range forces.
51    
52     int* identArray; // array of unique identifiers for the atoms
53 gezelter 483 int* molMembershipArray; // map of atom numbers onto molecule numbers
54 mmeineke 377
55     int n_constraints; // the number of constraints on the system
56    
57     unsigned int n_SRI; // the number of short range interactions
58    
59     double lrPot; // the potential energy from the long range calculations.
60    
61 gezelter 588 double Hmat[3][3]; // the periodic boundry conditions. The Hmat is the
62     // column vectors of the x, y, and z box vectors.
63     // h1 h2 h3
64     // [ Xx Yx Zx ]
65     // [ Xy Yy Zy ]
66     // [ Xz Yz Zz ]
67     //
68     double HmatInv[3][3];
69 mmeineke 568
70 gezelter 621 double boxL[3]; // The Lengths of the 3 column vectors of Hmat
71 mmeineke 572 double boxVol;
72     int orthoRhombic;
73 mmeineke 568
74    
75 mmeineke 626 double dielectric; // the dielectric of the medium for reaction field
76 mmeineke 568
77 mmeineke 377
78     int usePBC; // whether we use periodic boundry conditions.
79     int useLJ;
80     int useSticky;
81     int useDipole;
82     int useReactionField;
83     int useGB;
84     int useEAM;
85    
86    
87     double dt, run_time; // the time step and total time
88     double sampleTime, statusTime; // the position and energy dump frequencies
89     double target_temp; // the target temperature of the system
90     double thermalTime; // the temp kick interval
91 gezelter 637 double currentTime; // Used primarily for correlation Functions
92 mmeineke 377
93     int n_mol; // n_molecules;
94     Molecule* molecules; // the array of molecules
95    
96     int nComponents; // the number of componentsin the system
97     int* componentsNmol; // the number of molecules of each component
98     MoleculeStamp** compStamps;// the stamps matching the components
99     LinkedMolStamp* headStamp; // list of stamps used in the simulation
100    
101    
102     char ensemble[100]; // the enesemble of the simulation (NVT, NVE, etc. )
103     char mixingRule[100]; // the mixing rules for Lennard jones/van der walls
104 mmeineke 542 BaseIntegrator *the_integrator; // the integrator of the simulation
105 mmeineke 377
106     char finalName[300]; // the name of the eor file to be written
107     char sampleName[300]; // the name of the dump file to be written
108     char statusName[300]; // the name of the stat file to be written
109    
110    
111     // refreshes the sim if things get changed (load balanceing, volume
112     // adjustment, etc.)
113    
114     void refreshSim( void );
115    
116    
117     // sets the internal function pointer to fortran.
118    
119     void setInternal( void (*fSetup) setFortranSimList,
120 mmeineke 626 void (*fBox) setFortranBoxList,
121     void (*fCut) notifyFortranCutOffList ){
122 mmeineke 377 setFsimulation = fSetup;
123     setFortranBoxSize = fBox;
124 mmeineke 626 notifyFortranCutOffs = fCut;
125 mmeineke 377 }
126    
127 gezelter 458 int getNDF();
128     int getNDFraw();
129    
130 gezelter 457 void setBox( double newBox[3] );
131 gezelter 588 void setBoxM( double newBox[3][3] );
132     void getBoxM( double theBox[3][3] );
133 gezelter 574 void scaleBox( double scale );
134 mmeineke 626
135     void setRcut( double theRcut );
136     void setEcr( double theEcr );
137     void setEcr( double theEcr, double theEst );
138 gezelter 457
139 mmeineke 626 double getRcut( void ) { return rCut; }
140     double getRlist( void ) { return rList; }
141     double getEcr( void ) { return ecr; }
142     double getEst( void ) { return est; }
143    
144 mmeineke 644 void setTime( double theTime ) { currentTime = theTime; }
145 mmeineke 643 void incrTime( double dt ) { currentTime += dt; }
146     void decrTime( double dt ) { currentTime -= dt; }
147 mmeineke 644 double getTime( void ) { return currentTime; }
148 mmeineke 626
149 mmeineke 568 void wrapVector( double thePos[3] );
150    
151 gezelter 588 void matMul3(double a[3][3], double b[3][3], double out[3][3]);
152     void matVecMul3(double m[3][3], double inVec[3], double outVec[3]);
153     void invertMat3(double in[3][3], double out[3][3]);
154 mmeineke 597 void transposeMat3(double in[3][3], double out[3][3]);
155     void printMat3(double A[3][3]);
156     void printMat9(double A[9]);
157 gezelter 588 double matDet3(double m[3][3]);
158 mmeineke 670
159     SimState* getConfiguration( void ) { return myConfiguration; }
160 gezelter 588
161 tim 658 void addProperty(GenericData* prop);
162     GenericData* getProperty(const string& propName);
163     vector<GenericData*> getProperties();
164 mmeineke 670
165 mmeineke 377 private:
166 mmeineke 626
167 mmeineke 670 SimState* myConfiguration;
168    
169 mmeineke 626 double origRcut, origEcr;
170     int boxIsInit, haveOrigRcut, haveOrigEcr;
171    
172     double oldEcr;
173     double oldRcut;
174    
175     double rList, rCut; // variables for the neighborlist
176     double ecr; // the electrostatic cutoff radius
177     double est; // the electrostatic skin thickness
178     double maxCutoff;
179 mmeineke 377
180 gezelter 588 void calcHmatInv( void );
181 mmeineke 568 void calcBoxL();
182 mmeineke 626 void checkCutOffs( void );
183 mmeineke 568
184 mmeineke 377 // private function to initialize the fortran side of the simulation
185     void (*setFsimulation) setFortranSimList;
186    
187     void (*setFortranBoxSize) setFortranBoxList;
188 mmeineke 626
189     void (*notifyFortranCutOffs) notifyFortranCutOffList;
190 tim 658
191     //Addtional Properties of SimInfo
192     map<string, GenericData*> properties;
193 mmeineke 626
194 mmeineke 377 };
195    
196    
197    
198     #endif