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