const Vector & TrussSection::getResistingForceIncInertia() { this->getResistingForce(); // subtract external load (*theVector) -= *theLoad; // now include the mass portion if (L != 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*L; for (int i = 0; i < dimension; i++) { (*theVector)(i) += m*accel1(i); (*theVector)(i+numDOF2) += m*accel2(i); } } else { // consistent mass matrix double m = rho*L/6.0; for (int i=0; i<dimension; 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& DispBeamColumn2d::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(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); } // 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; }
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& 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; }