LCOV - code coverage report
Current view: top level - src/interfacekernels - CZMInterfaceKernelTotalLagrangian.C (source / functions) Hit Total Coverage
Test: idaholab/moose tensor_mechanics: d6b47a Lines: 35 36 97.2 %
Date: 2024-02-27 11:53:14 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://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 "CZMInterfaceKernelTotalLagrangian.h"
      11             : 
      12             : registerMooseObject("TensorMechanicsApp", CZMInterfaceKernelTotalLagrangian);
      13             : 
      14             : InputParameters
      15         253 : CZMInterfaceKernelTotalLagrangian::validParams()
      16             : {
      17         253 :   InputParameters params = CZMInterfaceKernelBase::validParams();
      18         253 :   params.set<std::string>("traction_global_name") = "PK1traction";
      19         253 :   return params;
      20           0 : }
      21             : 
      22          81 : CZMInterfaceKernelTotalLagrangian::CZMInterfaceKernelTotalLagrangian(
      23          81 :     const InputParameters & parameters)
      24             :   : CZMInterfaceKernelBase(parameters),
      25         162 :     _dPK1traction_dF(getMaterialPropertyByName<RankThreeTensor>(_base_name + "dPK1traction_dF"))
      26             : {
      27          81 : }
      28             : 
      29             : Real
      30    15134752 : CZMInterfaceKernelTotalLagrangian::computeDResidualDDisplacement(
      31             :     const unsigned int & component_j, const Moose::DGJacobianType & type) const
      32             : {
      33    15134752 :   Real jacsd = _dtraction_djump_global[_qp](_component, component_j);
      34             :   Real jac = 0;
      35             : 
      36    15134752 :   switch (type)
      37             :   {
      38     3783688 :     case Moose::ElementElement: // Residual_sign -1  ddeltaU_ddisp sign -1;
      39     3783688 :       jac += _test[_i][_qp] * jacsd * _vars[component_j]->phiFace()[_j][_qp];
      40     3783688 :       jac -= _test[_i][_qp] * JacLD(component_j, /*neighbor=*/false);
      41     3783688 :       break;
      42     3783688 :     case Moose::ElementNeighbor: // Residual_sign -1  ddeltaU_ddisp sign 1;
      43     3783688 :       jac -= _test[_i][_qp] * jacsd * _vars[component_j]->phiFaceNeighbor()[_j][_qp];
      44     3783688 :       jac -= _test[_i][_qp] * JacLD(component_j, /*neighbor=*/true);
      45     3783688 :       break;
      46     3783688 :     case Moose::NeighborElement: // Residual_sign 1  ddeltaU_ddisp sign -1;
      47     3783688 :       jac -= _test_neighbor[_i][_qp] * jacsd * _vars[component_j]->phiFace()[_j][_qp];
      48     3783688 :       jac += _test_neighbor[_i][_qp] * JacLD(component_j, /*neighbor=*/false);
      49     3783688 :       break;
      50     3783688 :     case Moose::NeighborNeighbor: // Residual_sign 1  ddeltaU_ddisp sign 1;
      51     3783688 :       jac += _test_neighbor[_i][_qp] * jacsd * _vars[component_j]->phiFaceNeighbor()[_j][_qp];
      52     3783688 :       jac += _test_neighbor[_i][_qp] * JacLD(component_j, /*neighbor=*/true);
      53     3783688 :       break;
      54             :   }
      55             : 
      56    15134752 :   return jac;
      57             : }
      58             : 
      59             : Real
      60    15134752 : CZMInterfaceKernelTotalLagrangian::JacLD(const unsigned int cc, const bool neighbor) const
      61             : {
      62             :   Real jacld = 0;
      63             :   RealVectorValue phi;
      64    15134752 :   if (neighbor)
      65     7567376 :     phi = 0.5 * _vars[cc]->gradPhiFaceNeighbor()[_j][_qp];
      66             :   else
      67     7567376 :     phi = 0.5 * _vars[cc]->gradPhiFace()[_j][_qp];
      68             : 
      69    60539008 :   for (unsigned int j = 0; j < 3; j++)
      70    45404256 :     jacld += _dPK1traction_dF[_qp](_component, cc, j) * phi(j);
      71             : 
      72             :   mooseAssert(std::isfinite(jacld), "CZMInterfaceKernelTotalLagrangian JacLD is not finite");
      73    15134752 :   return jacld;
      74             : }

Generated by: LCOV version 1.14