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 "RBBMappingConverter.h" 11 : 12 : #include "CastUniquePointer.h" 13 : 14 : #include "libmesh/mesh_modification.h" 15 : #include "libmesh/unstructured_mesh.h" 16 : 17 : registerMooseObject("MooseApp", RBBMappingConverter); 18 : 19 : InputParameters 20 3101 : RBBMappingConverter::validParams() 21 : { 22 3101 : InputParameters params = MeshGenerator::validParams(); 23 : 24 12404 : params.addRequiredParam<MeshGeneratorName>( 25 : "input", "Input mesh to convert to use Rational Bernstein-Bezier mappings"); 26 : 27 3101 : params.addClassDescription( 28 : "Reinterpolates all elements in a mesh to use Rational Bernstein-Bezier mappings"); 29 : 30 3101 : return params; 31 0 : } 32 : 33 20 : RBBMappingConverter::RBBMappingConverter(const InputParameters & parameters) 34 40 : : MeshGenerator(parameters), _input_ptr(getMesh("input")) 35 : { 36 20 : } 37 : 38 : std::unique_ptr<MeshBase> 39 20 : RBBMappingConverter::generate() 40 : { 41 : // Put the input mesh in a local pointer 42 : std::unique_ptr<UnstructuredMesh> mesh = 43 20 : dynamic_pointer_cast<UnstructuredMesh>(std::move(_input_ptr)); 44 : 45 20 : 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 20 : mesh->clear_point_locator(); 52 : 53 40 : return mesh; 54 20 : }