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

Method newStep

SRC/analysis/integrator/AlphaOS_TP.cpp:153–214  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151
152
153int AlphaOS_TP::newStep(double _deltaT)
154{
155 updateCount = 0;
156
157 if (beta == 0 || gamma == 0 ) {
158 opserr << "AlphaOS_TP::newStep() - error in variable\n";
159 opserr << "gamma = " << gamma << " beta = " << beta << endln;
160 return -1;
161 }
162
163 deltaT = _deltaT;
164 if (deltaT <= 0.0) {
165 opserr << "AlphaOS_TP::newStep() - error in variable\n";
166 opserr << "dT = " << deltaT << "\n";
167 return -2;
168 }
169
170 // get a pointer to the LinearSOE and the AnalysisModel
171 LinearSOE *theLinSOE = this->getLinearSOE();
172 AnalysisModel *theModel = this->getAnalysisModel();
173 if (theLinSOE == 0 || theModel == 0) {
174 opserr << "WARNING AlphaOS_TP::newStep() - ";
175 opserr << "no LinearSOE or AnalysisModel has been set\n";
176 return -3;
177 }
178
179 // set the constants
180 c1 = 1.0;
181 c2 = gamma/(beta*deltaT);
182 c3 = 1.0/(beta*deltaT*deltaT);
183
184 if (U == 0) {
185 opserr << "AlphaOS_TP::newStep() - domainChange() failed or hasn't been called\n";
186 return -4;
187 }
188
189 // set weighting factors for subsequent iterations
190 alphaD = alphaR = alphaP = alpha;
191 alphaKU = 0.0;
192
193 // determine new response at time t+deltaT
194 U->addVector(1.0, *Utdot, deltaT);
195 double a1 = (0.5 - beta)*deltaT*deltaT;
196 U->addVector(1.0, *Utdotdot, a1);
197
198 double a2 = deltaT*(1.0 - gamma);
199 Udot->addVector(1.0, *Utdotdot, a2);
200
201 // set the trial response quantities
202 theModel->setDisp(*U);
203 theModel->setVel(*Udot);
204
205 // increment the time to t+deltaT and apply the load
206 double time = theModel->getCurrentDomainTime();
207 time += deltaT;
208 if (theModel->updateDomain(time, deltaT) < 0) {
209 opserr << "AlphaOS_TP::newStep() - failed to update the domain\n";
210 return -5;

Callers

nothing calls this directly

Calls 7

getLinearSOEMethod · 0.45
getAnalysisModelMethod · 0.45
addVectorMethod · 0.45
setDispMethod · 0.45
setVelMethod · 0.45
getCurrentDomainTimeMethod · 0.45
updateDomainMethod · 0.45

Tested by

no test coverage detected