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

Method setID

SRC/analysis/fe_ele/lagrange/LagrangeMP_FE.cpp:129–220  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

127// void setID(int index, int value);
128// Method to set the correMPonding index of the ID to value.
129int
130LagrangeMP_FE::setID(void)
131{
132 int result = 0;
133
134 // first determine the IDs in myID for those DOFs marked
135 // as constrained DOFs, this is obtained from the DOF_Group
136 // associated with the constrained node
137 if (theConstrainedNode == 0) {
138 opserr << "WARNING LagrangeMP_FE::setID(void)";
139 opserr << "- no asscoiated Constrained Node\n";
140 return -1;
141 }
142 DOF_Group *theConstrainedNodesDOFs = theConstrainedNode->getDOF_GroupPtr();
143 if (theConstrainedNodesDOFs == 0) {
144 opserr << "WARNING LagrangeMP_FE::setID(void)";
145 opserr << " - no DOF_Group with Constrained Node\n";
146 return -2;
147 }
148
149 const ID &constrainedDOFs = theMP->getConstrainedDOFs();
150 const ID &theConstrainedNodesID = theConstrainedNodesDOFs->getID();
151
152 int size1 = constrainedDOFs.Size();
153 for (int i=0; i<size1; i++) {
154 int constrained = constrainedDOFs(i);
155 if (constrained < 0 ||
156 constrained >= theConstrainedNode->getNumberDOF()) {
157
158 opserr << "WARNING LagrangeMP_FE::setID(void) - unknown DOF ";
159 opserr << constrained << " at Node\n";
160 myID(i) = -1; // modify so nothing will be added to equations
161 result = -3;
162 }
163 else {
164 if (constrained >= theConstrainedNodesID.Size()) {
165 opserr << "WARNING LagrangeMP_FE::setID(void) - ";
166 opserr << " Nodes DOF_Group too small\n";
167 myID(i) = -1; // modify so nothing will be added to equations
168 result = -4;
169 }
170 else
171 myID(i) = theConstrainedNodesID(constrained);
172 }
173 }
174
175 // now determine the IDs for the retained dof's
176 if (theRetainedNode == 0) {
177 opserr << "WARNING LagrangeMP_FE::setID(void)";
178 opserr << "- no asscoiated Retained Node\n";
179 return -1;
180 }
181 DOF_Group *theRetainedNodesDOFs = theRetainedNode->getDOF_GroupPtr();
182 if (theRetainedNodesDOFs == 0) {
183 opserr << "WARNING LagrangeMP_FE::setID(void)";
184 opserr << " - no DOF_Group with Retained Node\n";
185 return -2;
186 }

Callers

nothing calls this directly

Calls 6

getConstrainedDOFsMethod · 0.80
getIDMethod · 0.80
constrainedDOFsFunction · 0.50
getDOF_GroupPtrMethod · 0.45
SizeMethod · 0.45
getNumberDOFMethod · 0.45

Tested by

no test coverage detected