11#ifndef EBGEOMETRY_CONNECTEDCOMPONENTS_HPP
12#define EBGEOMETRY_CONNECTEDCOMPONENTS_HPP
29class ConnectedComponents;
31namespace ComponentsDetail {
47label(
const std::shared_ptr<
const Cells<T>>& a_cells,
const std::vector<uint32_t>& a_groupOf, uint32_t a_numGroups);
143 static constexpr uint32_t
None = 0xFFFFFFFFU;
176 std::vector<uint32_t>
186 const std::vector<uint32_t>&
212 const BoundingVolumes::AABBT<T>&
232 ComponentsDetail::label(const std::shared_ptr<const ComponentsDetail::Cells<U>>& a_cells,
233 const std::vector<uint32_t>& a_groupOf,
234 uint32_t a_numGroups);
239 std::shared_ptr<const ComponentsDetail::Cells<T>> m_cells;
244 std::vector<uint32_t> m_componentOfCell;
254 std::vector<std::vector<uint32_t>> m_neighbors;
259 std::vector<uint32_t> m_firstOfGroup;
280template <class T, class... UserPrimitives>
297template <class T, class... UserPrimitives>
301 const std::vector<uint32_t>& a_groupOf,
315template <class T, class... UserPrimitives>
322#include "EBGeometry_ConnectedComponentsImplem.hpp"
Declarations of bounding volume types used in bounding volume hierarchies.
ConnectedComponents< T > label(const std::shared_ptr< const Cells< T > > &a_cells, const std::vector< uint32_t > &a_groupOf, uint32_t a_numGroups)
The components of a search's cells for a grouping of the regions.
Domain: the regions a downstream code computes in and its groups of surfaces, over a tape.
#define EBGEOMETRY_HOST
Mark a function as callable from host code only (no-op on host compilers).
Definition EBGeometry_GPU.hpp:83
Utility macros for EBGeometry.
Declaration of Tape, a composed object (an Expr) compiled into a pool, and its evaluator.
Declaration of 2D and 3D point/vector classes with templated precision, and free functions on them.
Axis-aligned bounding box (AABB) enclosing a set of 3D points.
Definition EBGeometry_BoundingVolumes.hpp:37
The connected components of the regions of a tape, or of groups of them (see connectedComponents()): ...
Definition EBGeometry_ConnectedComponents.hpp:138
uint32_t getNumGroups() const noexcept
How many groups there are: the regions of the tape, or the groups given (one more than the largest).
uint32_t getNumComponents() const noexcept
How many components there are.
static constexpr uint32_t None
What componentAt() gives for a point outside the box searched.
Definition EBGeometry_ConnectedComponents.hpp:143
uint64_t getNumCells() const noexcept
How many cells the search kept (its cost: one evaluation of every region's function per cell,...
std::vector< uint32_t > componentsOf(uint32_t a_group) const
The components of a group, those reaching the box first, then by decreasing volume.
const ConnectedComponent< T > & component(uint32_t a_component) const
A component.
uint32_t componentAt(const Vec3T< T > &a_point) const noexcept
The component holding a point: that of the search's cell holding it. Within h of a surface,...
T resolution() const noexcept
The resolution searched with (ComponentOptions::m_resolution).
const BoundingVolumes::AABBT< T > & box() const noexcept
The box searched, grown to a whole number of cells.
const std::vector< uint32_t > & neighbors(uint32_t a_component) const
The components that touch a component (they share a face of the search's cells), in increasing order:...
A computational domain over a tape, for a downstream code (a solver EBGeometry does not provide): the...
Definition EBGeometry_Domain.hpp:63
A composed object compiled into a pool: a trivially copyable handle that evaluates the object's signe...
Definition EBGeometry_Tape.hpp:758
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:258
static constexpr Vec3T< T > zeros() noexcept
Return a vector with x = y = z = 0.
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
ConnectedComponents< T > connectedComponents(const Tape< T, UserPrimitives... > &a_tape, const ComponentOptions< T > &a_options)
The connected components of every region of a tape, the outside (region 0) included: its enclosed cav...
How connectedComponents() resolves the space it searches.
Definition EBGeometry_ConnectedComponents.hpp:57
T m_resolution
The resolution h, the size of the smallest cells (those near a surface), positive.
Definition EBGeometry_ConnectedComponents.hpp:64
BoundingVolumes::AABBT< T > m_box
The box searched: the space a solver computes in, say. Empty (the default): the tape's bounding box g...
Definition EBGeometry_ConnectedComponents.hpp:71
uint64_t m_maxCells
The most cells the search may keep, which bounds the memory it takes. A search that reaches it aborts...
Definition EBGeometry_ConnectedComponents.hpp:90
static constexpr uint64_t DefaultMaxCells
The default of m_maxCells.
Definition EBGeometry_ConnectedComponents.hpp:83
Definition EBGeometry_ConnectedComponents.hpp:34
One connected component: a connected part of space where every point is in one region (or one group o...
Definition EBGeometry_ConnectedComponents.hpp:100
bool m_reachesBox
Whether it reaches the boundary of the box searched. A component that does not is enclosed by others:...
Definition EBGeometry_ConnectedComponents.hpp:125
T m_volume
Its volume within the box searched, approximate: the error is of the order of its surface's area time...
Definition EBGeometry_ConnectedComponents.hpp:109
uint32_t m_group
What it is a component of: the region, or the group of regions (a material, a subdomain).
Definition EBGeometry_ConnectedComponents.hpp:104
Vec3T< T > m_seed
A point in it, as far from its surface as the search found one: what a solver asks for to name it.
Definition EBGeometry_ConnectedComponents.hpp:119
BoundingVolumes::AABBT< T > m_box
A box around it, approximate: within h of the smallest one.
Definition EBGeometry_ConnectedComponents.hpp:114