MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / addPressure_Constraint

Method addPressure_Constraint

DEVELOPER/core/Domain.cpp:583–617  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581//
582
583bool
584Domain::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
620int

Callers 1

recvSelfMethod · 0.95

Calls 6

getNodeMethod · 0.95
domainChangeMethod · 0.95
getTagMethod · 0.45
getComponentPtrMethod · 0.45
addComponentMethod · 0.45
setDomainMethod · 0.45

Tested by

no test coverage detected