const Matrix & SSPquad::getMass(void) { mMass.Zero(); // get mass density from the material double density = theMaterial->getRho(); // return zero matrix if density is zero if (density == 0.0) { return mMass; } // local coordinates of nodes double xi[4]; double eta[4]; xi[0] = -1.0; xi[1] = 1.0; xi[2] = 1.0; xi[3] = -1.0; eta[0] = -1.0; eta[1] = -1.0; eta[2] = 1.0; eta[3] = 1.0; double massTerm; for (int i = 0; i < 4; i++) { massTerm = density*mThickness*(J0 + J1*xi[i] + J2*eta[i]); mMass(2*i,2*i) += massTerm; mMass(2*i+1,2*i+1) += massTerm; } return mMass; }
const Matrix & SSPquadUP::getMass(void) { mMass.Zero(); // compute compressibility matrix term double oneOverQ = -0.25*J0*mThickness*mPorosity/fBulk; // get mass density from the material double density = theMaterial->getRho(); // transpose the shape function derivative array Matrix dNp(2,4); dNp(0,0) = dN(0,0); dNp(0,1) = dN(1,0); dNp(0,2) = dN(2,0); dNp(0,3) = dN(3,0); dNp(1,0) = dN(0,1); dNp(1,1) = dN(1,1); dNp(1,2) = dN(2,1); dNp(1,3) = dN(3,1); // compute stabilization matrix for incompressible problems Matrix Kp(4,4); Kp = -4.0*mAlpha*J0*mThickness*dN*dNp; // return zero matrix if density is zero if (density == 0.0) { return mMass; } // full mass matrix for the element [ M 0 ] // includes M and S submatrices [ 0 -S ] for (int i = 0; i < 4; i++) { int I = 2*i; int Ip1 = 2*i+1; int II = 3*i; int IIp1 = 3*i+1; int IIp2 = 3*i+2; for (int j = 0; j < 4; j++) { int J = 2*j; int Jp1 = 2*j+1; int JJ = 3*j; int JJp1 = 3*j+1; int JJp2 = 3*j+2; mMass(II,JJ) = mSolidM(I,J); mMass(IIp1,JJ) = mSolidM(Ip1,J); mMass(IIp1,JJp1) = mSolidM(Ip1,Jp1); mMass(II,JJp1) = mSolidM(I,Jp1); // contribution of compressibility matrix mMass(IIp2,JJp2) = Kp(i,j) + oneOverQ; } } return mMass; }
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; }
int SSPquadUP::addInertiaLoadToUnbalance(const Vector &accel) { // get mass density from the material double density = theMaterial->getRho(); // do nothing if density is zero if (density == 0.0) { return 0; } // Get R * accel from the nodes const Vector &Raccel1 = theNodes[0]->getRV(accel); const Vector &Raccel2 = theNodes[1]->getRV(accel); const Vector &Raccel3 = theNodes[2]->getRV(accel); const Vector &Raccel4 = theNodes[3]->getRV(accel); if (3 != Raccel1.Size() || 3 != Raccel2.Size() || 3 != Raccel3.Size() || 3 != Raccel4.Size()) { opserr << "SSPquadUP::addInertiaLoadToUnbalance matrix and vector sizes are incompatable\n"; return -1; } static double ra[12]; ra[0] = Raccel1(0); ra[1] = Raccel1(1); ra[2] = 0.0; ra[3] = Raccel2(0); ra[4] = Raccel2(1); ra[5] = 0.0; ra[6] = Raccel3(0); ra[7] = Raccel3(1); ra[8] = 0.0; ra[9] = Raccel4(0); ra[10] = Raccel4(1); ra[11] = 0.0; // compute mass matrix this->getMass(); for (int i = 0; i < 8; i++) { Q(i) += -mMass(i,i)*ra[i]; } return 0; }