LCOV - code coverage report
Current view: top level - src/auxkernels - MeshCutLevelSetAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose xfem: #31405 (292dce) with base fef103 Lines: 14 17 82.4 %
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 "MeshCutLevelSetAux.h"
      11             : #include "InterfaceMeshCutUserObjectBase.h"
      12             : 
      13             : registerMooseObject("XFEMApp", MeshCutLevelSetAux);
      14             : 
      15             : InputParameters
      16          40 : MeshCutLevelSetAux::validParams()
      17             : {
      18          40 :   InputParameters params = AuxKernel::validParams();
      19          40 :   params.addClassDescription(
      20             :       "Calculates signed distance from interface defined by InterfaceMeshCutUserObject.");
      21          80 :   params.addParam<UserObjectName>(
      22             :       "mesh_cut_user_object",
      23             :       "Name of InterfaceMeshCutUserObject that gives cut mesh information.");
      24          40 :   return params;
      25           0 : }
      26             : 
      27          20 : MeshCutLevelSetAux::MeshCutLevelSetAux(const InputParameters & parameters) : AuxKernel(parameters)
      28             : {
      29          20 :   if (!isNodal())
      30           0 :     mooseError("MeshCutLevelSetAux: Aux variable must be nodal variable.");
      31             : 
      32          20 :   FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem);
      33             : 
      34             :   const UserObject * uo =
      35          40 :       &(fe_problem->getUserObjectBase(getParam<UserObjectName>("mesh_cut_user_object")));
      36             : 
      37          20 :   if (dynamic_cast<const InterfaceMeshCutUserObjectBase *>(uo) == nullptr)
      38           0 :     mooseError("Failed to cast UserObject to InterfaceMeshCutUserObjectBase in MeshCutLevelSetAux");
      39             : 
      40          20 :   _mesh_cut_uo = dynamic_cast<const InterfaceMeshCutUserObjectBase *>(uo);
      41          20 : }
      42             : 
      43             : Real
      44      151728 : MeshCutLevelSetAux::computeValue()
      45             : {
      46      151728 :   return _mesh_cut_uo->calculateSignedDistance(*_current_node);
      47             : }

Generated by: LCOV version 1.14