EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Attributes | List of all members
EBGeometry::Subdomains Class Reference

The subdomains of a domain (see Domain), read on the host or a device: the subdomain of each region of its tape, and what a surface is to them. More...

#include <EBGeometry_Subdomains.hpp>

Inheritance diagram for EBGeometry::Subdomains:
Inheritance graph
[legend]
Collaboration diagram for EBGeometry::Subdomains:
Collaboration graph
[legend]

Classes

struct  Layout
 The arrays, as offsets: what a Domain stores. More...
 

Public Member Functions

 Subdomains () noexcept=default
 No subdomains: every region is in none.
 
 Subdomains (Pool &a_pool, const std::vector< uint32_t > &a_subdomainOf, const uint32_t a_numSubdomains)
 Build the table in a pool.
 
 Subdomains (const Layout &a_layout, const PoolLocation &a_location) noexcept
 Rebuild a view from a stored layout and the location of the pool that holds it (as a Domain does).
 
const Layout & layout () const noexcept
 The arrays, as offsets.
 
uint32_t getNumSubdomains () const noexcept
 How many subdomains there are.
 
uint32_t getNumRegions () const noexcept
 How many regions the table has a row for: the tape's.
 
uint32_t subdomainOf (const uint32_t a_region) const noexcept
 The subdomain a region is in.
 
template<class T >
SurfaceRole role (const SurfaceRef< T > &a_surface) const noexcept
 What a surface is to the subdomains at a point: from the regions on its two sides there, as a tape's region queries report them (Tape::closestSurface(p, region)).
 
Subdomains rebasedView (const Pool &a_pool) const noexcept
 A view resolving against another pool of the table's mirror chain (see PoolHandle).
 
- Public Member Functions inherited from EBGeometry::PoolHandle
PoolLocation location () const noexcept
 Where this handle's arrays live.
 
bool isAttachedTo (const Pool &a_pool) const noexcept
 Check whether this handle's arrays were reserved from a_pool.
 

Static Public Attributes

static constexpr uint32_t None = 0xFFFFFFFFU
 No subdomain, or a region in no subdomain.
 

Additional Inherited Members

- Protected Member Functions inherited from EBGeometry::PoolHandle
 PoolHandle () noexcept=default
 An unset location; the first reservation attaches it.
 
 PoolHandle (const PoolLocation &a_location) noexcept
 Adopt a location, as a handle rebuilt from a stored layout does.
 
 PoolHandle (const PoolHandle &) noexcept=default
 Copy a handle, as a derived handle's copy does.
 
 PoolHandle (PoolHandle &&) noexcept=default
 Move a handle; the same as a copy.
 
PoolHandle & operator= (const PoolHandle &) noexcept=default
 Copy-assign a handle, as a derived handle's assignment does.
 
PoolHandle & operator= (PoolHandle &&) noexcept=default
 Move-assign a handle; the same as a copy.
 
 ~PoolHandle () noexcept=default
 Destructor; protected, since a PoolHandle exists only as the base of a handle.
 
void * base () noexcept
 The base address this handle's offsets resolve against; see PoolLocation::base().
 
const void * base () const noexcept
 The base address this handle's offsets resolve against, for read-only access.
 
void attach (const Pool &a_pool, const char *a_who, const bool a_deviceWritten=false) noexcept
 Follow a_pool, as the first reservation does; see PoolLocation::attach().
 
PoolLocation rebasedLocation (const Pool &a_pool, uint64_t a_endByte, const char *a_who) const noexcept
 The location of this handle's arrays in another pool of its mirror chain; see PoolLocation::rebasedOnto().
 
void setLocation (const PoolLocation &a_location) noexcept
 Replace the location, for a view or a copy made by a derived handle.
 

Detailed Description

The subdomains of a domain (see Domain), read on the host or a device: the subdomain of each region of its tape, and what a surface is to them.

A view of a table in a pool, a row per region of the tape: trivially copyable, a pool handle (see PoolHandle), what Tape::signedDistance(p, subdomains, subdomain) and Tape::closestSurface(p, subdomains, subdomain) take. A Domain builds it from a DomainSetup and returns it (Domain::subdomains()); the pool must outlive it. A default-constructed one has no subdomains: every region is in none.

A table rather than ranges of regions: on a device, finding a region's subdomain is one load whatever the number of subdomains, where scanning ranges in the pool grew with them and scanning them in a kernel's parameters capped them.

Constructor & Destructor Documentation

◆ Subdomains() [1/2]

EBGeometry::Subdomains::Subdomains ( Pool &  a_pool,
const std::vector< uint32_t > &  a_subdomainOf,
const uint32_t  a_numSubdomains 
)
inline

Build the table in a pool.

Aborts with a message, in every build, for a subdomain number not below a_numSubdomains.

Parameters
[in,out]a_poolPool to reserve the table from (not frozen).
[in]a_subdomainOfThe subdomain of each region of the tape, or None.
[in]a_numSubdomainsHow many subdomains there are.

◆ Subdomains() [2/2]

EBGeometry::Subdomains::Subdomains ( const Layout &  a_layout,
const PoolLocation &  a_location 
)
inlinenoexcept

Rebuild a view from a stored layout and the location of the pool that holds it (as a Domain does).

Parameters
[in]a_layoutThe arrays.
[in]a_locationWhere they live.

Member Function Documentation

◆ getNumRegions()

uint32_t EBGeometry::Subdomains::getNumRegions ( ) const
inlinenoexcept

How many regions the table has a row for: the tape's.

Returns
The count.

◆ getNumSubdomains()

uint32_t EBGeometry::Subdomains::getNumSubdomains ( ) const
inlinenoexcept

How many subdomains there are.

Returns
The count.

◆ layout()

const Layout & EBGeometry::Subdomains::layout ( ) const
inlinenoexcept

The arrays, as offsets.

Returns
The layout.

◆ rebasedView()

Subdomains EBGeometry::Subdomains::rebasedView ( const Pool &  a_pool) const
inlinenoexcept

A view resolving against another pool of the table's mirror chain (see PoolHandle).

Parameters
[in]a_poolThe pool, or a mirror of it.
Returns
The view.

◆ role()

template<class T >
SurfaceRole EBGeometry::Subdomains::role ( const SurfaceRef< T > &  a_surface) const
inlinenoexcept

What a surface is to the subdomains at a point: from the regions on its two sides there, as a tape's region queries report them (Tape::closestSurface(p, region)).

Template Parameters
TFloating-point precision.
Parameters
[in]a_surfaceThe surface, with its sides.
Returns
Its role; None when the sides are not set.

◆ subdomainOf()

uint32_t EBGeometry::Subdomains::subdomainOf ( const uint32_t  a_region) const
inlinenoexcept

The subdomain a region is in.

Parameters
[in]a_regionA region of the tape; a region past its last is in none.
Returns
The subdomain, or None.

The documentation for this class was generated from the following file: