| 477 | // values in u, components identified by myID; |
| 478 | |
| 479 | void |
| 480 | TransformationDOF_Group::setNodeDisp(const Vector &u) |
| 481 | { |
| 482 | #ifdef TRANSF_INCREMENTAL_MP |
| 483 | // save the previous mod trial here |
| 484 | static Vector modTrialDispOld; |
| 485 | modTrialDispOld = modTotalDisp; // at previous iteration |
| 486 | #endif // TRANSF_INCREMENTAL_MP |
| 487 | |
| 488 | // call base class method and return if no MP_Constraint |
| 489 | if (theMP == 0) { |
| 490 | this->DOF_Group::setNodeDisp(u); |
| 491 | return; |
| 492 | } |
| 493 | |
| 494 | const ID &theID = this->getID(); |
| 495 | for (int i=0; i<modNumDOF; i++) { |
| 496 | int loc = theID(i); |
| 497 | if (loc >= 0) |
| 498 | (*modUnbalance)(i) = u(loc); |
| 499 | else |
| 500 | (*modUnbalance)(i) = 0.0; |
| 501 | } |
| 502 | |
| 503 | |
| 504 | if (needRetainedData == 0) { |
| 505 | int retainedNode = theMP->getNodeRetained(); |
| 506 | Domain *theDomain = myNode->getDomain(); |
| 507 | Node *retainedNodePtr = theDomain->getNode(retainedNode); |
| 508 | const Vector &responseR = retainedNodePtr->getTrialDisp(); |
| 509 | const ID &retainedDOF = theMP->getRetainedDOFs(); |
| 510 | |
| 511 | for (int i=numConstrainedNodeRetainedDOF, j=0; i<modNumDOF; i++, j++) { |
| 512 | int loc = theID(i); |
| 513 | if (loc < 0) |
| 514 | (*modUnbalance)(i) = responseR(retainedDOF(j)); |
| 515 | } |
| 516 | } |
| 517 | |
| 518 | #ifdef TRANSF_INCREMENTAL_MP |
| 519 | modTotalDisp = *modUnbalance; // save it for next iteration |
| 520 | #endif // TRANSF_INCREMENTAL_MP |
| 521 | |
| 522 | // at this point the modUnbalance contains the reduced total displacement. |
| 523 | // remove the trial one to obtain the increment, so that we transform only the increment |
| 524 | #ifdef TRANSF_INCREMENTAL_MP |
| 525 | modUnbalance->addVector(1.0, modTrialDispOld, -1.0); |
| 526 | #ifdef TRANSF_INCREMENTAL_MP_DEBUG |
| 527 | opserr << " N = " << myNode->getTag() << "\n"; |
| 528 | opserr << " solut: " << u; |
| 529 | opserr << " oldtr: " << modTrialDispOld; |
| 530 | opserr << " trial: " << myNode->getTrialDisp(); |
| 531 | opserr << " commi: " << myNode->getDisp(); |
| 532 | opserr << " incre: " << myNode->getIncrDisp(); |
| 533 | opserr << " delta: " << myNode->getIncrDeltaDisp(); |
| 534 | Domain* dom = myNode->getDomain(); |
| 535 | Node* ret = dom->getNode(theMP->getNodeRetained()); |
| 536 | opserr << " R VEL: " << ret->getTrialVel(); |
nothing calls this directly
no test coverage detected