LCOV - code coverage report
Current view: top level - src/materials/cohesive_zone_model - CZMComputeGlobalTractionTotalLagrangian.C (source / functions) Hit Total Coverage
Test: idaholab/moose tensor_mechanics: d6b47a Lines: 47 48 97.9 %
Date: 2024-02-27 11:53:14 Functions: 7 7 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://www.mooseframework.org
       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             : 
      10             : #include "CZMComputeGlobalTractionTotalLagrangian.h"
      11             : #include "CohesiveZoneModelTools.h"
      12             : 
      13             : registerMooseObject("TensorMechanicsApp", CZMComputeGlobalTractionTotalLagrangian);
      14             : 
      15             : InputParameters
      16          66 : CZMComputeGlobalTractionTotalLagrangian::validParams()
      17             : {
      18          66 :   InputParameters params = CZMComputeGlobalTractionBase::validParams();
      19             : 
      20          66 :   params.addClassDescription("Compute the equilibrium traction (PK1) and its derivatives for the "
      21             :                              "Total Lagrangian formulation.");
      22          66 :   return params;
      23           0 : }
      24             : 
      25          30 : CZMComputeGlobalTractionTotalLagrangian::CZMComputeGlobalTractionTotalLagrangian(
      26          30 :     const InputParameters & parameters)
      27             :   : CZMComputeGlobalTractionBase(parameters),
      28          30 :     _displacement_jump_global(
      29          60 :         getMaterialPropertyByName<RealVectorValue>(_base_name + "displacement_jump_global")),
      30          30 :     _czm_reference_rotation(
      31          30 :         getMaterialPropertyByName<RankTwoTensor>(_base_name + "czm_reference_rotation")),
      32          60 :     _R(getMaterialPropertyByName<RankTwoTensor>(_base_name + "czm_rotation")),
      33          60 :     _F(getMaterialPropertyByName<RankTwoTensor>(_base_name + "F_czm")),
      34          60 :     _PK1traction(declarePropertyByName<RealVectorValue>(_base_name + "PK1traction")),
      35         150 :     _dPK1traction_dF(declarePropertyByName<RankThreeTensor>(_base_name + "dPK1traction_dF"))
      36             : {
      37          30 : }
      38             : 
      39             : void
      40         944 : CZMComputeGlobalTractionTotalLagrangian::initQpStatefulProperties()
      41             : {
      42         944 :   _PK1traction[_qp] = 0;
      43         944 : }
      44             : 
      45             : void
      46       17746 : CZMComputeGlobalTractionTotalLagrangian::computeEquilibriumTracionAndDerivatives()
      47             : {
      48       17746 :   _J = _F[_qp].det();
      49       17746 :   _F_inv = _F[_qp].inverse();
      50             : 
      51       17746 :   _area_ratio = CohesiveZoneModelTools::computeAreaRatio(_F_inv.transpose(), _J, _normals[_qp]);
      52             : 
      53       17746 :   _traction_global[_qp] = (_czm_total_rotation[_qp] * _interface_traction[_qp]);
      54       17746 :   _PK1traction[_qp] = _traction_global[_qp] * _area_ratio;
      55             : 
      56             :   // compute derivatives of _PK1traction wrt dF
      57       17746 :   computedTPK1dJumpGlobal();
      58       17746 :   computeAreaRatioAndDerivatives();
      59       17746 :   computedTPK1dF();
      60       17746 : }
      61             : 
      62             : void
      63       17746 : CZMComputeGlobalTractionTotalLagrangian::computedTPK1dJumpGlobal()
      64             : {
      65             :   // compute the PK1 traction derivatives w.r.t the displacment jump in global
      66             :   // coordinates
      67       17746 :   _dtraction_djump_global[_qp] = _area_ratio * _czm_total_rotation[_qp] *
      68       17746 :                                  _dinterface_traction_djump[_qp] *
      69       17746 :                                  _czm_total_rotation[_qp].transpose();
      70       17746 : }
      71             : 
      72             : void
      73       17746 : CZMComputeGlobalTractionTotalLagrangian::computeAreaRatioAndDerivatives()
      74             : {
      75       17746 :   _dR_dF = CohesiveZoneModelTools::computedRdF(_R[_qp], _R[_qp].transpose() * _F[_qp]);
      76             :   usingTensorIndices(i_, j_, k_, l_, m_);
      77       17746 :   _dczm_total_rotation_dF = _czm_reference_rotation[_qp].times<m_, j_, i_, m_, k_, l_>(_dR_dF);
      78             : 
      79       17746 :   const GenericRankFourTensor<false> dFinv_dF = CohesiveZoneModelTools::computedFinversedF(_F_inv);
      80             : 
      81             :   _d_area_ratio_dF =
      82       17746 :       CohesiveZoneModelTools::computeDAreaRatioDF(_F_inv.transpose(), _normals[_qp], _J, dFinv_dF);
      83       17746 : }
      84             : 
      85             : void
      86       17746 : CZMComputeGlobalTractionTotalLagrangian::computedTPK1dF()
      87             : {
      88             :   // The derivative of the PK1 traction w.r.t. F
      89             :   usingTensorIndices(i_, j_, k_, l_);
      90             :   const RankThreeTensor djump_dF =
      91       17746 :       _dczm_total_rotation_dF.transposeIj().contraction<j_>(_displacement_jump_global[_qp]);
      92             : 
      93       17746 :   _dPK1traction_dF[_qp] =
      94       17746 :       _d_area_ratio_dF.mixedProductJkI(_czm_total_rotation[_qp] * _interface_traction[_qp]) +
      95       17746 :       _area_ratio *
      96       35492 :           (_dczm_total_rotation_dF.contraction<j_>(_interface_traction[_qp]) +
      97       53238 :            (_czm_total_rotation[_qp] * _dinterface_traction_djump[_qp]).contraction(djump_dF));
      98       17746 : }

Generated by: LCOV version 1.14