https://mooseframework.inl.gov
Loading...
Searching...
No Matches
MeshTraversingUtils.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 "libmesh/elem.h"
13#include "libmesh/point.h"
14
16{
22inline bool
23elementSubdomainIdInList(const Elem * const elem,
24 const std::vector<subdomain_id_type> & subdomain_id_list)
25{
26 return std::find(subdomain_id_list.begin(), subdomain_id_list.end(), elem->subdomain_id()) !=
27 subdomain_id_list.end();
28}
29
37inline bool
38normalsWithinTol(const Point & normal_1, const Point & normal_2, const Real tol)
39{
40 return (1.0 - normal_1 * normal_2) <= tol;
41}
42}
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.
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.