Exemplo n.º 1
0
int 
N4BiaxialTruss::getResponse(int responseID, Information &eleInfo)
{
	double strain;

	switch (responseID) {
	case 1:
		return eleInfo.setVector(this->getResistingForce());

	default:
		return 0;
	}
}
Exemplo n.º 2
0
int 
WheelRail::getResponse(int responseID, Information &eleInfo)
{
	switch (responseID) {
  case 1: // stiffness
    return eleInfo.setMatrix(this->getTangentStiff());
    
  case 2: // activeData
 /*/ 记录激活量
      激活自由度(5个) 激活单元号(1个) commited位置(1个)//*/
	for(int i=0;i<5;i++)
		activeData(i)=activeDof(i);
	activeData(5)=this->activeBeamIndex;
	activeData(6)=currentLocation;
    return eleInfo.setVector(activeData);
    
  case 3:
	/*/ 记录有效单元节点力
    P(5个)//*/
	for(int i=0;i<5;i++)
		localActiveForce(i)=(*P)(activeDof(i));
	return eleInfo.setVector(localActiveForce);
    
  case 4:
	  /*/ 记录接触量
      嵌入量(1个)uF(1个) Fhz(1个) theDeltaY(1个) uUnderWheel(3个)//*/
	contactData(0)=this->deltaU;
	contactData(1)=this->uF;
	contactData(2)=this->Fhz;
	contactData(3)=this->theDeltaY;
	for(int i=0;i<3;i++)
		contactData(i+4)= railDisp(i);
    return eleInfo.setVector(contactData);

  default:
    return -1;
  }
}
Exemplo n.º 3
0
int XC::Twenty_Node_Brick::getResponse(int responseID, Information &eleInfo)
  {
        static Vector stresses(162);

        if(responseID == 1)
                return eleInfo.setVector(this->getResistingForce());

        else if(responseID == 2)
                return eleInfo.setMatrix(this->getTangentStiff());

    else if(responseID == 3)
        return eleInfo.setMatrix(this->getMass());

    else if(responseID == 4)
        return eleInfo.setMatrix(this->getDamp());

        else if(responseID == 5) {

                // Loop over the integration points
                int cnt = 0;
                for(int i = 0; i < nintu; i++) {

                        // Get material stress response
                        const XC::Vector &sigma = physicalProperties[i]->getStress();
                        stresses(cnt++) = sigma(0);
                        stresses(cnt++) = sigma(1);
                        stresses(cnt++) = sigma(2);
                        stresses(cnt++) = sigma(3);
                        stresses(cnt++) = sigma(4);
                        stresses(cnt++) = sigma(5);
                }
                return eleInfo.setVector(stresses);

        }
        else

                return -1;
}
Exemplo n.º 4
0
int XC::FourNodeQuad::getResponse(int responseID, Information &eleInfo)
  {
    if(responseID == 1)
      { return eleInfo.setVector(this->getResistingForce()); }
    else if(responseID == 2)
      { return eleInfo.setMatrix(this->getTangentStiff()); }
    else if(responseID == 3)
      {
        // Loop over the integration points
        int cnt = 0;
        for(size_t i= 0;i<physicalProperties.size(); i++)
          {
            // Get material stress response
            const XC::Vector &sigma = physicalProperties[i]->getStress();
            P(cnt) = sigma(0);
            P(cnt+1) = sigma(1);
            cnt += 2;
          }
        return eleInfo.setVector(P);
      }
    else
      return -1;
  }
int 
AC3D8HexWithSensitivity::getResponse (int responseID, Information &eleInfo)
{
  switch(responseID) {
    case 1:
      return eleInfo.setVector(this->getResistingForce());
      
    case 2:
      return eleInfo.setMatrix(this->getTangentStiff());
    
    default: 
      return -1;
  }
}
Exemplo n.º 6
0
int 
Tri31::getResponse(int responseID, Information &eleInfo)                                         
{

	if (responseID == 1) {
		return eleInfo.setVector(this->getResistingForce());
    } else if (responseID == 3) {
		// Loop over the integration points
        static Vector stresses(3*numgp);
        int cnt = 0;
        for (int i = 0; i < numgp; i++) {
			// Get material stress response
            const Vector &sigma = theMaterial[i]->getStress();
            stresses(cnt) = sigma(0);
            stresses(cnt+1) = sigma(1);
            stresses(cnt+2) = sigma(2);
            cnt += 3;
       }
       return eleInfo.setVector(stresses);
  } else

    return -1;
}
Exemplo n.º 7
0
int
ElasticBeam2d::getResponse (int responseID, Information &eleInfo)
{
  double N, M1, M2, V;
  double L = theCoordTransf->getInitialLength();
  this->getResistingForce();

  switch (responseID) {
  case 1: // stiffness
    return eleInfo.setMatrix(this->getTangentStiff());
    
  case 2: // global forces
    return eleInfo.setVector(this->getResistingForce());
    
  case 3: // local forces
    // Axial
    N = q(0);
    P(3) =  N;
    P(0) = -N+p0[0];
    // Moment
    M1 = q(1);
    M2 = q(2);
    P(2) = M1;
    P(5) = M2;
    // Shear
    V = (M1+M2)/L;
    P(1) =  V+p0[1];
    P(4) = -V+p0[2];
    return eleInfo.setVector(P);
    
  case 4: // basic forces
    return eleInfo.setVector(q);

  default:
    return -1;
  }
}
Exemplo n.º 8
0
int XC::DispBeamColumn2d::getResponse(int responseID, Information &eleInfo)
{
  double V;
  double L = theCoordTransf->getInitialLength();

  if(responseID == 1)
    return eleInfo.setVector(this->getResistingForce());

  else if(responseID == 2) {
      P(3) =  q(0);
      P(0) = -q(0)+p0[0];
      P(2) = q(1);
      P(5) = q(2);
      V = (q(1)+q(2))/L;
      P(1) =  V+p0[1];
      P(4) = -V+p0[2];
      return eleInfo.setVector(P);
  }

  // Chord rotation
  else if(responseID == 3)
    return eleInfo.setVector(theCoordTransf->getBasicTrialDisp());

  // Plastic rotation
  else if(responseID == 4) {
    static XC::Vector vp(3);
    static XC::Vector ve(3);
    const XC::Matrix &kb = this->getInitialBasicStiff();
    kb.Solve(q, ve);
    vp = theCoordTransf->getBasicTrialDisp();
    vp -= ve;
    return eleInfo.setVector(vp);
  }

  else
    return -1;
}
Exemplo n.º 9
0
int ECGenericTCP::getResponse(int responseID, Information &info)
{
    switch (responseID)  {
    case 1:  // ctrl displacements
        return info.setVector(*ctrlDisp);
        
    case 2:  // ctrl velocities
        return info.setVector(*ctrlVel);
        
    case 3:  // ctrl accelerations
        return info.setVector(*ctrlAccel);
        
    case 4:  // ctrl forces
        return info.setVector(*ctrlForce);
        
    case 5:  // ctrl times
        return info.setVector(*ctrlTime);
        
    case 6:  // daq displacements
        return info.setVector(*daqDisp);
        
    case 7:  // daq velocities
        return info.setVector(*daqVel);
        
    case 8:  // daq accelerations
        return info.setVector(*daqAccel);
        
    case 9:  // daq forces
        return info.setVector(*daqForce);
        
    case 10:  // daq times
        return info.setVector(*daqTime);
        
    default:
        return -1;
    }
}
Exemplo n.º 10
0
int
FourNodeQuadUP::getResponse(int responseID, Information &eleInfo)
{
    switch (responseID) {

    case 1:
        return eleInfo.setVector(this->getResistingForce());

    case 2:
        return eleInfo.setMatrix(this->getTangentStiff());

    default:
        return -1;
    }
}
Exemplo n.º 11
0
int 
SectionForceDeformation2d::getResponseSensitivity(int responseID, int gradIndex,
						Information &secInfo)
{
  Vector &theVec = *(secInfo.theVector);

  switch (responseID) {
  case 1:
    theVec = this->getSectionDeformationSensitivity(gradIndex);
    return secInfo.setVector(theVec);
    
  case 2: {
    const Matrix &ks = this->getSectionTangent();
    const Vector &dedh = this->getSectionDeformationSensitivity(gradIndex);
    const Vector &dsdh = this->getStressResultantSensitivity(gradIndex, true);
    theVec.addMatrixVector(0.0, ks, dedh, 1.0);
    theVec.addVector(1.0, dsdh, 1.0);
    return secInfo.setVector(theVec);
  }

  default:
    return -1;
  }
}
Exemplo n.º 12
0
int
ParallelMaterial::getResponse(int responseID, Information &info)
{
  Vector stresses(numMaterials);
  int i;

  switch (responseID) {
  case 100:
    for (i = 0; i < numMaterials; i++)
      stresses(i) = theModels[i]->getStress();
    return info.setVector(stresses);

  default:
    return this->UniaxialMaterial::getResponse(responseID, info);
  }
}
Exemplo n.º 13
0
int EETrussCorot::getResponse(int responseID, Information &eleInfo)
{
    switch (responseID)  {
    case 1:  // global forces
        return eleInfo.setVector(this->getResistingForce());
        
    case 2:  // local forces
        theVector->Zero();
        // Axial
        (*theVector)(0)        = -(*qDaq)(0);
        (*theVector)(numDOF/2) =  (*qDaq)(0);
        
        return eleInfo.setVector(*theVector);
        
    case 3:  // basic force
        return eleInfo.setVector(*qDaq);
        
    case 4:  // ctrl basic displacement
        return eleInfo.setVector(dbCtrl);
        
    case 5:  // ctrl basic velocity
        return eleInfo.setVector(vbCtrl);
        
    case 6:  // ctrl basic acceleration
        return eleInfo.setVector(abCtrl);
        
    case 7:  // daq basic displacement
        return eleInfo.setVector(this->getBasicDisp());
        
    case 8:  // daq basic velocitie
        return eleInfo.setVector(this->getBasicVel());
        
    case 9:  // daq basic acceleration
        return eleInfo.setVector(this->getBasicAccel());
        
    default:
        return 0;
    }
}
Exemplo n.º 14
0
int
PileToe3D::getResponse(int responseID, Information &eleInfo)
{
  Vector mReactions(6);
  if (responseID == 1) {

     // full reactions on master nodes
     for (int ii=0; ii<6; ii++) {
          mReactions(ii)   = -mInternalForces(ii);
     }
     return eleInfo.setVector(mReactions);

  } else

    opserr << "PileToe3D::getResponse(int responseID=" << responseID << ", Information &eleInfo): " << " unknown request" << endln;
    return -1;
}
Exemplo n.º 15
0
int
ZeroLengthContact2D::getResponse(int responseID, Information &eleInfo)
{
 if (responseID == 1)
	 return eleInfo.setVector(this->getResistingForce());
 else if (responseID == 2)
	 return eleInfo.setMatrix(this->getTangentStiff());
 else if (responseID == 3)
 {//opserr<<"Contact2D getResponse p="<<this->pressure<<endln;
 return eleInfo.setDouble(this->pressure);
 }
 else if (responseID == 4)
  return eleInfo.setDouble(this->gap);

 else
	 return -1;
}
Exemplo n.º 16
0
int 
CoupledZeroLength::getResponse(int responseID, Information &eleInformation)
{
    const Vector& disp1 = theNodes[0]->getTrialDisp();
    const Vector& disp2 = theNodes[1]->getTrialDisp();
    const Vector  diff  = disp2-disp1;

    switch (responseID) {
    case -1:
        return -1;

    case 1:
        return eleInformation.setVector(this->getResistingForce());

    default:
        return -1;
    }
}
Exemplo n.º 17
0
int
Quad4FiberOverlay::getResponse(int responseID, Information &eleInfo)
{
 double strain;
 
  switch (responseID) {
  case -1:
    return -1;
  case 1: // global forces                                                                                               
    return eleInfo.setVector(this->getResistingForce());
  case 2:
	strain = this->computeCurrentStrain();
	theMaterial->setTrialStrain(strain);
    return eleInfo.setDouble(Af*theMaterial->getStress());
  default:
    return 0;
  }
}
Exemplo n.º 18
0
int 
CorotTrussSection::getResponse(int responseID, Information &eleInfo)
{
    double strain, force;

    switch (responseID) {
    case 1:
        return eleInfo.setVector(this->getResistingForce());

    case 2:
        if (Lo == 0.0) {
            strain = 0.0;
            force = 0.0;
        } else {

            int order = theSection->getOrder();
            const ID &code = theSection->getType();

            const Vector &s = theSection->getStressResultant();
            force = 0.0;
            int i;
            for (i = 0; i < order; i++) {
                if (code(i) == SECTION_RESPONSE_P)
                    force += s(i);
            }

        }      
        return eleInfo.setDouble(force);    

    case 3:
        if (Lo == 0.0) {
            strain = 0.0;
        } else {
            strain = this->computeCurrentStrain();
        }
        return eleInfo.setDouble(Lo * strain);

    default:
        return -1;
    }
}
Exemplo n.º 19
0
int 
TPB1D::getResponse(int responseID, Information &eleInformation)
{
    const Vector& disp1 = theNodes[0]->getTrialDisp();
    const Vector& disp2 = theNodes[1]->getTrialDisp();
    const Vector  diff  = disp2-disp1;

    switch (responseID) {
    case -1:
        return -1;

    case 1:
        return eleInformation.setVector(this->getResistingForce());

    case 2:
        if (eleInformation.theVector != 0) {
	  (*(eleInformation.theVector))(0) = theMaterial->getStress();
        }
        return 0;

    case 3:
        if (eleInformation.theVector != 0) {
	  (*(eleInformation.theVector))(0) = theMaterial->getStrain();
        }
        return 0;

    case 4:
        if (eleInformation.theVector != 0) {
	  (*(eleInformation.theVector))(0) = theMaterial->getStrain();
	  (*(eleInformation.theVector))(1) = theMaterial->getStress();
	}
	return 0;      
    
    default:
      return -1;
    }
}
Exemplo n.º 20
0
int 
CorotTruss::getResponse(int responseID, Information &eleInfo)
{
    double strain;

    switch (responseID) {
    case 1:
        return eleInfo.setVector(this->getResistingForce());

    case 2:
        return eleInfo.setDouble(A * theMaterial->getStress());

    case 3:
        if (Lo == 0.0) {
            strain = 0.0;
        } else {
            strain = theMaterial->getStrain();
        }
        return eleInfo.setDouble(Lo * strain);

    default:
        return 0;
    }
}
Exemplo n.º 21
0
int TwoNodeLink::getResponse(int responseID, Information &eleInfo)
{
    Vector defoAndForce(numDir*2);
    
    switch (responseID)  {
    case 1:  // global forces
        return eleInfo.setVector(this->getResistingForce());
        
    case 2:  // local forces
        theVector->Zero();
        // determine resisting forces in local system
        theVector->addMatrixTransposeVector(0.0, Tlb, qb, 1.0);
        // add P-Delta effects to local forces
        if (Mratio.Size() == 4)
            this->addPDeltaForces(*theVector);
        
        return eleInfo.setVector(*theVector);
        
    case 3:  // basic forces
        return eleInfo.setVector(qb);
        
    case 4:  // local displacements
        return eleInfo.setVector(ul);
        
    case 5:  // basic displacements
        return eleInfo.setVector(ub);
        
    case 6:  // basic deformations and basic forces
        defoAndForce.Zero();
        defoAndForce.Assemble(ub,0);
        defoAndForce.Assemble(qb,numDir);
        
        return eleInfo.setVector(defoAndForce);
        
    default:
        return 0;
    }
}
Exemplo n.º 22
0
int LeadRubberX::getResponse(int responseID, Information &eleInfo)
{
	double kGeo1, MpDelta1, MpDelta2, MpDelta3, MpDelta4, MpDelta5, MpDelta6;
   Vector dzduVec(4), kbVec(4), Param(6);

    switch (responseID)  {
        case 1:  // global forces
        return eleInfo.setVector(this->getResistingForce());
       
        case 2:  // local forces
        theVector.Zero();
        // determine resisting forces in local system
        theVector.addMatrixTransposeVector(0.0, Tlb, qb, 1.0);
        // add P-Delta moments
        kGeo1 = 0.5*qb(0);
        MpDelta1 = kGeo1*(ul(7)-ul(1));
        theVector(5)  += MpDelta1;
        theVector(11) += MpDelta1;
        MpDelta2 = kGeo1*shearDistI*L*ul(5);
        theVector(5)  += MpDelta2;
        theVector(11) -= MpDelta2;
        MpDelta3 = kGeo1*(1.0 - shearDistI)*L*ul(11);
        theVector(5)  -= MpDelta3;
        theVector(11) += MpDelta3;
        MpDelta4 = kGeo1*(ul(8)-ul(2));
        theVector(4)  -= MpDelta4;
        theVector(10) -= MpDelta4;
        MpDelta5 = kGeo1*shearDistI*L*ul(4);
        theVector(4)  += MpDelta5;
        theVector(10) -= MpDelta5;
        MpDelta6 = kGeo1*(1.0 - shearDistI)*L*ul(10);
        theVector(4)  -= MpDelta6;
        theVector(10) += MpDelta6;
        return eleInfo.setVector(theVector);
       
        case 3:  // basic forces
        return eleInfo.setVector(qb);
       
        case 4:  // local displacements
        return eleInfo.setVector(ul);
       
        case 5:  // basic displacements
        return eleInfo.setVector(ub);

		case 6:  // hysteretic evolution parameter
        return eleInfo.setVector(z);
        
		case 7:  // dzdu
        dzduVec(0) = dzdu(0,0); dzduVec(1) = dzdu(0,1);
        dzduVec(2) = dzdu(1,0); dzduVec(3) = dzdu(1,1);
        return eleInfo.setVector(dzduVec);
        
		case 8:  // basic stiffness
        kbVec(0) = kb(1,1); kbVec(1) = kb(1,2);
        kbVec(2) = kb(2,1); kbVec(3) = kb(2,2);
        return eleInfo.setVector(kbVec);

		case 9:  // parameters that varies with time
        Param(0) = Fcn;
		Param(1) = Fcrn; 
		Param(2) = Kv;
        Param(3) = ke; 
		Param(4) = TL_commit;
		Param(5) = qYield;
        return eleInfo.setVector(Param);
       
    default:
                return -1;
        }
}
Exemplo n.º 23
0
int 
DispBeamColumn2d::getResponseSensitivity(int responseID, int gradNumber,
					 Information &eleInfo)
{
  // Basic deformation sensitivity
  if (responseID == 3) {  
    const Vector &dvdh = crdTransf->getBasicDisplSensitivity(gradNumber);
    return eleInfo.setVector(dvdh);
  }

  // Basic force sensitivity
  else if (responseID == 9) {
    static Vector dqdh(3);

    dqdh.Zero();

    return eleInfo.setVector(dqdh);
  }

  // dsdh
  else if (responseID == 76) {

    int sectionNum = eleInfo.theInt;
    int order = theSections[sectionNum-1]->getOrder();
    const ID &code = theSections[sectionNum-1]->getType();

    Vector dsdh(order);
    dsdh = theSections[sectionNum-1]->getStressResultantSensitivity(gradNumber, true);

    const Vector &v = crdTransf->getBasicTrialDisp();
    const Vector &dvdh = crdTransf->getBasicDisplSensitivity(gradNumber);

    double L = crdTransf->getInitialLength();
    double oneOverL = 1.0/L;

    const Matrix &ks = theSections[sectionNum-1]->getSectionTangent();

    Vector dedh(order);

    //const Matrix &pts = quadRule.getIntegrPointCoords(numSections);
    double xi[maxNumSections];
    beamInt->getSectionLocations(numSections, L, xi);

    double x = xi[sectionNum-1];

    //double xi6 = 6.0*pts(i,0);
    double xi6 = 6.0*x;

    int j;
    for (j = 0; j < order; j++) {
      switch(code(j)) {
      case SECTION_RESPONSE_P:
	dedh(j) = oneOverL*dvdh(0); break;
      case SECTION_RESPONSE_MZ:
	dedh(j) = oneOverL*((xi6-4.0)*dvdh(1) + (xi6-2.0)*dvdh(2)); break;
      default:
	dedh(j) = 0.0; break;
      }
    }

    dsdh.addMatrixVector(1.0, ks, dedh, 1.0);

    return eleInfo.setVector(dsdh);
  }

  else
    return -1;
}
Exemplo n.º 24
0
int 
DispBeamColumn2d::getResponse(int responseID, Information &eleInfo)
{
  double V;
  double L = crdTransf->getInitialLength();

  if (responseID == 1)
    return eleInfo.setVector(this->getResistingForce());

  else if (responseID == 12) {
    P.Zero();
    P.addVector(1.0, this->getRayleighDampingForces(), 1.0);
    return eleInfo.setVector(P);

  } else if (responseID == 2) {
      P(3) =  q(0);
      P(0) = -q(0)+p0[0];
      P(2) = q(1);
      P(5) = q(2);
      V = (q(1)+q(2))/L;
      P(1) =  V+p0[1];
      P(4) = -V+p0[2];
      return eleInfo.setVector(P);
  }

  else if (responseID == 9) {
    return eleInfo.setVector(q);
  }

  else if (responseID == 19) {
    static Matrix kb(3,3);
    this->getBasicStiff(kb);
    return eleInfo.setMatrix(kb);
  }

  // Chord rotation
  else if (responseID == 3) {
    return eleInfo.setVector(crdTransf->getBasicTrialDisp());
  }

  // Plastic rotation
  else if (responseID == 4) {
    static Vector vp(3);
    static Vector ve(3);
    const Matrix &kb = this->getInitialBasicStiff();
    kb.Solve(q, ve);
    vp = crdTransf->getBasicTrialDisp();
    vp -= ve;
    return eleInfo.setVector(vp);
  }

  // Curvature sensitivity
  else if (responseID == 5) {
    /*
      Vector curv(numSections);
      const Vector &v = crdTransf->getBasicDispGradient(1);
      
      double L = crdTransf->getInitialLength();
      double oneOverL = 1.0/L;
      //const Matrix &pts = quadRule.getIntegrPointCoords(numSections);
      double pts[2];
      pts[0] = 0.0;
      pts[1] = 1.0;
      
      // Loop over the integration points
      for (int i = 0; i < numSections; i++) {
	int order = theSections[i]->getOrder();
	const ID &code = theSections[i]->getType();
	//double xi6 = 6.0*pts(i,0);
	double xi6 = 6.0*pts[i];
	curv(i) = oneOverL*((xi6-4.0)*v(1) + (xi6-2.0)*v(2));
      }
      
      return eleInfo.setVector(curv);
    */

    Vector curv(numSections);

    /*
    // Loop over the integration points
    for (int i = 0; i < numSections; i++) {
      int order = theSections[i]->getOrder();
      const ID &code = theSections[i]->getType();
      const Vector &dedh = theSections[i]->getdedh();
      for (int j = 0; j < order; j++) {
	if (code(j) == SECTION_RESPONSE_MZ)
	  curv(i) = dedh(j);
      }
    }
    */

    return eleInfo.setVector(curv);
  }

  // Basic deformation sensitivity
  else if (responseID == 6) {  
    const Vector &dvdh = crdTransf->getBasicDisplSensitivity(1);
    return eleInfo.setVector(dvdh);
  }

  else if (responseID == 7) {
    //const Matrix &pts = quadRule.getIntegrPointCoords(numSections);
    double xi[maxNumSections];
    beamInt->getSectionLocations(numSections, L, xi);
    Vector locs(numSections);
    for (int i = 0; i < numSections; i++)
      locs(i) = xi[i]*L;
    return eleInfo.setVector(locs);
  }

  else if (responseID == 8) {
    //const Vector &wts = quadRule.getIntegrPointWeights(numSections);
    double wt[maxNumSections];
    beamInt->getSectionWeights(numSections, L, wt);
    Vector weights(numSections);
    for (int i = 0; i < numSections; i++)
      weights(i) = wt[i]*L;
    return eleInfo.setVector(weights);
  }

  else
    return Element::getResponse(responseID, eleInfo);
}
Exemplo n.º 25
0
int 
ElasticForceBeamColumn2d::getResponse(int responseID, Information &eleInfo)
{
  static Vector Se(NEBD);
  static Vector vp(NEBD);
  static Matrix fe(NEBD,NEBD);

  if (responseID == 1)
    return eleInfo.setVector(this->getResistingForce());
  
  else if (responseID == 2) {
    double p0[3]; p0[0] = 0.0; p0[1] = 0.0; p0[2] = 0.0;
    if (numEleLoads > 0)
      this->computeReactions(p0);
    this->computeBasicForces(Se);
    theVector(3) =  Se(0);
    theVector(0) = -Se(0)+p0[0];
    theVector(2) = Se(1);
    theVector(5) = Se(2);
    double V = (Se(1)+Se(2))/crdTransf->getInitialLength();
    theVector(1) =  V+p0[1];
    theVector(4) = -V+p0[2];
    return eleInfo.setVector(theVector);
  }

  // Chord rotation
  else if (responseID == 7) {
    this->computeBasicForces(Se);
    return eleInfo.setVector(Se);
  }
      
  // Chord rotation
  else if (responseID == 3) {
    vp = crdTransf->getBasicTrialDisp();
    return eleInfo.setVector(vp);
  }

  // Plastic rotation
  else if (responseID == 4) {
    this->computeBasicForces(Se);
    this->getInitialFlexibility(fe);
    vp = crdTransf->getBasicTrialDisp();
    vp.addMatrixVector(1.0, fe, Se, -1.0);
    return eleInfo.setVector(vp);
  }

  // Point of inflection
  else if (responseID == 5) {
    double LI = 0.0;
    this->computeBasicForces(Se);
    if (fabs(Se(1)+Se(2)) > DBL_EPSILON) {
      double L = crdTransf->getInitialLength();
      
      LI = Se(1)/(Se(1)+Se(2))*L;
    }

    return eleInfo.setDouble(LI);
  }

  else if (responseID == 7) {
    this->computeBasicForces(Se);
    return eleInfo.setVector(Se);
  }
  else if (responseID == 10) {
    double L = crdTransf->getInitialLength();
    double pts[maxNumSections];
    beamIntegr->getSectionLocations(numSections, L, pts);
    Vector locs(numSections);
    for (int i = 0; i < numSections; i++)
      locs(i) = pts[i]*L;
    return eleInfo.setVector(locs);
  }

  else if (responseID == 11) {
    double L = crdTransf->getInitialLength();
    double wts[maxNumSections];
    beamIntegr->getSectionWeights(numSections, L, wts);
    Vector weights(numSections);
    for (int i = 0; i < numSections; i++)
      weights(i) = wts[i]*L;
    return eleInfo.setVector(weights);
  }

  else
    return -1;
}
Exemplo n.º 26
0
int 
DispBeamColumn3d::getResponse(int responseID, Information &eleInfo)
{
  double N, V, M1, M2, T;
  double L = crdTransf->getInitialLength();
  double oneOverL = 1.0/L;

  if (responseID == 1)
    return eleInfo.setVector(this->getResistingForce());

  else if (responseID == 12)
    return eleInfo.setVector(this->getRayleighDampingForces());
    
  else if (responseID == 2) {
    // Axial
    N = q(0);
    P(6) =  N;
    P(0) = -N+p0[0];
    
    // Torsion
    T = q(5);
    P(9) =  T;
    P(3) = -T;
    
    // Moments about z and shears along y
    M1 = q(1);
    M2 = q(2);
    P(5)  = M1;
    P(11) = M2;
    V = (M1+M2)*oneOverL;
    P(1) =  V+p0[1];
    P(7) = -V+p0[2];
    
    // Moments about y and shears along z
    M1 = q(3);
    M2 = q(4);
    P(4)  = M1;
    P(10) = M2;
    V = (M1+M2)*oneOverL;
    P(2) = -V+p0[3];
    P(8) =  V+p0[4];

    return eleInfo.setVector(P);
  }

  // Chord rotation
  else if (responseID == 3)
    return eleInfo.setVector(crdTransf->getBasicTrialDisp());

  // Plastic rotation
  else if (responseID == 4) {
    static Vector vp(6);
    static Vector ve(6);
    const Matrix &kb = this->getInitialBasicStiff();
    kb.Solve(q, ve);
    vp = crdTransf->getBasicTrialDisp();
    vp -= ve;
    return eleInfo.setVector(vp);
  }

  else
    return -1;
}
Exemplo n.º 27
0
int 
UniaxialMaterial::getResponse(int responseID, Information &matInfo)
{
  static Vector stressStrain(2);
  static Vector stressStrainTangent(3);

  static Vector tempData(2);  //L.jiang [SIF]
  static Information infoData(tempData);  //L.jiang [SIF]

  // each subclass must implement its own stuff   

  // added for sensitivity recorder. Quan 2009
  if ((responseID>10000)&&(responseID<20000)){
      matInfo.setDouble(this->getStressSensitivity(responseID-10000,false));
      return 0;
  }
  else if (responseID>20000){
      matInfo.setDouble(this->getStrainSensitivity(responseID-20000));
      return 0;
  }

  double kInit;
  double stress;
  double strain;

  switch (responseID) {
    case 1:
      matInfo.setDouble(this->getStress());
      return 0;
      
    case 2:
      matInfo.setDouble(this->getTangent());
      return 0;      

    case 3:
      matInfo.setDouble(this->getStrain());
      return 0;      

  case 6: // an approx to plastic strain
      strain = this->getStrain();
      stress = this->getStress();
      kInit = this->getTangent();
      strain = strain-stress/kInit;
      matInfo.setDouble(strain);
      return 0;      
    
    case 4:
      stressStrain(0) = this->getStress();
      stressStrain(1) = this->getStrain();
      matInfo.setVector(stressStrain);
      return 0;
      
	  case 5:
      stressStrainTangent(0) = this->getStress();
      stressStrainTangent(1) = this->getStrain();
      stressStrainTangent(2) = this->getTangent();
      matInfo.setVector(stressStrainTangent);
      return 0;
	 
	  //Added by Liming, UoE, for temperature and elongation output,[SIF]2017
	  case 7:
		  if ((this->getVariable("TempAndElong", infoData)) != 0) {
			  opserr << "Warning: invalid tag in uniaxialMaterial:getVariable" << endln;
			  return -1;
		  }
		  tempData = infoData.getData();
		  matInfo.setVector(tempData);
		  return 0;
  default:      
    return -1;
  }
}
Exemplo n.º 28
0
int 
TrussSection::getResponse(int responseID, Information &eleInfo)
{
    double strain, force;
    static Vector sVec(1);
    static Vector fVec(1);
    static Matrix kVec(1,1);

    switch (responseID) {
  case 1:
      return eleInfo.setVector(this->getResistingForce());

  case 2:
      if (L == 0.0) {
          strain = 0.0;
          force = 0.0;
      } else {

          int order = theSection->getOrder();
          const ID &code = theSection->getType();

          const Vector &s = theSection->getStressResultant();
          force = 0.0;
          int i;
          for (i = 0; i < order; i++) {
              if (code(i) == SECTION_RESPONSE_P)
                  force += s(i);
          }

      }      
      fVec(0) = force;
      return eleInfo.setVector(fVec);    

  case 3:
      if (L == 0.0) {
          strain = 0.0;
      } else {
          strain = this->computeCurrentStrain();
      }
      sVec(0) = L*strain;
      return eleInfo.setVector(sVec);

    case 4:
      if (L == 0.0) {
          force = 0.0;
      } else {

          int order = theSection->getOrder();
          const ID &code = theSection->getType();

          const Matrix &ks = theSection->getSectionTangent();
          force = 0.0;
          int i;
          for (i = 0; i < order; i++) {
	    if (code(i) == SECTION_RESPONSE_P)
	      force += ks(i,i);
          }

      }      
      kVec(0,0) = force/L;
      return eleInfo.setMatrix(kVec);

  default:
      return -1;
    }
}
Exemplo n.º 29
0
int TotalLagrangianFD8NodeBrick::getResponse (int responseID, Information &eleInfo)

{    

	 int i;

     static Vector P0(NumTotalGaussPts*6);

     

     switch (responseID) {

     

     case 1:

          return eleInfo.setVector(this->getResistingForce() );



     case 3: { 

        Vector P0(NumTotalGaussPts*6);

        tensor sigma; 

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

          sigma = theMaterial[i]->getCauchyStressTensor();

          P0(i*6 +0 ) = sigma.val(1,1);

          P0(i*6 +1 ) = sigma.val(2,2);

          P0(i*6 +2 ) = sigma.val(3,3);

          P0(i*6 +3 ) = sigma.val(2,3);

          P0(i*6 +4 ) = sigma.val(3,1);

          P0(i*6 +5 ) = sigma.val(1,2);

        }

        return eleInfo.setVector(P0);

     }



     case 4: { 

        Vector P0(NumTotalGaussPts*6);

        tensor sigma; 

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

          sigma = theMaterial[i]->getStressTensor();

          P0(i*6 +0 ) = sigma.val(1,1);

          P0(i*6 +1 ) = sigma.val(2,2);

          P0(i*6 +2 ) = sigma.val(3,3);

          P0(i*6 +3 ) = sigma.val(2,3);

          P0(i*6 +4 ) = sigma.val(3,1);

          P0(i*6 +5 ) = sigma.val(1,2);

        }

        return eleInfo.setVector(P0);

     }



     case 5: { 

        Vector P0(NumTotalGaussPts*6);

        tensor e;

	tensor E;

	tensor F;

	tensor tI2("I", 2, def_dim_2); 

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

          E = theMaterial[i]->getStrainTensor();

	  F = theMaterial[i]->getF();

	  F = F.inverse();

	  e = F("ki")*F("kj"); e.null_indices();

	  e = (tI2-e) *0.5;

          P0(i*6 +0 ) = e.val(1,1);

          P0(i*6 +1 ) = e.val(2,2);

          P0(i*6 +2 ) = e.val(3,3);

          P0(i*6 +3 ) = e.val(2,3);

          P0(i*6 +4 ) = e.val(3,1);

          P0(i*6 +5 ) = e.val(1,2);

        }

        return eleInfo.setVector(P0);

     }



     case 6: { 

        Vector P0(NumTotalGaussPts*6);

        tensor E; 

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

          E = theMaterial[i]->getStrainTensor();

          P0(i*6 +0 ) = E.val(1,1);

          P0(i*6 +1 ) = E.val(2,2);

          P0(i*6 +2 ) = E.val(3,3);

          P0(i*6 +3 ) = E.val(2,3);

          P0(i*6 +4 ) = E.val(3,1);

          P0(i*6 +5 ) = E.val(1,2);

        }

        return eleInfo.setVector(P0);

     }

    

     default:

     return -1;



   }    

}
Exemplo n.º 30
0
int 
BeamColumnJoint3d::getResponse(int responseID, Information &eleInfo)
{
	static Vector delta(13);
	static Vector def(4);
	static Vector U(16);
	static Vector Utemp(12);
	double bsFa, bsFb, bsFc, bsFd;
	double bsFac, bsFbd, isFac, isFbd; 

	switch (responseID) {
	case 1:       
		if(eleInfo.theVector!=0)
		{
			(*(eleInfo.theVector))(0) =  UeprCommit(0);
			(*(eleInfo.theVector))(1) =  UeprCommit(1);
			(*(eleInfo.theVector))(2) =  UeprCommit(2);
			(*(eleInfo.theVector))(3) =  UeprCommit(3);
			(*(eleInfo.theVector))(4) =  UeprCommit(4);
			(*(eleInfo.theVector))(5) =  UeprCommit(5);
			(*(eleInfo.theVector))(6) =  UeprCommit(6);
			(*(eleInfo.theVector))(7) =  UeprCommit(7);
			(*(eleInfo.theVector))(8) =  UeprCommit(8);
			(*(eleInfo.theVector))(9) =  UeprCommit(9);
			(*(eleInfo.theVector))(10) = UeprCommit(10);
			(*(eleInfo.theVector))(11) = UeprCommit(11);
			(*(eleInfo.theVector))(12) = UeprCommit(12);
			(*(eleInfo.theVector))(13) = UeprCommit(13);
			(*(eleInfo.theVector))(14) = UeprCommit(14);
			(*(eleInfo.theVector))(15) = UeprCommit(15);
			(*(eleInfo.theVector))(16) = UeprCommit(16);
			(*(eleInfo.theVector))(17) = UeprCommit(17);
			(*(eleInfo.theVector))(18) = UeprCommit(18);
			(*(eleInfo.theVector))(19) = UeprCommit(19);
			(*(eleInfo.theVector))(20) = UeprCommit(20);
			(*(eleInfo.theVector))(21) = UeprCommit(21);
			(*(eleInfo.theVector))(22) = UeprCommit(22);
			(*(eleInfo.theVector))(23) = UeprCommit(23);
		}
		return 0;

	case 2:
		if (eleInfo.theVector !=0) {
			(*(eleInfo.theVector))(0) = UeprIntCommit(0);
			(*(eleInfo.theVector))(1) = UeprIntCommit(1);
			(*(eleInfo.theVector))(2) = UeprIntCommit(2);
			(*(eleInfo.theVector))(3) = UeprIntCommit(3);
		}
		return 0;

	case 3:

		// modified 01.04.03  -------- determine which plane the joint lies
		Utemp.addMatrixVector(0.0,Transf,UeprCommit,1.0);
		U.Assemble(Utemp,0,1.0);
		U.Assemble(UeprIntCommit,12,1.0);

		delta.addMatrixVector(0.0,BCJoint,U,1.0);
		
		bsFa = fabs(delta(0) - delta(1))/elemWidth;
		bsFc = fabs(delta(7) - delta(6))/elemWidth;
		bsFac = bsFa + bsFc;
		bsFb = fabs(delta(4) - delta(3))/elemHeight;
		bsFd = fabs(delta(10) - delta(9))/elemHeight;
		bsFbd = bsFb + bsFd;

		def(0) = bsFac + bsFbd; // contribution of bar slip deformation
		
		
		isFac = (delta(2) + delta(8))/elemHeight;
		isFbd = (delta(5) + delta(11))/elemWidth;

		def(1) = isFac + isFbd;  // contribution due to interface shear spring

		def(2) = delta(12);  // contribution due to shear panel

		def(3) = def(0) + def(1) + def(2);  // total joint deformation


		return eleInfo.setVector(def);
	default:
		return -1;
	}
}