| 206 | |
| 207 | |
| 208 | int |
| 209 | CentralDifferenceNoDamping::update(const Vector &X) |
| 210 | { |
| 211 | updateCount++; |
| 212 | if (updateCount > 1) { |
| 213 | opserr << "ERROR CentralDifferenceNoDamping::update() - called more than once -"; |
| 214 | opserr << " Central Difference integraion schemes require a LINEAR solution algorithm\n"; |
| 215 | return -1; |
| 216 | } |
| 217 | |
| 218 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 219 | |
| 220 | if (theModel == 0) { |
| 221 | opserr << "ERROR CentralDifferenceNoDamping::update() - no AnalysisModel set\n"; |
| 222 | return -2; |
| 223 | } |
| 224 | |
| 225 | // check domainChanged() has been called, i.e. Ut will not be zero |
| 226 | if (U == 0) { |
| 227 | opserr << "WARNING CentralDifferenceNoDamping::update() - domainChange() failed or not called\n"; |
| 228 | return -2; |
| 229 | } |
| 230 | |
| 231 | // check deltaU is of correct size |
| 232 | if (X.Size() != U->Size()) { |
| 233 | opserr << "WARNING CentralDifferenceNoDamping::update() - Vectors of incompatible size "; |
| 234 | opserr << " expecting " << U->Size() << " obtained " << X.Size() << endln; |
| 235 | return -3; |
| 236 | } |
| 237 | |
| 238 | // determine the acceleration at time t |
| 239 | (*Udotdot) = X; |
| 240 | |
| 241 | // determine the vel at t+ 0.5 * delta t |
| 242 | Udot->addVector(1.0, X, deltaT); |
| 243 | |
| 244 | // determine the displacement at t+delta t |
| 245 | U->addVector(1.0, *Udot, deltaT); |
| 246 | |
| 247 | // update the disp & responses at the DOFs |
| 248 | theModel->setDisp(*U); |
| 249 | theModel->updateDomain(); |
| 250 | |
| 251 | return 0; |
| 252 | } |
| 253 | |
| 254 | int |
| 255 | CentralDifferenceNoDamping::commit(void) |
nothing calls this directly
no test coverage detected