13 #include "libmesh/mesh_generation.h" 14 #include "libmesh/string_to_enum.h" 27 params.
addParam<
MooseEnum>(
"elem_type", types,
"The type of element to generate");
28 params.
addParam<
unsigned int>(
"n_smooth", 0,
"Number of smoothing operations");
34 _radius(getParam<
Real>(
"radius")),
35 _nr(getParam<unsigned
int>(
"nr")),
36 _elem_type(getParam<
MooseEnum>(
"elem_type")),
37 _n_smooth(getParam<unsigned
int>(
"n_smooth"))
41 std::unique_ptr<MeshBase>
45 mesh->set_mesh_dimension(3);
46 mesh->set_spatial_dimension(3);
50 MeshTools::Generation::build_sphere(static_cast<UnstructuredMesh &>(*
mesh),
const MooseEnum _elem_type
element type
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.
static InputParameters validParams()
registerMooseObject("MooseApp", SphereMeshGenerator)
const unsigned int & _n_smooth
number of smoothing operations
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
static InputParameters validParams()
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
const unsigned int & _nr
number of radial elements
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
SphereMeshGenerator(const InputParameters ¶meters)
Create a sphere volume mesh.
std::unique_ptr< MeshBase > buildMeshBaseObject(unsigned int dim=libMesh::invalid_uint)
Build a MeshBase object whose underlying type will be determined by the Mesh input file block...
MeshGenerators are objects that can modify or add to an existing mesh.
void ErrorVector unsigned int
const Real & _radius
sphere radius