23 params.
addClassDescription(
"Marks elements as inside, outside, or intercepted based on a given "
24 "distance function or geometry.");
27 "signed_dist_function",
28 "Signed distance function to evaluate. Exactly one of 'signed_dist_function' and "
29 "'in_out_test' must be provided; providing neither or both is invalid.");
34 params.
addParam<Real>(
"threshold", 0,
"Threshold for inside/outside classification.");
36 "is_domain_inside_surface",
37 "When true, the retained (inside) domain is the region enclosed by the surface (signed "
38 "distance below 'threshold', or points reported inside by the in-out test); when false, the "
39 "retained domain is the region outside the surface.");
43 "The name of the in-out test user object. Exactly one of 'in_out_test' and "
44 "'signed_dist_function' must be provided; providing neither or both is invalid.");
51 _parsed_function(isParamSetByUser(
"signed_dist_function")
52 ? &getFunctionByName(parameters.get<FunctionName>(
"signed_dist_function"))
54 _subdomain_id_inside(getParam<
SubdomainID>(
"subdomain_id_inside")),
55 _subdomain_id_outside(getParam<
SubdomainID>(
"subdomain_id_outside")),
56 _threshold(getParam<Real>(
"threshold")),
57 _is_domain_inside_surface(getParam<bool>(
"is_domain_inside_surface")),
58 _in_out_test_base(nullptr)
62 _depend_uo.insert(getParam<UserObjectName>(
"in_out_test"));
76 ") does not implement the point-in-surface check interface.");
94 mooseError(
"InterceptedElementModifier: provide exactly one geometry source, but both "
95 "'signed_dist_function' and 'in_out_test' were set.");
102 mooseError(
"InterceptedElementModifier: provide exactly one geometry source, but neither "
103 "'signed_dist_function' nor 'in_out_test' was set.");
111 mooseError(
"InterceptedElementModifier: _current_elem is null!");
113 const auto classify_from_occupancy =
126 const auto is_in_domain = [
this](
const Point & point)
132 const auto is_outside_domain = [
this](
const Point & point)
139 return classify_from_occupancy(
145 const auto is_in_domain = [
this](
const Point & point)
151 return classify_from_occupancy(
156 mooseError(
"InterceptedElementModifier: DistanceType::NONE is invalid in "
157 "computeSubdomainID().");
160 mooseError(
"InterceptedElementModifier: unhandled DistanceType in computeSubdomainID().");
subdomain_id_type SubdomainID
registerMooseObject("ShiftedBoundaryMethodApp", InterceptedElementModifier)
void initialSetup() override
const Elem *const & _current_elem
virtual Real value(Real t, const Point &p) const
Modifies element subdomains dynamically based on an analytical signed distance function or a point-in...
DistanceType _in_out_test_type
How to classify the element to be inside or outside.
static InputParameters validParams()
const PointInSurfaceCheckInterface * _in_out_test_base
user object for in-out test
virtual void initialSetup() override
Validate that exactly one geometry source (signed_dist_function or in_out_test) is set,...
SubdomainID _subdomain_id_outside
IDs for subdomain classification (outside)
const PointInSurfaceCheckInterface * getCheckedInOutTest()
Fetches the "in_out_test" user object and validates it implements the point-in-surface check interfac...
InterceptedElementModifier(const InputParameters ¶meters)
const Function * _parsed_function
Store the parsed function.
SubdomainID _subdomain_id_inside
IDs for subdomain classification (inside)
Real _threshold
Threshold value for classification.
virtual SubdomainID computeSubdomainID() override
bool _is_domain_inside_surface
When true, the retained (inside) domain is the region enclosed by the surface (signed distance below ...
const std::string & type() const
const std::string & name() const
void paramError(const std::string ¶m, Args... args) const
bool isParamSetByUser(const std::string &name) const
void mooseError(Args &&... args) const
bool contains(const libMesh::Point &p) const
const SBMUtils::InterceptedSubdomainPolicy _intercepted_subdomain_policy
Policy for assigning partial elements to a dedicated intercepted subdomain.
const Order _qrule_order
Quadrature order used to estimate the retained-domain fraction.
const Real _lambda
Threshold applied to the fraction outside the retained domain for a partial element.
Common partial-element classification parameters for shifted boundary element modifiers.
static InputParameters validParams()
std::set< std::string > _depend_uo
const UserObjectBase & getUserObjectBase(const std::string ¶m_name, bool is_dependency=true) const
ElementDomainOccupancy elementDomainOccupancy(const Elem &elem, Order qrule_order, const std::function< bool(const libMesh::Point &)> &is_in_domain)
Test an element against the domain defined by is_in_domain.
SubdomainID classifySubdomainFromOccupancy(const ElementDomainOccupancy &occupancy, const ClassificationSubdomains &subdomain_id_settings, bool mark_intercepted, Real lambda)
Classify an element from its retained-domain occupancy measurements.
The subdomain IDs a (possibly partial) element can be labeled with.
Results of testing an element against a domain.