MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / setNodeDisp

Method setNodeDisp

SRC/analysis/dof_grp/TransformationDOF_Group.cpp:479–564  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

477// values in u, components identified by myID;
478
479void
480TransformationDOF_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();

Callers

nothing calls this directly

Calls 12

getTMethod · 0.95
getIDMethod · 0.80
getNodeRetainedMethod · 0.45
getDomainMethod · 0.45
getNodeMethod · 0.45
addVectorMethod · 0.45
getTagMethod · 0.45
getDispMethod · 0.45
addMatrixVectorMethod · 0.45
getNumberDOFMethod · 0.45
incrTrialDispMethod · 0.45
setTrialDispMethod · 0.45

Tested by

no test coverage detected