MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / update

Method update

SRC/analysis/integrator/CentralDifferenceAlternative.cpp:191–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

189
190
191int
192CentralDifferenceAlternative::update(const Vector &X)
193{
194 updateCount++;
195 if (updateCount > 1) {
196 opserr << "ERROR CentralDifferenceAlternative::update() - called more than once -";
197 opserr << " Central Difference integraion schemes require a LINEAR solution algorithm\n";
198 return -1;
199 }
200
201 AnalysisModel *theModel = this->getAnalysisModel();
202
203 if (theModel == 0) {
204 opserr << "ERROR CentralDifferenceAlternative::update() - no AnalysisModel set\n";
205 return -2;
206 }
207
208 // check domainChanged() has been called, i.e. Ut will not be zero
209 if (Ut == 0) {
210 opserr << "WARNING CentralDifferenceAlternative::update() - domainChange() failed or not called\n";
211 return -2;
212 }
213
214 // check deltaU is of correct size
215 if (X.Size() != Ut->Size()) {
216 opserr << "WARNING CentralDifferenceAlternative::update() - Vectors of incompatible size ";
217 opserr << " expecting " << Ut->Size() << " obtained " << X.Size() << endln;
218 return -3;
219 }
220
221
222 // determine the displacement at t+delta t
223 Utp1->addVector(0.0, X, deltaT * deltaT);
224 (*Utp1) += *Ut;
225 Utp1->addVector(1.0, *Udot, deltaT);
226
227 // determine the vel at t+ 0.5 * delta t
228 (*Udot) = *Utp1;
229 (*Udot) -= *Ut;
230 (*Udot) *= (1.0/deltaT);
231
232 // update the disp & responses at the DOFs
233 theModel->setDisp(*Utp1);
234 theModel->setVel(*Udot);
235 theModel->updateDomain();
236
237 return 0;
238 }
239
240int
241CentralDifferenceAlternative::commit(void)

Callers

nothing calls this directly

Calls 6

getAnalysisModelMethod · 0.45
SizeMethod · 0.45
addVectorMethod · 0.45
setDispMethod · 0.45
setVelMethod · 0.45
updateDomainMethod · 0.45

Tested by

no test coverage detected