int SSPquad::update(void) // this function updates variables for an incremental step n to n+1 { // get trial displacement const Vector &mDisp_1 = theNodes[0]->getTrialDisp(); const Vector &mDisp_2 = theNodes[1]->getTrialDisp(); const Vector &mDisp_3 = theNodes[2]->getTrialDisp(); const Vector &mDisp_4 = theNodes[3]->getTrialDisp(); // assemble displacement vector Vector u(8); u(0) = mDisp_1(0); u(1) = mDisp_1(1); u(2) = mDisp_2(0); u(3) = mDisp_2(1); u(4) = mDisp_3(0); u(5) = mDisp_3(1); u(6) = mDisp_4(0); u(7) = mDisp_4(1); Vector strain(3); strain = Mmem*u; theMaterial->setTrialStrain(strain); return 0; }
const Vector & SSPquad::getResistingForce(void) // this function computes the resisting force vector for the element { // get stress from the material mStress = theMaterial->getStress(); // get trial displacement const Vector &mDisp_1 = theNodes[0]->getTrialDisp(); const Vector &mDisp_2 = theNodes[1]->getTrialDisp(); const Vector &mDisp_3 = theNodes[2]->getTrialDisp(); const Vector &mDisp_4 = theNodes[3]->getTrialDisp(); Vector d(8); d(0) = mDisp_1(0); d(1) = mDisp_1(1); d(2) = mDisp_2(0); d(3) = mDisp_2(1); d(4) = mDisp_3(0); d(5) = mDisp_3(1); d(6) = mDisp_4(0); d(7) = mDisp_4(1); // add stabilization force to internal force vector mInternalForces = Kstab*d; // add internal force from the stress -> fint = Kstab*d + 4*t*Jo*Mmem'*stress mInternalForces.addMatrixTransposeVector(1.0, Mmem, mStress, 4.0*mThickness*J0); // subtract body forces from internal force vector 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; if (applyLoad == 0) { for (int i = 0; i < 4; i++) { mInternalForces(2*i) -= b[0]*mThickness*(J0 + J1*xi[i] + J2*eta[i]); mInternalForces(2*i+1) -= b[1]*mThickness*(J0 + J1*xi[i] + J2*eta[i]); } } else { for (int i = 0; i < 4; i++) { mInternalForces(2*i) -= appliedB[0]*mThickness*(J0 + J1*xi[i] + J2*eta[i]); mInternalForces(2*i+1) -= appliedB[1]*mThickness*(J0 + J1*xi[i] + J2*eta[i]); } } // inertial unbalance load mInternalForces.addVector(1.0, Q, -1.0); return mInternalForces; }
const Vector & SSPquadUP::getResistingForce(void) // this function computes the resisting force vector for the element { Vector f1(8); Vector f2(4); Vector mStress(3); // get stress from the material mStress = theMaterial->getStress(); // get trial displacement const Vector &mDisp_1 = theNodes[0]->getTrialDisp(); const Vector &mDisp_2 = theNodes[1]->getTrialDisp(); const Vector &mDisp_3 = theNodes[2]->getTrialDisp(); const Vector &mDisp_4 = theNodes[3]->getTrialDisp(); Vector d(8); d(0) = mDisp_1(0); d(1) = mDisp_1(1); d(2) = mDisp_2(0); d(3) = mDisp_2(1); d(4) = mDisp_3(0); d(5) = mDisp_3(1); d(6) = mDisp_4(0); d(7) = mDisp_4(1); // add stabilization force to internal force vector f1 = Kstab*d; // add internal force from the stress f1.addMatrixTransposeVector(1.0, Mmem, mStress, 4.0*mThickness*J0); // get mass density from the material double density = theMaterial->getRho(); // subtract body forces from internal force vector 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; if (applyLoad == 0) { for (int i = 0; i < 4; i++) { f1(2*i) -= density*b[0]*mThickness*(J0 + J1*xi[i] + J2*eta[i]); f1(2*i+1) -= density*b[1]*mThickness*(J0 + J1*xi[i] + J2*eta[i]); } } else { for (int i = 0; i < 4; i++) { f1(2*i) -= density*appliedB[0]*mThickness*(J0 + J1*xi[i] + J2*eta[i]); f1(2*i+1) -= density*appliedB[1]*mThickness*(J0 + J1*xi[i] + J2*eta[i]); } } // account for fluid body forces Matrix k(2,2); Vector body(2); // permeability tensor k(0,0) = perm[0]; k(1,1) = perm[1]; // body force vector if (applyLoad == 0) { body(0) = b[0]; body(1) = b[1]; } else { body(0) = appliedB[0]; body(1) = appliedB[1]; } f2 = 4.0*J0*mThickness*fDens*dN*k*body; // assemble full internal force vector for the element mInternalForces(0) = f1(0); mInternalForces(1) = f1(1); mInternalForces(2) = f2(0); mInternalForces(3) = f1(2); mInternalForces(4) = f1(3); mInternalForces(5) = f2(1); mInternalForces(6) = f1(4); mInternalForces(7) = f1(5); mInternalForces(8) = f2(2); mInternalForces(9) = f1(6); mInternalForces(10) = f1(7); mInternalForces(11) = f2(3); // inertial unbalance load mInternalForces.addVector(1.0, Q, -1.0); return mInternalForces; }