| 220 | // destructor. |
| 221 | |
| 222 | DOF_Group::~DOF_Group() |
| 223 | { |
| 224 | numDOFs--; |
| 225 | |
| 226 | int numDOF = unbalance->Size(); |
| 227 | |
| 228 | // set the pointer in the associated Node to 0, to stop |
| 229 | // segmentation fault if node tries to use this object after destroyed |
| 230 | if (myNode != 0) |
| 231 | myNode->setDOF_GroupPtr(0); |
| 232 | |
| 233 | // delete tangent and residual if created specially |
| 234 | if (numDOF > MAX_NUM_DOF) { |
| 235 | if (tangent != 0) delete tangent; |
| 236 | if (unbalance != 0) delete unbalance; |
| 237 | } |
| 238 | |
| 239 | // if this is the last FE_Element, clean up the |
| 240 | // storage for the matrix and vector objects |
| 241 | if (numDOFs == 0) { |
| 242 | for (int i=0; i<MAX_NUM_DOF; i++) { |
| 243 | if (theVectors[i] != 0) |
| 244 | delete theVectors[i]; |
| 245 | if (theMatrices[i] != 0) |
| 246 | delete theMatrices[i]; |
| 247 | } |
| 248 | delete [] theMatrices; |
| 249 | delete [] theVectors; |
| 250 | } |
| 251 | } |
| 252 | |
| 253 | // void setID(int index, int value); |
| 254 | // Method to set the corresponding index of the ID to value. |
nothing calls this directly
no test coverage detected