https://mooseframework.inl.gov
Loading...
Searching...
No Matches
RBBMappingConverter.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
10#include "RBBMappingConverter.h"
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>(
25 "input", "Input mesh to convert to use Rational Bernstein-Bezier mappings");
26
28 "Reinterpolates all elements in a mesh to use Rational Bernstein-Bezier mappings");
29
30 return params;
31}
32
34 : MeshGenerator(parameters), _input_ptr(getMesh("input"))
35{
36}
37
38std::unique_ptr<MeshBase>
40{
41 // Put the input mesh in a local pointer
42 std::unique_ptr<UnstructuredMesh> mesh =
43 dynamic_pointer_cast<UnstructuredMesh>(std::move(_input_ptr));
44
45 MeshTools::Modification::all_rbb(*mesh);
46
47 // The remapping here subtly changes element geometry. libMesh
48 // should be properly clearing any point locator accordingly, but
49 // until that's fixed we should clear it ourselves, and even
50 // afterward this is a cheap redundancy.
51 mesh->clear_point_locator();
52
53 return mesh;
54}
registerMooseObject("MooseApp", RBBMappingConverter)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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...
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.
static InputParameters validParams()
Takes a mesh with a Lagrange mapping, and reinterpolate its nodes using a Rational Bezier-Bernstein m...
static InputParameters validParams()
std::unique_ptr< MeshBase > & _input_ptr
Input mesh defining the original mixed mesh.
RBBMappingConverter(const InputParameters &parameters)
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
MeshBase & mesh