https://mooseframework.inl.gov
Loading...
Searching...
No Matches
SBMUtils.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "MooseMesh.h"
13#include "MooseTypes.h"
14#include "libmesh/enum_order.h"
15
16#include <functional>
17
18class Function;
20class InputParameters;
21namespace libMesh
22{
23class Point;
24}
25
26namespace SBMUtils
27{
28bool checkWatertightnessFromRawElems(const std::vector<const Elem *> & bd_elements);
29
31Real activeElementFraction(const Elem & elem,
32 Order qrule_order,
33 const std::function<bool(const libMesh::Point &)> & is_active);
34
39bool isInactive(Real active_fraction, Real lambda);
40
55
63
71 const ClassificationSubdomains & subdomains,
72 bool mark_intercepted,
73 Real lambda);
74
76std::vector<const Function *>
77buildDistanceFunctions(const std::vector<FunctionName> & function_names,
78 const FunctionInterface & function_provider);
79
84RealVectorValue
85distanceVectorFromFunction(const Function * func, const libMesh::Point & pt, Real t);
86
88RealVectorValue trueNormalFromFunction(const Function * func, const libMesh::Point & pt, Real t);
89
91RealVectorValue closestDistanceVector(const std::vector<const Function *> & funcs,
92 const libMesh::Point & pt,
93 Real t);
94
96RealVectorValue closestTrueNormalVector(const std::vector<const Function *> & funcs,
97 const libMesh::Point & pt,
98 Real t);
99
103Real unionSignedDistance(const std::vector<const Function *> & funcs, Real t, const Point & p);
104}
subdomain_id_type SubdomainID
const Real p
Real activeElementFraction(const Elem &elem, Order qrule_order, const std::function< bool(const libMesh::Point &)> &is_active)
Compute the fraction of an element's quadrature-weighted measure satisfying a predicate.
Definition SBMUtils.C:26
Real unionSignedDistance(const std::vector< const Function * > &funcs, Real t, const Point &p)
Computes the union signed distance by taking the minimum of all signed distance functions.
Definition SBMUtils.C:207
RealVectorValue closestTrueNormalVector(const std::vector< const Function * > &funcs, const libMesh::Point &pt, Real t)
Scan all distance functions and return the corresponding normal vector.
Definition SBMUtils.C:185
bool checkWatertightnessFromRawElems(const std::vector< const Elem * > &bd_elements)
Definition SBMUtils.C:84
bool isInactive(Real active_fraction, Real lambda)
Return whether a partial element is inactive, i.e.
Definition SBMUtils.C:51
SubdomainID classifyPartialElement(const ElementActivity &activity, const ClassificationSubdomains &subdomains, bool mark_intercepted, Real lambda)
Classify a (possibly partial) element into an inside/outside/intercepted subdomain.
Definition SBMUtils.C:62
std::vector< const Function * > buildDistanceFunctions(const std::vector< FunctionName > &function_names, const FunctionInterface &function_provider)
Build a list of distance functions based on names specified in input.
Definition SBMUtils.C:95
RealVectorValue distanceVectorFromFunction(const Function *func, const libMesh::Point &pt, Real t)
Compute the distance vector induced by a distance function.
Definition SBMUtils.C:120
RealVectorValue trueNormalFromFunction(const Function *func, const libMesh::Point &pt, Real t)
Compute the true boundary surface normal at the point on the boundary closest to pt.
Definition SBMUtils.C:140
RealVectorValue closestDistanceVector(const std::vector< const Function * > &funcs, const libMesh::Point &pt, Real t)
Scan all distance functions and return the closest distance vector.
Definition SBMUtils.C:163
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
The subdomain IDs a (possibly partial) element can be labeled with.
Definition SBMUtils.h:58
Measured activity state of a (possibly partial) element, used to classify it.
Definition SBMUtils.h:47
bool all_nodes_active
Whether all of the element's nodes are on the active (retained) side.
Definition SBMUtils.h:49
bool all_nodes_inactive
Whether all of the element's nodes are on the inactive (removed) side.
Definition SBMUtils.h:51
Real active_fraction
Fraction of the element's quadrature-weighted measure that is active, in [0, 1].
Definition SBMUtils.h:53