| 863 | } |
| 864 | |
| 865 | bool |
| 866 | Domain::addNodalLoad(NodalLoad *load, int pattern) |
| 867 | { |
| 868 | int nodTag = load->getNodeTag(); |
| 869 | Node *res = this->getNode(nodTag); |
| 870 | if (res == 0) { |
| 871 | opserr << "Domain::addNodalLoad() HI - no node with tag " << nodTag << |
| 872 | "exits in the model, not adding the nodal load" << *load << endln; |
| 873 | return false; |
| 874 | } |
| 875 | |
| 876 | // now add it to the pattern |
| 877 | TaggedObject *thePattern = theLoadPatterns->getComponentPtr(pattern); |
| 878 | if (thePattern == 0) { |
| 879 | opserr << "Domain::addNodalLoad() - no pattern with tag" << |
| 880 | pattern << "in the model, not adding the nodal load" << *load << endln; |
| 881 | |
| 882 | return false; |
| 883 | } |
| 884 | LoadPattern *theLoadPattern = (LoadPattern *)thePattern; |
| 885 | bool result = theLoadPattern->addNodalLoad(load); |
| 886 | if (result == false) { |
| 887 | opserr << "Domain::addNodalLoad() - pattern with tag" << |
| 888 | pattern << "could not add the load" << *load << endln; |
| 889 | |
| 890 | return false; |
| 891 | } |
| 892 | |
| 893 | load->setDomain(this); // done in LoadPattern::addNodalLoad() |
| 894 | this->domainChange(); |
| 895 | |
| 896 | return result; |
| 897 | } |
| 898 | |
| 899 | |
| 900 | bool |
no test coverage detected