https://mooseframework.inl.gov
Functions
MeshTraversingUtils Namespace Reference

Functions

bool elementSubdomainIdInList (const Elem *const elem, const std::vector< subdomain_id_type > &subdomain_id_list)
 Determines whether the given element's subdomain id is in the given subdomain_id_list. More...
 
bool normalsWithinTol (const Point &normal_1, const Point &normal_2, const Real tol)
 Determines whether two normal vectors are within normal_tol of each other. More...
 

Function Documentation

◆ elementSubdomainIdInList()

bool MeshTraversingUtils::elementSubdomainIdInList ( const Elem *const  elem,
const std::vector< subdomain_id_type > &  subdomain_id_list 
)
inline

Determines whether the given element's subdomain id is in the given subdomain_id_list.

Parameters
elempointer to the element to consider
subdomain_id_listvector of subdomains to consider

Definition at line 23 of file MeshTraversingUtils.h.

Referenced by SurfaceMeshGeneratorBase::elementSatisfiesRequirements(), SideSetsGeneratorBase::elemSideSatisfiesRequirements(), SurfaceMeshGeneratorBase::flood(), SideSetsGeneratorBase::flood(), SideSetsBetweenSubdomainsGenerator::generate(), ParsedGenerateSideset::generate(), and SideSetsAroundSubdomainGenerator::generate().

25 {
26  return std::find(subdomain_id_list.begin(), subdomain_id_list.end(), elem->subdomain_id()) !=
27  subdomain_id_list.end();
28 }
KOKKOS_INLINE_FUNCTION const T * find(const T &target, const T *const begin, const T *const end)
Find a value in an array.
Definition: KokkosUtils.h:40

◆ normalsWithinTol()

bool MeshTraversingUtils::normalsWithinTol ( const Point &  normal_1,
const Point &  normal_2,
const Real  tol 
)
inline

Determines whether two normal vectors are within normal_tol of each other.

Parameters
normal_1The first normal vector to compare to normal_2.
normal_2The second normal vector to compare to normal_1.
tolThe comparison tolerance.
Returns
A bool indicating whether 1 - dot(normal_1, normal_2) <= tol.

Definition at line 38 of file MeshTraversingUtils.h.

Referenced by SurfaceMeshGeneratorBase::elementSatisfiesRequirements(), SideSetsGeneratorBase::elemSideSatisfiesRequirements(), SideSetsFromNormalsGenerator::generate(), SideSetsFromPointsGenerator::generate(), and SideSetsFromAllNormalsGenerator::generate().

39 {
40  return (1.0 - normal_1 * normal_2) <= tol;
41 }