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

Method newStep

DEVELOPER/integrator/Trapezoidal.cpp:116–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114
115
116int Trapezoidal::newStep(double deltaT)
117{
118 // check the vectors have been created
119 if (U == 0) {
120 opserr << "Trapezoidal::newStep() - domainChange() failed or hasn't been called\n";
121 return -3;
122 }
123
124 // get a pointer to the AnalysisModel
125 AnalysisModel *theModel = this->getAnalysisModel();
126
127 // set response at t to be that at t+deltaT of previous step
128 (*Ut) = *U;
129 (*Utdot) = *Udot;
130 (*Utdotdot) = *Udotdot;
131
132 c1 = 1.0;
133 c2 = 2.0/deltaT;
134 c3 = 4.0/(deltaT*deltaT);
135
136 (*Udot) *= -1.0;
137
138 double a3 = -4.0/deltaT;
139 double a4 = -1;
140 Udotdot->addVector(a4, *Utdot, a3);
141
142 // set the trial response quantities
143 theModel->setVel(*Udot);
144 theModel->setAccel(*Udotdot);
145
146 // increment the time to t+deltaT and apply the load
147 double time = theModel->getCurrentDomainTime();
148 time += deltaT;
149 if (theModel->updateDomain(time, deltaT) < 0) {
150 opserr << "Trapezoidal::newStep() - failed to update the domain\n";
151 return -4;
152 }
153
154 return 0;
155}
156
157
158int Trapezoidal::revertToLastStep()

Callers

nothing calls this directly

Calls 6

getAnalysisModelMethod · 0.45
addVectorMethod · 0.45
setVelMethod · 0.45
setAccelMethod · 0.45
getCurrentDomainTimeMethod · 0.45
updateDomainMethod · 0.45

Tested by

no test coverage detected