| 829 | } |
| 830 | |
| 831 | bool |
| 832 | Domain::addLoadPattern(LoadPattern *load) |
| 833 | { |
| 834 | // first check if a load pattern with a similar tag exists in model |
| 835 | int tag = load->getTag(); |
| 836 | TaggedObject *other = theLoadPatterns->getComponentPtr(tag); |
| 837 | if (other != 0) { |
| 838 | opserr << "Domain::addLoadPattern - cannot add as LoadPattern with tag" << |
| 839 | tag << " already exists in model\n"; |
| 840 | |
| 841 | return false; |
| 842 | } |
| 843 | |
| 844 | int numSPs = 0; |
| 845 | SP_Constraint *theSP_Constraint; |
| 846 | SP_ConstraintIter &theSP_Constraints = load->getSPs(); |
| 847 | while ((theSP_Constraint = theSP_Constraints()) != 0) |
| 848 | numSPs++; |
| 849 | |
| 850 | // now we add the load pattern to the container for load patterns |
| 851 | bool result = theLoadPatterns->addComponent(load); |
| 852 | if (result == true) { |
| 853 | load->setDomain(this); |
| 854 | if (numSPs > 0) |
| 855 | this->domainChange(); |
| 856 | } |
| 857 | else |
| 858 | opserr << "Domain::addLoadPattern - cannot add LoadPattern with tag" << |
| 859 | tag << "to the container\n"; |
| 860 | |
| 861 | return result; |
| 862 | } |
| 863 | |
| 864 | bool |
| 865 | Domain::addParameter(Parameter *theParam) |
no test coverage detected