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

Method sendSelf

DEVELOPER/element/cpp/Truss2D.cpp:359–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359int
360Truss2D::sendSelf(int commitTag, Channel &theChannel)
361{
362 int res;
363
364 // note: we don't check for dataTag == 0 for Element
365 // objects as that is taken care of in a commit by the Domain
366 // object - don't want to have to do the check if sending data
367 int dataTag = this->getDbTag();
368
369 // Truss2D packs it's data into a Vector and sends this to theChannel
370 // along with it's dbTag and the commitTag passed in the arguments
371
372 Vector data(5);
373 data(0) = this->getTag();
374 data(1) = A;
375 data(2) = theMaterial->getClassTag();
376 int matDbTag = theMaterial->getDbTag();
377 // NOTE: we do have to ensure that the material has a database
378 // tag if we are sending to a database channel.
379 if (matDbTag == 0) {
380 matDbTag = theChannel.getDbTag();
381 if (matDbTag != 0)
382 theMaterial->setDbTag(matDbTag);
383 }
384 data(3) = matDbTag;
385
386 res = theChannel.sendVector(dataTag, commitTag, data);
387 if (res < 0) {
388 opserr << "WARNING Truss2D::sendSelf() - failed to send Vector\n";
389 return -1;
390 }
391
392 // Truss2D then sends the tags of it's two end nodes
393 res = theChannel.sendID(dataTag, commitTag, externalNodes);
394 if (res < 0) {
395 opserr << "WARNING Truss2D::sendSelf() - failed to send ID\n";
396 return -2;
397 }
398
399 // finally Truss2D asks it's material object to send itself
400 res = theMaterial->sendSelf(commitTag, theChannel);
401 if (res < 0) {
402 opserr << "WARNING Truss2D::sendSelf() - failed to send the Material\n";
403 return -3;
404 }
405
406 return 0;
407}
408
409int
410Truss2D::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker)

Callers

nothing calls this directly

Calls 6

getDbTagMethod · 0.45
getTagMethod · 0.45
getClassTagMethod · 0.45
setDbTagMethod · 0.45
sendVectorMethod · 0.45
sendIDMethod · 0.45

Tested by

no test coverage detected