--- trunk/OOPSE/libmdtools/LJFF.cpp 2003/06/19 22:02:44 559 +++ trunk/OOPSE/libmdtools/LJFF.cpp 2004/01/13 23:01:43 941 @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include using namespace std; @@ -65,7 +65,7 @@ namespace LJ_NS{ if( !strcmp( info.name, name ) ){ sprintf( painCave.errMsg, "Duplicate LJ atom type \"%s\" found in " - "the LJ_FF param file./n", + "the LJFF param file./n", name ); painCave.isFatal = 1; simError(); @@ -117,13 +117,12 @@ using namespace LJ_NS; //**************************************************************** -LJ_FF::LJ_FF(){ +LJFF::LJFF(){ char fileName[200]; char* ffPath_env = "FORCE_PARAM_PATH"; char* ffPath; char temp[200]; - char errMsg[1000]; headAtomType = NULL; currentAtomType = NULL; @@ -162,8 +161,8 @@ LJ_FF::LJ_FF(){ // generate the force file name - strcpy( fileName, "LJ_FF.frc" ); - // fprintf( stderr,"Trying to open %s\n", fileName ); + strcpy( fileName, "LJFF.frc" ); + fprintf( stderr,"Trying to open %s\n", fileName ); // attempt to open the file in the current directory first. @@ -201,14 +200,14 @@ LJ_FF::LJ_FF(){ #ifdef IS_MPI } - sprintf( checkPointMsg, "LJ_FF file opened sucessfully." ); + sprintf( checkPointMsg, "LJFF file opened sucessfully." ); MPIcheckPoint(); #endif // is_mpi } -LJ_FF::~LJ_FF(){ +LJFF::~LJFF(){ if( headAtomType != NULL ) delete headAtomType; @@ -223,12 +222,12 @@ LJ_FF::~LJ_FF(){ #endif // is_mpi } -void LJ_FF::initForceField( int ljMixRule ){ +void LJFF::initForceField( int ljMixRule ){ initFortran( ljMixRule, 0 ); } -void LJ_FF::cleanMe( void ){ +void LJFF::cleanMe( void ){ #ifdef IS_MPI @@ -243,13 +242,12 @@ void LJ_FF::cleanMe( void ){ #endif // is_mpi } -void LJ_FF::readParams( void ){ +void LJFF::readParams( void ){ atomStruct info; info.last = 1; // initialize last to have the last set. // if things go well, last will be set to 0 - int i; int identNum; @@ -303,7 +301,7 @@ void LJ_FF::readParams( void ){ // send out the linked list to all the other processes sprintf( checkPointMsg, - "LJ_FF atom structures read successfully." ); + "LJFF atom structures read successfully." ); MPIcheckPoint(); currentAtomType = headAtomType->next; //skip the first element who is a place holder. @@ -357,6 +355,9 @@ void LJ_FF::readParams( void ){ int isDipole = 0; int isSSD = 0; int isGB = 0; + int isEAM = 0; + int isCharge = 0; + double charge = 0.0; double dipole = 0.0; currentAtomType = headAtomType; @@ -369,8 +370,11 @@ void LJ_FF::readParams( void ){ &isSSD, &isDipole, &isGB, + &isEAM, + &isCharge, &(currentAtomType->epslon), &(currentAtomType->sigma), + &charge, &dipole, &isError ); if( isError ){ @@ -388,22 +392,20 @@ void LJ_FF::readParams( void ){ #ifdef IS_MPI sprintf( checkPointMsg, - "LJ_FF atom structures successfully sent to fortran\n" ); + "LJFF atom structures successfully sent to fortran\n" ); MPIcheckPoint(); #endif // is_mpi } -void LJ_FF::initializeAtoms( int nAtoms, Atom** the_atoms ){ +void LJFF::initializeAtoms( int nAtoms, Atom** the_atoms ){ int i; // initialize the atoms - Atom* thisAtom; - for( i=0; ifind( the_atoms[i]->getType() ); @@ -425,40 +427,40 @@ void LJ_FF::initializeAtoms( int nAtoms, Atom** the_at } } -void LJ_FF::initializeBonds( int nBonds, Bond** BondArray, +void LJFF::initializeBonds( int nBonds, Bond** BondArray, bond_pair* the_bonds ){ if( nBonds ){ sprintf( painCave.errMsg, - "LJ_FF does not support bonds.\n" ); + "LJFF does not support bonds.\n" ); painCave.isFatal = 1; simError(); } } -void LJ_FF::initializeBends( int nBends, Bend** bendArray, +void LJFF::initializeBends( int nBends, Bend** bendArray, bend_set* the_bends ){ if( nBends ){ sprintf( painCave.errMsg, - "LJ_FF does not support bends.\n" ); + "LJFF does not support bends.\n" ); painCave.isFatal = 1; simError(); } } -void LJ_FF::initializeTorsions( int nTorsions, Torsion** torsionArray, +void LJFF::initializeTorsions( int nTorsions, Torsion** torsionArray, torsion_set* the_torsions ){ if( nTorsions ){ sprintf( painCave.errMsg, - "LJ_FF does not support torsions.\n" ); + "LJFF does not support torsions.\n" ); painCave.isFatal = 1; simError(); } } -void LJ_FF::fastForward( char* stopText, char* searchOwner ){ +void LJFF::fastForward( char* stopText, char* searchOwner ){ int foundText = 0; char* the_token;