void setID(int index, int value); Method to set the correMPonding index of the ID to value.
| 127 | // void setID(int index, int value); |
| 128 | // Method to set the correMPonding index of the ID to value. |
| 129 | int |
| 130 | LagrangeMP_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 | } |
nothing calls this directly
no test coverage detected