Exemplo n.º 1
0
int 
Mehanny::getResponse(int responseID, Information &info)
{
  switch (responseID) {
  case -1:
    return -1;
    
  case 1:
    return info.setDouble( this->getDamage() );
    
  case 2:
    return info.setDouble( TrialPlasticDefo );
    
  case 3:
    if(info.theVector!=0)
      {
	(*(info.theVector))(0) = TrialPosPHC;
	(*(info.theVector))(1) = TrialSumPosFHC;
	(*(info.theVector))(2) = TrialNegPHC;
	(*(info.theVector))(3) = TrialSumNegFHC;
      }
    return 0;
    
  default:
    return -1;
  }
}
Exemplo n.º 2
0
int XC::CorotTruss::getResponse(int responseID, Information &eleInfo)
  {
    switch (responseID)
      {
      case 1:
        return eleInfo.setDouble(getAxialForce());
      case 2:
        return eleInfo.setDouble(Lo * theMaterial->getStrain());
      default:
        return 0;
      }
  }
int ElastomericBearingBoucWen2d::getResponse(int responseID, Information &eleInfo)
{
    double kGeo1, MpDelta1, MpDelta2, MpDelta3;
    
    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(4)-ul(1));
        theVector(2) += MpDelta1;
        theVector(5) += MpDelta1;
        MpDelta2 = kGeo1*shearDistI*L*ul(2);
        theVector(2) += MpDelta2;
        theVector(5) -= MpDelta2;
        MpDelta3 = kGeo1*(1.0 - shearDistI)*L*ul(5);
        theVector(2) -= MpDelta3;
        theVector(5) += MpDelta3;
        
        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.setDouble(z);
        
    case 7:  // dzdu
        return eleInfo.setDouble(dzdu);
        
    case 8:  // basic stiffness
        return eleInfo.setDouble(kb(1,1));
        
    default:
        return -1;
    }
}
Exemplo n.º 4
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.º 5
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.º 6
0
 int
   PY_Macro2D::getResponse(int responseID, Information &eleInfo)
 {
   double strain;

   switch (responseID) {
   case 1:
     return eleInfo.setDouble(S1);

   default:
     return 0;
   }
 }
Exemplo n.º 7
0
int 
UniaxialMaterial::getResponse(int responseID, Information &matInfo)
{
  static Vector stressStrain(2);
  static Vector stressStrainTangent(3);
  // 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;
  default:      
    return -1;
  }
}
Exemplo n.º 8
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.º 9
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.º 10
0
int 
HystereticEnergy::getResponse(int responseID, Information &info)
{
	switch (responseID) {
	case -1:
		return -1;
	
	case 1:
		return info.setDouble( this->getDamage() );

	case 2:
		if(info.theVector!=0)
		{
			for (int i = 0 ; i < 8 ; i++ ) (*(info.theVector))(i) = TrialInfo[i];
		}
		return 0;

	default:
		return -1;
	}
}
Exemplo n.º 11
0
int 
ParkAng::getResponse(int responseID, Information &info)
{
	switch (responseID) {
	case -1:
		return -1;
	
	case 1:
		return info.setDouble( this->getDamage() );

	case 2:
		if(info.theVector!=0)
		{
			(*(info.theVector))(0) = TrialInfo[1];
			(*(info.theVector))(1) = TrialInfo[0];
			(*(info.theVector))(2) = TrialInfo[2];
		}
		return 0;

	case 3:
		if(info.theVector!=0)
		{
			(*(info.theVector))(0) = TrialInfo[0];
			(*(info.theVector))(1) = TrialInfo[1];
			(*(info.theVector))(2) = TrialInfo[2];
			(*(info.theVector))(3) = TrialInfo[3];
			(*(info.theVector))(4) = TrialInfo[4];
			(*(info.theVector))(5) = TrialInfo[5];
		}

		return 0;

	default:
		return -1;
	}
}
Exemplo n.º 12
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.º 13
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;
  }
}