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

How a domain is made: its subdomains (the regions each computes in) and its surface groups (the selectors of each), as a plain value on the host, to build, copy, compare and edit. More...

#include <EBGeometry_DomainSetup.hpp>

Public Member Functions

uint32_t addSubdomain (std::vector< uint32_t > a_regions)
 Add a subdomain.
 
uint32_t getNumSubdomains () const noexcept
 How many subdomains there are.
 
uint32_t subdomainOf (const uint32_t a_region) const noexcept
 The subdomain a region is in.
 
bool computesIn (const uint32_t a_region) const noexcept
 Whether the domain computes in a region.
 
bool touches (const uint32_t a_first, const uint32_t a_second) const noexcept
 Whether a surface between two regions is one the domain must give a condition: one side or both in its regions.
 
std::vector< uint32_t > getRegions (const uint32_t a_subdomain) const
 The regions of a subdomain.
 
uint32_t getRegionsNeeded () const noexcept
 One past the largest region in a subdomain: the fewest regions a tape must have for the setup.
 
template<class T >
SurfaceRole role (const SurfaceRef< T > &a_surface) const noexcept
 What a surface is to the subdomains (as Subdomains::role()).
 
uint32_t addSurfaceGroup () noexcept
 Add a surface group.
 
void add (const uint32_t a_group, const SurfaceSelector &a_selector)
 Add a selector to a surface group.
 
void removeSurfaceGroup (const uint32_t a_group)
 Remove a surface group and its selectors; the surface groups after it move down by one.
 
void remove (const uint32_t a_group, const SurfaceSelector &a_selector)
 Remove the selectors of a surface group that equal one (to undo a click).
 
uint32_t getNumSurfaceGroups () const noexcept
 How many surface groups there are.
 
uint32_t getNumSelectors () const noexcept
 How many selectors there are, over all surface groups.
 
const SurfaceSelector & getSelector (const uint32_t a_selector) const
 A selector.
 
uint32_t getSurfaceGroupOfSelector (const uint32_t a_selector) const
 The surface group of a selector.
 
template<class T >
uint32_t surfaceGroupOf (const SurfaceRef< T > &a_surface) const noexcept
 The surface group a surface point is in (as SurfaceGroups::surfaceGroupOf()).
 
Subdomains buildSubdomains (Pool &a_pool, const uint32_t a_numRegions) const
 Build the subdomains for a tape of a number of regions.
 
SurfaceGroups buildSurfaceGroups (Pool &a_pool) const
 Build the surface groups.
 
bool operator== (const DomainSetup &a_other) const noexcept
 Whether two setups make the same domain: the same subdomains, and the same selectors in the same groups and order.
 
bool operator!= (const DomainSetup &a_other) const noexcept
 Whether two setups make different domains.
 

Detailed Description

How a domain is made: its subdomains (the regions each computes in) and its surface groups (the selectors of each), as a plain value on the host, to build, copy, compare and edit.

A description, not the domain itself: a Domain is built from it for one tape (Domain(pool, tape, setup)), as a snapshot, and editing the setup afterwards changes no domain already built. There is no limit on subdomains, surface groups or selectors. The queries here (subdomainOf(), role(), surfaceGroupOf()) answer on the host what the built domain answers on the host or a device, for tools that edit a setup (a viewer's panel, a coverage check). Host only.

Member Function Documentation

◆ add()

void EBGeometry::DomainSetup::add ( const uint32_t  a_group,
const SurfaceSelector &  a_selector 
)
inline

Add a selector to a surface group.

Aborts with a message, in every build, for a surface group not added.

Parameters
[in]a_groupThe surface group.
[in]a_selectorThe selector.

◆ addSubdomain()

uint32_t EBGeometry::DomainSetup::addSubdomain ( std::vector< uint32_t >  a_regions)
inline

Add a subdomain.

A region can be in one subdomain only; aborts with a message otherwise, or for an empty list, in every build. A region listed twice counts once. Whether the regions are the tape's is checked when a Domain is built; the setup keeps a row per region up to the largest it is given, so the numbers should be the tape's (Tape::region(), ExprIndex), not arbitrary ones.

Parameters
[in]a_regionsIts regions, in any order.
Returns
The subdomain's number (its label in the domain), from 0 in the order added.

◆ addSurfaceGroup()

uint32_t EBGeometry::DomainSetup::addSurfaceGroup ( )
inlinenoexcept

Add a surface group.

Returns
Its number, from 0 in the order added.

◆ buildSubdomains()

Subdomains EBGeometry::DomainSetup::buildSubdomains ( Pool &  a_pool,
const uint32_t  a_numRegions 
) const
inline

Build the subdomains for a tape of a number of regions.

Aborts with a message, in every build, when a subdomain holds a region the tape does not have.

Parameters
[in,out]a_poolPool to build the table in (not frozen).
[in]a_numRegionsThe tape's regions (Tape::getNumRegions()).
Returns
The subdomains.

◆ buildSurfaceGroups()

SurfaceGroups EBGeometry::DomainSetup::buildSurfaceGroups ( Pool &  a_pool) const
inline

Build the surface groups.

Parameters
[in,out]a_poolPool to build the selectors in (not frozen).
Returns
The surface groups.

◆ computesIn()

bool EBGeometry::DomainSetup::computesIn ( const uint32_t  a_region) const
inlinenoexcept

Whether the domain computes in a region.

Parameters
[in]a_regionThe region.
Returns
True if the region is in one of its subdomains.

◆ getNumSelectors()

uint32_t EBGeometry::DomainSetup::getNumSelectors ( ) const
inlinenoexcept

How many selectors there are, over all surface groups.

Returns
The count.

◆ getNumSubdomains()

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

How many subdomains there are.

Returns
The count.

◆ getNumSurfaceGroups()

uint32_t EBGeometry::DomainSetup::getNumSurfaceGroups ( ) const
inlinenoexcept

How many surface groups there are.

Returns
The count.

◆ getRegions()

std::vector< uint32_t > EBGeometry::DomainSetup::getRegions ( const uint32_t  a_subdomain) const
inline

The regions of a subdomain.

Parameters
[in]a_subdomainThe subdomain (below getNumSubdomains()).
Returns
Its regions, in increasing order.

◆ getRegionsNeeded()

uint32_t EBGeometry::DomainSetup::getRegionsNeeded ( ) const
inlinenoexcept

One past the largest region in a subdomain: the fewest regions a tape must have for the setup.

Returns
The count.

◆ getSelector()

const SurfaceSelector & EBGeometry::DomainSetup::getSelector ( const uint32_t  a_selector) const
inline

A selector.

Parameters
[in]a_selectorIts number (below getNumSelectors()).
Returns
The selector.

◆ getSurfaceGroupOfSelector()

uint32_t EBGeometry::DomainSetup::getSurfaceGroupOfSelector ( const uint32_t  a_selector) const
inline

The surface group of a selector.

Parameters
[in]a_selectorIts number (below getNumSelectors()).
Returns
The surface group.

◆ operator!=()

bool EBGeometry::DomainSetup::operator!= ( const DomainSetup &  a_other) const
inlinenoexcept

Whether two setups make different domains.

Parameters
[in]a_otherThe other setup.
Returns
True if they do.

◆ operator==()

bool EBGeometry::DomainSetup::operator== ( const DomainSetup &  a_other) const
inlinenoexcept

Whether two setups make the same domain: the same subdomains, and the same selectors in the same groups and order.

Parameters
[in]a_otherThe other setup.
Returns
True if they do.

◆ remove()

void EBGeometry::DomainSetup::remove ( const uint32_t  a_group,
const SurfaceSelector &  a_selector 
)
inline

Remove the selectors of a surface group that equal one (to undo a click).

Parameters
[in]a_groupThe surface group.
[in]a_selectorThe selector.

◆ removeSurfaceGroup()

void EBGeometry::DomainSetup::removeSurfaceGroup ( const uint32_t  a_group)
inline

Remove a surface group and its selectors; the surface groups after it move down by one.

Aborts with a message, in every build, for a surface group not added.

Parameters
[in]a_groupThe surface group.

◆ role()

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

What a surface is to the subdomains (as Subdomains::role()).

Template Parameters
TFloating-point precision.
Parameters
[in]a_surfaceThe surface, with its sides.
Returns
Its role.

◆ subdomainOf()

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

The subdomain a region is in.

Parameters
[in]a_regionThe region.
Returns
The subdomain, or Subdomains::None.

◆ surfaceGroupOf()

template<class T >
uint32_t EBGeometry::DomainSetup::surfaceGroupOf ( const SurfaceRef< T > &  a_surface) const
inlinenoexcept

The surface group a surface point is in (as SurfaceGroups::surfaceGroupOf()).

Template Parameters
TFloating-point precision.
Parameters
[in]a_surfaceThe surface, with its sides and their materials.
Returns
The surface group, or SurfaceGroups::None.

◆ touches()

bool EBGeometry::DomainSetup::touches ( const uint32_t  a_first,
const uint32_t  a_second 
) const
inlinenoexcept

Whether a surface between two regions is one the domain must give a condition: one side or both in its regions.

Parameters
[in]a_firstA region on one side.
[in]a_secondThe region on the other.
Returns
True if it touches the domain's regions.

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