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

Method recvSelf

DEVELOPER/core/BeamFiberMaterial2d.cpp:495–548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

493}
494
495int
496BeamFiberMaterial2d::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)
497{
498 int res = 0;
499
500 // recv an id containing the tag and associated materials class and db tags
501 static ID idData(3);
502 res = theChannel.sendID(this->getDbTag(), commitTag, idData);
503 if (res < 0) {
504 opserr << "BeamFiberMaterial2d::sendSelf() - failed to send id data\n";
505 return res;
506 }
507
508 this->setTag(idData(0));
509 int matClassTag = idData(1);
510
511 // if the associated material has not yet been created or is of the wrong type
512 // create a new material for recvSelf later
513 if (theMaterial == 0 || theMaterial->getClassTag() != matClassTag) {
514 if (theMaterial != 0)
515 delete theMaterial;
516 theMaterial = theBroker.getNewNDMaterial(matClassTag);
517 if (theMaterial == 0) {
518 opserr << "BeamFiberMaterial2d::recvSelf() - failed to get a material of type: " << matClassTag << endln;
519 return -1;
520 }
521 }
522 theMaterial->setDbTag(idData(2));
523
524 // recv a vector containing strains and set the strains
525 static Vector vecData(4);
526 res = theChannel.recvVector(this->getDbTag(), commitTag, vecData);
527 if (res < 0) {
528 opserr << "BeamFiberMaterial2d::sendSelf() - failed to send vector data\n";
529 return res;
530 }
531
532 Cstrain22 = vecData(0);
533 Cstrain33 = vecData(1);
534 Cgamma31 = vecData(2);
535 Cgamma23 = vecData(3);
536
537 Tstrain22 = Cstrain22;
538 Tstrain33 = Cstrain33;
539 Tgamma31 = Cgamma31;
540 Tgamma23 = Cgamma23;
541
542 // now receive the materials data
543 res = theMaterial->recvSelf(commitTag, theChannel, theBroker);
544 if (res < 0)
545 opserr << "BeamFiberMaterial2d::sendSelf() - failed to send vector material\n";
546
547 return res;
548}
549
550int
551BeamFiberMaterial2d::setParameter(const char **argv, int argc,

Callers

nothing calls this directly

Calls 7

sendIDMethod · 0.45
getDbTagMethod · 0.45
setTagMethod · 0.45
getClassTagMethod · 0.45
getNewNDMaterialMethod · 0.45
setDbTagMethod · 0.45
recvVectorMethod · 0.45

Tested by

no test coverage detected