int 
NineFourNodeQuadUP::addInertiaLoadToUnbalance(const Vector &accel)
{
  // accel = uDotDotG (see EarthquakePattern.cpp)
  // Get R * accel from the nodes

  static Vector ra(22);
  int i, j, ik;

  ra.Zero();

  for (i=0; i<nenu; i++) {
      const Vector &Raccel = theNodes[i]->getRV(accel);
      if ((i<nenp && 3 != Raccel.Size()) || (i>=nenp && 2 != Raccel.Size())) {
         opserr << "NineFourNodeQuadUP::addInertiaLoadToUnbalance matrix and vector sizes are incompatable\n";
         return -1;
	  }

  	  if (i<nenp) ik = i*3;
      if (i>=nenp) ik = nenp*3 + (i-nenp)*2;
      ra[ik] = Raccel(0);
      ra[ik+1] = Raccel(1);
  }

  // Compute mass matrix
  this->getMass();
  
  // Want to add ( - fact * M R * accel ) to unbalance 
  for (i = 0; i < 22; i++) {
    for (j = 0; j < 22; j++)
      Q(i) += -K(i,j)*ra[j];
  }
  
  return 0;
}
Exemple #2
0
int 
ShellMITC9::addInertiaLoadToUnbalance(const Vector &accel)
{
  static Vector r(54);
  int tangFlag = 1 ;

  int i;

  int allRhoZero = 0;
  for (i=0; i<9; i++) {
    if (materialPointers[i]->getRho() != 0.0)
      allRhoZero = 1;
  }

  if (allRhoZero == 0) 
    return 0;

  formInertiaTerms( tangFlag ) ;

  int count = 0;
  for (i=0; i<9; i++) {
    const Vector &Raccel = nodePointers[i]->getRV(accel);
    for (int j=0; j<6; j++)
      r(count++) = Raccel(j);
  }

  if (load == 0) 
    load = new Vector(54);
  load->addMatrixVector(1.0, mass, r, -1.0);

  return 0;
}
Exemple #3
0
int XC::Twenty_Node_Brick::addInertiaLoadToUnbalance(const XC::Vector &accel)
{
        static XC::Vector ra(60);
//        printf("calling addInertiaLoadToUnbalance()\n");
        ra.Zero();

        for(int i = 0;i < nenu;i++)
          {
            const XC::Vector &Raccel = theNodes[i]->getRV(accel);
            if(3 != Raccel.Size())
              {
                std::cerr << "XC::Twenty_Node_Brick::addInertiaLoadToUnbalance matrix and vector sizes are incompatable\n";
                return -1;
              }
            ra[i*3] = Raccel(0);
            ra[i*3+1] = Raccel(1);
            ra[i*3+2] = Raccel(2);
          }

        // Compute mass matrix
        int tangFlag = 1 ;
        formInertiaTerms( tangFlag ) ;

        // create the load vector if one does not exist
        if(load.isEmpty())
          load.reset(60);

        // add -M * RV(accel) to the load vector
        load.addMatrixVector(1.0, mass, ra, -1.0);
        //for( i = 0; i < 60; i++) {
        //        for( j = 0; j < 60; j++)
        //                                load(i) += -mass(i,j)*ra[j];
        //}

        return 0;
}
Exemple #4
0
int GenericClient::addInertiaLoadToUnbalance(const Vector &accel)
{
    if (massFlag == false)
        this->getMass();
    
    int ndim = 0, i;
    Vector Raccel(numDOF);
    
    // assemble Raccel vector
    for (i=0; i<numExternalNodes; i++ )  {
        Raccel.Assemble(theNodes[i]->getRV(accel), ndim);
        ndim += theNodes[i]->getNumberDOF();
    }
    
    // want to add ( - fact * M R * accel ) to unbalance
    theLoad.addMatrixVector(1.0, theMass, Raccel, -1.0);
    
    return 0;
}
Exemple #5
0
int
NineNodeMixedQuad::addInertiaLoadToUnbalance(const Vector &accel)
{
  static const int numberGauss = 9 ;
  static const int numberNodes = 9 ;
  static const int ndf = 2 ; 

  int i;

  // check to see if have mass
  int haveRho = 0;
  for (i = 0; i < numberGauss; i++) {
    if (materialPointers[i]->getRho() != 0.0)
      haveRho = 1;
  }

  if (haveRho == 0)
    return 0;

  // Compute mass matrix
  int tangFlag = 1 ;
  formInertiaTerms( tangFlag ) ;

  // store computed RV fro nodes in resid vector
  int count = 0;

  for (i=0; i<numberNodes; i++) {
    const Vector &Raccel = nodePointers[i]->getRV(accel);
    for (int j=0; j<ndf; j++)
      resid(count++) = Raccel(i);
  }

  // create the load vector if one does not exist
  if (load == 0) 
    load = new Vector(numberNodes*ndf);

  // add -M * RV(accel) to the load vector
  load->addMatrixVector(1.0, mass, resid, -1.0);
  
  return 0;
}
Exemple #6
0
int Adapter::addInertiaLoadToUnbalance(const Vector &accel)
{    
    // check for quick return
    if (mb == 0)
        return 0;
    
    int ndim = 0, i;
    Vector Raccel(numDOF);
    
    // get mass matrix
    Matrix M = this->getMass();
    // assemble Raccel vector
    for (i=0; i<numExternalNodes; i++ )  {
        Raccel.Assemble(theNodes[i]->getRV(accel), ndim);
        ndim += theNodes[i]->getNumberDOF();
    }
    
    // want to add ( - fact * M R * accel ) to unbalance
    theLoad.addMatrixVector(1.0, M, Raccel, -1.0);
    
    return 0;
}
int

TwentyEightNodeBrickUP::addInertiaLoadToUnbalance(const Vector &accel)

{

	static Vector ra(68);

	int i, j, ik;

	ra.Zero();



	for( i = 0; i < nenu; i++) {

		const Vector &Raccel = nodePointers[i]->getRV(accel);

		if ((i<nenp && 4 != Raccel.Size()) || (i>=nenp && 3 != Raccel.Size())) {

			opserr << "TwentyEightNodeBrickUP::addInertiaLoadToUnbalance matrix and vector sizes are incompatable\n";

			return -1;

		}



		if (i<nenp)

			ik = i*4;

		else

			ik = nenp*4 + (i-nenp)*3;



		ra[ik] = Raccel(0);

		ra[ik+1] = Raccel(1);

		ra[ik+2] = Raccel(2);

	}



	// Compute mass matrix

	int tangFlag = 1 ;

	formInertiaTerms( tangFlag ) ;



	// create the load vector if one does not exist

	if (load == 0)

	  load = new Vector(68);



	// add -M * RV(accel) to the load vector

	load->addMatrixVector(1.0, mass, ra, -1.0);

	//for( i = 0; i < 68; i++) {

	//	for( j = 0; j < 68; j++)

	//				load(i) += -mass(i,j)*ra[j];

	//}



	return 0;

}