ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/UseTheForce/DUFF.cpp
(Generate patch)

Comparing trunk/OOPSE-2.0/src/UseTheForce/DUFF.cpp (file contents):
Revision 1634 by gezelter, Fri Oct 22 21:21:02 2004 UTC vs.
Revision 1653 by gezelter, Wed Oct 27 00:01:29 2004 UTC

# Line 454 | Line 454 | DUFF::DUFF(){
454  
455   DUFF::DUFF(){
456  
457 <  char fileName[200];
458 <  char* ffPath_env = "FORCE_PARAM_PATH";
459 <  char* ffPath;
460 <  char temp[200];
457 >  string fileName;
458 >  string tempString;
459  
460    headAtomType       = NULL;
461    currentAtomType    = NULL;
# Line 567 | Line 565 | DUFF::DUFF(){
565      
566      // generate the force file name
567      
568 <    strcpy( fileName, "DUFF.frc" );
568 >    fileName = "DUFF.frc";
569      //    fprintf( stderr,"Trying to open %s\n", fileName );
570      
571      // attempt to open the file in the current directory first.
572      
573 <    frcFile = fopen( fileName, "r" );
573 >    frcFile = fopen( fileName.c_str(), "r" );
574      
575      if( frcFile == NULL ){
576        
577        // next see if the force path enviorment variable is set
578 <      
579 <      ffPath = getenv( ffPath_env );
580 <      if( ffPath == NULL ) {
581 <        STR_DEFINE(ffPath, FRC_PATH );
582 <      }
585 <      
586 <      
587 <      strcpy( temp, ffPath );
588 <      strcat( temp, "/" );
589 <      strcat( temp, fileName );
590 <      strcpy( fileName, temp );
591 <      
592 <      frcFile = fopen( fileName, "r" );
578 >
579 >      tempString = ffPath + "/" + fileName;
580 >      fileName = tempString;
581 >            
582 >      frcFile = fopen( fileName.c_str(), "r" );
583        
584        if( frcFile == NULL ){
585          
# Line 598 | Line 588 | DUFF::DUFF(){
588                   "\t%s\n"
589                   "\tHave you tried setting the FORCE_PARAM_PATH environment "
590                   "variable?\n",
591 <                 fileName );
591 >                 fileName.c_str() );
592          painCave.severity = OOPSE_ERROR;
593          painCave.isFatal = 1;
594          simError();
# Line 656 | Line 646 | void DUFF::initForceField(){
646    
647    initFortran( entry_plug->useReactionField );
648   }
659
660 double DUFF::getAtomTypeMass (char* atomType) {
661
662  currentAtomType = headAtomType->find( atomType );
663  if( currentAtomType == NULL ){
664    sprintf( painCave.errMsg,
665            "AtomType error, %s not found in force file.\n",
666             atomType );
667    painCave.isFatal = 1;
668    simError();
669  }
649  
671  return currentAtomType->mass;
672 }
650  
651   void DUFF::readParams( void ){
652  
# Line 1109 | Line 1086 | void DUFF::readParams( void ){
1086  
1087   #endif // is_mpi
1088  
1089 <  entry_plug->useLJ = 1;
1089 >  entry_plug->useLennardJones = 1;
1090   }
1091  
1092  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines