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

Method newStep

SRC/analysis/integrator/NewmarkHSIncrReduct.cpp:115–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113
114
115int NewmarkHSIncrReduct::newStep(double deltaT)
116{
117 if (beta == 0 || gamma == 0 || reduct == 0) {
118 opserr << "NewmarkHSIncrReduct::newStep() - error in variable\n";
119 opserr << "gamma = " << gamma << " beta = " << beta
120 << " reduct = " << reduct << endln;
121 return -1;
122 }
123
124 if (deltaT <= 0.0) {
125 opserr << "NewmarkHSIncrReduct::newStep() - error in variable\n";
126 opserr << "dT = " << deltaT << endln;
127 return -2;
128 }
129
130 // get a pointer to the AnalysisModel
131 AnalysisModel *theModel = this->getAnalysisModel();
132
133 // set the constants
134 c1 = 1.0;
135 c2 = gamma/(beta*deltaT);
136 c3 = 1.0/(beta*deltaT*deltaT);
137
138 if (U == 0) {
139 opserr << "NewmarkHSIncrReduct::newStep() - domainChange() failed or hasn't been called\n";
140 return -3;
141 }
142
143 // set response at t to be that at t+deltaT of previous step
144 (*Ut) = *U;
145 (*Utdot) = *Udot;
146 (*Utdotdot) = *Udotdot;
147
148 // determine new velocities and accelerations at t+deltaT
149 double a1 = (1.0 - gamma/beta);
150 double a2 = deltaT*(1.0 - 0.5*gamma/beta);
151 Udot->addVector(a1, *Utdotdot, a2);
152
153 double a3 = -1.0/(beta*deltaT);
154 double a4 = 1.0 - 0.5/beta;
155 Udotdot->addVector(a4, *Utdot, a3);
156
157 // set the trial response quantities
158 theModel->setVel(*Udot);
159 theModel->setAccel(*Udotdot);
160
161 // increment the time to t+deltaT and apply the load
162 double time = theModel->getCurrentDomainTime();
163 time += deltaT;
164 if (theModel->updateDomain(time, deltaT) < 0) {
165 opserr << "NewmarkHSIncrReduct::newStep() - failed to update the domain\n";
166 return -4;
167 }
168
169 return 0;
170}
171
172

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