--- trunk/OOPSE/libmdtools/DUFF.cpp 2003/06/24 19:57:54 564 +++ trunk/OOPSE/libmdtools/DUFF.cpp 2003/08/20 19:11:51 704 @@ -22,7 +22,7 @@ using namespace std; #define HARMONIC_BOND 1 -namespace TPE { // restrict the access of the folowing to this file only. +namespace DUFF_NS { // restrict the access of the folowing to this file only. // Declare the structures that will be passed by MPI @@ -35,6 +35,11 @@ namespace TPE { // restrict the access of the folowin double dipole; double w0; double v0; + double v0p; + double rl; + double ru; + double rlp; + double rup; int isSSD; int isDipole; int ident; @@ -138,6 +143,11 @@ namespace TPE { // restrict the access of the folowin next->dipole = info.dipole; next->w0 = info.w0; next->v0 = info.v0; + next->v0p = info.v0p; + next->rl = info.rl; + next->ru = info.ru; + next->rlp = info.rlp; + next->rup = info.rup; next->ident = info.ident; } } @@ -154,6 +164,11 @@ namespace TPE { // restrict the access of the folowin info.dipole = dipole; info.w0 = w0; info.v0 = v0; + info.v0p = v0p; + info.rl = rl; + info.ru = ru; + info.rlp = rlp; + info.rup = rup; info.ident = ident; info.last = 0; } @@ -170,6 +185,11 @@ namespace TPE { // restrict the access of the folowin double dipole; double w0; double v0; + double v0p; + double rl; + double ru; + double rlp; + double rup; int ident; LinkedAtomType* next; }; @@ -420,7 +440,7 @@ namespace TPE { // restrict the access of the folowin } // namespace -using namespace TPE; +using namespace DUFF_NS; //**************************************************************** @@ -764,6 +784,7 @@ void DUFF::readParams( void ){ int isGB = 0; int isLJ = 1; + int isEAM =0; double GB_dummy = 0.0; @@ -773,7 +794,10 @@ void DUFF::readParams( void ){ if(currentAtomType->isDipole) entry_plug->useDipole = 1; if(currentAtomType->isSSD) { entry_plug->useSticky = 1; - set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0)); + set_sticky_params( &(currentAtomType->w0), &(currentAtomType->v0), + &(currentAtomType->v0p), + &(currentAtomType->rl), &(currentAtomType->ru), + &(currentAtomType->rlp), &(currentAtomType->rup)); } if( currentAtomType->name[0] != '\0' ){ @@ -783,6 +807,7 @@ void DUFF::readParams( void ){ &(currentAtomType->isSSD), &(currentAtomType->isDipole), &isGB, + &isEAM, &(currentAtomType->epslon), &(currentAtomType->sigma), &(currentAtomType->dipole), @@ -1285,7 +1310,9 @@ void DUFF::initializeBends( int nBends, Bend** bendArr } gBend = new GhostBend( *the_atoms[a], - *the_atoms[b] ); + *the_atoms[b], + *the_atoms[c] ); + gBend->setConstants( currentBendType->k1, currentBendType->k2, currentBendType->k3, @@ -1301,7 +1328,7 @@ void DUFF::initializeBends( int nBends, Bend** bendArr currentBendType->k3, currentBendType->t0 ); bendArray[i] = qBend; - } + } } } } @@ -1408,7 +1435,7 @@ void DUFF::fastForward( char* stopText, char* searchOw } -int TPE::parseAtom( char *lineBuffer, int lineNum, atomStruct &info ){ +int DUFF_NS::parseAtom( char *lineBuffer, int lineNum, atomStruct &info ){ char* the_token; @@ -1494,15 +1521,59 @@ int TPE::parseAtom( char *lineBuffer, int lineNum, ato } info.v0 = atof( the_token ); + if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ + sprintf( painCave.errMsg, + "Error parseing AtomTypes: line %d\n", lineNum ); + painCave.isFatal = 1; + simError(); + } + + info.v0p = atof( the_token ); + + if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ + sprintf( painCave.errMsg, + "Error parseing AtomTypes: line %d\n", lineNum ); + painCave.isFatal = 1; + simError(); + } + + info.rl = atof( the_token ); + + if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ + sprintf( painCave.errMsg, + "Error parseing AtomTypes: line %d\n", lineNum ); + painCave.isFatal = 1; + simError(); + } + + info.ru = atof( the_token ); + + if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ + sprintf( painCave.errMsg, + "Error parseing AtomTypes: line %d\n", lineNum ); + painCave.isFatal = 1; + simError(); + } + + info.rlp = atof( the_token ); + + if( ( the_token = strtok( NULL, " \n\t,;" ) ) == NULL ){ + sprintf( painCave.errMsg, + "Error parseing AtomTypes: line %d\n", lineNum ); + painCave.isFatal = 1; + simError(); + } + + info.rup = atof( the_token ); } - else info.v0 = info.w0 = 0.0; + else info.v0 = info.w0 = info.v0p = info.rl = info.ru = info.rlp = info.rup = 0.0; return 1; } else return 0; } -int TPE::parseBond( char *lineBuffer, int lineNum, bondStruct &info ){ +int DUFF_NS::parseBond( char *lineBuffer, int lineNum, bondStruct &info ){ char* the_token; char bondType[30]; @@ -1541,6 +1612,8 @@ int TPE::parseBond( char *lineBuffer, int lineNum, bon } info.d0 = atof( the_token ); + + info.k0=0.0; } else if( !strcmp( bondType, "harmonic" ) ){ info.type = HARMONIC_BOND; @@ -1579,7 +1652,7 @@ int TPE::parseBond( char *lineBuffer, int lineNum, bon } -int TPE::parseBend( char *lineBuffer, int lineNum, bendStruct &info ){ +int DUFF_NS::parseBend( char *lineBuffer, int lineNum, bendStruct &info ){ char* the_token; @@ -1667,7 +1740,7 @@ int TPE::parseBend( char *lineBuffer, int lineNum, ben else return 0; } -int TPE::parseTorsion( char *lineBuffer, int lineNum, torsionStruct &info ){ +int DUFF_NS::parseTorsion( char *lineBuffer, int lineNum, torsionStruct &info ){ char* the_token;