| 84 | } |
| 85 | |
| 86 | void |
| 87 | Pressure_Constraint::setDomain(Domain* theDomain) |
| 88 | { |
| 89 | freesurf = false; |
| 90 | // set new domain |
| 91 | DomainComponent::setDomain(theDomain); |
| 92 | |
| 93 | // check domain |
| 94 | if(theDomain == 0) return; |
| 95 | |
| 96 | // check the node |
| 97 | int nodeId = this->getTag(); |
| 98 | Node* theNode = theDomain->getNode(nodeId); |
| 99 | if(theNode == 0) { |
| 100 | opserr<<"WARNING: node "<<nodeId<<" does not exist "; |
| 101 | opserr<<"-- Pressure_Constraint::setDomain\n"; |
| 102 | return; |
| 103 | } |
| 104 | |
| 105 | // check pval |
| 106 | if (pval != 0) return; |
| 107 | |
| 108 | if (pTag == nodeId) { |
| 109 | opserr << "WARNING: pressure node has the same tag as the PC\n"; |
| 110 | return; |
| 111 | } |
| 112 | |
| 113 | // check the pressure node |
| 114 | Node* pNode = theDomain->getNode(pTag); |
| 115 | if(pNode == 0) { |
| 116 | opserr<<"WARNING: pressure node "<<pTag<<" does not exist "; |
| 117 | opserr<<"-- Pressure_Constraint::setDomain\n"; |
| 118 | return; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | Node* |
| 123 | Pressure_Constraint::getPressureNode() |