| 131 | |
| 132 | |
| 133 | int HHTExplicit_TP::newStep(double _deltaT) |
| 134 | { |
| 135 | updateCount = 0; |
| 136 | |
| 137 | if (gamma == 0) { |
| 138 | opserr << "HHTExplicit_TP::newStep() - error in variable\n"; |
| 139 | opserr << "gamma = " << gamma << endln; |
| 140 | return -1; |
| 141 | } |
| 142 | |
| 143 | deltaT = _deltaT; |
| 144 | if (deltaT <= 0.0) { |
| 145 | opserr << "HHTExplicit_TP::newStep() - error in variable\n"; |
| 146 | opserr << "dT = " << deltaT << endln; |
| 147 | return -2; |
| 148 | } |
| 149 | |
| 150 | // get a pointer to the LinearSOE and the AnalysisModel |
| 151 | LinearSOE *theLinSOE = this->getLinearSOE(); |
| 152 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 153 | if (theLinSOE == 0 || theModel == 0) { |
| 154 | opserr << "WARNING HHTExplicit_TP::newStep() - "; |
| 155 | opserr << "no LinearSOE or AnalysisModel has been set\n"; |
| 156 | return -3; |
| 157 | } |
| 158 | |
| 159 | // set the constants |
| 160 | c2 = gamma*deltaT; |
| 161 | c3 = 1.0; |
| 162 | |
| 163 | if (U == 0) { |
| 164 | opserr << "HHTExplicit_TP::newStep() - domainChange() failed or hasn't been called\n"; |
| 165 | return -4; |
| 166 | } |
| 167 | |
| 168 | // set weighting factors for subsequent iterations |
| 169 | alphaD = alphaR = alphaP = alpha; |
| 170 | |
| 171 | // set response at t to be that at t+deltaT of previous step |
| 172 | (*Ut) = *U; |
| 173 | (*Utdot) = *Udot; |
| 174 | (*Utdotdot) = *Udotdot; |
| 175 | |
| 176 | // determine new displacements and velocities at time t+deltaT |
| 177 | U->addVector(1.0, *Utdot, deltaT); |
| 178 | double a1 = 0.5*deltaT*deltaT; |
| 179 | U->addVector(1.0, *Utdotdot, a1); |
| 180 | |
| 181 | double a2 = deltaT*(1.0 - gamma); |
| 182 | Udot->addVector(1.0, *Utdotdot, a2); |
| 183 | |
| 184 | // no need to zero accelerations because alphaM = 0 |
| 185 | //Udotdot->Zero(); |
| 186 | //theModel->setResponse(*U, *Udot, *Udotdot); |
| 187 | |
| 188 | // set the trial response quantities |
| 189 | theModel->setDisp(*U); |
| 190 | theModel->setVel(*Udot); |
nothing calls this directly
no test coverage detected