LCOV - code coverage report
Current view: top level - src/bcs - CrackTipEnrichmentCutOffBC.C (source / functions) Hit Total Coverage
Test: idaholab/moose xfem: #31405 (292dce) with base fef103 Lines: 15 16 93.8 %
Date: 2025-09-04 07:58:55 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 "CrackTipEnrichmentCutOffBC.h"
      11             : 
      12             : registerMooseObject("XFEMApp", CrackTipEnrichmentCutOffBC);
      13             : 
      14             : InputParameters
      15          64 : CrackTipEnrichmentCutOffBC::validParams()
      16             : {
      17          64 :   InputParameters p = DirichletBC::validParams();
      18         128 :   p.addRequiredParam<Real>("cut_off_radius",
      19             :                            "The cut off radius of crack tip enrichment functions");
      20          64 :   p.set<bool>("use_displaced_mesh") = false;
      21         128 :   p.addRequiredParam<UserObjectName>("crack_front_definition",
      22             :                                      "The CrackFrontDefinition user object name");
      23          64 :   p.set<bool>("preset") = true;
      24          64 :   return p;
      25           0 : }
      26             : 
      27          32 : CrackTipEnrichmentCutOffBC::CrackTipEnrichmentCutOffBC(const InputParameters & parameters)
      28             :   : DirichletBC(parameters),
      29          32 :     _cut_off_radius(getParam<Real>("cut_off_radius")),
      30          64 :     _crack_front_definition(getUserObject<CrackFrontDefinition>("crack_front_definition"))
      31             : {
      32          32 : }
      33             : 
      34             : bool
      35       63488 : CrackTipEnrichmentCutOffBC::shouldApply() const
      36             : {
      37             :   Real r, theta;
      38       63488 :   _crack_front_definition.calculateRThetaToCrackFront((*_current_node), r, theta);
      39             : 
      40       63488 :   if (r > _cut_off_radius)
      41             :     return true;
      42             :   else
      43        3968 :     return false;
      44             : }

Generated by: LCOV version 1.14