LCOV - code coverage report
Current view: top level - src/materials/cohesive_zone_model - CZMComputeGlobalTractionTotalLagrangian.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #31405 (292dce) with base fef103 Lines: 45 49 91.8 %
Date: 2025-09-04 07:57:23 Functions: 6 7 85.7 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.14