| 407 | } |
| 408 | |
| 409 | int |
| 410 | Truss2D::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 | |
| 457 | void |
| 458 | Truss2D::Print(OPS_Stream &s, int flag) |
nothing calls this directly
no test coverage detected