| 1 |
#define __C |
| 2 |
|
| 3 |
#include "config.h" |
| 4 |
#include "fSimulation.h" |
| 5 |
#include "fortranWrappers.hpp" |
| 6 |
|
| 7 |
//extern "C"{ |
| 8 |
|
| 9 |
void F90_FUNC(wrapforcefield, WRAPFORCEFIELD) (void (*wrapFunction)(void (*p1) makeAtypeList, |
| 10 |
void (*p2) initFortranFFList, |
| 11 |
void (*p3) doForceLoopList, |
| 12 |
void (*p4) set_sticky_params_List, |
| 13 |
void (*p5) set_gb_pair_params_List, |
| 14 |
void (*p6) newEAMtype_List) |
| 15 |
); |
| 16 |
|
| 17 |
void F90_FUNC(wrapsimmod, WRAPSIMMOD) (void (*wrapFunction)(void (*p1) setFortranSimList, |
| 18 |
void (*p2) setFortranBoxList, |
| 19 |
void (*p3) notifyFortranCutOffList) |
| 20 |
); |
| 21 |
|
| 22 |
#ifdef IS_MPI |
| 23 |
void F90_FUNC(wrapsimparallelmod, WRAPSIMPARALLELMOD) (void (*wrapFunction)(void (*p1) setFortranMPIlist) ); |
| 24 |
#endif // is_mpi |
| 25 |
//} |
| 26 |
|
| 27 |
void wrapFF( void (*p1) makeAtypeList, void (*p2) initFortranFFList, |
| 28 |
void (*p3) doForceLoopList, void (*p4) set_sticky_params_List, |
| 29 |
void (*p5) set_gb_pair_params_List, void (*p6) newEAMtype_List); |
| 30 |
void (*makeAtype) makeAtypeList; |
| 31 |
void (*initFortranFF) initFortranFFList; |
| 32 |
void (*set_sticky_params) set_sticky_params_List; |
| 33 |
void (*set_gb_pair_params) set_gb_pair_params_List; |
| 34 |
void (*newEAMtype) newEAMtype_List; |
| 35 |
|
| 36 |
void wrapSimInfo( void (*p1) setFortranSimList, void (*p2) setFortranBoxList, |
| 37 |
void (*p3) notifyFortranCutOffList ); |
| 38 |
|
| 39 |
#ifdef IS_MPI |
| 40 |
void wrapSimParallel(void (*p1) setFortranMPIlist ); |
| 41 |
#endif // is_mpi |
| 42 |
|
| 43 |
|
| 44 |
// take care of the ForceField functions |
| 45 |
|
| 46 |
ForceFields* currentFF; |
| 47 |
void wrapMeFF( ForceFields* thisFF ){ |
| 48 |
|
| 49 |
currentFF = thisFF; |
| 50 |
F90_FUNC(wrapforcefield, WRAPFORCEFIELD)( wrapFF ); |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
void wrapFF( void (*p1) makeAtypeList, void (*p2) initFortranFFList, |
| 55 |
void (*p3) doForceLoopList, void (*p4) set_sticky_params_List, |
| 56 |
void (*p5) set_gb_pair_params_List, void (*p6) newEAMtype_List){ |
| 57 |
|
| 58 |
makeAtype = p1; |
| 59 |
initFortranFF = p2; |
| 60 |
currentFF->setFortranForceLoop( p3 ); |
| 61 |
set_sticky_params = p4; |
| 62 |
set_gb_pair_params = p5; |
| 63 |
newEAMtype = p6; |
| 64 |
|
| 65 |
} |
| 66 |
|
| 67 |
|
| 68 |
// wrap the SimInfo functions |
| 69 |
|
| 70 |
SimInfo* currentPlug; |
| 71 |
void wrapMeSimInfo( SimInfo* thePlug ){ |
| 72 |
|
| 73 |
currentPlug = thePlug; |
| 74 |
F90_FUNC(wrapsimmod, WRAPSIMMOD) ( wrapSimInfo ); |
| 75 |
} |
| 76 |
|
| 77 |
void wrapSimInfo( void (*p1) setFortranSimList, void (*p2) setFortranBoxList, |
| 78 |
void (*p3) notifyFortranCutOffList){ |
| 79 |
|
| 80 |
currentPlug->setInternal( p1, p2, p3 ); |
| 81 |
} |
| 82 |
|
| 83 |
|
| 84 |
#ifdef IS_MPI |
| 85 |
|
| 86 |
// wrap the mpiSim functions |
| 87 |
|
| 88 |
mpiSimulation* currentMPIsim; |
| 89 |
void wrapMeSimParallel( mpiSimulation* thisMPIsim ){ |
| 90 |
|
| 91 |
currentMPIsim = thisMPIsim; |
| 92 |
F90_FUNC(wrapsimparallelmod, WRAPSIMPARALLELMOD) ( wrapSimParallel ); |
| 93 |
} |
| 94 |
|
| 95 |
void wrapSimParallel(void (*p1) setFortranMPIlist ){ |
| 96 |
|
| 97 |
currentMPIsim->setInternal( p1 ); |
| 98 |
} |
| 99 |
|
| 100 |
|
| 101 |
#endif // is_mpi |
| 102 |
|