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 348 by mmeineke, Fri Mar 14 21:33:10 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;
25 <  wrapMe();
23 >  wrapMeSimInfo( this );
24   }
25  
26 + void SimInfo::refreshSim(){
27  
28 < void SimInfo::wrapMe(){
28 >  simtype fInfo;
29 >  int isError;
30  
31 <  wrapsimmod_( wrapSimInfo );
32 < }
31 >  fInfo.box[0] = box_x;
32 >  fInfo.box[1] = box_y;
33 >  fInfo.box[2] = box_z;
34  
35 +  fInfo.rlist = rList;
36 +  fInfo.rcut = rCut;
37 +  fInfo.SIM_uses_PBC = usePBC;
38  
39 < void SimInfo::refreshSim(){
40 <  
37 <  double box[3];
38 <  
39 <  box[0] = box_x;
40 <  box[1] = box_y;
41 <  box[2] = box_z;
39 >  isError = 0;
40 >  setFsimulation( &fInfo, &isError );
41  
42 <  
42 >  if( isError ){
43  
44 <  setFsimulation( &n_atoms, box, &rList, &rCut,&ensemble,
45 <                 &mixingRule,&usePBC);
46 < }
44 >    sprintf( painCave.errMsg,
45 >             "There was an error setting the simulation information in fortran.\n" );
46 >    painCave.isFatal = 1;
47 >    simError();
48 >  }
49  
50 <
51 < void wrapSimInfo(void (*fSub)( int*, double*, double*, double*)){
52 <  
53 <  currentInfo->setInternal(fSub);
50 > #ifdef IS_MPI
51 >  sprintf( checkPointMsg,
52 >           "succesfully sent the simulation information to fortran.\n");
53 >  MPIcheckPoint();
54 > #endif // is_mpi
55   }
56 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines