| 47 | #include <DOF_Group.h> |
| 48 | |
| 49 | LagrangeEQ_FE::LagrangeEQ_FE(int tag, Domain &theDomain, EQ_Constraint &TheEQ, |
| 50 | DOF_Group &theGroup, double Alpha) |
| 51 | :FE_Element(tag, 2+(TheEQ.getRetainedDOFs()).Size(), |
| 52 | 2+(TheEQ.getRetainedDOFs()).Size()), |
| 53 | alpha(Alpha), theEQ(&TheEQ), |
| 54 | theConstrainedNode(0), theRetainedNode(0), |
| 55 | theDofGroup(&theGroup), tang(0), resid(0) |
| 56 | { |
| 57 | int size = 2 + (theEQ->getRetainedDOFs()).Size(); |
| 58 | |
| 59 | tang = new Matrix(size,size); |
| 60 | resid = new Vector(size); |
| 61 | if (tang == 0 || resid == 0 || tang->noCols() == 0 || resid->Size() == 0) { |
| 62 | opserr << "FATAL LagrangeEQ_FE::LagrangeEQ_FE() - out of memory\n"; |
| 63 | exit(-1); |
| 64 | } |
| 65 | tang->Zero(); |
| 66 | resid->Zero(); |
| 67 | |
| 68 | theConstrainedNode = theDomain.getNode(theEQ->getNodeConstrained()); |
| 69 | |
| 70 | if (theConstrainedNode == 0) { |
| 71 | opserr << "FATAL LagrangeEQ_FE::LagrangeEQ_FE() - Constrained"; |
| 72 | opserr << " Node does not exist in Domain\n"; |
| 73 | opserr << theEQ->getNodeConstrained() << endln; |
| 74 | exit(-1); |
| 75 | } |
| 76 | |
| 77 | DOF_Group *theConstrainedNodeDOFGrpPtr = theConstrainedNode->getDOF_GroupPtr(); |
| 78 | if (theConstrainedNodeDOFGrpPtr != 0) |
| 79 | myDOF_Groups(0) = theConstrainedNodeDOFGrpPtr->getTag(); |
| 80 | else |
| 81 | opserr << "WARNING LagrangeEQ_FE::LagrangeEQ_FE() - no DOF_Group with Constrained Node\n"; |
| 82 | |
| 83 | const ID &nodeRetained = theEQ->getNodeRetained(); |
| 84 | theRetainedNode = new Node*[nodeRetained.Size()]; |
| 85 | for (int i = 0; i < nodeRetained.Size(); ++i) { |
| 86 | theRetainedNode[i] = theDomain.getNode(nodeRetained(i)); |
| 87 | if (theRetainedNode[i] == 0) { |
| 88 | opserr << "FATAL LagrangeEQ_FE::LagrangeEQ_FE() - Retained"; |
| 89 | opserr << " Node does not exist in Domain\n"; |
| 90 | opserr << nodeRetained(i) << endln; |
| 91 | exit(-1); |
| 92 | } |
| 93 | DOF_Group *theRetainedNodeDOFGrpPtr = theRetainedNode[i]->getDOF_GroupPtr(); |
| 94 | if (theRetainedNodeDOFGrpPtr != 0) |
| 95 | myDOF_Groups(i+1) = theRetainedNodeDOFGrpPtr->getTag(); |
| 96 | else |
| 97 | opserr << "WARNING LagrangeEQ_FE::LagrangeEQ_FE() - no DOF_Group with Retained Node\n"; |
| 98 | } |
| 99 | |
| 100 | myDOF_Groups(nodeRetained.Size() + 1) = theDofGroup->getTag(); |
| 101 | |
| 102 | if (theEQ->isTimeVarying() == false) { |
| 103 | this->determineTangent(); |
| 104 | } |
| 105 | } |
| 106 |
nothing calls this directly
no test coverage detected