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

Method Truss2D

DEVELOPER/element/cpp/Truss2D.cpp:130–156  ·  view source on GitHub ↗

typical constructor

Source from the content-addressed store, hash-verified

128
129// typical constructor
130Truss2D::Truss2D(int tag,
131 int Nd1, int Nd2,
132 UniaxialMaterial &theMat,
133 double a)
134:Element(tag, 0),
135 externalNodes(2),
136 trans(1,4), L(0.0), A(a)
137{
138 // get a copy of the material object for our own use
139 theMaterial = theMat.getCopy();
140 if (theMaterial == 0) {
141 opserr << "FATAL Truss2D::Truss2D() - out of memory, could not get a copy of the Material\n";
142 exit(-1);
143 }
144
145 // fill in the ID containing external node info with node id's
146 if (externalNodes.Size() != 2) {
147 opserr << "FATAL Truss2D::Truss2D() - out of memory, could not create an ID of size 2\n";
148 exit(-1);
149 }
150
151 externalNodes(0) = Nd1;
152 externalNodes(1) = Nd2;
153
154 theNodes[0] = 0;
155 theNodes[1] = 0;
156}
157
158// constructor which should be invoked by an FE_ObjectBroker only
159Truss2D::Truss2D()

Callers

nothing calls this directly

Calls 3

exitFunction · 0.85
getCopyMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected