ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE_old/src/mdtools/libmdCode/LJ_FF.cpp
(Generate patch)

Comparing trunk/OOPSE_old/src/mdtools/libmdCode/LJ_FF.cpp (file contents):
Revision 296 by mmeineke, Thu Mar 6 20:05:39 2003 UTC vs.
Revision 299 by mmeineke, Fri Mar 7 19:31:02 2003 UTC

# Line 426 | Line 426 | void LJ_FF::initializeAtoms( void ){
426    MPIcheckPoint();
427   #endif // is_mpi
428  
429 <  initFortran();
429 >  this->initFortran();
430    entry_plug->refreshSim();
431    
432   }
# Line 472 | Line 472 | void LJ_FF::initializeTorsions( torsion_set* the_torsi
472   #endif // is_mpi
473  
474   }
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  }
491
492  frc = Atom::getFrcArray();
493  pos = Atom::getPosArray();
494  trq = Atom::getTrqArray();
495  tau = entry_plug->tau;
475  
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  
476   void LJ_FF::fastForward( char* stopText, char* searchOwner ){
477  
478    int foundText = 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines