LCOV - code coverage report
Current view: top level - include/utils - ContactFrictionUtils.h (source / functions) Hit Total Coverage
Test: idaholab/moose contact: #33358 (34476d) with base 4fcf7b Lines: 10 11 90.9 %
Date: 2026-07-17 19:51:21 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             : #pragma once
      11             : 
      12             : #include "MooseError.h"
      13             : #include "MooseEnum.h"
      14             : #include "MooseTypes.h"
      15             : 
      16             : #include "libmesh/libmesh.h"
      17             : 
      18             : #include <cmath>
      19             : 
      20             : namespace Moose
      21             : {
      22             : namespace Contact
      23             : {
      24             : 
      25       12936 : CreateMooseEnumClass(FrictionCoefficientRegularization, NONE, ARCTAN_SLIP);
      26             : 
      27             : inline MooseEnum
      28        2156 : frictionCoefficientRegularizationOptions()
      29             : {
      30        4312 :   MooseEnum options(getFrictionCoefficientRegularizationOptions(), "NONE");
      31        4312 :   options.addDocumentation("NONE", "Use the supplied Coulomb friction coefficient.");
      32        4312 :   options.addDocumentation(
      33             :       "ARCTAN_SLIP",
      34             :       "Scale the Coulomb friction coefficient by an arctangent function of the slip increment.");
      35        2156 :   return options;
      36           0 : }
      37             : 
      38             : template <typename TMu, typename TSlip>
      39             : auto
      40      238120 : regularizedFrictionCoefficient(const TMu & mu,
      41             :                                const TSlip & slip_increment,
      42             :                                const FrictionCoefficientRegularization regularization,
      43             :                                const Real reference_slip) -> decltype(mu + mu * slip_increment)
      44             : {
      45             :   using std::atan;
      46             :   using Result = decltype(mu + mu * slip_increment);
      47             : 
      48      238120 :   if (regularization == FrictionCoefficientRegularization::NONE)
      49      227440 :     return Result(mu);
      50             : 
      51             :   mooseAssert(reference_slip > 0.0,
      52             :               "Friction coefficient regularization requires a positive reference slip");
      53             : 
      54       21360 :   return mu * (2.0 / libMesh::pi) * atan(slip_increment / reference_slip);
      55             : }
      56             : 
      57             : } // namespace Contact
      58             : } // namespace Moose

Generated by: LCOV version 1.14