示例#1
0
int
ShellMITC9::getResponse(int responseID, Information &eleInfo)
{
  int i;
  int cnt = 0;
  static Vector stresses(84);
  static Vector strains(84);

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

  case 2: // stresses
    for (i = 0; i < 9; i++) {

      // Get material stress response
      const Vector &sigma = materialPointers[i]->getStressResultant();
      stresses(cnt) = sigma(0);
      stresses(cnt+1) = sigma(1);
      stresses(cnt+2) = sigma(2);
      stresses(cnt+3) = sigma(3);
      stresses(cnt+4) = sigma(4);
      stresses(cnt+5) = sigma(5);
      stresses(cnt+6) = sigma(6);
      stresses(cnt+7) = sigma(7);
      cnt += 8;
    }
    return eleInfo.setVector(stresses);
    break;

	case 3: // strains
    for (i = 0; i < 9; i++) {

      // Get material stress response
      const Vector &deformation = materialPointers[i]->getSectionDeformation();
      strains(cnt) = deformation(0);
      strains(cnt+1) = deformation(1);
      strains(cnt+2) = deformation(2);
      strains(cnt+3) = deformation(3);
      strains(cnt+4) = deformation(4);
      strains(cnt+5) = deformation(5);
      strains(cnt+6) = deformation(6);
      strains(cnt+7) = deformation(7);
      cnt += 8;
    }
    return eleInfo.setVector(strains);
    break;

  default:
    return -1;
  }
}
bool Foam::deformingEngineMesh::realDeformation() const
{

    if (virtualPistonPosition() + engTime().pistonDisplacement().value() > deckHeight_ - SMALL)
    {
        return true;
    }
    else
    {
        return deformation();
    }
}
bool Foam::twoStrokeEngine::realDeformation() const
{
    if
    (
        virtualPistonPosition() + engTime().pistonDisplacement().value()
      > deckHeight() - engTime().clearance().value() - SMALL
    )
    {
        return true;
    }
    else
    {
        return deformation();
    }
}
bool Foam::engineValveSliding::realDeformation() const
{
    return deformation();
}