void TFP_Bearing::Print(OPS_Stream &s, int flag) { s << "Element: " << this->getTag(); s << " type: TFP_Bearing iNode: " << externalNodes(0); s << " jNode: " << externalNodes(1) << endln; }
//first constructor //////////////////////////////////////////////////////////////////////////// Quad4FiberOverlay::Quad4FiberOverlay(int tag, int nd1, int nd2, int nd3, int nd4, UniaxialMaterial &m, double AreaFiber,double B1, double B2) :Element(tag, ELE_TAG_Quad4FiberOverlay) ,theMaterial(0) ,externalNodes(SL_NUM_NODE) ,g1(SL_NUM_NDF) ,dualg1(SL_NUM_NDF) ,g2(SL_NUM_NDF) ,dualg2(SL_NUM_NDF) ,beta1(B1) ,beta2(B2) ,dNidxAlphai(SL_NUM_NODE,SL_NUM_NDF) ,Q1(SL_NUM_NDF) ,Q2(SL_NUM_NDF),Q3(SL_NUM_NDF),Q4(SL_NUM_NDF) ,Qfi(SL_NUM_NDF) ,Qfj(SL_NUM_NDF) ,Vf(SL_NUM_NDF) ,A(3) ,AA(3) ,Bb(SL_NUM_DOF) ,Af(AreaFiber) ,u(SL_NUM_DOF) { //determine int pts location based on fiber orientation nFi.Zero(); nFj.Zero(); A.Zero(); AA.Zero(); nFi[0] = -1.0; nFi[1] = (beta1 - 0.5) * 2.0; nFj[0] = 1.0; nFj[1] = (beta2 - 0.5) * 2.0; A = nFj - nFi; A.Normalize(); AA[0] = A(0)*A(0); AA[1] = A(1)*A(1); AA[2] = A(1)*A(0); // this must be 1* A1 A2 since strain uses gamma = 2 eps12 //set up integration paramaters (2 intgr pts) pts[0][0] = nFi(0)+A(0)*(1-0.5773502691896258); pts[0][1] = nFi(1)+A(1)*(1-0.5773502691896258); pts[1][0] = nFj(0)-A(0)*(1-0.5773502691896258); pts[1][1] = nFj(1)-A(1)*(1-0.5773502691896258); wts[0] = 1.0; wts[1] = 1.0; externalNodes(0) = nd1; externalNodes(1) = nd2; externalNodes(2) = nd3; externalNodes(3) = nd4; theMaterial = m.getCopy(); for(int i = 0; i<4;i++){ theNodes[i] = 0; } }
// method: setDomain() // to set a link to the enclosing Domain, ensure nodes exist in Domain // and set pointers to these nodes, also determines the length and // transformation Matrix. void TFP_Bearing::setDomain(Domain *theDomain) { // check Domain is not null - invoked when object removed from a domain if (theDomain == 0) { exit(-1); return; } // first ensure nodes exist in Domain and set the node pointers Node *end1Ptr, *end2Ptr; int Nd1 = externalNodes(0); int Nd2 = externalNodes(1); end1Ptr = theDomain->getNode(Nd1); end2Ptr = theDomain->getNode(Nd2); if (end1Ptr == 0) { opserr << "WARNING TFP_Bearing::setDomain() - at truss " << this->getTag() << " node " << Nd1 << " does not exist in domain\n"; exit(-1); return; // don't go any further - otherwise segemntation fault } if (end2Ptr == 0) { opserr << "WARNING TFP_Bearing::setDomain() - at truss " << this->getTag() << " node " << Nd2 << " does not exist in domain\n"; exit(-1); return; // don't go any further - otherwise segemntation fault } theNodes[0] = end1Ptr; theNodes[1] = end2Ptr; // call the DomainComponent class method THIS IS VERY IMPORTANT this->DomainComponent::setDomain(theDomain); // ensure connected nodes have correct number of dof's int dofNd1 = end1Ptr->getNumberDOF(); int dofNd2 = end2Ptr->getNumberDOF(); if ((dofNd1 != dofNd2) || ((dofNd2 != 3) && (dofNd2 != 6)) ) { opserr << "TFP_Bearing::setDomain(): 3 or 6 dof required at nodes\n"; exit(-1); return; } if (dofNd2 == 3) { theMatrix = new Matrix(6,6); theVector = new Vector(6); numDOF = 6; } else { theMatrix = new Matrix(12,12); theVector = new Vector(12); numDOF = 12; } this->update(); }
void TFP_Bearing::Print(OPS_Stream &s, int flag) { if (flag == OPS_PRINT_CURRENTSTATE) { s << "Element: " << this->getTag(); s << " type: TFP_Bearing iNode: " << externalNodes(0); s << " jNode: " << externalNodes(1) << endln; } if (flag == OPS_PRINT_PRINTMODEL_JSON) { s << "\t\t\t{"; s << "\"name\": " << this->getTag() << ", "; s << "\"type\": \"TFP_Bearing\", "; s << "\"nodes\": [" << externalNodes(0) << ", " << externalNodes(1) << "]}"; } }
// constructors: PileToe3D::PileToe3D(int tag, int Nd1, int BNd1, int BNd2, double rad, double k, CrdTransf &coordTransf) :Element(tag,ELE_TAG_PileToe3D), crdTransf(0), externalNodes(PT3D_NUM_NODE), externalBNodes(2), mTangentStiffness(PT3D_NUM_DOF, PT3D_NUM_DOF), mInternalForces(PT3D_NUM_DOF) { externalNodes(0) = Nd1; externalBNodes(0) = BNd1; externalBNodes(1) = BNd2; mRadius = rad; mSubgradeCoeff = k; mCC = mRadius; // Initial value of mCC --> Total area // get copy of the transformation & material object crdTransf = coordTransf.getCopy3d(); // check it: if (!crdTransf) { opserr << "Error: PileToe3D:PileToe3D: could not create copy of coordinate transformation object" << endln; exit(-1); } // element tag for debugging MyTag = tag; // set initialization to true for setDomain function mInitialize = true; }
void PileToe3D::Print(OPS_Stream &s, int flag) { opserr << "PileToe3D, element id: " << this->getTag() << endln; opserr << " Connected external nodes: " ; for (int i = 0; i<PT3D_NUM_NODE; i++) { opserr << externalNodes(i)<< " "; } return; }
// // domain /////////////////////////////////////////////////////////////////////////////////// void Quad4FiberOverlay::setDomain(Domain *theDomain) { // Check Domain is not null - invoked when object removed from a domain if (theDomain == 0) { theNodes[0] = 0; theNodes[1] = 0; theNodes[2] = 0; theNodes[3] = 0; return; } int Nd1 = externalNodes(0); int Nd2 = externalNodes(1); int Nd3 = externalNodes(2); int Nd4 = externalNodes(3); theNodes[0] = theDomain->getNode(Nd1); theNodes[1] = theDomain->getNode(Nd2); theNodes[2] = theDomain->getNode(Nd3); theNodes[3] = theDomain->getNode(Nd4); Q1 = theNodes[0]->getCrds(); Q2 = theNodes[1]->getCrds(); Q3 = theNodes[2]->getCrds(); Q4 = theNodes[3]->getCrds(); Qfi = Q1 + (Q4 - Q1)*beta1; Qfj = Q2 + (Q3 - Q2)*beta2; Vf = Qfj - Qfi; Lf = Vf.Norm(); this->DomainComponent::setDomain(theDomain); }
void PileToe3D::setDomain(Domain *theDomain) { theNodes[0] = theDomain->getNode(externalNodes(0)); theBNodes[0] = theDomain->getNode(externalBNodes(0)); theBNodes[1] = theDomain->getNode(externalBNodes(1)); for (int i = 0; i < 1; i++) { if (theNodes[i] == 0) { opserr << "PileToe3D::setDomain() - no node with tag: " << theNodes[i] << endln; return; // don't go any further - otherwise segmentation fault } } for (int i = 0; i < 2; i++) { if (theBNodes[i] == 0) { opserr << "PileToe3D::setDomain() - no beam node with tag: " << theNodes[i] << endln; return; // don't go any further - otherwise segmentation fault } } // only perform these steps during initial creation of element if (mInitialize) { // initialize coordinate vectors //const Vector &mIcrd_1 = theNodes[0]->getCrds(); // coordinate matrix //mNodeCrd(0,0) = mIcrd_1(0); } //Initialize Coordinate Transformation if (crdTransf->initialize(theBNodes[0], theBNodes[1])) { // Add some error check } double L = crdTransf->getInitialLength(); if (L == 0.0) { // Add some error check } // call the base class method this->DomainComponent::setDomain(theDomain); }
// typical constructor TFP_Bearing::TFP_Bearing(int tag, int Nd1, int Nd2, double *R, double *DOUT, double *DIN, double *MU, double *H, double h0, double a, double k, double vYield) :Element(tag, ELE_TAG_TFP_Bearing), externalNodes(2), H0(h0), Ac(a), Ap(a), numDOF(0), theMatrix(0), theVector(0), vyield(vYield) { K = k; // fill in the ID containing external node info with node id's if (externalNodes.Size() != 2) { opserr << "FATAL TFP_Bearing::TFP_Bearing() - out of memory, could not create an ID of size 2\n"; exit(-1); } externalNodes(0) = Nd1; externalNodes(1) = Nd2; theNodes[0] = 0; theNodes[1] = 0; for (int i=0; i<4; i++) { r[i] = R[i]; dOut[i] = DOUT[i]; dIn[i] = DIN[i]; mu[i] = MU[i]; h[i] = H[i]; } double dh = 0.0; for (int i=0; i<8; i++) { vpCommit[i] = 0.0; vpTrial[i] = 0.0; vCommit[i] = 0.0; vTrial[i] = 0.0; vs[i] = 0.0; FrCommit[i] = 0.0; FrTrial[i] = 0.0; d[i] = 0.0; // r[i] - sqrt(r[i]*r[i]-sqrt(vs[i]*vs[i]+vs[i+4]*vs[i+4])); dh += d[i]; } for (int i=0; i<4; i++) { PCommit[i] = 0.0; PTrial[i] = 0.0; UCommit[i] = 0.0; UTrial[i] = 0.0; N[i] = a; } HTrial = H0 + dh; }