Example #1
0
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;
}
Example #2
0
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;
}
Example #3
0
//! @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;
  }
Example #4
0
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;
}
Example #5
0
const Vector &
N4BiaxialTruss::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();	
		const Vector &accel3 = theNodes[2]->getTrialAccel();	
		const Vector &accel4 = theNodes[3]->getTrialAccel();	
		
		int numDOF2 = numDOF/4;
		double M = 0.5*rho*L;
		for (int i = 0; i < dimension; i++) {
			(*theVector)(i) += M*accel1(i);
			(*theVector)(i+numDOF2) += M*accel2(i);
			(*theVector)(i+2*numDOF2) += M*accel3(i);
			(*theVector)(i+3*numDOF2) += M*accel4(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;
}
Example #6
0
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;
}