| 174 | // Method to add an element to the model. |
| 175 | |
| 176 | bool |
| 177 | AnalysisModel::addDOF_Group(DOF_Group *theGroup) |
| 178 | { |
| 179 | |
| 180 | // check we don't add a null pointer or this is a subclass trying |
| 181 | // to use a method it shouldn't be using |
| 182 | if (theGroup == 0 || theDOFs == 0) |
| 183 | return false; |
| 184 | |
| 185 | |
| 186 | // check if an Element with a similar tag already exists in the Domain |
| 187 | int tag = theGroup->getTag(); |
| 188 | TaggedObject *other = theDOFs->getComponentPtr(tag); |
| 189 | if (other != 0) { |
| 190 | opserr << "AnalysisModel::addDOF_Group - group with tag " << tag << "already exists in model\n"; |
| 191 | return false; |
| 192 | } |
| 193 | |
| 194 | // add the element to the container object for the elements |
| 195 | bool result = theDOFs->addComponent(theGroup); |
| 196 | if (result == true) { |
| 197 | numDOF_Grp++; |
| 198 | return true; // o.k. |
| 199 | } else |
| 200 | return false; |
| 201 | } |
| 202 | |
| 203 | void |
| 204 | AnalysisModel::clearAll(void) |