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

Comparing trunk/OOPSE_old/src/mdtools/libmdCode/TraPPE_ExFF.cpp (file contents):
Revision 296 by mmeineke, Thu Mar 6 20:05:39 2003 UTC vs.
Revision 321 by mmeineke, Wed Mar 12 15:12:24 2003 UTC

# Line 217 | Line 217 | TraPPE_ExFF::TraPPE_ExFF(){
217        
218        ffPath = getenv( ffPath_env );
219        if( ffPath == NULL ) {
220 <        sprintf( painCave.errMsg,
221 <                 "Error opening the force field parameter file: %s\n"
222 <                 "Have you tried setting the FORCE_PARAM_PATH environment "
223 <                 "vairable?\n",
224 <                 fileName );
225 <        painCave.isFatal = 1;
226 <        simError();
220 >        STR_DEFINE(ffPath, FRC_PATH );
221        }
222        
223        
# Line 1009 | Line 1003 | void TraPPE_ExFF::initializeBends( bend_set* the_bends
1003                   // if things go well, last will be set to 0
1004  
1005    QuadraticBend* qBend;
1006 +  GhostBend* gBend;
1007    SRI **the_sris;
1008    Atom** the_atoms;
1009    int nBends;
# Line 1109 | Line 1104 | void TraPPE_ExFF::initializeBends( bend_set* the_bends
1104  
1105      atomA = the_atoms[a]->getType();
1106      atomB = the_atoms[b]->getType();
1107 <    atomC = the_atoms[c]->getType();
1107 >
1108 >    if( the_bends[i].isGhost ) atomC = "GHOST";
1109 >    else atomC = the_atoms[c]->getType();
1110 >
1111      currentBendType = headBendType->find( atomA, atomB, atomC );
1112      if( currentBendType == NULL ){
1113        sprintf( painCave.errMsg, "BendType error, %s - %s - %s not found"
# Line 1122 | Line 1120 | void TraPPE_ExFF::initializeBends( bend_set* the_bends
1120      if( !strcmp( currentBendType->type, "quadratic" ) ){
1121        
1122        index = i + entry_plug->n_bonds;
1123 <      qBend = new QuadraticBend( *the_atoms[a],
1124 <                                 *the_atoms[b],
1125 <                                 *the_atoms[c] );
1126 <      qBend->setConstants( currentBendType->k1,
1127 <                           currentBendType->k2,
1128 <                           currentBendType->k3,
1129 <                           currentBendType->t0 );
1130 <      the_sris[index] = qBend;
1123 >      
1124 >      if( the_bends[i].isGhost){
1125 >        
1126 >        if( the_bends[i].ghost == b ){
1127 >          // do nothing
1128 >        }
1129 >        else if( the_bends[i].ghost == a ){
1130 >          c = a;
1131 >          a = b;
1132 >          b = a;
1133 >        }
1134 >        else{
1135 >          sprintf( painCave.errMsg,
1136 >                   "BendType error, %s - %s - %s,\n"
1137 >                   "  --> central atom is not "
1138 >                   "correctly identified with the "
1139 >                   "\"ghostVectorSource = \" tag.\n",
1140 >                   atomA, atomB, atomC );
1141 >          painCave.isFatal = 1;
1142 >          simError();
1143 >        }
1144 >        
1145 >        gBend = new GhostBend( *the_atoms[a],
1146 >                               *the_atoms[b] );                        
1147 >        gBend->setConstants( currentBendType->k1,
1148 >                             currentBendType->k2,
1149 >                             currentBendType->k3,
1150 >                             currentBendType->t0 );
1151 >        the_sris[index] = gBend;
1152 >      }
1153 >      else{
1154 >        qBend = new QuadraticBend( *the_atoms[a],
1155 >                                   *the_atoms[b],
1156 >                                   *the_atoms[c] );
1157 >        qBend->setConstants( currentBendType->k1,
1158 >                             currentBendType->k2,
1159 >                             currentBendType->k3,
1160 >                             currentBendType->t0 );
1161 >        the_sris[index] = qBend;
1162 >      }
1163      }
1164    }
1165  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines