9 |
|
#include "SRI.hpp" |
10 |
|
#include "simError.h" |
11 |
|
|
12 |
+ |
#include <fortranWrappers.hpp> |
13 |
+ |
|
14 |
|
#ifdef IS_MPI |
15 |
|
#include "mpiForceField.h" |
16 |
|
#endif // is_mpi |
85 |
|
#endif |
86 |
|
|
87 |
|
} // namespace |
86 |
– |
|
87 |
– |
|
88 |
– |
// declaration of functions needed to wrap the fortran module |
89 |
– |
|
90 |
– |
|
88 |
|
|
92 |
– |
TraPPE_ExFF* currentTPEwrap; |
93 |
– |
|
89 |
|
using namespace TPE; |
90 |
|
|
91 |
|
|
103 |
|
char errMsg[1000]; |
104 |
|
|
105 |
|
// do the funtion wrapping |
106 |
< |
currentTPEwrap = this; |
112 |
< |
wrapMe(); |
106 |
> |
wrapMeFF( this ); |
107 |
|
|
108 |
|
|
109 |
|
#ifdef IS_MPI |
270 |
|
} |
271 |
|
|
272 |
|
|
279 |
– |
void TraPPE_ExFF::wrapMe( void ){ |
280 |
– |
|
281 |
– |
char* currentFF = "TraPPE_Ex"; |
282 |
– |
int isError = 0; |
283 |
– |
|
284 |
– |
forcefactory_( currentFF, &isError, TPEfunctionWrapper, strlen(currentFF) ); |
285 |
– |
|
286 |
– |
if( isError ){ |
287 |
– |
|
288 |
– |
sprintf( painCave.errMsg, |
289 |
– |
"TraPPE_ExFF error: an error was returned from fortran when the " |
290 |
– |
"the functions were being wrapped.\n" ); |
291 |
– |
painCave.isFatal = 1; |
292 |
– |
simError(); |
293 |
– |
} |
294 |
– |
|
295 |
– |
#ifdef IS_MPI |
296 |
– |
sprintf( checkPointMsg, "TraPPE_ExFF functions succesfully wrapped." ); |
297 |
– |
MPIcheckPoint(); |
298 |
– |
#endif // is_mpi |
299 |
– |
} |
300 |
– |
|
301 |
– |
|
302 |
– |
void TPEfunctionWrapper( void (*p1)( int* ident, double* mass, double* epslon, |
303 |
– |
double* sigma, int* isDipole, |
304 |
– |
int* isSSD, double* dipole, double* w0, |
305 |
– |
double* v0, int* isError ), |
306 |
– |
void (*p2)( int*, int*, int* ), |
307 |
– |
void (*p3)( double*,double*,double*,double*, |
308 |
– |
short int*, int* ) ){ |
309 |
– |
|
310 |
– |
|
311 |
– |
newTPEtype = p1; |
312 |
– |
initTPEfortran = p2; |
313 |
– |
currentTPEwrap->setTPEfortran( p3 ); |
314 |
– |
} |
315 |
– |
|
316 |
– |
|
317 |
– |
|
273 |
|
void TraPPE_ExFF::initializeAtoms( void ){ |
274 |
|
|
275 |
|
class LinkedType { |