15 : _elem(elem), _normal(normal)
17 mooseAssert(
elem,
"Element must not be null");
19 if (!MooseUtils::absoluteFuzzyEqual(
_normal.norm(), 1))
20 mooseError(
"SurfaceElement: normal vector must be unit length, length = ",
_normal.norm());
26 const BoundingBox bbox =
_elem->loose_bounding_box();
27 const Point d = bbox.second - bbox.first;
35 Real max_projected = 0.0;
36 for (
const Real sy : {1.0, -1.0})
37 for (
const Real sz : {1.0, -1.0})
39 const Point diag(d(0), sy * d(1), sz * d(2));
40 const Point tangent_vec = diag - normal_dir * (diag * normal_dir);
41 max_projected = std::max(max_projected, tangent_vec.norm());
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
SurfaceElement(const Elem *elem, const Point &normal)
Constructor takes a pointer to a surface element and its precomputed unit normal.
Real getProjectedBoundingBoxDiagonal(const Point &normal_dir) const
Compute the length of the element bounding-box diagonal projected onto a plane orthogonal to a given ...
const Elem * _elem
Pointer to the libMesh element representing this surface face.
const Elem & elem() const
Getter for the underlying element.
const Point _normal
Unit normal vector of the surface element.