377 |
|
#endif // is_mpi |
378 |
|
|
379 |
|
// call new A_types in fortran |
380 |
+ |
|
381 |
+ |
int isError; |
382 |
+ |
currentAtomType = headAtomType; |
383 |
+ |
while( currentAtomType != NULL ){ |
384 |
+ |
|
385 |
+ |
if( currentAtomType->name[0] != NULL ){ |
386 |
+ |
isError = 0; |
387 |
+ |
newLJtype( &(currentAtomType->ident), |
388 |
+ |
&(currentAtomType->mass), |
389 |
+ |
&(currentAtomType->epslon), |
390 |
+ |
&(currentAtomType->sigma), |
391 |
+ |
isError ); |
392 |
+ |
if( isError ){ |
393 |
+ |
sprintf( painCave.errMsg, |
394 |
+ |
"Error initializing the \"%s\" atom type in fortran\n", |
395 |
+ |
currentAtomType->name ); |
396 |
+ |
painCave.isFatal = 1; |
397 |
+ |
simError(); |
398 |
+ |
} |
399 |
+ |
} |
400 |
+ |
currentAtomType = currentAtomType->next; |
401 |
+ |
} |
402 |
+ |
|
403 |
+ |
#ifdef IS_MPI |
404 |
+ |
sprintf( checkPointMsg, |
405 |
+ |
"LJ_FF atom structures successfully sent to fortran\n" ); |
406 |
+ |
MPIcheckPoint(); |
407 |
+ |
#endif // is_mpi |
408 |
|
|
409 |
+ |
|
410 |
|
|
411 |
|
// initialize the atoms |
412 |
|
|
581 |
|
} |
582 |
|
else return 0; |
583 |
|
} |
584 |
+ |
|
585 |
+ |
|
586 |
+ |
void LJ_FF::doForces( void ){ |
587 |
+ |
|
588 |
+ |
int i; |
589 |
+ |
double* frc; |
590 |
+ |
double* pos; |
591 |
+ |
double potE; |
592 |
+ |
short int calcPot = 0; |
593 |
+ |
|
594 |
+ |
// forces are zeroed here, before any are acumulated. |
595 |
+ |
// NOTE: do not rezero the forces in Fortran. |
596 |
+ |
|
597 |
+ |
for(i=0; i<entry_plug->n_atoms; i++){ |
598 |
+ |
entry_plug->atoms[i]->zeroForces(); |
599 |
+ |
} |
600 |
+ |
|
601 |
+ |
frc = Atom::getFrcArray(); |
602 |
+ |
pos = Atom::getPosArray(); |
603 |
+ |
|
604 |
+ |
doLJfortran( pos, frc, potE, calcPot ); |
605 |
+ |
} |
606 |
+ |
|