| 9 |
|
#include "SRI.hpp" |
| 10 |
|
#include "simError.h" |
| 11 |
|
|
| 12 |
– |
|
| 12 |
|
// Declare the structures that will be passed by the parser and MPI |
| 13 |
|
|
| 14 |
|
typedef struct{ |
| 24 |
|
int parseAtomLJ( char *lineBuffer, int lineNum, atomStruct &info ); |
| 25 |
|
|
| 26 |
|
#ifdef IS_MPI |
| 28 |
– |
|
| 27 |
|
#include "mpiForceField.h" |
| 28 |
|
|
| 29 |
|
MPI_Datatype mpiAtomStructType; |
| 71 |
|
// begins the actual forcefield stuff. |
| 72 |
|
//**************************************************************** |
| 73 |
|
|
| 74 |
+ |
|
| 75 |
|
LJ_FF::LJ_FF(){ |
| 76 |
|
|
| 77 |
|
char fileName[200]; |
| 212 |
|
short int* doPotentialCalc ) ){ |
| 213 |
|
|
| 214 |
|
|
| 215 |
< |
p1 = newLJtype; |
| 216 |
< |
p2 = initLJfortran; |
| 215 |
> |
newLJtype = p1; |
| 216 |
> |
initLJfortran = p2; |
| 217 |
|
currentLJwrap->setLJfortran( p3 ); |
| 218 |
|
} |
| 219 |
|
|
| 385 |
|
|
| 386 |
|
if( currentAtomType->name[0] != '\0' ){ |
| 387 |
|
isError = 0; |
| 388 |
< |
newLJtype( &(currentAtomType->ident), |
| 388 |
> |
newLJtype( &(currentAtomType->ident), |
| 389 |
|
&(currentAtomType->mass), |
| 390 |
|
&(currentAtomType->epslon), |
| 391 |
|
&(currentAtomType->sigma), |
| 437 |
|
|
| 438 |
|
#ifdef IS_MPI |
| 439 |
|
double tempBig = bigSigma; |
| 440 |
< |
MPI::COMM_WORLD::Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX ); |
| 440 |
> |
MPI::COMM_WORLD.Allreduce( &tempBig, &bigSigma, 1, MPI_DOUBLE, MPI_MAX ); |
| 441 |
|
#endif //is_mpi |
| 442 |
|
|
| 443 |
|
//calc rCut and rList |
| 604 |
|
} |
| 605 |
|
|
| 606 |
|
|
| 607 |
< |
void LJ_FF::doForces( void ){ |
| 607 |
> |
void LJ_FF::doForces( int calcPot ){ |
| 608 |
|
|
| 609 |
|
int i; |
| 610 |
|
double* frc; |
| 611 |
|
double* pos; |
| 612 |
< |
short int calcPot = 1; |
| 612 |
> |
short int passedCalcPot = (short int)calcPot; |
| 613 |
|
|
| 614 |
|
// forces are zeroed here, before any are acumulated. |
| 615 |
|
// NOTE: do not rezero the forces in Fortran. |
| 621 |
|
frc = Atom::getFrcArray(); |
| 622 |
|
pos = Atom::getPosArray(); |
| 623 |
|
|
| 624 |
< |
doLJfortran( pos, frc, &(entry_plug->lrPot), &calcPot ); |
| 624 |
> |
// entry_plug->lrPot = -1; |
| 625 |
> |
doLJfortran( pos, frc, &(entry_plug->lrPot), &passedCalcPot ); |
| 626 |
> |
|
| 627 |
> |
|
| 628 |
> |
// fprintf( stderr, |
| 629 |
> |
// "lrPot = %lf\n", entry_plug->lrPot ); |
| 630 |
> |
|
| 631 |
|
} |
| 632 |
|
|
| 633 |
|
void LJ_FF::initFortran( void ){ |