| 170 | |
| 171 | |
| 172 | int CollocationHSFixedNumIter::newStep(double _deltaT) |
| 173 | { |
| 174 | if (theta <= 0.0 ) { |
| 175 | opserr << "CollocationHSFixedNumIter::newStep() - error in variable\n"; |
| 176 | opserr << "theta: " << theta << " <= 0.0\n"; |
| 177 | return -1; |
| 178 | } |
| 179 | |
| 180 | deltaT = _deltaT; |
| 181 | if (deltaT <= 0.0) { |
| 182 | opserr << "CollocationHSFixedNumIter::newStep() - error in variable\n"; |
| 183 | opserr << "dT = " << deltaT << endln; |
| 184 | return -2; |
| 185 | } |
| 186 | |
| 187 | // get a pointer to the AnalysisModel |
| 188 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 189 | |
| 190 | // set the constants |
| 191 | c1 = 1.0; |
| 192 | c2 = gamma/(beta*theta*deltaT); |
| 193 | c3 = 1.0/(beta*theta*theta*deltaT*deltaT); |
| 194 | |
| 195 | if (U == 0) { |
| 196 | opserr << "CollocationHSFixedNumIter::newStep() - domainChange() failed or hasn't been called\n"; |
| 197 | return -3; |
| 198 | } |
| 199 | |
| 200 | // set response at t to be that at t+deltaT of previous step |
| 201 | (*Utm2) = *Utm1; |
| 202 | (*Utm1) = *Ut; |
| 203 | (*Ut) = *U; |
| 204 | (*Utdot) = *Udot; |
| 205 | (*Utdotdot) = *Udotdot; |
| 206 | |
| 207 | // determine new velocities and accelerations at t+theta*deltaT |
| 208 | double a1 = (1.0 - gamma/beta); |
| 209 | double a2 = theta*deltaT*(1.0 - 0.5*gamma/beta); |
| 210 | Udot->addVector(a1, *Utdotdot, a2); |
| 211 | |
| 212 | double a3 = -1.0/(beta*theta*deltaT); |
| 213 | double a4 = 1.0 - 0.5/beta; |
| 214 | Udotdot->addVector(a4, *Utdot, a3); |
| 215 | |
| 216 | // set the trial response quantities |
| 217 | theModel->setVel(*Udot); |
| 218 | theModel->setAccel(*Udotdot); |
| 219 | |
| 220 | // increment the time to t+theta*deltaT and apply the load |
| 221 | double time = theModel->getCurrentDomainTime(); |
| 222 | time += theta*deltaT; |
| 223 | theModel->applyLoadDomain(time); |
| 224 | |
| 225 | return 0; |
| 226 | } |
| 227 | |
| 228 | |
| 229 | int CollocationHSFixedNumIter::revertToLastStep() |
nothing calls this directly
no test coverage detected