LCOV - code coverage report
Current view: top level - src/meshgenerators - ElementsToSimplicesConverter.C (source / functions) Hit Total Coverage
Test: idaholab/moose framework: 2bf808 Lines: 13 14 92.9 %
Date: 2025-07-17 01:28:37 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 "ElementsToSimplicesConverter.h"
      11             : 
      12             : #include "CastUniquePointer.h"
      13             : 
      14             : #include "libmesh/mesh_modification.h"
      15             : #include "libmesh/unstructured_mesh.h"
      16             : 
      17             : registerMooseObject("MooseApp", ElementsToSimplicesConverter);
      18             : 
      19             : InputParameters
      20       14385 : ElementsToSimplicesConverter::validParams()
      21             : {
      22       14385 :   InputParameters params = MeshGenerator::validParams();
      23             : 
      24       14385 :   params.addRequiredParam<MeshGeneratorName>("input", "Input mesh to convert to all-simplex mesh");
      25             : 
      26       14385 :   params.addClassDescription("Splits all non-simplex elements in a mesh into simplices.");
      27             : 
      28       14385 :   return params;
      29           0 : }
      30             : 
      31          60 : ElementsToSimplicesConverter::ElementsToSimplicesConverter(const InputParameters & parameters)
      32          60 :   : MeshGenerator(parameters), _input_ptr(getMesh("input"))
      33             : {
      34          60 : }
      35             : 
      36             : std::unique_ptr<MeshBase>
      37          60 : ElementsToSimplicesConverter::generate()
      38             : {
      39             :   // Put the input mesh in a local pointer
      40             :   std::unique_ptr<UnstructuredMesh> mesh =
      41          60 :       dynamic_pointer_cast<UnstructuredMesh>(std::move(_input_ptr));
      42             : 
      43          60 :   MeshTools::Modification::all_tri(*mesh);
      44             : 
      45         120 :   return mesh;
      46          60 : }

Generated by: LCOV version 1.14