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

Method handle

SRC/analysis/handler/TransformationConstraintHandler.cpp:78–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78int
79TransformationConstraintHandler::handle(const ID *nodesLast)
80{
81 // first check links exist to a Domain and an AnalysisModel object
82 Domain *theDomain = this->getDomainPtr();
83 AnalysisModel *theModel = this->getAnalysisModelPtr();
84 Integrator *theIntegrator = this->getIntegratorPtr();
85
86 if ((theDomain == 0) || (theModel == 0) || (theIntegrator == 0)) {
87 opserr << "WARNING TransformationConstraintHandler::handle() - ";
88 opserr << " setLinks() has not been called\n";
89 return -1;
90 }
91
92 // get number ofelements and nodes in the domain
93 // and init the theFEs and theDOFs arrays
94 int numMPConstraints = theDomain->getNumMPs();
95
96 // int numSPConstraints = theDomain->getNumSPs();
97 int numSPConstraints = 0;
98 SP_ConstraintIter &theSP1s = theDomain->getDomainAndLoadPatternSPs();
99 SP_Constraint *theSP1;
100 while ((theSP1 = theSP1s()) != 0)
101 numSPConstraints++;
102
103 numDOF = 0;
104 ID transformedNode(0, 64);
105
106 int i;
107
108 // create an ID of constrained node tags in MP_Constraints
109 ID constrainedNodesMP(0, numMPConstraints);
110 MP_Constraint **mps =0;
111 if (numMPConstraints != 0) {
112 mps = new MP_Constraint *[numMPConstraints];
113 if (mps == 0) {
114 opserr << "WARNING TransformationConstraintHandler::handle() - ";
115 opserr << "ran out of memory for MP_Constraints";
116 opserr << " array of size " << numMPConstraints << endln;
117 return -3;
118 }
119 MP_ConstraintIter &theMPs = theDomain->getMPs();
120 MP_Constraint *theMP;
121 int index = 0;
122 while ((theMP = theMPs()) != 0) {
123 int nodeConstrained = theMP->getNodeConstrained();
124 if (transformedNode.getLocation(nodeConstrained) < 0)
125 transformedNode[numDOF++] = nodeConstrained;
126 constrainedNodesMP[index] = nodeConstrained;
127 mps[index] = theMP;
128 index++;
129 }
130 }
131
132 // create an ID of constrained node tags in SP_Constraints
133 ID constrainedNodesSP(0, numSPConstraints);;
134 SP_Constraint **sps =0;
135 if (numSPConstraints != 0) {

Callers

nothing calls this directly

Calls 15

getNodesMethod · 0.80
getIDMethod · 0.80
getDomainPtrMethod · 0.45
getAnalysisModelPtrMethod · 0.45
getIntegratorPtrMethod · 0.45
getNumMPsMethod · 0.45
getNodeConstrainedMethod · 0.45
getLocationMethod · 0.45
getNodeTagMethod · 0.45
getTagMethod · 0.45
getNumberDOFMethod · 0.45
addSP_ConstraintMethod · 0.45

Tested by

no test coverage detected