const Vector & ElasticForceBeamColumn2d::getResistingForceIncInertia() { // Compute the current resisting force theVector = this->getResistingForce(); // Check for a quick return if (rho != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); double L = crdTransf->getInitialLength(); double m = 0.5*rho*L; theVector(0) += m*accel1(0); theVector(1) += m*accel1(1); theVector(3) += m*accel2(0); theVector(4) += m*accel2(1); // add the damping forces if rayleigh damping if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) theVector += this->getRayleighDampingForces(); } else { // add the damping forces if rayleigh damping if (betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) theVector += this->getRayleighDampingForces(); } return theVector; }
const Vector& EEBeamColumn2d::getResistingForceIncInertia() { // this already includes damping forces from specimen theVector = this->getResistingForce(); // add the damping forces from rayleigh damping if (addRayleigh == 1) { if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) theVector.addVector(1.0, this->getRayleighDampingForces(), 1.0); } // add inertia forces from element mass if (L != 0.0 && rho != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); double m = 0.5*rho*L; theVector(0) += m * accel1(0); theVector(1) += m * accel1(1); theVector(3) += m * accel2(0); theVector(4) += m * accel2(1); } return theVector; }
const Vector& Timoshenko2d::getResistingForceIncInertia() { // Add the inertial forces if (rho != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); // Compute the current resisting force this->getResistingForce(); double L = crdTransf->getInitialLength(); double m = 0.5*rho*L; P(0) += m*accel1(0); P(1) += m*accel1(1); P(3) += m*accel2(0); P(4) += m*accel2(1); } // Add the damping forces if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) { P += this->getRayleighDampingForces(); } return P; }
const Vector& FourNodeQuad3d::getResistingForceIncInertia() { int i; static double rhoi[4]; double sum = 0.0; for (i = 0; i < 4; i++) { rhoi[i] = theMaterial[i]->getRho(); sum += rhoi[i]; } // if no mass terms .. just add damping terms if (sum == 0.0) { this->getResistingForce(); // add the damping forces if rayleigh damping if (betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) P += this->getRayleighDampingForces(); return P; } const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); const Vector &accel3 = theNodes[2]->getTrialAccel(); const Vector &accel4 = theNodes[3]->getTrialAccel(); static double a[12]; a[0] = accel1(0); a[1] = accel1(1); a[2] = accel1(2); a[3] = accel2(0); a[4] = accel2(1); a[5] = accel2(2); a[6] = accel3(0); a[7] = accel3(1); a[8] = accel3(2); a[9] = accel4(0); a[10] = accel4(1); a[11] = accel4(2); // Compute the current resisting force this->getResistingForce(); // Compute the mass matrix this->getMass(); // Take advantage of lumped mass matrix for (i = 0; i < 12; i++) P(i) += K(i,i)*a[i]; // add the damping forces if rayleigh damping if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) P += this->getRayleighDampingForces(); return P; }
const Vector & SSPquadUP::getResistingForceIncInertia() { // terms stemming from acceleration const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); const Vector &accel3 = theNodes[2]->getTrialAccel(); const Vector &accel4 = theNodes[3]->getTrialAccel(); // compute current resisting force this->getResistingForce(); // compute mass matrix this->getMass(); Vector a(12); a(0) = accel1(0); a(1) = accel1(1); a(2) = accel1(2); a(3) = accel2(0); a(4) = accel2(1); a(5) = accel2(2); a(6) = accel3(0); a(7) = accel3(1); a(8) = accel3(2); a(9) = accel4(0); a(10) = accel4(1); a(11) = accel4(2); mInternalForces.addMatrixVector(1.0, mMass, a, 1.0); // terms stemming from velocity const Vector &vel1 = theNodes[0]->getTrialVel(); const Vector &vel2 = theNodes[1]->getTrialVel(); const Vector &vel3 = theNodes[2]->getTrialVel(); const Vector &vel4 = theNodes[3]->getTrialVel(); Vector v(12); v(0) = vel1(0); v(1) = vel1(1); v(2) = vel1(2); v(3) = vel2(0); v(4) = vel2(1); v(5) = vel2(2); v(6) = vel3(0); v(7) = vel3(1); v(8) = vel3(2); v(9) = vel4(0); v(10) = vel4(1); v(11) = vel4(2); // compute damping matrix this->getDamp(); mInternalForces.addMatrixVector(1.0, mDamp, v, 1.0); return mInternalForces; }
const Vector& Tri31::getResistingForceIncInertia() { int i; static double rhoi[1]; //numgp double sum = 0.0; for (i = 0; i < numgp; i++) { if(rho == 0) { rhoi[i] = theMaterial[i]->getRho(); } else { rhoi[i] = rho; } sum += rhoi[i]; } // if no mass terms .. just add damping terms if (sum == 0.0) { this->getResistingForce(); // add the damping forces if rayleigh damping if (betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) P += this->getRayleighDampingForces(); return P; } const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); const Vector &accel3 = theNodes[2]->getTrialAccel(); static double a[6]; a[0] = accel1(0); a[1] = accel1(1); a[2] = accel2(0); a[3] = accel2(1); a[4] = accel3(0); a[5] = accel3(1); // Compute the current resisting force this->getResistingForce(); // Compute the mass matrix this->getMass(); // Take advantage of lumped mass matrix for (i = 0; i < 2*numnodes; i++) P(i) += K(i,i)*a[i]; // add the damping forces if rayleigh damping if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) P += this->getRayleighDampingForces(); return P; }
//! @brief Return the resisting force of the element including //! inertia. const XC::Vector &XC::FourNodeQuad::getResistingForceIncInertia(void) const { static Vector rhoi(4); rhoi= physicalProperties.getRhoi(); double sum = this->physicalProperties.getRho(); for(int i= 0;i<rhoi.Size();i++) sum += rhoi[i]; // if no mass terms .. just add damping terms if(sum == 0.0) { this->getResistingForce(); // add the damping forces if rayleigh damping if(!rayFactors.nullKValues()) P += this->getRayleighDampingForces(); return P; } const XC::Vector &accel1 = theNodes[0]->getTrialAccel(); const XC::Vector &accel2 = theNodes[1]->getTrialAccel(); const XC::Vector &accel3 = theNodes[2]->getTrialAccel(); const XC::Vector &accel4 = theNodes[3]->getTrialAccel(); static double a[8]; a[0] = accel1(0); a[1] = accel1(1); a[2] = accel2(0); a[3] = accel2(1); a[4] = accel3(0); a[5] = accel3(1); a[6] = accel4(0); a[7] = accel4(1); // Compute the current resisting force this->getResistingForce(); // Compute the mass matrix this->getMass(); //Take advantage of lumped mass matrix for(int i= 0;i<8;i++) P(i)+= K(i,i)*a[i]; // add the damping forces if rayleigh damping if(!rayFactors.nullValues()) P+= this->getRayleighDampingForces(); if(isDead()) P*=dead_srf; return P; }
const Vector & SSPquad::getResistingForceIncInertia() { // get mass density from the material double density = theMaterial->getRho(); // if density is zero only add damping terms if (density == 0.0) { this->getResistingForce(); // add the damping forces if rayleigh damping if (betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) { mInternalForces += this->getRayleighDampingForces(); } return mInternalForces; } const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); const Vector &accel3 = theNodes[2]->getTrialAccel(); const Vector &accel4 = theNodes[3]->getTrialAccel(); static double a[8]; a[0] = accel1(0); a[1] = accel1(1); a[2] = accel2(0); a[3] = accel2(1); a[4] = accel3(0); a[5] = accel3(1); a[6] = accel4(0); a[7] = accel4(1); // compute current resisting force this->getResistingForce(); // compute mass matrix this->getMass(); for (int i = 0; i < 8; i++) { mInternalForces(i) += mMass(i,i)*a[i]; } // add the damping forces if rayleigh damping if (alphaM != 0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) { mInternalForces += this->getRayleighDampingForces(); } return mInternalForces; }
const Vector& ElastomericBearingBoucWen2d::getResistingForceIncInertia() { // this already includes damping forces from materials theVector = this->getResistingForce(); // subtract external load theVector.addVector(1.0, theLoad, -1.0); // add the damping forces from rayleigh damping if (addRayleigh == 1) { if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) theVector.addVector(1.0, this->getRayleighDampingForces(), 1.0); } // add inertia forces from element mass if (mass != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); double m = 0.5*mass; for (int i=0; i<2; i++) { theVector(i) += m * accel1(i); theVector(i+3) += m * accel2(i); } } return theVector; }
const Vector& EEBearing3d::getResistingForceIncInertia() { // this already includes damping forces from specimen theVector = this->getResistingForce(); // add the damping forces from rayleigh damping if (addRayleigh == 1) { if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) theVector.addVector(1.0, this->getRayleighDampingForces(), 1.0); } // add inertia forces from element mass if (mass != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); double m = 0.5*mass; for (int i=0; i<3; i++) { theVector(i) += m * accel1(i); theVector(i+6) += m * accel2(i); } } return theVector; }
const Vector& ElasticTimoshenkoBeam2d::getResistingForceIncInertia() { // first get the resisting forces theVector = this->getResistingForce(); // subtract external load theVector.addVector(1.0, theLoad, -1.0); // add the damping forces from rayleigh damping if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) theVector.addVector(1.0, this->getRayleighDampingForces(), 1.0); // check for quick return if (rho == 0.0) return theVector; // add inertia forces from element mass const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); static Vector accel(6); for (int i=0; i<3; i++) { accel(i) = accel1(i); accel(i+3) = accel2(i); } theVector.addMatrixVector(1.0, M, accel, 1.0); return theVector; }
const Vector& EETrussCorot::getResistingForceIncInertia() { // this already includes damping forces from specimen *theVector = this->getResistingForce(); // add the damping forces from rayleigh damping if (addRayleigh == 1) { if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) theVector->addVector(1.0, this->getRayleighDampingForces(), 1.0); } // add inertia forces from element mass if (L != 0.0 && rho != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); int numDOF2 = numDOF/2; double m = 0.5*rho*L; for (int i=0; i<numDIM; i++) { (*theVector)(i) += m * accel1(i); (*theVector)(i+numDOF2) += m * accel2(i); } } return *theVector; }
const Vector & Truss2::getResistingForceIncInertia() { this->getResistingForce(); // subtract external load (*theVector) -= *theLoad; // now include the mass portion if (L != 0.0 && rho != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); int numDOF2 = numDOF/2; double M = 0.5*rho*L; for (int i = 0; i < dimension; i++) { (*theVector)(i) += M*accel1(i); (*theVector)(i+numDOF2) += M*accel2(i); } // add the damping forces if rayleigh damping if (doRayleighDamping == 1 && (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0)) (*theVector) += this->getRayleighDampingForces(); } else { // add the damping forces if rayleigh damping if (doRayleighDamping == 1 && (betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0)) (*theVector) += this->getRayleighDampingForces(); } return *theVector; }
const Vector & TrussSection::getResistingForceIncInertia() { this->getResistingForce(); // now include the mass portion if (L != 0.0 && rho != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); double M = 0.5*rho*L; int dof = dimension; int start = numDOF/2; for (int i=0; i<dof; i++) { (*theVector)(i) += M*accel1(i); (*theVector)(i+start) += M*accel2(i); } } // add the damping forces if rayleigh damping if (doRayleighDamping == 1) if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) *theVector += this->getRayleighDampingForces(); return *theVector; }
const XC::Vector &XC::CorotTruss::getResistingForceIncInertia(void) const { Vector &P = *theVector; P = this->getResistingForce(); const double rho= getRho(); if(rho != 0.0) { const XC::Vector &accel1 = theNodes[0]->getTrialAccel(); const XC::Vector &accel2 = theNodes[1]->getTrialAccel(); double M = 0.5*rho*Lo; int numDOF2 = numDOF/2; for(int i = 0; i < getNumDIM(); i++) { P(i)+= M*accel1(i); P(i+numDOF2)+= M*accel2(i); } } // add the damping forces if rayleigh damping if(!rayFactors.nullValues()) *theVector+= this->getRayleighDampingForces(); if(isDead()) (*theVector)*=dead_srf; //XXX Se aplica 2 veces sobre getResistingForce: arreglar. return *theVector; }
const Vector& SingleFPSimple2d::getResistingForceIncInertia() { // this already includes damping forces from materials theVector = this->getResistingForce(); // add the damping forces from rayleigh damping if (addRayleigh == 1) { if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) theVector += this->getRayleighDampingForces(); } // add inertia forces from element mass if (mass != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); double m = 0.5*mass; for (int i=0; i<2; i++) { theVector(i) += m * accel1(i); theVector(i+3) += m * accel2(i); } } return theVector; }
const Vector & CorotTruss::getResistingForceIncInertia() { Vector &P = *theVector; P = this->getResistingForce(); if (rho != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); double M = 0.5*rho*Lo; int numDOF2 = numDOF/2; for (int i = 0; i < numDIM; i++) { P(i) += M*accel1(i); P(i+numDOF2) += M*accel2(i); } } // add the damping forces if rayleigh damping if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) *theVector += this->getRayleighDampingForces(); return *theVector; }
const Vector& TwoNodeLink::getResistingForceIncInertia() { // this already includes damping forces from materials this->getResistingForce(); // subtract external load theVector->addVector(1.0, *theLoad, -1.0); // add the damping forces from rayleigh damping if (addRayleigh == 1) { if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) theVector->addVector(1.0, this->getRayleighDampingForces(), 1.0); } // add inertia forces from element mass if (mass != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); int numDOF2 = numDOF/2; double m = 0.5*mass; for (int i=0; i<numDIM; i++) { (*theVector)(i) += m * accel1(i); (*theVector)(i+numDOF2) += m * accel2(i); } } return *theVector; }
const Vector & CorotTrussSection::getResistingForceIncInertia() { Vector &P = *theVector; P = this->getResistingForce(); // subtract external load P -= *theLoad; // now include the mass portion if (Lo != 0.0 && rho != 0.0) { // add inertia forces from element mass const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); int numDOF2 = numDOF/2; if (cMass == 0) { // lumped mass matrix double m = 0.5*rho*Lo; for (int i=0; i<numDIM; i++) { P(i) += m*accel1(i); P(i+numDOF2) += m*accel2(i); } } else { // consistent mass matrix double m = rho*Lo/6.0; for (int i=0; i<numDIM; i++) { (*theVector)(i) += 2.0*m*accel1(i) + m*accel2(i); (*theVector)(i+numDOF2) += m*accel1(i) + 2.0*m*accel2(i); } } // add the damping forces if rayleigh damping if (doRayleighDamping == 1 && (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0)) theVector->addVector(1.0, this->getRayleighDampingForces(), 1.0); } else { // add the damping forces if rayleigh damping if (doRayleighDamping == 1 && (betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0)) theVector->addVector(1.0, this->getRayleighDampingForces(), 1.0); } return *theVector; }
const Vector& DispBeamColumn3d::getResistingForceIncInertia() { P = this->getResistingForce(); // Subtract other external nodal loads ... P_res = P_int - P_ext P.addVector(1.0, Q, -1.0); if (rho != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); if (cMass == 0) { // take advantage of lumped mass matrix double L = crdTransf->getInitialLength(); double m = 0.5*rho*L; P(0) += m*accel1(0); P(1) += m*accel1(1); P(2) += m*accel1(2); P(6) += m*accel2(0); P(7) += m*accel2(1); P(8) += m*accel2(2); } else { // use matrix vector multip. for consistent mass matrix static Vector accel(12); for (int i=0; i<6; i++) { accel(i) = accel1(i); accel(i+6) = accel2(i); } P.addMatrixVector(1.0, this->getMass(), accel, 1.0); } // add the damping forces if rayleigh damping if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) P.addVector(1.0, this->getRayleighDampingForces(), 1.0); } else { // add the damping forces if rayleigh damping if (betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) P.addVector(1.0, this->getRayleighDampingForces(), 1.0); } return P; }
const Vector & ElasticBeam2d::getResistingForceIncInertia() { P = this->getResistingForce(); // subtract external load P = P - Q P.addVector(1.0, Q, -1.0); // add the damping forces if rayleigh damping if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) P.addVector(1.0, this->getRayleighDampingForces(), 1.0); if (rho == 0.0) return P; // add inertia forces from element mass const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); if (cMass == 0) { // take advantage of lumped mass matrix double L = theCoordTransf->getInitialLength(); double m = 0.5*rho*L; P(0) += m * accel1(0); P(1) += m * accel1(1); P(3) += m * accel2(0); P(4) += m * accel2(1); } else { // use matrix vector multip. for consistent mass matrix static Vector accel(6); for (int i=0; i<3; i++) { accel(i) = accel1(i); accel(i+3) = accel2(i); } P.addMatrixVector(1.0, this->getMass(), accel, 1.0); } return P; }
const Vector& DispBeamColumn2dWithSensitivity::getResistingForceIncInertia() { P = this->getResistingForce(); // Subtract other external nodal loads ... P_res = P_int - P_ext P.addVector(1.0, Q, -1.0); if (rho != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); // Compute the current resisting force this->getResistingForce(); double L = crdTransf->getInitialLength(); double m = 0.5*rho*L; P(0) += m*accel1(0); P(1) += m*accel1(1); P(3) += m*accel2(0); P(4) += m*accel2(1); // add the damping forces if rayleigh damping if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) P.addVector(1.0, this->getRayleighDampingForces(), 1.0); } else { // add the damping forces if rayleigh damping if (betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) P.addVector(1.0, this->getRayleighDampingForces(), 1.0); } return P; }
const Vector& PFEMElement2DBubble::getResistingForceIncInertia() { // resize P int ndf = this->getNumDOF(); P.resize(ndf); P.Zero(); // get velocity, accleration Vector v(ndf), vdot(ndf); for(int i=0; i<3; i++) { const Vector& accel = nodes[2*i]->getTrialAccel(); vdot(numDOFs(2*i)) = accel(0); vdot(numDOFs(2*i)+1) = accel(1); const Vector& accel2 = nodes[2*i+1]->getTrialAccel(); // pressure vdot(numDOFs(2*i+1)) = accel2(0); const Vector& vel = nodes[2*i]->getTrialVel(); v(numDOFs(2*i)) = vel(0); v(numDOFs(2*i)+1) = vel(1); const Vector& vel2 = nodes[2*i+1]->getTrialVel(); // pressure v(numDOFs(2*i+1)) = vel2(0); } // bubble force Vector fp(3); getFp(fp); // internal force P.addMatrixVector(1.0, getMass(), vdot, 1.0); P.addMatrixVector(1.0, getDamp(), v, 1.0); // external force Vector F(6); getF(F); for(int i=0; i<3; i++) { P(numDOFs(2*i)) -= F(2*i); P(numDOFs(2*i)+1) -= F(2*i+1); P(numDOFs(2*i+1)) -= fp(i); } //opserr<<"F = "<<F; return P; }
int EETruss::update() { int rValue = 0; // get current time Domain *theDomain = this->getDomain(); (*t)(0) = theDomain->getCurrentTime(); // determine dsp, vel and acc in basic system const Vector &disp1 = theNodes[0]->getTrialDisp(); const Vector &disp2 = theNodes[1]->getTrialDisp(); const Vector &vel1 = theNodes[0]->getTrialVel(); const Vector &vel2 = theNodes[1]->getTrialVel(); const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); const Vector &dispIncr1 = theNodes[0]->getIncrDeltaDisp(); const Vector &dispIncr2 = theNodes[1]->getIncrDeltaDisp(); (*db)(0) = (*vb)(0) = (*ab)(0) = 0.0; double dbDelta = 0.0; for (int i=0; i<numDIM; i++) { (*db)(0) += (disp2(i)-disp1(i))*cosX[i]; (*vb)(0) += (vel2(i)-vel1(i))*cosX[i]; (*ab)(0) += (accel2(i)-accel1(i))*cosX[i]; dbDelta += (dispIncr2(i)-dispIncr1(i))*cosX[i]; } // do not check time for right now because of transformation constraint // handler calling update at beginning of new step when applying load // if (fabs(dbDelta) > DBL_EPSILON || (*t)(0) > tLast) { if (fabs(dbDelta) > DBL_EPSILON) { // set the trial response at the site if (theSite != 0) { theSite->setTrialResponse(db, vb, ab, (Vector*)0, t); } else { sData[0] = OF_RemoteTest_setTrialResponse; rValue += theChannel->sendVector(0, 0, *sendData, 0); } } // save the last time tLast = (*t)(0); return rValue; }
const Vector & PDeltaCrdTransf2d::getBasicTrialAccel(void) { // determine global accelerations const Vector &accel1 = nodeIPtr->getTrialAccel(); const Vector &accel2 = nodeJPtr->getTrialAccel(); static double ag[6]; for (int i = 0; i < 3; i++) { ag[i] = accel1(i); ag[i+3] = accel2(i); } static Vector ab(3); double oneOverL = 1.0/L; double sl = sinTheta*oneOverL; double cl = cosTheta*oneOverL; ab(0) = -cosTheta*ag[0] - sinTheta*ag[1] + cosTheta*ag[3] + sinTheta*ag[4]; ab(1) = -sl*ag[0] + cl*ag[1] + ag[2] + sl*ag[3] - cl*ag[4]; if (nodeIOffset != 0) { double t02 = -cosTheta*nodeIOffset[1] + sinTheta*nodeIOffset[0]; double t12 = sinTheta*nodeIOffset[1] + cosTheta*nodeIOffset[0]; ab(0) -= t02*ag[2]; ab(1) += oneOverL*t12*ag[2]; } if (nodeJOffset != 0) { double t35 = -cosTheta*nodeJOffset[1] + sinTheta*nodeJOffset[0]; double t45 = sinTheta*nodeJOffset[1] + cosTheta*nodeJOffset[0]; ab(0) += t35*ag[5]; ab(1) -= oneOverL*t45*ag[5]; } ab(2) = ab(1) + ag[5] - ag[2]; return ab; }
const Vector& PFEMElement2DCompressible::getResistingForceIncInertia() { // resize P int ndf = this->getNumDOF(); P.resize(ndf); P.Zero(); // get velocity, accleration Vector v(ndf), vdot(ndf); for(int i=0; i<3; i++) { const Vector& accel = nodes[2*i]->getTrialAccel(); vdot(numDOFs(2*i)) = accel(0); vdot(numDOFs(2*i)+1) = accel(1); const Vector& accel2 = nodes[2*i+1]->getTrialAccel(); vdot(numDOFs(2*i+1)) = accel2(0); const Vector& vel = nodes[2*i]->getTrialVel(); v(numDOFs(2*i)) = vel(0); v(numDOFs(2*i)+1) = vel(1); const Vector& vel2 = nodes[2*i+1]->getTrialVel(); v(numDOFs(2*i+1)) = vel2(0); } // Ma+k1v-Gp // Gt*v+Mp*p P.addMatrixVector(1.0, getMass(), vdot, 1.0); P.addMatrixVector(1.0, getDamp(), v, 1.0); // f double J2 = J/2.0; for(int i=0; i<3; i++) { P(numDOFs(2*i)) -= rho*bx/3.*J2; P(numDOFs(2*i)+1) -= rho*by/3.*J2; } return P; }
const Vector& YamamotoBiaxialHDR::getResistingForceIncInertia() { theVector = this->getResistingForce(); // add the damping forces if rayleigh damping if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) theVector += this->getRayleighDampingForces(); // now include the mass portion if (mass != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); double m = 0.5*mass; for (int i = 0; i < 3; i++) { theVector(i) += m * accel1(i); theVector(i+3) += m * accel2(i); } } return theVector; }
const Vector& ActuatorCorot::getResistingForceIncInertia() { this->getResistingForce(); // add the damping forces if rayleigh damping if (alphaM != 0.0 || betaK != 0.0 || betaK0 != 0.0 || betaKc != 0.0) (*theVector) += this->getRayleighDampingForces(); // now include the mass portion if (L != 0.0 && rho != 0.0) { const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); int numDOF2 = numDOF/2; double m = 0.5*rho*L; for (int i=0; i<numDIM; i++) { (*theVector)(i) += m * accel1(i); (*theVector)(i+numDOF2) += m * accel2(i); } } return *theVector; }
int EETrussCorot::update() { int rValue = 0; // get current time Domain *theDomain = this->getDomain(); (*t)(0) = theDomain->getCurrentTime(); // determine dsp, vel and acc in basic system const Vector &disp1 = theNodes[0]->getTrialDisp(); const Vector &disp2 = theNodes[1]->getTrialDisp(); const Vector &vel1 = theNodes[0]->getTrialVel(); const Vector &vel2 = theNodes[1]->getTrialVel(); const Vector &accel1 = theNodes[0]->getTrialAccel(); const Vector &accel2 = theNodes[1]->getTrialAccel(); const Vector &dispIncr1 = theNodes[0]->getIncrDeltaDisp(); const Vector &dispIncr2 = theNodes[1]->getIncrDeltaDisp(); // initial offsets double d21Last[3]; d21[0] = L; d21[1] = d21[2] = 0.0; v21[0] = v21[1] = v21[2] = 0.0; a21[0] = a21[1] = a21[2] = 0.0; d21Last[0] = L; d21Last[1] = d21Last[2] = 0.0; // update offsets in basic system for (int i=0; i<numDIM; i++) { double deltaDisp = disp2(i) - disp1(i); d21[0] += deltaDisp*R(0,i); d21[1] += deltaDisp*R(1,i); d21[2] += deltaDisp*R(2,i); double deltaVel = vel2(i) - vel1(i); v21[0] += deltaVel*R(0,i); v21[1] += deltaVel*R(1,i); v21[2] += deltaVel*R(2,i); double deltaAccel = accel2(i) - accel1(i); a21[0] += deltaAccel*R(0,i); a21[1] += deltaAccel*R(1,i); a21[2] += deltaAccel*R(2,i); double deltaDispLast = (disp2(i)-dispIncr2(i)) - (disp1(i)-dispIncr1(i)); d21Last[0] += deltaDispLast*R(0,i); d21Last[1] += deltaDispLast*R(1,i); d21Last[2] += deltaDispLast*R(2,i); } // compute new length and deformation Ln = sqrt(d21[0]*d21[0] + d21[1]*d21[1] + d21[2]*d21[2]); double c1 = d21[0]*v21[0] + d21[1]*v21[1] + d21[2]*v21[2]; double c2 = v21[0]*v21[0] + v21[1]*v21[1] + v21[2]*v21[2] + d21[0]*a21[0] + d21[1]*a21[1] + d21[2]*a21[2]; (*db)(0) = Ln - L; (*vb)(0) = c1/Ln; (*ab)(0) = c2/Ln - (c1*c1)/(Ln*Ln*Ln); double LnLast = sqrt(d21Last[0]*d21Last[0] + d21Last[1]*d21Last[1] + d21Last[2]*d21Last[2]); double dbDelta = (Ln - L) - (LnLast - L); // do not check time for right now because of transformation constraint // handler calling update at beginning of new step when applying load // if (fabs(dbDelta) > DBL_EPSILON || (*t)(0) > tLast) { if (fabs(dbDelta) > DBL_EPSILON) { // set the trial response at the site if (theSite != 0) { theSite->setTrialResponse(db, vb, ab, (Vector*)0, t); } else { sData[0] = OF_RemoteTest_setTrialResponse; rValue += theChannel->sendVector(0, 0, *sendData, 0); } } // save the last time tLast = (*t)(0); return rValue; }
const Vector& FourNodeQuadUP::getResistingForceIncInertia() { int i, j, k; const Vector &accel1 = nd1Ptr->getTrialAccel(); const Vector &accel2 = nd2Ptr->getTrialAccel(); const Vector &accel3 = nd3Ptr->getTrialAccel(); const Vector &accel4 = nd4Ptr->getTrialAccel(); static double a[12]; a[0] = accel1(0); a[1] = accel1(1); a[2] = accel1(2); a[3] = accel2(0); a[4] = accel2(1); a[5] = accel2(2); a[6] = accel3(0); a[7] = accel3(1); a[8] = accel3(2); a[9] = accel4(0); a[10] = accel4(1); a[11] = accel4(2); // Compute the current resisting force this->getResistingForce(); //opserr<<"K "<<P<<endln; // Compute the mass matrix this->getMass(); for (i = 0; i < 12; i++) { for (j = 0; j < 12; j++) P(i) += K(i,j)*a[j]; } //opserr<<"K+M "<<P<<endln; // dynamic seepage force /*for (i = 0, k = 0; i < 4; i++, k += 3) { // loop over integration points for (j = 0; j < 4; j++) { P(i+2) -= rho*dvol[j]*(shp[2][i][j]*a[k]*perm[0]*shp[0][i][j] +shp[2][i][j]*a[k+1]*perm[1]*shp[1][i][j]); } }*/ //opserr<<"K+M+fb "<<P<<endln; const Vector &vel1 = nd1Ptr->getTrialVel(); const Vector &vel2 = nd2Ptr->getTrialVel(); const Vector &vel3 = nd3Ptr->getTrialVel(); const Vector &vel4 = nd4Ptr->getTrialVel(); a[0] = vel1(0); a[1] = vel1(1); a[2] = vel1(2); a[3] = vel2(0); a[4] = vel2(1); a[5] = vel2(2); a[6] = vel3(0); a[7] = vel3(1); a[8] = vel3(2); a[9] = vel4(0); a[10] = vel4(1); a[11] = vel4(2); this->getDamp(); for (i = 0; i < 12; i++) { for (j = 0; j < 12; j++) { P(i) += K(i,j)*a[j]; } } //opserr<<"final "<<P<<endln; return P; }