| 76 | } |
| 77 | |
| 78 | int |
| 79 | TransformationConstraintHandler::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) { |
nothing calls this directly
no test coverage detected