| 718 | |
| 719 | |
| 720 | int |
| 721 | SectionAggregator::sendSelf(int cTag, Channel &theChannel) |
| 722 | { |
| 723 | int res = 0; |
| 724 | |
| 725 | // Need otherDbTag since classTags ID and data ID may be the same size |
| 726 | if (otherDbTag == 0) |
| 727 | otherDbTag = theChannel.getDbTag(); |
| 728 | |
| 729 | // Create ID for tag and section order data |
| 730 | static ID data(5); |
| 731 | |
| 732 | int order = this->getOrder(); |
| 733 | |
| 734 | data(0) = this->getTag(); |
| 735 | data(1) = otherDbTag; |
| 736 | data(2) = order; |
| 737 | if (theSection == 0) |
| 738 | data(3) = 0; |
| 739 | else |
| 740 | data(3) = theSection->getOrder(); |
| 741 | data(3) = (theSection != 0) ? theSection->getOrder() : 0; |
| 742 | data(4) = numMats; |
| 743 | |
| 744 | // Send the tag and section order data |
| 745 | res += theChannel.sendID(this->getDbTag(), cTag, data); |
| 746 | if (res < 0) { |
| 747 | opserr << "SectionAggregator::sendSelf -- could not send data ID\n"; |
| 748 | |
| 749 | return res; |
| 750 | } |
| 751 | |
| 752 | // Determine how many classTags there are and allocate ID vector |
| 753 | // for the tags and section code |
| 754 | int numTags = (theSection == 0) ? numMats : numMats + 1; |
| 755 | ID classTags(2*numTags + numMats); |
| 756 | |
| 757 | // Loop over the UniaxialMaterials filling in class and db tags |
| 758 | int i, dbTag; |
| 759 | for (i = 0; i < numMats; i++) { |
| 760 | classTags(i) = theAdditions[i]->getClassTag(); |
| 761 | |
| 762 | dbTag = theAdditions[i]->getDbTag(); |
| 763 | |
| 764 | if (dbTag == 0) { |
| 765 | dbTag = theChannel.getDbTag(); |
| 766 | if (dbTag != 0) |
| 767 | theAdditions[i]->setDbTag(dbTag); |
| 768 | } |
| 769 | |
| 770 | classTags(i+numTags) = dbTag; |
| 771 | } |
| 772 | |
| 773 | // Put the Section class and db tags into the ID vector |
| 774 | if (theSection != 0) { |
| 775 | classTags(numTags-1) = theSection->getClassTag(); |
| 776 | |
| 777 | dbTag = theSection->getDbTag(); |