LCOV - code coverage report
Current view: top level - src/auxkernels - XFEMCutPlaneAux.C (source / functions) Hit Total Coverage
Test: idaholab/moose xfem: #31653 (13b9bb) with base 7323e9 Lines: 21 24 87.5 %
Date: 2025-11-06 21:28:15 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 "XFEMCutPlaneAux.h"
      11             : 
      12             : #include "XFEM.h"
      13             : 
      14             : registerMooseObject("XFEMApp", XFEMCutPlaneAux);
      15             : 
      16             : InputParameters
      17        5616 : XFEMCutPlaneAux::validParams()
      18             : {
      19        5616 :   InputParameters params = AuxKernel::validParams();
      20       11232 :   MooseEnum quantity("origin_x origin_y origin_z normal_x normal_y normal_z");
      21       11232 :   params.addRequiredParam<MooseEnum>(
      22        5616 :       "quantity", quantity, "The quantity to be extracted.  Choices: " + quantity.getRawNames());
      23       11232 :   params.addParam<unsigned int>("plane_id", 0, "The index of the cut plane");
      24        5616 :   params.addClassDescription(
      25             :       "Computes the normal and origin of a cutting plane for each partial element.");
      26        5616 :   return params;
      27        5616 : }
      28             : 
      29        5184 : XFEMCutPlaneAux::XFEMCutPlaneAux(const InputParameters & parameters)
      30             :   : AuxKernel(parameters),
      31        5184 :     _quantity(Xfem::XFEM_CUTPLANE_QUANTITY(int(getParam<MooseEnum>("quantity")))),
      32       15552 :     _plane_id(getParam<unsigned int>("plane_id"))
      33             : {
      34        5184 :   FEProblemBase * fe_problem = dynamic_cast<FEProblemBase *>(&_subproblem);
      35        5184 :   if (fe_problem == nullptr)
      36           0 :     mooseError("Problem casting _subproblem to FEProblemBase in XFEMCutPlaneAux");
      37       10368 :   _xfem = MooseSharedNamespace::dynamic_pointer_cast<XFEM>(fe_problem->getXFEM());
      38        5184 :   if (_xfem == nullptr)
      39           0 :     mooseError("Problem casting to XFEM in XFEMCutPlaneAux");
      40        5184 :   if (isNodal())
      41           0 :     mooseError("XFEMCutPlaneAux can only be run on an element variable");
      42        5184 : }
      43             : 
      44             : Real
      45    15612984 : XFEMCutPlaneAux::computeValue()
      46             : {
      47    15612984 :   Real value = _xfem->getCutPlane(_current_elem, _quantity, _plane_id);
      48             : 
      49    15612984 :   return value;
      50             : }

Generated by: LCOV version 1.14