13 #include "libmesh/mesh_modification.h" 23 params.
addRequiredParam<MeshGeneratorName>(
"input",
"The mesh we want to modify");
26 "Any point on the plane/line over which the reflection operation will be done");
28 "mirror_normal_vector",
29 "A vector normal to (perpendicular/orthogonal to) the plane/line over which the " 30 "reflection operation will be done");
37 _input(getMesh(
"input")),
39 _mirror_normal_vector(getParam<
RealEigenVector>(
"mirror_normal_vector"))
44 "mirror_point should be a 3d vector, but only ",
46 "components were specified.");
50 " mirror_normal_vector should be a 3d vector, but only ",
52 "components were specified.");
57 mooseInfo(
"Input normal plane vector was not normalized, normalization was performed");
61 std::unique_ptr<MeshBase>
64 std::unique_ptr<MeshBase>
mesh = std::move(
_input);
74 mirror_transformation << (1 - 2 * a * a), (-2 * a * b), (-2 * a * c), (-2 * a * d), (-2 * a * b),
75 (1 - 2 * b * b), (-2 * b * c), (-2 * b * d), (-2 * a * c), (-2 * b * c), (1 - 2 * c * c),
76 (-2 * c * d), (0), (0), (0), (1);
78 for (
auto & node :
mesh->node_ptr_range())
81 location_vec << (*node)(0), (*node)(1), (*node)(2), 1;
82 location_vec = mirror_transformation * location_vec;
84 (*node)(0) = location_vec(0);
85 (*node)(1) = location_vec(1);
86 (*node)(2) = location_vec(2);
90 MeshTools::Modification::orient_elements(*
mesh);
void mooseInfo(Args &&... args) const
bool absoluteFuzzyEqual(const T &var1, const T2 &var2, const T3 &tol=libMesh::TOLERANCE *libMesh::TOLERANCE)
Function to check whether two variables are equal within an absolute tolerance.
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 ...
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealEigenMatrix
static InputParameters validParams()
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
MeshGenerators are objects that can modify or add to an existing mesh.