--- trunk/OOPSE-4/src/UseTheForce/DUFF.cpp 2004/10/26 22:24:52 1650 +++ trunk/OOPSE-4/src/UseTheForce/DUFF.cpp 2004/11/04 16:20:28 1706 @@ -454,10 +454,8 @@ DUFF::DUFF(){ DUFF::DUFF(){ - char fileName[200]; - char* ffPath_env = "FORCE_PARAM_PATH"; - char* ffPath; - char temp[200]; + string fileName; + string tempString; headAtomType = NULL; currentAtomType = NULL; @@ -567,29 +565,21 @@ DUFF::DUFF(){ // generate the force file name - strcpy( fileName, "DUFF.frc" ); + fileName = "DUFF.frc"; // fprintf( stderr,"Trying to open %s\n", fileName ); // attempt to open the file in the current directory first. - frcFile = fopen( fileName, "r" ); + frcFile = fopen( fileName.c_str(), "r" ); if( frcFile == NULL ){ // next see if the force path enviorment variable is set - - ffPath = getenv( ffPath_env ); - if( ffPath == NULL ) { - STR_DEFINE(ffPath, FRC_PATH ); - } - - - strcpy( temp, ffPath ); - strcat( temp, "/" ); - strcat( temp, fileName ); - strcpy( fileName, temp ); - - frcFile = fopen( fileName, "r" ); + + tempString = ffPath + "/" + fileName; + fileName = tempString; + + frcFile = fopen( fileName.c_str(), "r" ); if( frcFile == NULL ){ @@ -598,7 +588,7 @@ DUFF::DUFF(){ "\t%s\n" "\tHave you tried setting the FORCE_PARAM_PATH environment " "variable?\n", - fileName ); + fileName.c_str() ); painCave.severity = OOPSE_ERROR; painCave.isFatal = 1; simError(); @@ -777,18 +767,16 @@ void DUFF::readParams( void ){ if( currentAtomType->name[0] != '\0' ){ if (currentAtomType->isSSD || currentAtomType->isDipole) - DirectionalAtomType* at = new DirectionalAtomType(); + at = new DirectionalAtomType(); else - AtomType* at = new AtomType(); + at = new AtomType(); if (currentAtomType->isSSD) { ((DirectionalAtomType*)at)->setSticky(); - entry_plug->useSticky = 1; } if (currentAtomType->isDipole) { ((DirectionalAtomType*)at)->setDipole(); - entry_plug->useDipoles = 1; } at->setIdent(currentAtomType->ident); @@ -1095,8 +1083,6 @@ void DUFF::readParams( void ){ MPIcheckPoint(); #endif // is_mpi - - entry_plug->useLennardJones = 1; } @@ -1155,7 +1141,13 @@ void DUFF::initializeAtoms( int nAtoms, Atom** the_ato the_atoms[i]->setMass( currentAtomType->mass ); the_atoms[i]->setIdent( currentAtomType->ident ); + + if (currentAtomType->isSSD) entry_plug->useSticky = 1; + if (currentAtomType->isDipole) entry_plug->useDipoles = 1; + // Fix this later. We'll set it a bunch of times. + entry_plug->useLennardJones = 1; + if( bigSigma < currentAtomType->sigma ) bigSigma = currentAtomType->sigma; if( currentAtomType->isDipole ){