31 params.
addRequiredParam<MeshGeneratorName>(
"mesh_generator",
"Mesh generator providing the mesh");
32 MooseEnum mesh_generator_type(
"saved_mesh final_generator");
35 "Whether the mesh generator providing the mesh is the final "
36 "mesh generator, or simply provides a 'saved_mesh'");
37 params.
addParam<std::string>(
"saved_mesh_name",
"Name used to generate the mesh");
49 _mesh_generator_type(getParam<
MooseEnum>(
"mesh_generator_type"))
53 "The name of the saved mesh must be provided if using a mesh generator that saves "
54 "the mesh for the component to use");
63 _mg_names.push_back(getParam<MeshGeneratorName>(
"mesh_generator"));
69 const auto saved_mesh =
73 const auto component_mesh = saved_mesh ? saved_mesh.get() :
_mesh->getMeshPtr();
74 mooseAssert(component_mesh,
"Should have a mesh");
77 std::set<subdomain_id_type>
blocks;
78 component_mesh->subdomain_ids(
blocks);
79 for (
const auto bid :
blocks)
80 _blocks.push_back(component_mesh->subdomain_name(bid));
registerActionComponent("MooseApp", MeshGeneratorComponent)
registerMooseAction("MooseApp", MeshGeneratorComponent, "add_mesh_generator")
Base class for components that are defined using an action.
const std::vector< SubdomainName > & blocks() const
Returns the subdomains for the component mesh, if any.
std::vector< MeshGeneratorName > _mg_names
Name(s) of the final mesh generator(s) creating the mesh for the component.
void addRequiredTask(const std::string &task)
Add a new required task for all physics deriving from this class NOTE: This does not register the tas...
std::vector< SubdomainName > _blocks
Names of the blocks the component is comprised of.
static InputParameters validParams()
std::shared_ptr< MooseMesh > & _mesh
MooseApp & _app
The MOOSE application this is associated with.
Helper class to help Components accept boundary condition parameters that the Physics may use to gene...
static InputParameters validParams()
virtual void checkIntegrity() override
Used for various checks notably:
Helper class to help Components define the initial conditions the Physics may need from the parameter...
static InputParameters validParams()
virtual void checkIntegrity() override
Used for various checks notably:
Helper class to help Components define the material properties the Physics may need from the paramete...
static InputParameters validParams()
Helper class to help creating an entire physics Note: Trying out virtual inheritance.
static InputParameters validParams()
Component whose mesh is generated in the [Mesh] block on which one can define a Physics.
virtual void setupComponent() override
const MooseEnum _mesh_generator_type
Whether the component uses a saved mesh or the final mesh.
virtual void addMeshGenerators() override
static InputParameters validParams()
Class constructor.
MeshGeneratorComponent(const InputParameters ¶ms)
void checkIntegrity() override
Used for various checks notably:
std::unique_ptr< libMesh::MeshBase > getSavedMesh(const std::string &name)
Get the saved mesh by name.
MeshGeneratorSystem & getMeshGeneratorSystem()
Gets the system that manages the MeshGenerators.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...