ElasticBeam2d::ElasticBeam2d(int tag, double a, double e, double i, int Nd1, int Nd2, CrdTransf &coordTransf, double Alpha, double depth, double r, int cm) :Element(tag,ELE_TAG_ElasticBeam2d), A(a), E(e), I(i), alpha(Alpha), d(depth), rho(r), cMass(cm), Q(6), q(3), connectedExternalNodes(2), theCoordTransf(0) { connectedExternalNodes(0) = Nd1; connectedExternalNodes(1) = Nd2; theCoordTransf = coordTransf.getCopy2d(); if (!theCoordTransf) { opserr << "ElasticBeam2d::ElasticBeam2d -- failed to get copy of coordinate transformation\n"; exit(01); } q0[0] = 0.0; q0[1] = 0.0; q0[2] = 0.0; p0[0] = 0.0; p0[1] = 0.0; p0[2] = 0.0; // set node pointers to NULL theNodes[0] = 0; theNodes[1] = 0; }
DispBeamColumn2d::DispBeamColumn2d(int tag, int nd1, int nd2, int numSec, SectionForceDeformation **s, BeamIntegration& bi, CrdTransf &coordTransf, double r, int cm) :Element (tag, ELE_TAG_DispBeamColumn2d), numSections(numSec), theSections(0), crdTransf(0), beamInt(0), connectedExternalNodes(2), Q(6), q(3), rho(r), cMass(cm), parameterID(0) { // Allocate arrays of pointers to SectionForceDeformations theSections = new SectionForceDeformation *[numSections]; if (theSections == 0) { opserr << "DispBeamColumn2d::DispBeamColumn2d - failed to allocate section model pointer\n"; exit(-1); } for (int i = 0; i < numSections; i++) { // Get copies of the material model for each integration point theSections[i] = s[i]->getCopy(); // Check allocation if (theSections[i] == 0) { opserr << "DispBeamColumn2d::DispBeamColumn2d -- failed to get a copy of section model\n"; exit(-1); } } beamInt = bi.getCopy(); if (beamInt == 0) { opserr << "DispBeamColumn2d::DispBeamColumn2d - failed to copy beam integration\n"; exit(-1); } crdTransf = coordTransf.getCopy2d(); if (crdTransf == 0) { opserr << "DispBeamColumn2d::DispBeamColumn2d - failed to copy coordinate transformation\n"; exit(-1); } // Set connected external node IDs connectedExternalNodes(0) = nd1; connectedExternalNodes(1) = nd2; theNodes[0] = 0; theNodes[1] = 0; q0[0] = 0.0; q0[1] = 0.0; q0[2] = 0.0; p0[0] = 0.0; p0[1] = 0.0; p0[2] = 0.0; }
ElasticBeam2d::ElasticBeam2d(int tag, int Nd1, int Nd2, SectionForceDeformation §ion, CrdTransf &coordTransf, double Alpha, double depth, double r, int cm) :Element(tag,ELE_TAG_ElasticBeam2d), alpha(Alpha), d(depth), rho(r), cMass(cm), Q(6), q(3), connectedExternalNodes(2), theCoordTransf(0) { E = 1.0; rho = r; cMass = cm; const Matrix §Tangent = section.getInitialTangent(); const ID §Code = section.getType(); for (int i=0; i<sectCode.Size(); i++) { int code = sectCode(i); switch(code) { case SECTION_RESPONSE_P: A = sectTangent(i,i); break; case SECTION_RESPONSE_MZ: I = sectTangent(i,i); break; default: break; } } connectedExternalNodes(0) = Nd1; connectedExternalNodes(1) = Nd2; theCoordTransf = coordTransf.getCopy2d(); if (!theCoordTransf) { opserr << "ElasticBeam2d::ElasticBeam2d -- failed to get copy of coordinate transformation\n"; exit(-1); } q0[0] = 0.0; q0[1] = 0.0; q0[2] = 0.0; p0[0] = 0.0; p0[1] = 0.0; p0[2] = 0.0; // set node pointers to NULL theNodes[0] = 0; theNodes[1] = 0; }
ElasticTimoshenkoBeam2d::ElasticTimoshenkoBeam2d(int tag, int Nd1, int Nd2, double e, double g, double a, double iz, double avy, CrdTransf &coordTransf, double r, int cm) : Element(tag, ELE_TAG_ElasticTimoshenkoBeam2d), connectedExternalNodes(2), theCoordTransf(0), E(e), G(g), A(a), Iz(iz), Avy(avy), rho(r), cMass(cm), nlGeo(0), phi(0.0), L(0.0), ul(6), ql(6), ql0(6), kl(6,6), klgeo(6,6), Tgl(6,6), Ki(6,6), M(6,6), theLoad(6) { // ensure the connectedExternalNode ID is of correct size & set values if (connectedExternalNodes.Size() != 2) { opserr << "ElasticTimoshenkoBeam2d::ElasticTimoshenkoBeam2d() - element: " << this->getTag() << " - failed to create an ID of size 2.\n"; exit(-1); } connectedExternalNodes(0) = Nd1; connectedExternalNodes(1) = Nd2; // set node pointers to NULL for (int i=0; i<2; i++) theNodes[i] = 0; // get a copy of the coordinate transformation theCoordTransf = coordTransf.getCopy2d(); if (!theCoordTransf) { opserr << "ElasticTimoshenkoBeam2d::ElasticTimoshenkoBeam2d() - " << "failed to get copy of coordinate transformation.\n"; exit(-1); } // 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::ElasticTimoshenkoBeam2d()" << " - Element: " << this->getTag() << endln << "Unsupported Corotational transformation assigned.\n" << "Using PDelta transformation instead.\n"; } // zero fixed end forces vector ql0.Zero(); }
// constructor which takes the unique element tag, sections, // and the node ID's of it's nodal end points. // allocates the necessary space needed by each object ElasticForceBeamColumn2d::ElasticForceBeamColumn2d (int tag, int nodeI, int nodeJ, int numSec, SectionForceDeformation **sec, BeamIntegration &bi, CrdTransf &coordTransf, double massDensPerUnitLength): Element(tag,ELE_TAG_ElasticForceBeamColumn2d), connectedExternalNodes(2), beamIntegr(0), numSections(numSec), crdTransf(0), rho(massDensPerUnitLength), initialFlag(0), numEleLoads(0), parameterID(0) { theNodes[0] = 0; theNodes[1] = 0; connectedExternalNodes(0) = nodeI; connectedExternalNodes(1) = nodeJ; beamIntegr = bi.getCopy(); if (beamIntegr == 0) { opserr << "Error: ElasticForceBeamColumn2d::ElasticForceBeamColumn2d: could not create copy of beam integration object" << endln; } // get copy of the transformation object crdTransf = coordTransf.getCopy2d(); if (crdTransf == 0) { opserr << "Error: ElasticForceBeamColumn2d::ElasticForceBeamColumn2d: could not create copy of coordinate transformation object" << endln; } if (numSections > maxNumSections) { opserr << "Error: ElasticForceBeamColumn2d::ElasticForceBeamColumn2d: numSections " << numSections << " exceeds max allowed, " << maxNumSections << endln; numSections = maxNumSections; } int i; for (i = 0; i < numSections; i++) { sections[i] = sec[i]->getCopy(); if (sections[i] == 0) { opserr << "Error: ElasticForceBeamColumn2d::ElasticForceBeamColumn2d: could not create copy of section object " << i << endln; } } for ( ; i < maxNumSections; i++) sections[i] = 0; }
Timoshenko2d::Timoshenko2d(int tag, int nd1, int nd2, int numSec, SectionForceDeformation **s, CrdTransf &coordTransf, BeamIntegration& bi, double r, double SCF, int noIter) :Element (tag, ELE_TAG_Timoshenko2d), numSections(numSec), theSections(0), crdTransf(0), beamInt(0), connectedExternalNodes(2), Rslt(3), Defo(3), Q(6), q(3), rho(r), shearCF(SCF), iterSwitch(noIter) { // Allocate arrays of pointers to SectionForceDeformations theSections = new SectionForceDeformation *[numSections]; if (theSections == 0) { opserr << "Timoshenko2d::Timoshenko2d - failed to allocate section model pointer\n"; exit(-1); } for (int i = 0; i< numSections; i++){ // Get copies of the material model for each integration point SectionForceDeformation *theSection = s[i]->getCopy(); switch (s[i]->getClassTag()) { case SEC_TAG_TimoshenkoSection2d: theSections[i] = (TimoshenkoSection2d *)theSection; break; default: opserr << "Timoshenko2d::Timoshenko2d() --default secTag at sec " << i+1 << endln; theSections[i] = theSection; break; } Omega[i]=0.0; } crdTransf = coordTransf.getCopy2d(); if (crdTransf == 0) { opserr << "Timoshenko2d::Timoshenko2d - failed to copy coordinate transformation\n"; exit(-1); } beamInt = bi.getCopy(); if (beamInt == 0) { opserr << "Timoshenko2d::Timoshenko2d() - failed to copy beam integration\n"; exit(-1); } // Set connected external node IDs connectedExternalNodes(0) = nd1; connectedExternalNodes(1) = nd2; theNodes[0] = 0; theNodes[1] = 0; q0[0] = 0.0; q0[1] = 0.0; q0[2] = 0.0; p0[0] = 0.0; p0[1] = 0.0; p0[2] = 0.0; if (nd == 0) nd = new Matrix [maxNumSections]; if (bd == 0) bd = new Matrix [maxNumSections]; if (!nd || !bd ) { opserr << "Timoshenko2d::Timoshenko2d() -- failed to allocate static section arrays"; exit(-1); } // AddingSensitivity:BEGIN ///////////////////////////////////// parameterID = 0; // AddingSensitivity:END ////////////////////////////////////// }
// responsible for allocating the necessary space needed // by each object and storing the tags of the end nodes. EEBeamColumn2d::EEBeamColumn2d(int tag, int Nd1, int Nd2, CrdTransf &coordTransf, ExperimentalSite *site, bool iM, int addRay, double r) : ExperimentalElement(tag, ELE_TAG_EEBeamColumn2d, site), connectedExternalNodes(2), theCoordTransf(0), iMod(iM), addRayleigh(addRay), rho(r), L(0.0), theLoad(6), db(0), vb(0), ab(0), t(0), dbDaq(0), vbDaq(0), abDaq(0), qDaq(0), tDaq(0), dbCtrl(3), vbCtrl(3), abCtrl(3), kbInit(3,3), tLast(0.0), firstWarning(true) { // ensure the connectedExternalNode ID is of correct size & set values if (connectedExternalNodes.Size() != 2) { opserr << "EEBeamColumn2d::EEBeamColumn2d() - element: " << tag << " failed to create an ID of size 2\n"; exit(-1); } connectedExternalNodes(0) = Nd1; connectedExternalNodes(1) = Nd2; // set node pointers to NULL int i; for (i=0; i<2; i++) theNodes[i] = 0; // set the data size for the experimental site sizeCtrl = new ID(OF_Resp_All); sizeDaq = new ID(OF_Resp_All); (*sizeCtrl)[OF_Resp_Disp] = 3; (*sizeCtrl)[OF_Resp_Vel] = 3; (*sizeCtrl)[OF_Resp_Accel] = 3; (*sizeCtrl)[OF_Resp_Time] = 1; (*sizeDaq)[OF_Resp_Disp] = 3; (*sizeDaq)[OF_Resp_Vel] = 3; (*sizeDaq)[OF_Resp_Accel] = 3; (*sizeDaq)[OF_Resp_Force] = 3; (*sizeDaq)[OF_Resp_Time] = 1; theSite->setSize(*sizeCtrl, *sizeDaq); // allocate memory for trial response vectors db = new Vector(3); vb = new Vector(3); ab = new Vector(3); t = new Vector(1); // allocate memory for daq response vectors dbDaq = new Vector(3); vbDaq = new Vector(3); abDaq = new Vector(3); qDaq = new Vector(3); tDaq = new Vector(1); // set the initial stiffness matrix size theInitStiff.resize(6,6); // get a copy of the coordinate transformation theCoordTransf = coordTransf.getCopy2d(); if (!theCoordTransf) { opserr << "EEBeamColumn2d::EEBeamColumn2d() - " << "failed to get copy of the coordinate transformation\n"; exit(-1); } // initialize additional vectors dbCtrl.Zero(); vbCtrl.Zero(); abCtrl.Zero(); for (i=0; i<3; i++) { qA0[i] = 0.0; pA0[i] = 0.0; } }
// responsible for allocating the necessary space needed // by each object and storing the tags of the end nodes. EEBeamColumn2d::EEBeamColumn2d(int tag, int Nd1, int Nd2, CrdTransf &coordTransf, int port, char *machineInetAddr, int ssl, int udp, int dataSize, bool iM, int addRay, double r) : ExperimentalElement(tag, ELE_TAG_EEBeamColumn2d), connectedExternalNodes(2), theCoordTransf(0), iMod(iM), addRayleigh(addRay), rho(r), L(0.0), theLoad(6), theChannel(0), sData(0), sendData(0), rData(0), recvData(0), db(0), vb(0), ab(0), t(0), dbDaq(0), vbDaq(0), abDaq(0), qDaq(0), tDaq(0), dbCtrl(3), vbCtrl(3), abCtrl(3), kbInit(3,3), tLast(0.0), firstWarning(true) { // ensure the connectedExternalNode ID is of correct size & set values if (connectedExternalNodes.Size() != 2) { opserr << "EEBeamColumn2d::EEBeamColumn2d() - element: " << tag << " failed to create an ID of size 2\n"; exit(-1); } connectedExternalNodes(0) = Nd1; connectedExternalNodes(1) = Nd2; // set node pointers to NULL int i; for (i=0; i<2; i++) theNodes[i] = 0; // setup the connection if (ssl) { if (machineInetAddr == 0) theChannel = new TCP_SocketSSL(port, "127.0.0.1"); else theChannel = new TCP_SocketSSL(port, machineInetAddr); } else if (udp) { if (machineInetAddr == 0) theChannel = new UDP_Socket(port, "127.0.0.1"); else theChannel = new UDP_Socket(port, machineInetAddr); } else { if (machineInetAddr == 0) theChannel = new TCP_Socket(port, "127.0.0.1"); else theChannel = new TCP_Socket(port, machineInetAddr); } if (!theChannel) { opserr << "EEBeamColumn2d::EEBeamColumn2d() " << "- failed to create channel\n"; exit(-1); } if (theChannel->setUpConnection() != 0) { opserr << "EEBeamColumn2d::EEBeamColumn2d() " << "- failed to setup connection\n"; exit(-1); } delete [] machineInetAddr; // set the data size for the experimental site int intData[2*OF_Resp_All+1]; ID idData(intData, 2*OF_Resp_All+1); sizeCtrl = new ID(intData, OF_Resp_All); sizeDaq = new ID(&intData[OF_Resp_All], OF_Resp_All); idData.Zero(); (*sizeCtrl)[OF_Resp_Disp] = 3; (*sizeCtrl)[OF_Resp_Vel] = 3; (*sizeCtrl)[OF_Resp_Accel] = 3; (*sizeCtrl)[OF_Resp_Time] = 1; (*sizeDaq)[OF_Resp_Disp] = 3; (*sizeDaq)[OF_Resp_Vel] = 3; (*sizeDaq)[OF_Resp_Accel] = 3; (*sizeDaq)[OF_Resp_Force] = 3; (*sizeDaq)[OF_Resp_Time] = 1; if (dataSize < 13) dataSize = 13; intData[2*OF_Resp_All] = dataSize; theChannel->sendID(0, 0, idData, 0); // allocate memory for the send vectors int id = 1; sData = new double [dataSize]; sendData = new Vector(sData, dataSize); db = new Vector(&sData[id], 3); id += 3; vb = new Vector(&sData[id], 3); id += 3; ab = new Vector(&sData[id], 3); id += 3; t = new Vector(&sData[id], 1); sendData->Zero(); // allocate memory for the receive vectors id = 0; rData = new double [dataSize]; recvData = new Vector(rData, dataSize); dbDaq = new Vector(&rData[id], 3); id += 3; vbDaq = new Vector(&rData[id], 3); id += 3; abDaq = new Vector(&rData[id], 3); id += 3; qDaq = new Vector(&rData[id], 3); id += 3; tDaq = new Vector(&rData[id], 1); recvData->Zero(); // set the initial stiffness matrix size theInitStiff.resize(6,6); // get a copy of the coordinate transformation theCoordTransf = coordTransf.getCopy2d(); if (!theCoordTransf) { opserr << "EEBeamColumn2d::EEBeamColumn2d() - " << "failed to get copy of the coordinate transformation\n"; exit(-1); } // initialize additional vectors dbCtrl.Zero(); vbCtrl.Zero(); abCtrl.Zero(); for (i=0; i<3; i++) { qA0[i] = 0.0; pA0[i] = 0.0; } }