336 |
|
// call new A_types in fortran |
337 |
|
|
338 |
|
int isError; |
339 |
+ |
|
340 |
+ |
// dummy variables |
341 |
+ |
int isLJ = 1; |
342 |
+ |
int isDipole = 0; |
343 |
+ |
int isSSD = 0; |
344 |
+ |
int isGB = 0; |
345 |
+ |
double w0 = 0.0; |
346 |
+ |
double v0 = 0.0; |
347 |
+ |
double dipole = 0.0; |
348 |
+ |
|
349 |
+ |
|
350 |
|
currentAtomType = headAtomType; |
351 |
|
while( currentAtomType != NULL ){ |
352 |
|
|
353 |
|
if( currentAtomType->name[0] != '\0' ){ |
354 |
|
isError = 0; |
355 |
< |
newLJtype( &(currentAtomType->ident), |
356 |
< |
&(currentAtomType->mass), |
357 |
< |
&(currentAtomType->epslon), |
358 |
< |
&(currentAtomType->sigma), |
359 |
< |
&isError ); |
355 |
> |
newAtype( &(currentAtomType->ident), |
356 |
> |
&(currentAtomType->mass), |
357 |
> |
&(currentAtomType->epslon), |
358 |
> |
&(currentAtomType->sigma), |
359 |
> |
&isLJ, &isSSD, &isDipole, &isGB, &w0, &v0, &dipole, |
360 |
> |
&isError ); |
361 |
|
if( isError ){ |
362 |
|
sprintf( painCave.errMsg, |
363 |
|
"Error initializing the \"%s\" atom type in fortran\n", |
426 |
|
MPIcheckPoint(); |
427 |
|
#endif // is_mpi |
428 |
|
|
429 |
< |
initFortran(); |
429 |
> |
this->initFortran(); |
430 |
|
entry_plug->refreshSim(); |
431 |
< |
|
431 |
> |
|
432 |
|
} |
433 |
|
|
434 |
|
void LJ_FF::initializeBonds( bond_pair* the_bonds ){ |
467 |
|
painCave.isFatal = 1; |
468 |
|
simError(); |
469 |
|
} |
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 |
– |
|
470 |
|
#ifdef IS_MPI |
495 |
– |
sprintf( checkPointMsg, |
496 |
– |
"returned from the force calculation.\n" ); |
471 |
|
MPIcheckPoint(); |
472 |
|
#endif // is_mpi |
473 |
|
|
474 |
|
} |
501 |
– |
|
502 |
– |
void LJ_FF::initFortran( void ){ |
503 |
– |
|
504 |
– |
int nLocal = entry_plug->n_atoms; |
505 |
– |
int *ident; |
506 |
– |
int isError; |
507 |
– |
int i; |
475 |
|
|
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 |
– |
|
476 |
|
void LJ_FF::fastForward( char* stopText, char* searchOwner ){ |
477 |
|
|
478 |
|
int foundText = 0; |