106 |
|
|
107 |
|
ffPath = getenv( ffPath_env ); |
108 |
|
if( ffPath == NULL ) { |
109 |
< |
sprintf( painCave.errMsg, |
110 |
< |
"Error opening the force field parameter file: %s\n" |
111 |
< |
"Have you tried setting the FORCE_PARAM_PATH environment " |
112 |
< |
"vairable?\n", |
113 |
< |
fileName ); |
114 |
< |
painCave.isFatal = 1; |
115 |
< |
simError(); |
109 |
> |
STR_DEFINE(ffPath, FRC_PATH ); |
110 |
|
} |
111 |
|
|
112 |
|
|
420 |
|
MPIcheckPoint(); |
421 |
|
#endif // is_mpi |
422 |
|
|
423 |
< |
initFortran(); |
423 |
> |
this->initFortran(); |
424 |
|
entry_plug->refreshSim(); |
425 |
|
|
426 |
|
} |
466 |
|
#endif // is_mpi |
467 |
|
|
468 |
|
} |
475 |
– |
|
476 |
– |
void LJ_FF::doForces( int calcPot ){ |
477 |
– |
|
478 |
– |
int i, isError; |
479 |
– |
double* frc; |
480 |
– |
double* pos; |
481 |
– |
double* trq; |
482 |
– |
double* tau; |
483 |
– |
short int passedCalcPot = (short int)calcPot; |
484 |
– |
|
485 |
– |
// forces are zeroed here, before any are acumulated. |
486 |
– |
// NOTE: do not rezero the forces in Fortran. |
487 |
– |
|
488 |
– |
for(i=0; i<entry_plug->n_atoms; i++){ |
489 |
– |
entry_plug->atoms[i]->zeroForces(); |
490 |
– |
} |
469 |
|
|
492 |
– |
frc = Atom::getFrcArray(); |
493 |
– |
pos = Atom::getPosArray(); |
494 |
– |
trq = Atom::getTrqArray(); |
495 |
– |
tau = entry_plug->tau; |
496 |
– |
|
497 |
– |
// dummy variables |
498 |
– |
// NOTE: THIS IS A MAJOR POTENTIAL BUG!!!!!! be careful. |
499 |
– |
// that said, here we go anyway. |
500 |
– |
|
501 |
– |
double* A = NULL; |
502 |
– |
double* mu = NULL; |
503 |
– |
double* u_l = NULL; |
504 |
– |
|
505 |
– |
isError = 0; |
506 |
– |
fortranForceLoop( pos, A, mu, u_l, frc, trq, tau, &(entry_plug->lrPot), |
507 |
– |
&passedCalcPot, &isError ); |
508 |
– |
|
509 |
– |
|
510 |
– |
if( isError ){ |
511 |
– |
sprintf( painCave.errMsg, |
512 |
– |
"Error returned from the fortran force calculation.\n" ); |
513 |
– |
painCave.isFatal = 1; |
514 |
– |
simError(); |
515 |
– |
} |
516 |
– |
|
517 |
– |
#ifdef IS_MPI |
518 |
– |
sprintf( checkPointMsg, |
519 |
– |
"returned from the force calculation.\n" ); |
520 |
– |
MPIcheckPoint(); |
521 |
– |
#endif // is_mpi |
522 |
– |
|
523 |
– |
} |
524 |
– |
|
525 |
– |
void LJ_FF::initFortran( void ){ |
526 |
– |
|
527 |
– |
int nLocal = entry_plug->n_atoms; |
528 |
– |
int *ident; |
529 |
– |
int isError; |
530 |
– |
int i; |
531 |
– |
|
532 |
– |
ident = new int[nLocal]; |
533 |
– |
|
534 |
– |
for(i=0; i<nLocal; i++){ |
535 |
– |
ident[i] = entry_plug->atoms[i]->getIdent(); |
536 |
– |
} |
537 |
– |
|
538 |
– |
isError = 0; |
539 |
– |
initfortran( &nLocal, ident, &isError ); |
540 |
– |
|
541 |
– |
if(isError){ |
542 |
– |
sprintf( painCave.errMsg, |
543 |
– |
"LJ_FF error: There was an error initializing the component list in fortran.\n" ); |
544 |
– |
painCave.isFatal = 1; |
545 |
– |
simError(); |
546 |
– |
} |
547 |
– |
|
548 |
– |
|
549 |
– |
#ifdef IS_MPI |
550 |
– |
sprintf( checkPointMsg, "LJ_FF successfully initialized the fortran component list.\n" ); |
551 |
– |
MPIcheckPoint(); |
552 |
– |
#endif // is_mpi |
553 |
– |
|
554 |
– |
delete[] ident; |
555 |
– |
|
556 |
– |
} |
557 |
– |
|
558 |
– |
|
470 |
|
void LJ_FF::fastForward( char* stopText, char* searchOwner ){ |
471 |
|
|
472 |
|
int foundText = 0; |