Ejemplo n.º 1
0
void
RankTwoTensorTest::ddetTest()
{
  // this derivative is less trivial than dtrace and dsecondInvariant,
  // so let's check with a finite-difference approximation
  Real ep = 1E-5; // small finite-difference parameter
  Real det; // determinant provided by RankTwoTensor
  RankTwoTensor deriv; // derivative of det provided by RankTwoTensor
  RankTwoTensor mep; // the RankTwoTensor with successive entries shifted by ep

  det = _m3.det();
  deriv = _m3.ddet();
  mep = _m3;
  for (unsigned i = 0 ; i < 3 ; ++i)
    for (unsigned j = 0 ; j < 3 ; ++j)
    {
      mep(i, j) += ep;
      CPPUNIT_ASSERT_DOUBLES_EQUAL((mep.det() - det)/ep, deriv(i, j), ep);
      mep(i, j) -= ep;
    }

  det = _unsymmetric1.det();
  deriv = _unsymmetric1.ddet();
  mep = _unsymmetric1;
  for (unsigned i = 0 ; i < 3 ; ++i)
    for (unsigned j = 0 ; j < 3 ; ++j)
    {
      mep(i, j) += ep;
      CPPUNIT_ASSERT_DOUBLES_EQUAL((mep.det() - det)/ep, deriv(i, j), ep);
      mep(i, j) -= ep;
    }
}
RankFourTensor
TensorMechanicsPlasticOrthotropic::dflowPotential_dstress(const RankTwoTensor & stress,
                                                          Real /*intnl*/) const
{
  if (_associative)
  {
    const RankTwoTensor j2prime = _l1 * stress;
    const RankTwoTensor j3prime = _l2 * stress;
    const RankTwoTensor dj2 = dj2_dSkl(j2prime);
    const RankTwoTensor dj3 = j3prime.ddet();
    const Real j2 = -j2prime.generalSecondInvariant();
    const Real j3 = j3prime.det();
    const RankFourTensor dr =
        dfj2_dj2(j2, j3) *
            _l1.innerProductTranspose(dj2).outerProduct(_l1.innerProductTranspose(dj2)) +
        dfj2_dj3(j2, j3) *
            _l1.innerProductTranspose(dj2).outerProduct(_l2.innerProductTranspose(dj3)) +
        dfj3_dj2(j2, j3) *
            _l2.innerProductTranspose(dj3).outerProduct(_l1.innerProductTranspose(dj2)) +
        dfj3_dj3(j2, j3) *
            _l2.innerProductTranspose(dj3).outerProduct(_l2.innerProductTranspose(dj3));
    const RankTwoTensor r = _b * dI_sigma() +
                            dphi_dj2(j2, j3) * _l1.innerProductTranspose(dj2_dSkl(j2prime)) +
                            dphi_dj3(j2, j3) * _l2.innerProductTranspose(j3prime.ddet());
    const Real norm = r.L2norm();
    return dr / norm - (r / Utility::pow<3>(norm)).outerProduct(dr.innerProductTranspose(r));
  }
  else
    return TensorMechanicsPlasticJ2::dflowPotential_dstress(stress, 0);
}
Real
TensorMechanicsPlasticOrthotropic::yieldFunction(const RankTwoTensor & stress, Real intnl) const
{
  const RankTwoTensor j2prime = _l1 * stress;
  const RankTwoTensor j3prime = _l2 * stress;
  return _b * stress.trace() +
         std::pow(std::pow(-j2prime.generalSecondInvariant(), 3.0 / 2.0) - j3prime.det(),
                  1.0 / 3.0) -
         yieldStrength(intnl);
}
RankTwoTensor
TensorMechanicsPlasticOrthotropic::dyieldFunction_dstress(const RankTwoTensor & stress,
                                                          Real /*intnl*/) const
{
  const RankTwoTensor j2prime = _l1 * stress;
  const RankTwoTensor j3prime = _l2 * stress;
  const Real j2 = -j2prime.generalSecondInvariant();
  const Real j3 = j3prime.det();
  return _b * dI_sigma() + dphi_dj2(j2, j3) * _l1.innerProductTranspose(dj2_dSkl(j2prime)) +
         dphi_dj3(j2, j3) * _l2.innerProductTranspose(j3prime.ddet());
}