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

Method setID

SRC/analysis/fe_ele/lagrange/LagrangeEQ_FE.cpp:117–201  ·  view source on GitHub ↗

void setID(int index, int value); Method to set the corresponding index of the ID to value.

Source from the content-addressed store, hash-verified

115// void setID(int index, int value);
116// Method to set the corresponding index of the ID to value.
117int
118LagrangeEQ_FE::setID(void)
119{
120 int result = 0;
121
122 // first determine the IDs in myID for those DOFs marked
123 // as constrainedDOF DOFs, this is obtained from the DOF_Group
124 // associated with the constrainedDOF node
125 if (theConstrainedNode == 0) {
126 opserr << "WARNING LagrangeEQ_FE::setID(void)";
127 opserr << "- no asscoiated Constrained Node\n";
128 return -1;
129 }
130 DOF_Group *theConstrainedNodesDOFs = theConstrainedNode->getDOF_GroupPtr();
131 if (theConstrainedNodesDOFs == 0) {
132 opserr << "WARNING LagrangeEQ_FE::setID(void)";
133 opserr << " - no DOF_Group with Constrained Node\n";
134 return -2;
135 }
136 const ID &theConstrainedNodesID = theConstrainedNodesDOFs->getID();
137
138 int constrainedDOF = theEQ->getConstrainedDOFs();
139 if (constrainedDOF < 0 || constrainedDOF >= theConstrainedNode->getNumberDOF()) {
140 opserr << "WARNING LagrangeEQ_FE::setID(void) - unknown DOF ";
141 opserr << constrainedDOF << " at Node\n";
142 myID(0) = -1; // modify so nothing will be added to equations
143 result = -3;
144 }
145 else {
146 if (constrainedDOF >= theConstrainedNodesID.Size()) {
147 opserr << "WARNING LagrangeEQ_FE::setID(void) - ";
148 opserr << " Nodes DOF_Group too small\n";
149 myID(0) = -1; // modify so nothing will be added to equations
150 result = -4;
151 }
152 else
153 myID(0) = theConstrainedNodesID(constrainedDOF);
154 }
155
156 // now determine the IDs for the retained dof's
157 if (theRetainedNode == 0) {
158 opserr << "WARNING LagrangeEQ_FE::setID(void)";
159 opserr << "- no asscoiated Retained Node\n";
160 return -1;
161 }
162 const ID &nodeRetained = theEQ->getNodeRetained();
163 const ID &RetainedDOFs = theEQ->getRetainedDOFs();
164 for (int i = 0; i < nodeRetained.Size(); ++i) {
165 if (theRetainedNode[i] == 0) {
166 opserr << "WARNING LagrangeEQ_FE::setID(void)";
167 opserr << "- no asscoiated Retained Node\n";
168 return -1;
169 }
170 DOF_Group *theRetainedNodesDOFs = theRetainedNode[i]->getDOF_GroupPtr();
171 if (theRetainedNodesDOFs == 0) {
172 opserr << "WARNING LagrangeEQ_FE::setID(void)";
173 opserr << " - no DOF_Group with Retained Node\n";
174 return -2;

Callers

nothing calls this directly

Calls 6

getIDMethod · 0.80
getConstrainedDOFsMethod · 0.80
getDOF_GroupPtrMethod · 0.45
getNumberDOFMethod · 0.45
SizeMethod · 0.45
getNodeRetainedMethod · 0.45

Tested by

no test coverage detected