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

Method addFE_Element

SRC/analysis/model/AnalysisModel.cpp:141–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139// Method to add an element to the model.
140
141bool
142AnalysisModel::addFE_Element(FE_Element *theElement)
143{
144 // check we don't add a null pointer or this is a subclass
145 // trying to use this method when it shouldn't
146 if (theElement == 0 || theFEs == 0)
147 return false;
148
149 // check if an Element with a similar tag already exists in the Domain
150 int tag = theElement->getTag();
151 TaggedObject *other = theFEs->getComponentPtr(tag);
152 if (other != 0) {
153 opserr << "AnalysisModel::addFE_Element - element with tag " << tag << "already exists in model\n";
154 return false;
155 }
156
157 // add the element to the container object for the elements
158 bool result = theFEs->addComponent(theElement);
159 if (result == true) {
160 theElement->setAnalysisModel(*this);
161 numFE_Ele++;
162 return true; // o.k.
163 } else
164 return false;
165
166
167 return result;
168}
169
170
171

Callers 5

handleMethod · 0.45
handleMethod · 0.45
handleMethod · 0.45
handleMethod · 0.45
handleMethod · 0.45

Calls 4

getTagMethod · 0.45
getComponentPtrMethod · 0.45
addComponentMethod · 0.45
setAnalysisModelMethod · 0.45

Tested by

no test coverage detected