13 #include "libmesh/elem.h" 23 MooseEnum location(
"INSIDE OUTSIDE",
"INSIDE");
25 params.
addRequiredParam<MeshGeneratorName>(
"input",
"The mesh we want to modify");
27 "block_id",
"Subdomain id to set for inside/outside the bounding box");
29 "location", location,
"Control of where the subdomain id is to be set");
31 "Defines a subdomain inside or outside of a bounding box with arbitrary orientation.");
40 _input(getMesh(
"input")),
46 std::unique_ptr<MeshBase>
49 std::unique_ptr<MeshBase>
mesh = std::move(
_input);
52 for (
const auto & elem :
mesh->active_element_ptr_range())
57 else if (!contains &&
_location ==
"OUTSIDE")
61 mesh->set_isnt_prepared();
bool containsPoint(const Point &point)
Test if the supplied point is within the defined oriented bounding box.
static InputParameters validParams()
Class constructor.
std::unique_ptr< MeshBase > & _input
T * get(const std::unique_ptr< T > &u)
The MooseUtils::get() specializations are used to support making forwards-compatible code changes fro...
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.
MeshGenerator for defining a Subdomain inside or outside of a bounding box with arbitrary orientation...
registerMooseObject("MooseApp", OrientedSubdomainBoundingBoxGenerator)
std::unique_ptr< MeshBase > generate() override
Generate / modify the mesh.
static InputParameters validParams()
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
static InputParameters validParams()
const subdomain_id_type _block_id
Block ID to assign to the region.
OrientedSubdomainBoundingBoxGenerator(const InputParameters ¶meters)
MeshGenerators are objects that can modify or add to an existing mesh.
const MooseEnum _location
ID location (inside or outside of the bounding box)