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

Method ZeroLength

SRC/element/zeroLength/ZeroLength.cpp:273–315  ·  view source on GitHub ↗

Construct element with one unidirectional material (numMaterials1d=1)

Source from the content-addressed store, hash-verified

271
272// Construct element with one unidirectional material (numMaterials1d=1)
273ZeroLength::ZeroLength(int tag,
274 int dim,
275 int Nd1, int Nd2,
276 const Vector &x, const Vector &yp,
277 UniaxialMaterial &theMat,
278 int direction,
279 int doRayleigh)
280 :Element(tag,ELE_TAG_ZeroLength),
281 connectedExternalNodes(2),
282 dimension(dim), numDOF(0), transformation(3,3), useRayleighDamping(doRayleigh),
283 theMatrix(0), theVector(0),
284 numMaterials1d(1), theMaterial1d(0), dir1d(0), t1d(0), d0(0), v0(0),
285 theDamping(0), fd(0)
286{
287 // allocate memory for numMaterials1d uniaxial material models
288 theMaterial1d = new UniaxialMaterial* [numMaterials1d];
289 dir1d = new ID(numMaterials1d);
290
291 if ( theMaterial1d == 0 || dir1d == 0 ) {
292 opserr << "FATAL ZeroLength::ZeroLength - failed to create a 1d material or direction array\n";
293 exit(-1);
294 }
295
296 // initialize uniaxial materials and directions and check for valid values
297 if (direction == 2 && dim == 2) // For Keri Ryan
298 direction = 5;
299
300 (*dir1d)(0) = direction;
301 this->checkDirection( *dir1d );
302
303 // get a copy of the material and check we obtained a valid copy
304 theMaterial1d[0] = theMat.getCopy();
305 if (theMaterial1d[0] == 0) {
306 opserr << "FATAL ZeroLength::ZeroLength - failed to get a copy of material " << theMat.getTag() << endln;
307 exit(-1);
308 }
309
310 // establish the connected nodes and set up the transformation matrix for orientation
311 this->setUp( Nd1, Nd2, x, yp);
312
313 // designate to setDomain that this is the initial construction of the element
314 mInitialize = 1;
315}
316
317
318ZeroLength::ZeroLength(int tag,

Callers

nothing calls this directly

Calls 6

checkDirectionMethod · 0.95
setUpMethod · 0.95
exitFunction · 0.85
getCopyMethod · 0.45
getTagMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected