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

Method setDomain

SRC/element/WrapperElement.cpp:107–147  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107void
108WrapperElement::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
149int
150WrapperElement::commitState()

Callers

nothing calls this directly

Calls 2

getCurrentTimeMethod · 0.45
getNodeMethod · 0.45

Tested by

no test coverage detected