int ElasticBeam3d::recvSelf(int cTag, Channel &theChannel, FEM_ObjectBroker &theBroker) { int res = 0; static Vector data(17); res += theChannel.recvVector(this->getDbTag(), cTag, data); if (res < 0) { opserr << "ElasticBeam3d::recvSelf -- could not receive data Vector\n"; return res; } A = data(0); E = data(1); G = data(2); Jx = data(3); Iy = data(4); Iz = data(5); rho = data(6); cMass = (int)data(7); this->setTag((int)data(8)); connectedExternalNodes(0) = (int)data(9); connectedExternalNodes(1) = (int)data(10); alphaM = data(13); betaK = data(14); betaK0 = data(15); betaKc = data(16); // Check if the CoordTransf is null; if so, get a new one int crdTag = (int)data(11); if (theCoordTransf == 0) { theCoordTransf = theBroker.getNewCrdTransf(crdTag); if (theCoordTransf == 0) { opserr << "ElasticBeam3d::recvSelf -- could not get a CrdTransf3d\n"; exit(-1); } } // Check that the CoordTransf is of the right type; if not, delete // the current one and get a new one of the right type if (theCoordTransf->getClassTag() != crdTag) { delete theCoordTransf; theCoordTransf = theBroker.getNewCrdTransf(crdTag); if (theCoordTransf == 0) { opserr << "ElasticBeam3d::recvSelf -- could not get a CrdTransf3d\n"; exit(-1); } } // Now, receive the CoordTransf theCoordTransf->setDbTag((int)data(12)); res += theCoordTransf->recvSelf(cTag, theChannel, theBroker); if (res < 0) { opserr << "ElasticBeam3d::recvSelf -- could not receive CoordTransf\n"; return res; } return res; }
int DispBeamColumn2d::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker) { // // receive the integer data containing tag, numSections and coord transformation info // int dbTag = this->getDbTag(); int i; static Vector data(14); if (theChannel.recvVector(dbTag, commitTag, data) < 0) { opserr << "DispBeamColumn2d::recvSelf() - failed to recv data Vector\n"; return -1; } this->setTag((int)data(0)); connectedExternalNodes(0) = (int)data(1); connectedExternalNodes(1) = (int)data(2); int nSect = (int)data(3); int crdTransfClassTag = (int)data(4); int crdTransfDbTag = (int)data(5); int beamIntClassTag = (int)data(6); int beamIntDbTag = (int)data(7); rho = data(8); cMass = (int)data(9); alphaM = data(10); betaK = data(11); betaK0 = data(12); betaKc = data(13); // create a new crdTransf object if one needed if (crdTransf == 0 || crdTransf->getClassTag() != crdTransfClassTag) { if (crdTransf != 0) delete crdTransf; crdTransf = theBroker.getNewCrdTransf(crdTransfClassTag); if (crdTransf == 0) { opserr << "DispBeamColumn2d::recvSelf() - failed to obtain a CrdTrans object with classTag " << crdTransfClassTag << endln; return -2; } } crdTransf->setDbTag(crdTransfDbTag); // invoke recvSelf on the crdTransf object if (crdTransf->recvSelf(commitTag, theChannel, theBroker) < 0) { opserr << "DispBeamColumn2d::sendSelf() - failed to recv crdTranf\n"; return -3; } // create a new beamInt object if one needed if (beamInt == 0 || beamInt->getClassTag() != beamIntClassTag) { if (beamInt != 0) delete beamInt; beamInt = theBroker.getNewBeamIntegration(beamIntClassTag); if (beamInt == 0) { opserr << "DispBeamColumn2d::recvSelf() - failed to obtain the beam integration object with classTag" << beamIntClassTag << endln; exit(-1); } } beamInt->setDbTag(beamIntDbTag); // invoke recvSelf on the beamInt object if (beamInt->recvSelf(commitTag, theChannel, theBroker) < 0) { opserr << "DispBeamColumn2d::sendSelf() - failed to recv beam integration\n"; return -3; } // // recv an ID for the sections containing each sections dbTag and classTag // ID idSections(2*nSect); int loc = 0; if (theChannel.recvID(dbTag, commitTag, idSections) < 0) { opserr << "DispBeamColumn2d::recvSelf() - failed to recv ID data\n"; return -1; } // // now receive the sections // if (numSections != nSect) { // // we do not have correct number of sections, must delete the old and create // new ones before can recvSelf on the sections // // delete the old if (numSections != 0) { for (int i=0; i<numSections; i++) delete theSections[i]; delete [] theSections; } // create a new array to hold pointers theSections = new SectionForceDeformation *[nSect]; if (theSections == 0) { opserr << "DispBeamColumn2d::recvSelf() - out of memory creating sections array of size " << nSect << endln; return -1; } // create a section and recvSelf on it numSections = nSect; loc = 0; for (i=0; i<numSections; i++) { int sectClassTag = idSections(loc); int sectDbTag = idSections(loc+1); loc += 2; theSections[i] = theBroker.getNewSection(sectClassTag); if (theSections[i] == 0) { opserr << "DispBeamColumn2d::recvSelf() - Broker could not create Section of class type " << sectClassTag << endln; exit(-1); } theSections[i]->setDbTag(sectDbTag); if (theSections[i]->recvSelf(commitTag, theChannel, theBroker) < 0) { opserr << "DispBeamColumn2d::recvSelf() - section " << i << " failed to recv itself\n"; return -1; } } } else { // // for each existing section, check it is of correct type // (if not delete old & create a new one) then recvSelf on it // loc = 0; for (i=0; i<numSections; i++) { int sectClassTag = idSections(loc); int sectDbTag = idSections(loc+1); loc += 2; // check of correct type if (theSections[i]->getClassTag() != sectClassTag) { // delete the old section[i] and create a new one delete theSections[i]; theSections[i] = theBroker.getNewSection(sectClassTag); if (theSections[i] == 0) { opserr << "DispBeamColumn2d::recvSelf() - Broker could not create Section of class type " << sectClassTag << endln; exit(-1); } } // recvSelf on it theSections[i]->setDbTag(sectDbTag); if (theSections[i]->recvSelf(commitTag, theChannel, theBroker) < 0) { opserr << "DispBeamColumn2d::recvSelf() - section " << i << " failed to recv itself\n"; return -1; } } } return 0; }
int Timoshenko2d::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker) { // receive the integer data containing tag, numSections and coord transformation info int dbTag = this->getDbTag(); int i; static ID idData(7); // one bigger than needed so no clash with section ID if (theChannel.recvID(dbTag, commitTag, idData) < 0) { opserr << "Timoshenko2d::recvSelf() - failed to recv ID data\n"; return -1; } this->setTag(idData(0)); connectedExternalNodes(0) = idData(1); connectedExternalNodes(1) = idData(2); int crdTransfClassTag = idData(4); int crdTransfDbTag = idData(5); // create a new crdTransf object if one needed if (crdTransf == 0 || crdTransf->getClassTag() != crdTransfClassTag) { if (crdTransf != 0) delete crdTransf; crdTransf = theBroker.getNewCrdTransf(crdTransfClassTag); if (crdTransf == 0) { opserr << "Timoshenko2d::recvSelf() - failed to obtain a CrdTrans object with classTag " << crdTransfClassTag << endln; return -2; } } crdTransf->setDbTag(crdTransfDbTag); // invoke recvSelf on the crdTransf object if (crdTransf->recvSelf(commitTag, theChannel, theBroker) < 0) { opserr << "Timoshenko2d::sendSelf() - failed to recv crdTranf\n"; return -3; } // // recv an ID for the sections containing each sections dbTag and classTag // ID idSections(2*idData(3)); int loc = 0; if (theChannel.recvID(dbTag, commitTag, idSections) < 0) { opserr << "Timoshenko2d::recvSelf() - failed to recv ID data\n"; return -1; } // now receive the sections if (numSections != idData(3)) { // // we do not have correct number of sections, must delete the old and create // new ones before can recvSelf on the sections // // delete the old if (numSections != 0) { for (i=0; i<numSections; i++) delete theSections[i]; delete [] theSections; } // create a new array to hold pointers theSections = new SectionForceDeformation *[idData(3)]; if (theSections == 0) { opserr << "Timoshenko2d::recvSelf() - out of memory creating sections array of size " << idData(3) << endln; return -1; } // create a section and recvSelf on it numSections = idData(3); loc = 0; for (i=0; i<numSections; i++) { int sectClassTag = idSections(loc); int sectDbTag = idSections(loc+1); loc += 2; //switch (sectClassTag) { //default: opserr << "Timoshenko2d::recvSelf() --default secTag at sec " << i+1 << endln; theSections[i] = new FiberSection2d(); // break; //} if (theSections[i] == 0) { opserr << "Timoshenko2d::recvSelf() - Broker could not create Section of class type " << sectClassTag << endln; exit(-1); } theSections[i]->setDbTag(sectDbTag); if (theSections[i]->recvSelf(commitTag, theChannel, theBroker) < 0) { opserr << "Timoshenko2d::recvSelf() - section " << i << " failed to recv itself\n"; return -1; } } } else { // for each existing section, check it is of correct type // (if not delete old & create a new one) then recvSelf on it loc = 0; for (i=0; i<numSections; i++) { int sectClassTag = idSections(loc); int sectDbTag = idSections(loc+1); loc += 2; // check of correct type if (theSections[i]->getClassTag() != sectClassTag) { // delete the old section[i] and create a new one delete theSections[i]; //switch (sectClassTag) { //default: opserr << "Timoshenko2d::recvSelf() --default secTag at sec " << i+1 << endln; theSections[i] = new FiberSection2d(); // break; //} if (theSections[i] == 0) { opserr << "Timoshenko2d::recvSelf() - Broker could not create Section of class type " << sectClassTag << endln; exit(-1); } } // recvSelf on it theSections[i]->setDbTag(sectDbTag); if (theSections[i]->recvSelf(commitTag, theChannel, theBroker) < 0) { opserr << "Timoshenko2d::recvSelf() - section " << i << " failed to recv itself\n"; return -1; } } } return 0; }
int PileToe3D::recvSelf(int commitTag, Channel &theChannel, FEM_ObjectBroker &theBroker) { int res; int dataTag = this->getDbTag(); // PileToe3D creates a Vector, receives the Vector and then sets the // internal data with the data in the Vector static Vector data(6); res = theChannel.recvVector(dataTag, commitTag, data); if (res < 0) { opserr <<"WARNING PileToe3D::recvSelf() - failed to receive Vector\n"; return -1; } this->setTag((int)data(0)); mRadius = data(1); mSubgradeCoeff = data(2); mCC = data(3); MyTag = (int)data(0); // PileToe3D now receives the tags of it's one external node res = theChannel.recvID(dataTag, commitTag, externalNodes); if (res < 0) { opserr <<"WARNING PileToe3D::recvSelf() - " << this->getTag() << " failed to receive ID\n"; return -2; } // PileToe3D now receives the tags of it's two beam external nodes res = theChannel.recvID(dataTag, commitTag, externalBNodes); if (res < 0) { opserr <<"WARNING PileToe3D::recvSelf() - " << this->getTag() << " failed to receive ID\n"; return -2; } int crdClass = (int)data(4); int crdDb = (int)data(5); // check if we have a material object already & if we do if of right type if ((crdTransf == 0) || (crdTransf->getClassTag() != crdClass)) { // if old one .. delete it if (crdTransf != 0) delete crdTransf; // create a new material object crdTransf = theBroker.getNewCrdTransf(crdClass); if (crdTransf == 0) { opserr <<"WARNING PileToe3D::recvSelf() - " << this->getTag() << " failed to get a blank CrdTransf of type " << crdClass << endln; return -3; } } crdTransf->setDbTag(crdDb); // note: we set the dbTag before we receive the material res = crdTransf->recvSelf(commitTag, theChannel, theBroker); if (res < 0) { opserr <<"WARNING PileToe3D::recvSelf() - "<< this->getTag() << "failed to receive its Material\n"; return -3; } return 0; }
int ModElasticBeam2d::recvSelf(int cTag, Channel &theChannel, FEM_ObjectBroker &theBroker) { int res = 0; static Vector data(19); res += theChannel.recvVector(this->getDbTag(), cTag, data); if (res < 0) { opserr << "ModElasticBeam2d::recvSelf -- could not receive data Vector\n"; return res; } A = data(0); E = data(1); I = data(2); alpha = data(10); d = data(11); alphaM = data(12); betaK = data(13); betaK0 = data(14); betaKc = data(15); //added by Dimitrios Lignos K11 = data(16); K33 = data(17); K44 = data(18); rho = data(3); cMass = (int)data(4); this->setTag((int)data(5)); connectedExternalNodes(0) = (int)data(6); connectedExternalNodes(1) = (int)data(7); // Check if the CoordTransf is null; if so, get a new one int crdTag = (int)data(8); if (theCoordTransf == 0) { theCoordTransf = theBroker.getNewCrdTransf(crdTag); if (theCoordTransf == 0) { opserr << "ModElasticBeam2d::recvSelf -- could not get a CrdTransf2d\n"; exit(-1); } } // Check that the CoordTransf is of the right type; if not, delete // the current one and get a new one of the right type if (theCoordTransf->getClassTag() != crdTag) { delete theCoordTransf; theCoordTransf = theBroker.getNewCrdTransf(crdTag); if (theCoordTransf == 0) { opserr << "ModElasticBeam2d::recvSelf -- could not get a CrdTransf2d\n"; exit(-1); } } // Now, receive the CoordTransf theCoordTransf->setDbTag((int)data(9)); res += theCoordTransf->recvSelf(cTag, theChannel, theBroker); if (res < 0) { opserr << "ModElasticBeam2d::recvSelf -- could not receive CoordTransf\n"; return res; } // Revert the crdtrasf to its last committed state theCoordTransf->revertToLastCommit(); return res; }
int ElasticTimoshenkoBeam2d::recvSelf(int commitTag, Channel &rChannel, FEM_ObjectBroker &theBroker) { int res = 0; static Vector data(16); res += rChannel.recvVector(this->getDbTag(), commitTag, data); if (res < 0) { opserr << "ElasticTimoshenkoBeam2d::recvSelf() - could not receive data Vector.\n"; return res; } this->setTag((int)data(0)); connectedExternalNodes(0) = (int)data(1); connectedExternalNodes(1) = (int)data(2); E = data(3); G = data(4); A = data(5); Iz = data(6); Avy = data(7); rho = data(8); cMass = (int)data(9); alphaM = data(10); betaK = data(11); betaK0 = data(12); betaKc = data(13); // check if the CoordTransf is null; if so, get a new one int crdTag = (int)data(14); if (theCoordTransf == 0) { theCoordTransf = theBroker.getNewCrdTransf(crdTag); if (theCoordTransf == 0) { opserr << "ElasticTimoshenkoBeam2d::recvSelf() - could not get a CrdTransf2d.\n"; return -1; } } // check that the CoordTransf is of the right type; if not, delete // the current one and get a new one of the right type if (theCoordTransf->getClassTag() != crdTag) { delete theCoordTransf; theCoordTransf = theBroker.getNewCrdTransf(crdTag); if (theCoordTransf == 0) { opserr << "ElasticTimoshenkoBeam2d::recvSelf() - could not get a CrdTransf2d.\n"; return -1; } } // receive the CoordTransf theCoordTransf->setDbTag((int)data(15)); res += theCoordTransf->recvSelf(commitTag, rChannel, theBroker); if (res < 0) { opserr << "ElasticTimoshenkoBeam2d::recvSelf() - could not receive CoordTransf.\n"; return res; } // get coordinate transformation type and save flag if (strncmp(theCoordTransf->getClassType(),"Linear",6) == 0) { nlGeo = 0; } else if (strncmp(theCoordTransf->getClassType(),"PDelta",6) == 0) { nlGeo = 1; } else if (strncmp(theCoordTransf->getClassType(),"Corot",5) == 0) { nlGeo = 1; opserr << "\nWARNING ElasticTimoshenkoBeam2d::recvSelf()" << " - Element: " << this->getTag() << endln << "Unsupported Corotational transformation assigned.\n" << "Using PDelta transformation instead.\n"; } // revert the CoordTransf to its last committed state theCoordTransf->revertToLastCommit(); return res; }