262 |
|
} |
263 |
|
#endif // is_mpi |
264 |
|
} |
265 |
– |
|
266 |
– |
void TraPPE_ExFF::doForces( int calcPot ){ |
267 |
– |
|
268 |
– |
int i, isError; |
269 |
– |
double* frc; |
270 |
– |
double* pos; |
271 |
– |
double* tau; |
272 |
– |
short int passedCalcPot = (short int)calcPot; |
273 |
– |
|
274 |
– |
// forces are zeroed here, before any are acumulated. |
275 |
– |
// NOTE: do not rezero the forces in Fortran. |
265 |
|
|
266 |
< |
for(i=0; i<entry_plug->n_atoms; i++){ |
267 |
< |
entry_plug->atoms[i]->zeroForces(); |
268 |
< |
} |
280 |
< |
|
281 |
< |
frc = Atom::getFrcArray(); |
282 |
< |
pos = Atom::getPosArray(); |
283 |
< |
tau = entry_plug->tau; |
284 |
< |
|
285 |
< |
isError = 0; |
286 |
< |
fortranForceLoop( pos, frc, &(entry_plug->lrPot), tau, |
287 |
< |
&passedCalcPot, &isError ); |
288 |
< |
|
289 |
< |
|
290 |
< |
if( isError ){ |
291 |
< |
sprintf( painCave.errMsg, |
292 |
< |
"Error returned from the fortran force calculation.\n" ); |
293 |
< |
painCave.isFatal = 1; |
294 |
< |
simError(); |
295 |
< |
} |
296 |
< |
|
297 |
< |
#ifdef IS_MPI |
298 |
< |
sprintf( checkPointMsg, |
299 |
< |
"successfully returned from the force calculation.\n" ); |
300 |
< |
MPIcheckPoint(); |
301 |
< |
#endif // is_mpi |
302 |
< |
|
266 |
> |
void TraPPE_ExFF::initForceField( int ljMixRule ){ |
267 |
> |
|
268 |
> |
initFortran( ljMixRule, entry_plug->useReactionField ); |
269 |
|
} |
270 |
|
|
271 |
|
|
361 |
|
the_atoms = entry_plug->atoms; |
362 |
|
nAtoms = entry_plug->n_atoms; |
363 |
|
|
398 |
– |
|
364 |
|
////////////////////////////////////////////////// |
365 |
|
// a quick water fix |
366 |
|
|
498 |
|
|
499 |
|
int isGB = 0; |
500 |
|
int isLJ = 1; |
501 |
+ |
double GB_dummy = 0.0; |
502 |
|
|
503 |
|
|
504 |
|
currentAtomType = headAtomType; |
505 |
|
while( currentAtomType != NULL ){ |
506 |
|
|
507 |
+ |
if(currentAtomType->isDipole) entry_plug->useReactionField = 1; |
508 |
+ |
if(currentAtomType->isDipole) entry_plug->useDipole = 1; |
509 |
+ |
if(currentAtomType->isSSD) entry_plug->useSticky = 1; |
510 |
+ |
|
511 |
|
if( currentAtomType->name[0] != '\0' ){ |
512 |
|
isError = 0; |
513 |
< |
newTPEtype( &(currentAtomType->ident), |
514 |
< |
&(currentAtomType->mass), |
515 |
< |
&(currentAtomType->epslon), |
516 |
< |
&(currentAtomType->sigma), |
517 |
< |
&isLJ, |
518 |
< |
&(currentAtomType->isSSD), |
519 |
< |
&(currentAtomType->isDipole), |
520 |
< |
&isGB, |
521 |
< |
&(currentAtomType->w0), |
522 |
< |
&(currentAtomType->v0), |
523 |
< |
&(currentAtomType->dipole), |
524 |
< |
&isError ); |
513 |
> |
makeAtype( &(currentAtomType->ident), |
514 |
> |
&isLJ, |
515 |
> |
&(currentAtomType->isSSD), |
516 |
> |
&(currentAtomType->isDipole), |
517 |
> |
&isGB, |
518 |
> |
&(currentAtomType->epslon), |
519 |
> |
&(currentAtomType->sigma), |
520 |
> |
&(currentAtomType->dipole), |
521 |
> |
&(currentAtomType->w0), |
522 |
> |
&(currentAtomType->v0), |
523 |
> |
&GB_dummy, |
524 |
> |
&GB_dummy, |
525 |
> |
&GB_dummy, |
526 |
> |
&GB_dummy, |
527 |
> |
&GB_dummy, |
528 |
> |
&GB_dummy, |
529 |
> |
&isError ); |
530 |
|
if( isError ){ |
531 |
|
sprintf( painCave.errMsg, |
532 |
|
"Error initializing the \"%s\" atom type in fortran\n", |
637 |
|
|
638 |
|
entry_plug->rList = entry_plug->rCut + 1.0; |
639 |
|
|
640 |
+ |
entry_plug->useLJ = 1; // use Lennard Jones is on by default |
641 |
|
|
642 |
|
// clean up the memory |
643 |
|
|
647 |
|
sprintf( checkPointMsg, "TraPPE_Ex atoms initialized succesfully" ); |
648 |
|
MPIcheckPoint(); |
649 |
|
#endif // is_mpi |
674 |
– |
|
675 |
– |
initFortran(); |
676 |
– |
entry_plug->refreshSim(); |
650 |
|
|
651 |
|
} |
652 |
|
|