https://mooseframework.inl.gov
ElementsToSimplicesConverter.C
Go to the documentation of this file.
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 
11 
12 #include "CastUniquePointer.h"
13 
14 #include "libmesh/mesh_modification.h"
15 #include "libmesh/unstructured_mesh.h"
16 
18 
21 {
23 
24  params.addRequiredParam<MeshGeneratorName>("input", "Input mesh to convert to all-simplex mesh");
25 
26  params.addClassDescription("Splits all non-simplex elements in a mesh into simplices.");
27 
28  return params;
29 }
30 
32  : MeshGenerator(parameters), _input_ptr(getMesh("input"))
33 {
34 }
35 
36 std::unique_ptr<MeshBase>
38 {
39  // Put the input mesh in a local pointer
40  std::unique_ptr<UnstructuredMesh> mesh =
41  dynamic_pointer_cast<UnstructuredMesh>(std::move(_input_ptr));
42 
43  MeshTools::Modification::all_tri(*mesh);
44 
45  return mesh;
46 }
registerMooseObject("MooseApp", ElementsToSimplicesConverter)
std::unique_ptr< MeshBase > & _input_ptr
Input mesh defining the original mixed mesh.
MeshBase & mesh
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
static InputParameters validParams()
Definition: MeshGenerator.C:23
ElementsToSimplicesConverter(const InputParameters &parameters)
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:32
Takes a mesh with a mix of element types, and subdivides elements as needed to produce a mesh of the ...