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

Method recvSelf

DEVELOPER/element/cpp/Truss2D.cpp:409–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409int
410Truss2D::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
411{
412 int res;
413 int dataTag = this->getDbTag();
414
415 // Truss2D creates a Vector, receives the Vector and then sets the
416 // internal data with the data in the Vector
417
418 Vector data(5);
419 res = theChannel.recvVector(dataTag, commitTag, data);
420 if (res < 0) {
421 opserr << "WARNING Truss2D::recvSelf() - failed to receive Vector\n";
422 return -1;
423 }
424
425 this->setTag((int)data(0));
426 A = data(1);
427
428 // Truss2D now receives the tags of it's two external nodes
429 res = theChannel.recvID(dataTag, commitTag, externalNodes);
430 if (res < 0) {
431 opserr << "WARNING Truss2D::recvSelf() - failed to receive ID\n";
432 return -2;
433 }
434
435 // we create a material object of the correct type,
436 // sets its database tag and asks this new object to recveive itself.
437 int matClass = data(2);
438 int matDb = data(3);
439
440 theMaterial = theBroker.getNewUniaxialMaterial(matClass);
441 if (theMaterial == 0) {
442 opserr << "WARNING Truss2D::recvSelf() - failed to create a Material\n";
443 return -3;
444 }
445
446 // we set the dbTag before we receive the material - this is important
447 theMaterial->setDbTag(matDb);
448 res = theMaterial->recvSelf(commitTag, theChannel, theBroker);
449 if (res < 0) {
450 opserr << "WARNING Truss2D::recvSelf() - failed to receive the Material\n";
451 return -3;
452 }
453
454 return 0;
455}
456
457void
458Truss2D::Print(OPS_Stream &s, int flag)

Callers

nothing calls this directly

Calls 6

getDbTagMethod · 0.45
recvVectorMethod · 0.45
setTagMethod · 0.45
recvIDMethod · 0.45
setDbTagMethod · 0.45

Tested by

no test coverage detected