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& 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; }