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 311 by mmeineke, Tue Mar 11 16:27:34 2003 UTC

# Line 1009 | Line 1009 | void TraPPE_ExFF::initializeBends( bend_set* the_bends
1009                   // if things go well, last will be set to 0
1010  
1011    QuadraticBend* qBend;
1012 +  GhostBend* gBend;
1013    SRI **the_sris;
1014    Atom** the_atoms;
1015    int nBends;
# Line 1109 | Line 1110 | void TraPPE_ExFF::initializeBends( bend_set* the_bends
1110  
1111      atomA = the_atoms[a]->getType();
1112      atomB = the_atoms[b]->getType();
1113 <    atomC = the_atoms[c]->getType();
1113 >
1114 >    if( the_bends[i].isGhost ) atomC = "GHOST";
1115 >    else atomC = the_atoms[c]->getType();
1116 >
1117      currentBendType = headBendType->find( atomA, atomB, atomC );
1118      if( currentBendType == NULL ){
1119        sprintf( painCave.errMsg, "BendType error, %s - %s - %s not found"
# Line 1122 | Line 1126 | void TraPPE_ExFF::initializeBends( bend_set* the_bends
1126      if( !strcmp( currentBendType->type, "quadratic" ) ){
1127        
1128        index = i + entry_plug->n_bonds;
1129 <      qBend = new QuadraticBend( *the_atoms[a],
1130 <                                 *the_atoms[b],
1131 <                                 *the_atoms[c] );
1132 <      qBend->setConstants( currentBendType->k1,
1133 <                           currentBendType->k2,
1134 <                           currentBendType->k3,
1135 <                           currentBendType->t0 );
1136 <      the_sris[index] = qBend;
1129 >      
1130 >      if( the_bends[i].isGhost){
1131 >        
1132 >        if( the_bends[i].ghost == b ){
1133 >          // do nothing
1134 >        }
1135 >        else if( the_bends[i].ghost == a ){
1136 >          c = a;
1137 >          a = b;
1138 >          b = a;
1139 >        }
1140 >        else{
1141 >          sprintf( painCave.errMsg,
1142 >                   "BendType error, %s - %s - %s,\n"
1143 >                   "  --> central atom is not "
1144 >                   "correctly identified with the "
1145 >                   "\"ghostVectorSource = \" tag.\n",
1146 >                   atomA, atomB, atomC );
1147 >          painCave.isFatal = 1;
1148 >          simError();
1149 >        }
1150 >        
1151 >        gBend = new GhostBend( *the_atoms[a],
1152 >                               *the_atoms[b] );                        
1153 >        gBend->setConstants( currentBendType->k1,
1154 >                             currentBendType->k2,
1155 >                             currentBendType->k3,
1156 >                             currentBendType->t0 );
1157 >        the_sris[index] = gBend;
1158 >      }
1159 >      else{
1160 >        qBend = new QuadraticBend( *the_atoms[a],
1161 >                                   *the_atoms[b],
1162 >                                   *the_atoms[c] );
1163 >        qBend->setConstants( currentBendType->k1,
1164 >                             currentBendType->k2,
1165 >                             currentBendType->k3,
1166 >                             currentBendType->t0 );
1167 >        the_sris[index] = qBend;
1168 >      }
1169      }
1170    }
1171  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines