| 174 | } |
| 175 | |
| 176 | int |
| 177 | DistributedDisplacementControl::update(const Vector &dU) |
| 178 | { |
| 179 | |
| 180 | AnalysisModel *theModel = this->getAnalysisModel(); |
| 181 | LinearSOE *theLinSOE = this->getLinearSOE(); |
| 182 | if (theModel == 0 || theLinSOE == 0) { |
| 183 | opserr << "WARNING DistributedDisplacementControl::update() "; |
| 184 | opserr << "No AnalysisModel or LinearSOE has been set\n"; |
| 185 | return -1; |
| 186 | } |
| 187 | |
| 188 | (*deltaUbar) = dU; // have to do this as the SOE is gonna change |
| 189 | double dUabar = (*deltaUbar)(theDofID); |
| 190 | |
| 191 | // determine dUhat |
| 192 | if (processID == 0) |
| 193 | theLinSOE->setB(*phat); |
| 194 | else |
| 195 | theLinSOE->zeroB(); |
| 196 | |
| 197 | theLinSOE->solve(); |
| 198 | (*deltaUhat) = theLinSOE->getX(); |
| 199 | |
| 200 | double dUahat = (*deltaUhat)(theDofID); |
| 201 | |
| 202 | if (dUahat == 0.0) { |
| 203 | opserr << "WARNING DistributedDisplacementControl::update() "; |
| 204 | opserr << "dUahat is zero -- zero reference displacement at control node DOF\n"; |
| 205 | return -1; |
| 206 | } |
| 207 | |
| 208 | // determine delta lambda(1) == dlambda |
| 209 | double dLambda = -dUabar/dUahat; |
| 210 | |
| 211 | // determine delta U(i) |
| 212 | (*deltaU) = (*deltaUbar); |
| 213 | deltaU->addVector(1.0, *deltaUhat,dLambda); |
| 214 | |
| 215 | // update dU and dlambda |
| 216 | (*deltaUstep) += *deltaU; |
| 217 | deltaLambdaStep += dLambda; |
| 218 | currentLambda += dLambda; |
| 219 | |
| 220 | // update the model |
| 221 | theModel->incrDisp(*deltaU); |
| 222 | |
| 223 | theModel->applyLoadDomain(currentLambda); |
| 224 | if (theModel->updateDomain() < 0) { |
| 225 | opserr << "DistributedDisplacementControl::update - model failed to update for new dU\n"; |
| 226 | return -1; |
| 227 | } |
| 228 | |
| 229 | |
| 230 | // set the X soln in linearSOE to be deltaU for convergence Test |
| 231 | theLinSOE->setX(*deltaU); |
| 232 | |
| 233 | numIncrLastStep++; |
nothing calls this directly
no test coverage detected