36 "Dimension of the cylinder. 0 for a point (not implemented), "
37 "1 for an (axial) 1D line, 2 for a 2D-RZ cylinder, and 3 for "
39 params.
addParam<SubdomainName>(
"block",
"Block name for the cylinder");
44 params.
addParam<
bool>(
"position_is_bottom_center",
46 "Whether the 'position' parameter gives the position of the bottom-center "
47 "of the cylinder. Only used in 3D");
54 "Number of radial elements (per ring if multiple values specified). All rings are lumped at "
58 "n_axial",
"n_axial>0",
"Number of axial elements of the cylinder");
62 "Number of azimuthal sectors in each quadrant of cylinder face. Only used in 3D");
67 "boundary_layer_width>=0",
68 "The width of the radial boundary layer (if assigned).");
72 "The number of radial boundary layers. Only active if boundary_layer_width is specified");
85 _radius(getParam<Real>(
"radius")),
86 _height(getParam<Real>(
"length")),
87 _offset_position_to_center(getParam<bool>(
"position_is_bottom_center"))
99 paramError(
"dimension",
"0D cylinder not implemented");
104 params.
set<Real>(
"xmax") = {getParam<Real>(
"length")};
105 params.
set<
unsigned int>(
"nx") = {getParam<unsigned int>(
"n_axial")};
106 params.
set<std::string>(
"boundary_name_prefix") =
name();
109 params.
set<Real>(
"ymax") = {getParam<Real>(
"radius")};
110 params.
set<Real>(
"ymin") = 0;
112 paramError(
"n_radial",
"Should be provided for a 2D cylinder");
113 params.
set<
unsigned int>(
"ny") =
getParam<std::vector<unsigned int>>(
"n_radial")[0];
116 paramError(
"n_radial",
"Should not be provided for a 1D cylinder");
119 const auto block_name = getParam<SubdomainName>(
"block");
120 params.
set<SubdomainName>(
"subdomain_name") = block_name;
124 "GeneratedMeshGenerator",
name() +
"_base", params);
130 paramError(
"n_axial",
"Should be provided for a 3D cylinder");
132 paramError(
"n_sectors",
"Should be provided in 3D");
136 circle_params.
set<
bool>(
"preserve_volumes") =
true;
137 circle_params.
set<
bool>(
"has_outer_square") =
false;
138 auto ring_disc_vec = getParam<std::vector<unsigned int>>(
"n_radial");
140 ring_disc_vec = {std::accumulate(ring_disc_vec.begin(), ring_disc_vec.end(), (
unsigned int)0)};
143 Real inner_radius = getParam<Real>(
"radius") - getParam<Real>(
"boundary_layer_width");
144 circle_params.
set<std::vector<Real>>(
"radii") = {inner_radius, getParam<Real>(
"radius")};
145 ring_disc_vec.push_back(getParam<unsigned int>(
"n_boundary_layers"));
148 circle_params.
set<std::vector<Real>>(
"radii") = {getParam<Real>(
"radius")};
149 circle_params.
set<std::vector<unsigned int>>(
"rings") = ring_disc_vec;
151 circle_params.
set<
unsigned int>(
"num_sectors") = getParam<unsigned int>(
"n_sectors");
154 const auto block_name = getParam<SubdomainName>(
"block");
155 circle_params.
set<SubdomainName>(
"subdomain_name") = block_name;
159 "ConcentricCircleMeshGenerator",
name() +
"_circle_base", circle_params);
165 rotate_params.
set<MeshGeneratorName>(
"input") =
_mg_names.back();
166 rotate_params.
set<
MooseEnum>(
"transform") =
"ROTATE_EXT";
167 RealVectorValue angles(-90, -90, 90);
168 rotate_params.
set<RealVectorValue>(
"vector_value") = angles;
170 "TransformGenerator",
name() +
"_3D_init_rotate", rotate_params);
175 ext_params.
set<std::vector<unsigned int>>(
"num_layers") = {getParam<unsigned int>(
"n_axial")};
176 ext_params.
set<MeshGeneratorName>(
"input") =
_mg_names.back();
177 ext_params.
set<std::vector<Real>>(
"heights") = {
_height};
178 ext_params.
set<BoundaryName>(
"bottom_boundary") =
name() +
"_bottom_boundary";
179 ext_params.
set<BoundaryName>(
"top_boundary") =
name() +
"_top_boundary";
181 const Point default_direction(1, 0, 0);
182 ext_params.
set<Point>(
"direction") = default_direction;
184 "AdvancedExtruderGenerator",
name() +
"_base", ext_params);
200 {getParam<SubdomainName>(
"block")},
203 paramError(
"rotation",
"Rotation + 2D RZ cylinder not implemented");
226 "Rotation + offset cylinder to center not implemented. Use 'direction' instead");
228 const auto rotation_matrix =
230 ? RotationMatrix::rodriguesRotationMatrix<false>(RealVectorValue(1, 0, 0), *
_direction)
231 : RealTensorValue(1, 0, 0, 0, 1, 0, 0, 0, 1);
232 input_translation -= rotation_matrix * Point(
_radius, 0, 0);
234 return input_translation;
registerActionComponent("MooseApp", CylinderComponent)
registerMooseAction("MooseApp", CylinderComponent, "add_mesh_generator")
Base class for components that are defined using an action.
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.
MeshGeneratorName _top_mg_name
Name of the top-most mesh generator in the hierarchy of MGs on top of the ones generating this compon...
static InputParameters validParams()
unsigned int _dimension
Maximum dimension of the component.
const std::shared_ptr< MooseMesh > & getMesh() const
MooseApp & _app
The MOOSE application this is associated with.
ActionWarehouse & _awh
Reference to ActionWarehouse where we store object build by actions.
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()
Cylinder on which one can define a Physics.
const Real _radius
Radius of the cylinder.
const Real _height
Height of the cylinder.
virtual Point translation() const override
Return the translation of the component The default translation is the null vector.
virtual void setupComponent() override
virtual void checkIntegrity() override
Used for various checks notably:
static InputParameters validParams()
const bool _offset_position_to_center
Whether to center the cylinder.
virtual void addMeshGenerators() override
CylinderComponent(const InputParameters ¶ms)
InputParameters getValidParams(const std::string &name) const
Get valid parameters for the object.
void addMeshGenerator(const std::string &type, const std::string &name, const InputParameters ¶ms)
Add a mesh generator that will act on the meshes in the system.
MeshGeneratorSystem & getMeshGeneratorSystem()
Gets the system that manages the MeshGenerators.
const std::string & name() const
Get the name of the class.
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 isParamSetByUser(const std::string &name) const
Test if the supplied parameter is set by a user, as opposed to not set or set to default.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
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...
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
Factory & _factory
The Factory associated with the MooseApp.