https://mooseframework.inl.gov
CZMComputeDisplacementJumpTotalLagrangian.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 #include "CohesiveZoneModelTools.h"
13 
16 
17 template <bool is_ad>
20 {
22  params.addClassDescription(
23  "Compute the displacement jump increment across a czm interface in local "
24  "coordinates for the Total Lagrangian kinematic formulation");
25 
26  return params;
27 }
28 
29 template <bool is_ad>
32  : CZMComputeDisplacementJumpBase<is_ad>(parameters),
33  _F(this->template declareGenericPropertyByName<RankTwoTensor, is_ad>(_base_name + "F_czm")),
34  _R(this->template declareGenericPropertyByName<RankTwoTensor, is_ad>(_base_name +
35  "czm_rotation")),
36  _czm_reference_rotation(this->template declareGenericPropertyByName<RankTwoTensor, is_ad>(
37  _base_name + "czm_reference_rotation"))
38 {
39  // initializing the displacement gradient vectors
40  for (unsigned int i = 0; i < _ndisp; ++i)
41  {
42  _grad_disp.push_back(&this->template coupledGenericGradient<is_ad>("displacements", i));
43  _grad_disp_neighbor.push_back(
44  &this->template coupledGenericNeighborGradient<is_ad>("displacements", i));
45  }
46 
47  // All others zero (so this will work naturally for 2D and 1D problems)
48  for (unsigned int i = _ndisp; i < 3; i++)
49  {
50  if constexpr (is_ad)
51  {
52  _grad_disp.push_back(&_ad_grad_zero);
54  }
55  else
56  {
57  _grad_disp.push_back(&_grad_zero);
58  _grad_disp_neighbor.push_back(&_grad_zero);
59  }
60  }
61 }
62 
63 template <bool is_ad>
64 void
66 {
68  _displacement_jump_global[_qp] = 0;
69  _F[_qp].setToIdentity();
70  _R[_qp].setToIdentity();
71 }
72 
73 template <bool is_ad>
74 void
76 {
77  _interface_displacement_jump[_qp] =
78  _czm_total_rotation[_qp].transpose() * _displacement_jump_global[_qp];
79 }
80 
81 template <bool is_ad>
82 void
84 {
85  _czm_reference_rotation[_qp] = CohesiveZoneModelTools::computeReferenceRotation<is_ad>(
86  _normals[_qp], this->_mesh.dimension());
87  computeFandR();
88  _czm_total_rotation[_qp] = _R[_qp] * _czm_reference_rotation[_qp];
89 }
90 
91 template <bool is_ad>
92 void
94 {
97  (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]));
98  const auto F_neighbor =
100  GenericRankTwoTensor<is_ad>::initializeFromRows((*_grad_disp_neighbor[0])[_qp],
101  (*_grad_disp_neighbor[1])[_qp],
102  (*_grad_disp_neighbor[2])[_qp]));
103 
104  _F[_qp] = 0.5 * (F + F_neighbor);
105  // According to Cody mooseError are always fatal, so nothing we can do about
106  // them. The norm of the tensor might work, but there is the risk of an
107  // unwanted overflow (I tried and it happens). So checking component by
108  // component remains the only reasonable strategy. If someone finds a better
109  // way this could be changed in the future
110  for (unsigned int i = 0; i < 3; i++)
111  for (unsigned int j = 0; j < 3; j++)
112  if (!std::isfinite(MetaPhysicL::raw_value(_F[_qp](i, j))))
113  throw MooseException("CZMMaterialBaseIncremental _F is not finite, reducing time step");
114 
115  using FR2T = std::conditional_t<is_ad, ADFactorizedRankTwoTensor, FactorizedRankTwoTensor>;
116  const FR2T C = _F[_qp].transpose() * _F[_qp];
117  const auto Uinv = MathUtils::sqrt(C).inverse().get();
118  _R[_qp] = _F[_qp] * Uinv;
119 }
120 
std::vector< const GenericVariableGradient< is_ad > * > _grad_disp_neighbor
const VariableGradient & _grad_zero
const MooseArray< ADRealVectorValue > & _ad_grad_zero
std::vector< const GenericVariableGradient< is_ad > * > _grad_disp
the coupled displacement and neighbor displacement gradient
void computeRotationMatrices() override
method computing the required rotation matrices
auto raw_value(const Eigen::Map< T > &in)
static const std::string F
Definition: NS.h:165
Compute the displacement jump in interface coordinates across a cohesive zone for the total Lagrangia...
const unsigned int _ndisp
number of displacement components
registerMooseObject("SolidMechanicsApp", CZMComputeDisplacementJumpTotalLagrangian)
void computeFandR()
method computing F and the associated rotation
void computeLocalDisplacementJump() override
compute the interface displacement increment using an incremental total Lagrangian approach ...
void addClassDescription(const std::string &doc_string)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
This interface material class computes the displacement jump in the interface natural coordinate syst...
static const std::string C
Definition: NS.h:168
Moose::GenericType< RankTwoTensor, is_ad > GenericRankTwoTensor