LCOV - code coverage report
Current view: top level - src/constraints - MortarGenericTraction.C (source / functions) Hit Total Coverage
Test: idaholab/moose contact: #32971 (54bef8) with base c6cf66 Lines: 21 23 91.3 %
Date: 2026-05-29 20:36:03 Functions: 3 3 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 "MortarGenericTraction.h"
      11             : #include "CohesiveZoneModelBase.h"
      12             : 
      13             : registerMooseObject("ContactApp", MortarGenericTraction);
      14             : 
      15             : InputParameters
      16         180 : MortarGenericTraction::validParams()
      17             : {
      18         180 :   InputParameters params = ADMortarLagrangeConstraint::validParams();
      19             : 
      20         360 :   MooseEnum component("x=0 y=1 z=2");
      21         360 :   params.addRequiredParam<MooseEnum>(
      22             :       "component", component, "The force component constraint that this object is supplying");
      23         180 :   params.addClassDescription(
      24             :       "Used to apply tangential stresses from frictional contact using lagrange multipliers");
      25         360 :   params.addRequiredParam<UserObjectName>("cohesive_zone_uo", "The cohesive zone user object.");
      26         180 :   params.set<bool>("interpolate_normals") = false;
      27         180 :   params.set<bool>("compute_lm_residual") = false;
      28         180 :   return params;
      29         180 : }
      30             : 
      31          90 : MortarGenericTraction::MortarGenericTraction(const InputParameters & parameters)
      32             :   : ADMortarLagrangeConstraint(parameters),
      33          90 :     _component(getParam<MooseEnum>("component")),
      34          90 :     _cohesize_zone_uo(const_cast<CohesiveZoneModelBase &>(
      35         180 :         getUserObject<CohesiveZoneModelBase>("cohesive_zone_uo")))
      36             : {
      37          90 : }
      38             : 
      39             : ADReal
      40      215088 : MortarGenericTraction::computeQpResidual(Moose::MortarType type)
      41             : {
      42      215088 :   switch (type)
      43             :   {
      44      107544 :     case Moose::MortarType::Secondary:
      45      107544 :       return _test_secondary[_i][_qp] * _cohesize_zone_uo.czmGlobalTraction(_component)[_qp];
      46      107544 :     case Moose::MortarType::Primary:
      47      215088 :       return -_test_primary[_i][_qp] * _cohesize_zone_uo.czmGlobalTraction(_component)[_qp];
      48             : 
      49           0 :     default:
      50           0 :       return 0;
      51             :   }
      52             : }

Generated by: LCOV version 1.14