ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE_old/src/mdtools/libmdCode/SimInfo.cpp
(Generate patch)

Comparing trunk/OOPSE_old/src/mdtools/libmdCode/SimInfo.cpp (file contents):
Revision 285 by mmeineke, Wed Feb 26 18:45:57 2003 UTC vs.
Revision 365 by mmeineke, Tue Mar 18 22:17:31 2003 UTC

# Line 1 | Line 1
1   #include <cstdlib>
2 + #include <cstring>
3  
4 +
5   #include "SimInfo.hpp"
6   #define __C
7   #include "fSimulation.h"
8 < extern "C"{
7 <  void wrapsimmod_( void (*wrapFunction)(void (*fSub)( int*, double*,
8 <                                                       double*, double*)));
9 < }
8 > #include "simError.h"
9  
10 < void wrapSimInfo(void (*fSub)( int*, double*, double*, double*));
10 > #include <fortranWrappers.hpp>
11  
12   SimInfo* currentInfo;
13  
# Line 21 | Line 20 | SimInfo::SimInfo(){
20    setTemp = 0;
21    thermalTime = 0.0;
22  
23 <  currentInfo = this;
24 <  wrapMe();
25 < }
23 >  usePBC = 0;
24 >  useLJ = 0;
25 >  useSticky = 0;
26 >  useDipole = 0;
27 >  useReactionField = 0;
28 >  useGB = 0;
29 >  useEAM = 0;
30  
31  
29 void SimInfo::wrapMe(){
32  
33 <  wrapsimmod_( wrapSimInfo );
33 >  wrapMeSimInfo( this );
34   }
35  
34
36   void SimInfo::refreshSim(){
36  
37  double box[3];
38  
39  box[0] = box_x;
40  box[1] = box_y;
41  box[2] = box_z;
37  
38 <  
38 >  simtype fInfo;
39 >  int isError;
40  
41 <  setFsimulation( &n_atoms, box, &rList, &rCut,&ensemble,
42 <                 &mixingRule,&usePBC);
43 < }
41 >  fInfo.box[0] = box_x;
42 >  fInfo.box[1] = box_y;
43 >  fInfo.box[2] = box_z;
44  
45 +  fInfo.rlist = rList;
46 +  fInfo.rcut = rCut;
47 +  fInfo.SIM_uses_PBC = usePBC;
48 +  fInfo.SIM_uses_LJ = useLJ;
49 +  fInfo.SIM_uses_sticky = useSticky;
50 +  fInfo.SIM_uses_dipoles = useDipole;
51 +  fInfo.SIM_uses_RF = useReactionField;
52 +  fInfo.SIM_uses_GB = useGB;
53 +  fInfo.SIM_uses_EAM = useEAM;
54  
55 < void wrapSimInfo(void (*fSub)( int*, double*, double*, double*)){
56 <  
57 <  currentInfo->setInternal(fSub);
55 >
56 >  isError = 0;
57 >  setFsimulation( &fInfo,
58 >                  &n_atoms,
59 >                  identArray,
60 >                  &n_exclude,
61 >                  excludes,
62 >                  &nGlobalExcludes,
63 >                  globalExcludes,
64 >                  &isError );
65 >
66 >  if( isError ){
67 >
68 >    sprintf( painCave.errMsg,
69 >             "There was an error setting the simulation information in fortran.\n" );
70 >    painCave.isFatal = 1;
71 >    simError();
72 >  }
73 >
74 > #ifdef IS_MPI
75 >  sprintf( checkPointMsg,
76 >           "succesfully sent the simulation information to fortran.\n");
77 >  MPIcheckPoint();
78 > #endif // is_mpi
79   }
80 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines