ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/SimInfo.cpp
Revision: 457
Committed: Fri Apr 4 19:16:11 2003 UTC (21 years, 3 months ago) by gezelter
File size: 1972 byte(s)
Log Message:
Fixes for ExtendedSystem

File Contents

# User Rev Content
1 mmeineke 377 #include <cstdlib>
2     #include <cstring>
3    
4    
5     #include "SimInfo.hpp"
6     #define __C
7     #include "fSimulation.h"
8     #include "simError.h"
9    
10     #include "fortranWrappers.hpp"
11    
12     SimInfo* currentInfo;
13    
14     SimInfo::SimInfo(){
15     excludes = NULL;
16     n_constraints = 0;
17     n_oriented = 0;
18     n_dipoles = 0;
19     the_integrator = NULL;
20     setTemp = 0;
21     thermalTime = 0.0;
22 mmeineke 420 rCut = 0.0;
23 mmeineke 377
24     usePBC = 0;
25     useLJ = 0;
26     useSticky = 0;
27     useDipole = 0;
28     useReactionField = 0;
29     useGB = 0;
30     useEAM = 0;
31    
32 gezelter 457 wrapMeSimInfo( this );
33     }
34 mmeineke 377
35 gezelter 457 void SimInfo::setBox(double newBox[3]) {
36     box_x = newBox[0];
37     box_y = newBox[1];
38     box_z = newBox[2];
39     setFortranBoxSize(newBox);
40     }
41 mmeineke 377
42 gezelter 457 void SimInfo::getBox(double theBox[3]) {
43     theBox[0] = box_x;
44     theBox[1] = box_y;
45     theBox[2] = box_z;
46 mmeineke 377 }
47 gezelter 457
48 mmeineke 377 void SimInfo::refreshSim(){
49    
50     simtype fInfo;
51     int isError;
52 mmeineke 424 int* excl;
53 mmeineke 377
54     fInfo.box[0] = box_x;
55     fInfo.box[1] = box_y;
56     fInfo.box[2] = box_z;
57    
58     fInfo.rlist = rList;
59     fInfo.rcut = rCut;
60 gezelter 394 fInfo.rrf = ecr;
61     fInfo.rt = ecr - est;
62 mmeineke 377 fInfo.dielect = dielectric;
63    
64     fInfo.SIM_uses_PBC = usePBC;
65 mmeineke 443 //fInfo.SIM_uses_LJ = 0;
66 chuckv 439 fInfo.SIM_uses_LJ = useLJ;
67 mmeineke 443 fInfo.SIM_uses_sticky = useSticky;
68     //fInfo.SIM_uses_sticky = 0;
69 gezelter 394 fInfo.SIM_uses_dipoles = useDipole;
70 mmeineke 402 //fInfo.SIM_uses_dipoles = 0;
71 mmeineke 443 //fInfo.SIM_uses_RF = useReactionField;
72     fInfo.SIM_uses_RF = 0;
73 mmeineke 377 fInfo.SIM_uses_GB = useGB;
74     fInfo.SIM_uses_EAM = useEAM;
75    
76 mmeineke 424 excl = Exclude::getArray();
77 mmeineke 377
78     isError = 0;
79    
80 chuckv 441 // fInfo;
81     // n_atoms;
82     // identArray;
83     // n_exclude;
84     // excludes;
85     // nGlobalExcludes;
86     // globalExcludes;
87     // isError;
88 mmeineke 377
89 mmeineke 424 setFsimulation( &fInfo, &n_atoms, identArray, &n_exclude, excl,
90     &nGlobalExcludes, globalExcludes, &isError );
91 mmeineke 377
92     if( isError ){
93    
94     sprintf( painCave.errMsg,
95     "There was an error setting the simulation information in fortran.\n" );
96     painCave.isFatal = 1;
97     simError();
98     }
99    
100     #ifdef IS_MPI
101     sprintf( checkPointMsg,
102     "succesfully sent the simulation information to fortran.\n");
103     MPIcheckPoint();
104     #endif // is_mpi
105     }
106