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 289 by mmeineke, Wed Feb 26 18:45:57 2003 UTC vs.
Revision 290 by chuckv, Thu Feb 27 21:25:47 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 + #include "simError.h"
9 +
10   extern "C"{
11 <  void wrapsimmod_( void (*wrapFunction)(void (*fSub)( int*, double*,
8 <                                                       double*, double*)));
11 >  void wrapsimmod_( void (*wrapFunction)(void (*fSub)( simtype*, int* )));
12   }
13  
14 < void wrapSimInfo(void (*fSub)( int*, double*, double*, double*));
14 > void wrapSimInfo(void (*fSub)( simtype*, int* ));
15  
16   SimInfo* currentInfo;
17  
# Line 33 | Line 36 | void SimInfo::refreshSim(){
36  
37  
38   void SimInfo::refreshSim(){
36  
37  double box[3];
38  
39  box[0] = box_x;
40  box[1] = box_y;
41  box[2] = box_z;
39  
40 <  
40 >  simtype fInfo;
41 >  int isError;
42  
43 <  setFsimulation( &n_atoms, box, &rList, &rCut,&ensemble,
44 <                 &mixingRule,&usePBC);
45 < }
43 >  fInfo.box[0] = box_x;
44 >  fInfo.box[1] = box_y;
45 >  fInfo.box[2] = box_z;
46  
47 +  fInfo.rlist = rList;
48 +  fInfo.rcut = rCut;
49 +  fInfo.rlistsq = rlist * rlist;
50 +  fInfo.rcutsq = rCut * rCut;
51 +  fInfo.rcut6 = fInfo.rcutsq * fInfo.rcutsq * fInfo.rcutsq;
52 +  fInfo.natoms = n_atoms;
53 +  fInfo.usePBC = usePBC;
54 +  strcpy( fInfo.ensemble, ensemble );
55 +  strcpy( fInfo.mixingRule, mixingRule );
56  
57 < void wrapSimInfo(void (*fSub)( int*, double*, double*, double*)){
57 >  isError = 0;
58 >  setFsimulation( &fInfo, &isError );
59 >
60 >  if( isError ){
61 >
62 >    sprintf( painCave.errMsg,
63 >             "There was an error setting the simulation information in fortran.\n" );
64 >    painCave.isFatal = 1;
65 >    simError();
66 >  }
67 >
68 > #ifdef IS_MPI
69 >  sprintf( checkPointMsg,
70 >           "succesfully sent the simulation information to fortran.\n");
71 >  MPIcheckPoint();
72 > #endif // is_mpi
73 > }
74 >
75 > void wrapSimInfo(void (*fSub)( simtype*, int* )){
76    
77    currentInfo->setInternal(fSub);
78   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines