| 133 | |
| 134 | |
| 135 | int Collocation::newStep(double _deltaT) |
| 136 | { |
| 137 | if (theta <= 0.0 ) { |
| 138 | opserr << "Collocation::newStep() - error in variable\n"; |
| 139 | opserr << "theta: " << theta << " <= 0.0\n"; |
| 140 | return -1; |
| 141 | } |
| 142 | |
| 143 | deltaT = _deltaT; |
| 144 | if (deltaT <= 0.0) { |
| 145 | opserr << "Collocation::newStep() - error in variable\n"; |
| 146 | opserr << "dT = " << deltaT << endln; |
| 147 | return -2; |
| 148 | } |
| 149 | |
| 150 | // get a pointer to the AnalysisModel |
| 151 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 152 | |
| 153 | // set the constants |
| 154 | c1 = 1.0; |
| 155 | c2 = gamma/(beta*theta*deltaT); |
| 156 | c3 = 1.0/(beta*theta*theta*deltaT*deltaT); |
| 157 | |
| 158 | if (U == 0) { |
| 159 | opserr << "Collocation::newStep() - domainChange() failed or hasn't been called\n"; |
| 160 | return -3; |
| 161 | } |
| 162 | |
| 163 | // set response at t to be that at t+deltaT of previous step |
| 164 | (*Ut) = *U; |
| 165 | (*Utdot) = *Udot; |
| 166 | (*Utdotdot) = *Udotdot; |
| 167 | |
| 168 | // determine new velocities and accelerations at t+theta*deltaT |
| 169 | double a1 = (1.0 - gamma/beta); |
| 170 | double a2 = theta*deltaT*(1.0 - 0.5*gamma/beta); |
| 171 | Udot->addVector(a1, *Utdotdot, a2); |
| 172 | |
| 173 | double a3 = -1.0/(beta*theta*deltaT); |
| 174 | double a4 = 1.0 - 0.5/beta; |
| 175 | Udotdot->addVector(a4, *Utdot, a3); |
| 176 | |
| 177 | // set the trial response quantities |
| 178 | theModel->setVel(*Udot); |
| 179 | theModel->setAccel(*Udotdot); |
| 180 | |
| 181 | // increment the time to t+theta*deltaT and apply the load |
| 182 | double time = theModel->getCurrentDomainTime(); |
| 183 | time += theta*deltaT; |
| 184 | if (theModel->updateDomain(time, deltaT) < 0) { |
| 185 | opserr << "Collocation::newStep() - failed to update the domain\n"; |
| 186 | return -4; |
| 187 | } |
| 188 | |
| 189 | return 0; |
| 190 | } |
| 191 | |
| 192 |
nothing calls this directly
no test coverage detected