LCOV - code coverage report
Current view: top level - src/interfacekernels - CZMInterfaceKernelTotalLagrangian.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_mechanics: #32971 (54bef8) with base c6cf66 Lines: 36 37 97.3 %
Date: 2026-05-29 20:40:07 Functions: 4 4 100.0 %
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 "CZMInterfaceKernelTotalLagrangian.h"
      11             : 
      12             : registerMooseObject("SolidMechanicsApp", CZMInterfaceKernelTotalLagrangian);
      13             : 
      14             : InputParameters
      15         337 : CZMInterfaceKernelTotalLagrangian::validParams()
      16             : {
      17         337 :   InputParameters params = CZMInterfaceKernelBase::validParams();
      18         337 :   params.addClassDescription("Calculate residual contribution for balancing the traction across an "
      19             :                              "interface (used in the cohesive zone method).");
      20         337 :   params.set<std::string>("traction_global_name") = "PK1traction";
      21         337 :   return params;
      22           0 : }
      23             : 
      24         108 : CZMInterfaceKernelTotalLagrangian::CZMInterfaceKernelTotalLagrangian(
      25         108 :     const InputParameters & parameters)
      26             :   : CZMInterfaceKernelBase(parameters),
      27         216 :     _dPK1traction_dF(getMaterialPropertyByName<RankThreeTensor>(_base_name + "dPK1traction_dF"))
      28             : {
      29         108 : }
      30             : 
      31             : Real
      32    24887360 : CZMInterfaceKernelTotalLagrangian::computeDResidualDDisplacement(
      33             :     const unsigned int & component_j, const Moose::DGJacobianType & type) const
      34             : {
      35    24887360 :   Real jacsd = _dtraction_djump_global[_qp](_component, component_j);
      36             :   Real jac = 0;
      37             : 
      38    24887360 :   switch (type)
      39             :   {
      40     6221840 :     case Moose::ElementElement: // Residual_sign -1  ddeltaU_ddisp sign -1;
      41     6221840 :       jac += _test[_i][_qp] * jacsd * _vars[component_j]->phiFace()[_j][_qp];
      42     6221840 :       jac -= _test[_i][_qp] * JacLD(component_j, /*neighbor=*/false);
      43     6221840 :       break;
      44     6221840 :     case Moose::ElementNeighbor: // Residual_sign -1  ddeltaU_ddisp sign 1;
      45     6221840 :       jac -= _test[_i][_qp] * jacsd * _vars[component_j]->phiFaceNeighbor()[_j][_qp];
      46     6221840 :       jac -= _test[_i][_qp] * JacLD(component_j, /*neighbor=*/true);
      47     6221840 :       break;
      48     6221840 :     case Moose::NeighborElement: // Residual_sign 1  ddeltaU_ddisp sign -1;
      49     6221840 :       jac -= _test_neighbor[_i][_qp] * jacsd * _vars[component_j]->phiFace()[_j][_qp];
      50     6221840 :       jac += _test_neighbor[_i][_qp] * JacLD(component_j, /*neighbor=*/false);
      51     6221840 :       break;
      52     6221840 :     case Moose::NeighborNeighbor: // Residual_sign 1  ddeltaU_ddisp sign 1;
      53     6221840 :       jac += _test_neighbor[_i][_qp] * jacsd * _vars[component_j]->phiFaceNeighbor()[_j][_qp];
      54     6221840 :       jac += _test_neighbor[_i][_qp] * JacLD(component_j, /*neighbor=*/true);
      55     6221840 :       break;
      56             :   }
      57             : 
      58    24887360 :   return jac;
      59             : }
      60             : 
      61             : Real
      62    24887360 : CZMInterfaceKernelTotalLagrangian::JacLD(const unsigned int cc, const bool neighbor) const
      63             : {
      64             :   Real jacld = 0;
      65             :   RealVectorValue phi;
      66    24887360 :   if (neighbor)
      67    12443680 :     phi = 0.5 * _vars[cc]->gradPhiFaceNeighbor()[_j][_qp];
      68             :   else
      69    12443680 :     phi = 0.5 * _vars[cc]->gradPhiFace()[_j][_qp];
      70             : 
      71    99549440 :   for (unsigned int j = 0; j < 3; j++)
      72    74662080 :     jacld += _dPK1traction_dF[_qp](_component, cc, j) * phi(j);
      73             : 
      74             :   mooseAssert(std::isfinite(jacld), "CZMInterfaceKernelTotalLagrangian JacLD is not finite");
      75    24887360 :   return jacld;
      76             : }

Generated by: LCOV version 1.14