| 189 | } |
| 190 | |
| 191 | int |
| 192 | DisplacementControl::newStep(void) |
| 193 | { |
| 194 | |
| 195 | if (theDofID == -1) { |
| 196 | opserr << "DisplacementControl::newStep() - dof is fixed or constrained (or domainChanged has not been called!)\n"; |
| 197 | return -1; |
| 198 | } |
| 199 | |
| 200 | // get pointers to AnalysisModel and LinearSOE |
| 201 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 202 | LinearSOE *theLinSOE = this->getLinearSOE(); |
| 203 | if (theModel == 0 || theLinSOE == 0) { |
| 204 | opserr << "WARNING DisplacementControl::newStep() "; |
| 205 | opserr << "No AnalysisModel or LinearSOE has been set\n"; |
| 206 | return -1; |
| 207 | } |
| 208 | |
| 209 | if (theDomain == 0) |
| 210 | theDomain = theModel->getDomainPtr(); |
| 211 | |
| 212 | // determine increment for this iteration |
| 213 | double factor = double(specNumIncrStep)/numIncrLastStep; |
| 214 | theIncrement *=factor; |
| 215 | |
| 216 | if (theIncrement < minIncrement) |
| 217 | theIncrement = minIncrement; |
| 218 | else if (theIncrement > maxIncrement) |
| 219 | theIncrement = maxIncrement; |
| 220 | |
| 221 | |
| 222 | // get the current load factor |
| 223 | currentLambda = theModel->getCurrentDomainTime(); |
| 224 | |
| 225 | // determine dUhat |
| 226 | this->formTangent(tangFlag); |
| 227 | theLinSOE->setB(*phat); |
| 228 | if (theLinSOE->solve() < 0) { |
| 229 | opserr << "DisplacementControl::newStep(void) - failed in solver\n"; |
| 230 | return -1; |
| 231 | } |
| 232 | |
| 233 | (*deltaUhat) = theLinSOE->getX(); |
| 234 | Vector &dUhat = *deltaUhat;// this is the Uft in the nonlinear lecture notes |
| 235 | double dUahat = dUhat(theDofID);// this is the component of the Uft in our nonlinear lecture notes |
| 236 | |
| 237 | if (dUahat == 0.0) { |
| 238 | opserr << "WARNING DisplacementControl::newStep() "; |
| 239 | opserr << "dUahat is zero -- zero reference displacement at control node DOF\n"; |
| 240 | return -1; |
| 241 | } |
| 242 | |
| 243 | // determine delta lambda(1) == dlambda |
| 244 | double dlambda = theIncrement/dUahat; // this is the dlambda of the 1st step |
| 245 | |
| 246 | // calldLambda1dh=theIncrement; |
| 247 | deltaLambdaStep = dlambda; |
| 248 | currentLambda += dlambda; |
nothing calls this directly
no test coverage detected