LCOV - code coverage report
Current view: top level - src/constraints - CartesianMortarMechanicalContact.C (source / functions) Hit Total Coverage
Test: idaholab/moose contact: 8601ad Lines: 18 20 90.0 %
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 "CartesianMortarMechanicalContact.h"
      11             : 
      12             : registerMooseObject("ContactApp", CartesianMortarMechanicalContact);
      13             : 
      14             : InputParameters
      15         564 : CartesianMortarMechanicalContact::validParams()
      16             : {
      17         564 :   InputParameters params = ADMortarLagrangeConstraint::validParams();
      18             : 
      19        1128 :   MooseEnum component("x=0 y=1 z=2");
      20        1128 :   params.addRequiredParam<MooseEnum>(
      21             :       "component", component, "The force component constraint that this object is supplying");
      22         564 :   params.addClassDescription(
      23             :       "This class is used to apply normal contact forces using lagrange multipliers");
      24         564 :   params.set<bool>("compute_lm_residual") = false;
      25         564 :   return params;
      26         564 : }
      27             : 
      28         282 : CartesianMortarMechanicalContact::CartesianMortarMechanicalContact(
      29         282 :     const InputParameters & parameters)
      30         564 :   : ADMortarLagrangeConstraint(parameters), _component(getParam<MooseEnum>("component"))
      31             : {
      32         282 : }
      33             : 
      34             : ADReal
      35    10912672 : CartesianMortarMechanicalContact::computeQpResidual(Moose::MortarType type)
      36             : {
      37    10912672 :   switch (type)
      38             :   {
      39     5456336 :     case Moose::MortarType::Secondary:
      40     5456336 :       return _test_secondary[_i][_qp] * _lambda[_qp];
      41             : 
      42     5456336 :     case Moose::MortarType::Primary:
      43    10912672 :       return -_test_primary[_i][_qp] * _lambda[_qp];
      44             : 
      45           0 :     default:
      46           0 :       return 0;
      47             :   }
      48             : }

Generated by: LCOV version 1.14