| 105 | } |
| 106 | |
| 107 | void |
| 108 | WrapperElement::setDomain(Domain *theDomain) |
| 109 | { |
| 110 | // check Domain is not null - invoked when object removed from a domain |
| 111 | if (theDomain == 0) { |
| 112 | if (theNodes != 0) { |
| 113 | delete [] theNodes; |
| 114 | theNodes = 0; |
| 115 | } |
| 116 | return; |
| 117 | } |
| 118 | |
| 119 | committedTime = theDomain->getCurrentTime(); |
| 120 | committedDt = 0; |
| 121 | |
| 122 | int numNodes = theEle->nNode; |
| 123 | |
| 124 | theNodes = new Node *[numNodes]; |
| 125 | for (int i=0; i<numNodes; i++) { |
| 126 | Node *theNode = theDomain->getNode(theEle->node[i]); |
| 127 | if (theNode == 0) { |
| 128 | opserr << "WARNING WrapperElement::setDomain(Domain *theDomain) - node: "; |
| 129 | opserr << theEle->node[i] << " does not exist in domain for ele " << *this; |
| 130 | return; |
| 131 | } |
| 132 | // set up the pointer to the node |
| 133 | theNodes[i] = theNode; |
| 134 | } |
| 135 | |
| 136 | // call the DomainComponent class method THIS IS VERY IMPORTANT |
| 137 | this->DomainComponent::setDomain(theDomain); |
| 138 | |
| 139 | u = new double [theEle->nDOF]; |
| 140 | R = new double [theEle->nDOF]; |
| 141 | K = new double [theEle->nDOF*theEle->nDOF]; |
| 142 | M = new double [theEle->nDOF*theEle->nDOF]; |
| 143 | if (u == 0 || R == 0 || K == 0 || M == 0) { |
| 144 | opserr << "WARNING WrapperElement::setDomain(Domain *theDomain) - out of memory\n"; |
| 145 | return; |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | int |
| 150 | WrapperElement::commitState() |
nothing calls this directly
no test coverage detected