21 "builder",
"SBMSurfaceMeshBuilder that provides KDTree, elem_id_map, and boundary elements.");
24 "Returns unsigned distance to a surface mesh using KDTree nearest neighbor search. "
25 "The gradient returns the unit vector pointing from boundary to query point.");
37 const auto builder = &getUserObject<SBMSurfaceMeshBuilder>(
"builder");
39 if (!builder->hasKDTree())
42 "' requires SBMSurfaceMeshBuilder '",
44 "' to be configured with 'build_kd_tree = true'.");
54 std::vector<std::size_t> ret_index(1);
77 const Real dist = dv.norm();
80 return RealGradient(0, 0, 0);
93 RealVectorValue n = elem.
normal();
94 const Real n_norm = n.norm();
registerMooseObject("ShiftedBoundaryMethodApp", UnsignedDistanceToSurfaceMesh)
static InputParameters validParams()
void neighborSearch(const Point &query_point, unsigned int patch_size, std::vector< std::size_t > &return_index)
const std::string & name() const
void mooseError(Args &&... args) const
Base class for SBM boundary elements.
virtual Point distanceFrom(const Point &pt) const
Compute the distance vector from an arbitrary point to this boundary element.
const Point & normal() const
Getter for the normal vector.
Computes the unsigned distance to a surface mesh using KDTree nearest neighbor lookup from SBMSurface...
KDTree * _kd_tree
Cached pointers for speed.
RealVectorValue surfaceNormal(const Point &p) const
Return the true boundary surface normal evaluated at the closest point obtained by projecting the que...
const std::vector< std::unique_ptr< SBMBndElementBase > > * _boundary_elements
virtual void initialSetup() override
static InputParameters validParams()
const SBMBndElementBase & closestBoundaryElem(const Point &p) const
find closest boundary element using KDTree
Real value(Real t, const Point &p) const override
Return unsigned distance value.
RealGradient gradient(Real t, const Point &p) const override
Return the spatial gradient of the unsigned distance function.
RealVectorValue distanceVectorToSurface(const Point &p) const
find closest boundary element and return its distance vector
UnsignedDistanceToSurfaceMesh(const InputParameters ¶meters)
static constexpr Real TOLERANCE