23 "ShortestDistanceToSurface user object to query.");
25 MooseEnum methods(
"true_normal distance_by_index true_normal_by_index " 26 "distance_by_func true_normal_by_func");
28 "method", methods,
"Which ShortestDistanceToSurface accessor to call.");
30 MooseEnum components(
"x y z norm",
"norm");
32 "component", components,
"Vector component returned by computeValue (default: norm).");
34 params.
addParam<
unsigned int>(
"index", 0,
"Surface index used for the *ByIndex variants.");
36 params.
addParam<FunctionName>(
"function",
"Function used for the *ByFunc variants.");
40 "Optional fixed query point. If supplied, the accessor is evaluated at this " 41 "point instead of the current element's centroid (useful for hitting " 42 "zero-distance branches at a surface-mesh node).");
46 "Optional SBMSurfaceMeshBuilder; when supplied, initialSetup queries " 47 "getCentroids() so coverage tests can touch that otherwise-unused getter.");
49 params.
addClassDescription(
"Test-only AuxKernel that exposes ShortestDistanceToSurface accessors " 50 "(trueNormal, *ByIndex, *ByFunc) for coverage testing.");
61 _component(getParam<
MooseEnum>(
"component")),
62 _index(getParam<unsigned
int>(
"index")),
63 _function(isParamValid(
"function") ? &getFunction(
"function") : nullptr),
64 _use_at_point(isParamValid(
"at_point")),
65 _at_point(_use_at_point ? getParam<Point>(
"at_point") : Point())
68 paramError(
"variable",
"This AuxKernel only supports Elemental fields");
70 const bool needs_function =
_method ==
"distance_by_func" ||
_method ==
"true_normal_by_func";
72 paramError(
"function",
"A 'function' parameter is required for the *_by_func methods.");
79 mooseError(
"ShortestDistanceToSurfaceTestAux: builder '",
81 "' returned no centroids.");
92 else if (
_method ==
"distance_by_index")
94 else if (
_method ==
"true_normal_by_index")
96 else if (
_method ==
"distance_by_func")
RealVectorValue trueNormalByFunc(const Point &pt, Real t, const Function *func) const
Compute true normal using a specific distance function.
ShortestDistanceToSurfaceTestAux(const InputParameters ¶meters)
void paramError(const std::string ¶m, Args... args) const
registerMooseObject("ShiftedBoundaryMethodTestApp", ShortestDistanceToSurfaceTestAux)
virtual Real computeValue() override
Test-only AuxKernel that exposes the rarely-called ShortestDistanceToSurface accessors (trueNormal...
const std::string & name() const
const MooseEnum _component
const ShortestDistanceToSurface & _distance_to_surface
const std::vector< Point > & getCentroids() const
Get the centroids of the boundary elements.
User object that computes the shortest distance to one or more surfaces defined by function- and/or m...
RealVectorValue distanceVectorByIndex(unsigned int idx, const Point &pt) const
A distance vector from a point pt to a specific surface specified by index idx in the 'surfaces' para...
const SBMSurfaceMeshBuilder *const _builder
RealVectorValue trueNormal(const Point &pt) const
Return the true normal vector at the closest point on the boundaries.
RealVectorValue distanceVectorByFunc(const Point &pt, Real t, const Function *func) const
Compute distance vector using a specific distance function.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
RealVectorValue trueNormalByIndex(unsigned int idx, const Point &pt) const
A true normal vector at the projected point of pt onto a specific surface specified by index idx in t...
virtual void initialSetup() override
If a 'builder' was supplied, calls SBMSurfaceMeshBuilder::getCentroids() once and verifies it is non-...
void mooseError(Args &&... args) const
const Elem *const & _current_elem
static InputParameters validParams()
const bool _use_at_point
If set, queries are evaluated at this fixed point instead of the current element centroid.
const unsigned int _index
const Function *const _function
void ErrorVector unsigned int
static InputParameters validParams()