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 |
|
|
330 |
|
// call new A_types in fortran |
331 |
|
|
332 |
|
int isError; |
333 |
+ |
|
334 |
+ |
// dummy variables |
335 |
+ |
int isLJ = 1; |
336 |
+ |
int isDipole = 0; |
337 |
+ |
int isSSD = 0; |
338 |
+ |
int isGB = 0; |
339 |
+ |
double w0 = 0.0; |
340 |
+ |
double v0 = 0.0; |
341 |
+ |
double dipole = 0.0; |
342 |
+ |
|
343 |
+ |
|
344 |
|
currentAtomType = headAtomType; |
345 |
|
while( currentAtomType != NULL ){ |
346 |
|
|
347 |
|
if( currentAtomType->name[0] != '\0' ){ |
348 |
|
isError = 0; |
349 |
< |
newLJtype( &(currentAtomType->ident), |
350 |
< |
&(currentAtomType->mass), |
351 |
< |
&(currentAtomType->epslon), |
352 |
< |
&(currentAtomType->sigma), |
353 |
< |
&isError ); |
349 |
> |
newAtype( &(currentAtomType->ident), |
350 |
> |
&(currentAtomType->mass), |
351 |
> |
&(currentAtomType->epslon), |
352 |
> |
&(currentAtomType->sigma), |
353 |
> |
&isLJ, &isSSD, &isDipole, &isGB, &w0, &v0, &dipole, |
354 |
> |
&isError ); |
355 |
|
if( isError ){ |
356 |
|
sprintf( painCave.errMsg, |
357 |
|
"Error initializing the \"%s\" atom type in fortran\n", |
420 |
|
MPIcheckPoint(); |
421 |
|
#endif // is_mpi |
422 |
|
|
423 |
< |
initFortran(); |
423 |
> |
this->initFortran(); |
424 |
|
entry_plug->refreshSim(); |
425 |
< |
|
425 |
> |
|
426 |
|
} |
427 |
|
|
428 |
|
void LJ_FF::initializeBonds( bond_pair* the_bonds ){ |
461 |
|
painCave.isFatal = 1; |
462 |
|
simError(); |
463 |
|
} |
458 |
– |
#ifdef IS_MPI |
459 |
– |
MPIcheckPoint(); |
460 |
– |
#endif // is_mpi |
461 |
– |
|
462 |
– |
} |
463 |
– |
|
464 |
– |
void LJ_FF::doForces( int calcPot ){ |
465 |
– |
|
466 |
– |
int i, isError; |
467 |
– |
double* frc; |
468 |
– |
double* pos; |
469 |
– |
double* tau; |
470 |
– |
short int passedCalcPot = (short int)calcPot; |
471 |
– |
|
472 |
– |
// forces are zeroed here, before any are acumulated. |
473 |
– |
// NOTE: do not rezero the forces in Fortran. |
474 |
– |
|
475 |
– |
for(i=0; i<entry_plug->n_atoms; i++){ |
476 |
– |
entry_plug->atoms[i]->zeroForces(); |
477 |
– |
} |
478 |
– |
|
479 |
– |
frc = Atom::getFrcArray(); |
480 |
– |
pos = Atom::getPosArray(); |
481 |
– |
tau = entry_plug->tau; |
482 |
– |
|
483 |
– |
isError = 0; |
484 |
– |
doLJfortran( pos, frc, &(entry_plug->lrPot), tau, &passedCalcPot, &isError ); |
485 |
– |
|
486 |
– |
|
487 |
– |
if( isError ){ |
488 |
– |
sprintf( painCave.errMsg, |
489 |
– |
"Error returned from the fortran force calculation.\n" ); |
490 |
– |
painCave.isFatal = 1; |
491 |
– |
simError(); |
492 |
– |
} |
493 |
– |
|
464 |
|
#ifdef IS_MPI |
495 |
– |
sprintf( checkPointMsg, |
496 |
– |
"returned from the force calculation.\n" ); |
465 |
|
MPIcheckPoint(); |
466 |
|
#endif // is_mpi |
467 |
|
|
468 |
|
} |
501 |
– |
|
502 |
– |
void LJ_FF::initFortran( void ){ |
503 |
– |
|
504 |
– |
int nLocal = entry_plug->n_atoms; |
505 |
– |
int *ident; |
506 |
– |
int isError; |
507 |
– |
int i; |
469 |
|
|
509 |
– |
ident = new int[nLocal]; |
510 |
– |
|
511 |
– |
for(i=0; i<nLocal; i++){ |
512 |
– |
ident[i] = entry_plug->atoms[i]->getIdent(); |
513 |
– |
} |
514 |
– |
|
515 |
– |
isError = 0; |
516 |
– |
initLJfortran( &nLocal, ident, &isError ); |
517 |
– |
|
518 |
– |
if(isError){ |
519 |
– |
sprintf( painCave.errMsg, |
520 |
– |
"LJ_FF error: There was an error initializing the component list in fortran.\n" ); |
521 |
– |
painCave.isFatal = 1; |
522 |
– |
simError(); |
523 |
– |
} |
524 |
– |
|
525 |
– |
|
526 |
– |
#ifdef IS_MPI |
527 |
– |
sprintf( checkPointMsg, "LJ_FF successfully initialized the fortran component list.\n" ); |
528 |
– |
MPIcheckPoint(); |
529 |
– |
#endif // is_mpi |
530 |
– |
|
531 |
– |
delete[] ident; |
532 |
– |
|
533 |
– |
} |
534 |
– |
|
535 |
– |
|
470 |
|
void LJ_FF::fastForward( char* stopText, char* searchOwner ){ |
471 |
|
|
472 |
|
int foundText = 0; |