13 #include "libmesh/mesh_smoother_laplace.h" 14 #include "libmesh/unstructured_mesh.h" 15 #include "libmesh/replicated_mesh.h" 26 params.
addRequiredParam<MeshGeneratorName>(
"input",
"The mesh we want to smooth.");
27 params.
addClassDescription(
"Utilizes a simple Laplacian based smoother to attempt to improve " 28 "mesh quality. Will not move boundary nodes or nodes along " 29 "block/subdomain boundaries");
31 params.
addParam<
unsigned int>(
"iterations", 1,
"The number of smoothing iterations to do.");
38 _input(getMesh(
"input")),
39 _iterations(getParam<unsigned
int>(
"iterations"))
43 std::unique_ptr<MeshBase>
46 std::unique_ptr<MeshBase> old_mesh = std::move(
_input);
47 if (!old_mesh->is_replicated())
48 mooseError(
"SmoothMeshGenerator is not implemented for distributed meshes");
52 LaplaceMeshSmoother lms(static_cast<UnstructuredMesh &>(*
mesh));
unsigned int _iterations
The number of smoothing passes to do.
static InputParameters validParams()
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.
std::unique_ptr< MeshBase > & _input
Mesh that possibly comes from another generator.
registerMooseObject("MooseApp", SmoothMeshGenerator)
static InputParameters validParams()
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
SmoothMeshGenerator(const InputParameters ¶meters)
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
MeshGenerator for doing mesh smoothing.
MeshGenerators are objects that can modify or add to an existing mesh.
void ErrorVector unsigned int