12#include "libmesh/type_vector.h"
13#include "libmesh/point.h"
14#include "libmesh/elem.h"
24 "Removes elements lying 'above' the plane (in the direction of the normal).");
27 params.
addRequiredParam<RealVectorValue>(
"normal",
"The normal that defines the plane");
34 _point(getParam<Point>(
"point")),
35 _normal(getParam<RealVectorValue>(
"normal"))
38 paramError(
"normal",
"Normal vector must have a size!");
47 auto centroid = elem->vertex_average();
49 auto vec_from_plane_point = centroid -
_point;
51 auto norm = vec_from_plane_point.norm();
58 vec_from_plane_point /= norm;
60 return vec_from_plane_point *
_normal > 0;
registerMooseObject("MooseApp", PlaneDeletionGenerator)
This class deletes elements from the mesh data structure after it has been generated or read but befo...
static InputParameters validParams()
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 ...
Deletes elements lying above a plane.
RealVectorValue _normal
Normal vector.
virtual bool shouldDelete(const Elem *elem) override
Method that returns a Boolean indicating whether an element should be removed from the mesh.
const Point & _point
Point defining the plane.
PlaneDeletionGenerator(const InputParameters ¶meters)
static InputParameters validParams()