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

Method setOrder

DEVELOPER/core/BinaryFileStream.cpp:766–882  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

764}
765
766int
767BinaryFileStream::setOrder(const ID &orderData)
768{
769 if (sendSelfCount < 0) {
770 static ID numColumnID(1);
771 int numColumn = orderData.Size();
772 numColumnID(0) = numColumn;
773 theChannels[0]->sendID(0, 0, numColumnID);
774 if (numColumn != 0)
775 theChannels[0]->sendID(0, 0, orderData);
776 }
777
778 if (sendSelfCount > 0) {
779
780 sizeColumns = new ID(sendSelfCount+1);
781 theColumns = new ID *[sendSelfCount+1];
782 theData = new double *[sendSelfCount+1];
783 theRemoteData = new Vector *[sendSelfCount+1];
784
785 int numColumns = orderData.Size();
786 (*sizeColumns)(0) = numColumns;
787 if (numColumns != 0) {
788 theColumns[0] = new ID(orderData);
789 theData[0] = new double [numColumns];
790 } else {
791 theColumns[0] = 0;
792 theData[0] = 0;
793 }
794 theRemoteData[0] = 0;
795
796 maxCount = 0;
797 if (numColumns != 0)
798 maxCount = orderData(numColumns-1);
799
800 // now receive orderData from the other channels
801 for (int i=0; i<sendSelfCount; i++) {
802 static ID numColumnID(1);
803 if (theChannels[i]->recvID(0, 0, numColumnID) < 0) {
804 opserr << "BinaryFileStream::setOrder - failed to recv column size for process: " << i+1 << endln;
805 return -1;
806 }
807
808 int numColumns = numColumnID(0);
809
810 (*sizeColumns)(i+1) = numColumns;
811 if (numColumns != 0) {
812 theColumns[i+1] = new ID(numColumns);
813 if (theChannels[i]->recvID(0, 0, *theColumns[i+1]) < 0) {
814 opserr << "BinaryFileStream::setOrder - failed to recv column data for process: " << i+1 << endln;
815 return -1;
816 }
817
818 if (numColumns != 0 && (*theColumns[i+1])[numColumns-1] > maxCount)
819 maxCount = (*theColumns[i+1])[numColumns-1];
820
821 theData[i+1] = new double [numColumns];
822 theRemoteData[i+1] = new Vector(theData[i+1], numColumns);
823 } else {

Callers

nothing calls this directly

Calls 3

SizeMethod · 0.45
sendIDMethod · 0.45
recvIDMethod · 0.45

Tested by

no test coverage detected