| 581 | // |
| 582 | |
| 583 | bool |
| 584 | Domain::addPressure_Constraint(Pressure_Constraint *pConstraint) |
| 585 | { |
| 586 | #ifdef _G3DEBUG |
| 587 | // check the Node exists in the Domain |
| 588 | int nodeTag = pConstraint->getTag(); |
| 589 | Node *nodePtr = this->getNode(nodeTag); |
| 590 | if (nodePtr == 0) { |
| 591 | opserr << "Domain::addPressure_Constraint - cannot add as node with tag"; |
| 592 | opserr << nodeTag << "does not exist in model\n"; |
| 593 | return false; |
| 594 | } |
| 595 | #endif |
| 596 | |
| 597 | // check that no other object with similar tag exists in model |
| 598 | int tag = pConstraint->getTag(); |
| 599 | TaggedObject *other = thePCs->getComponentPtr(tag); |
| 600 | if (other != 0) { |
| 601 | opserr << "Domain::addPressure_Constraint - cannot add as constraint with tag"; |
| 602 | opserr << tag << "already exists in model\n"; |
| 603 | return false; |
| 604 | } |
| 605 | |
| 606 | bool result = thePCs->addComponent(pConstraint); |
| 607 | if (result == false) { |
| 608 | opserr << "Domain::addPressure_Constraint - cannot add constraint with tag"; |
| 609 | opserr << tag << "to the container\n"; |
| 610 | return false; |
| 611 | } |
| 612 | |
| 613 | pConstraint->setDomain(this); |
| 614 | this->domainChange(); |
| 615 | |
| 616 | return true; |
| 617 | } |
| 618 | |
| 619 | |
| 620 | int |
no test coverage detected