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

Method FE_Element

DEVELOPER/core/FE_Element.cpp:57–164  ·  view source on GitHub ↗

FE_Element(Element *, Integrator *theIntegrator); construictor that take the corresponding model element.

Source from the content-addressed store, hash-verified

55// FE_Element(Element *, Integrator *theIntegrator);
56// construictor that take the corresponding model element.
57FE_Element::FE_Element(int tag, Element *ele)
58 :TaggedObject(tag),
59 myDOF_Groups((ele->getExternalNodes()).Size()), myID(ele->getNumDOF()),
60 numDOF(ele->getNumDOF()), theModel(0), myEle(ele),
61 theResidual(0), theTangent(0), theIntegrator(0)
62{
63 if (numDOF <= 0) {
64 opserr << "FE_Element::FE_Element(Element *) ";
65 opserr << " element must have 1 dof " << *ele;
66 exit(-1);
67 }
68
69 // get elements domain & check it is valid
70 Domain *theDomain = ele->getDomain();
71 if (theDomain == 0) {
72 opserr << "FATAL FE_Element::FE_Element() - element has no domain "<< *ele;
73 exit(-1);
74 }
75
76 // keep a pointer to all DOF_Groups
77 int numGroups = ele->getNumExternalNodes();
78 const ID &nodes = ele->getExternalNodes();
79
80 for (int i=0; i<numGroups; i++) {
81 Node *nodePtr =theDomain->getNode(nodes(i));
82 if (nodePtr == 0) {
83 opserr << "FATAL FE_Element::FE_Element() - Node: ";
84 opserr << nodes(i) << "does not exist in the Domain\n";
85 opserr << *ele;
86 exit(-1);
87 }
88
89 DOF_Group *dofGrpPtr = nodePtr->getDOF_GroupPtr();
90 if (dofGrpPtr != 0)
91 myDOF_Groups(i) = dofGrpPtr->getTag();
92 else {
93 opserr << "FATAL FE_Element::FE_Element() - Node: ";
94 opserr << *nodePtr << " has no DOF_Group associated with it\n";
95 exit(-1);
96 }
97 }
98
99 // if this is the first FE_Element we now
100 // create the arrays used to store pointers to class wide
101 // matrix and vector objects used to return tangent and residual
102 if (numFEs == 0) {
103 theMatrices = new Matrix *[MAX_NUM_DOF+1];
104 theVectors = new Vector *[MAX_NUM_DOF+1];
105
106 if (theMatrices == 0 || theVectors == 0) {
107 opserr << "FE_Element::FE_Element(Element *) ";
108 opserr << " ran out of memory";
109 }
110 for (int i=0; i<MAX_NUM_DOF; i++) {
111 theMatrices[i] = 0;
112 theVectors[i] = 0;
113 }
114 }

Callers

nothing calls this directly

Calls 12

exitFunction · 0.85
SizeMethod · 0.45
getNumDOFMethod · 0.45
getDomainMethod · 0.45
getNumExternalNodesMethod · 0.45
getNodeMethod · 0.45
getDOF_GroupPtrMethod · 0.45
getTagMethod · 0.45
isSubdomainMethod · 0.45
noColsMethod · 0.45
noRowsMethod · 0.45
setFE_ElementPtrMethod · 0.45

Tested by

no test coverage detected