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

Some regions of an expression with their neighbors: a smaller expression in which those regions have the same solids and the same surfaces, with the same regions on both sides of each, numbered anew (see regionNeighborhood()). More...

#include <EBGeometry_RegionNeighborhood.hpp>

Public Member Functions

 RegionNeighborhood ()=delete
 No empty neighborhood: see regionNeighborhood().
 
const Expr< T > & object () const noexcept
 The smaller expression, to compile into a tape.
 
uint32_t getNumRegions () const noexcept
 How many regions it has, the background (region 0) included.
 
uint32_t wholeRegion (uint32_t a_region) const
 The whole expression's region that one of its regions is.
 
uint32_t region (uint32_t a_wholeRegion) const
 Its region that a region of the whole expression is.
 
uint32_t surface (uint32_t a_wholeSurface) const
 Its surface that a surface of the whole expression is (ExprIndex::getFirstSurface() numbering).
 
uint32_t wholeSurface (uint32_t a_surface) const
 The whole expression's surface that one of its surfaces is.
 
DomainSetup setup (const DomainSetup &a_wholeSetup) const
 A setup written for the whole expression, translated to this one: regions through the map, materials and surface labels by their names, surfaces through the leaves kept.
 

Static Public Attributes

static constexpr uint32_t None = 0xFFFFFFFFU
 What region() gives for a region that was dropped.
 

Friends

template<class U >
RegionNeighborhood< U > regionNeighborhood (const Expr< U > &a_expr, const std::vector< uint32_t > &a_regions)
 

Detailed Description

template<class T>
class EBGeometry::RegionNeighborhood< T >

Some regions of an expression with their neighbors: a smaller expression in which those regions have the same solids and the same surfaces, with the same regions on both sides of each, numbered anew (see regionNeighborhood()).

What a domain computes on, compiled on its own: a tape of object() gives the regions of the neighborhood the same signs (inside, outside) as the whole expression's tape gives them, and their surfaces the same regions, materials and labels on both sides, so a domain built for it from setup() has the same subdomains and surface groups. Away from those regions, the values of their functions may differ (a dropped region no longer cuts a kept one there), never their signs. The regions, surfaces and labels are numbered as ExprIndex numbers those of object(); wholeRegion() and region() map the regions both ways. Host only, a plain value.

Template Parameters
TFloating-point precision.

Member Function Documentation

◆ getNumRegions()

template<class T >
uint32_t EBGeometry::RegionNeighborhood< T >::getNumRegions ( ) const
noexcept

How many regions it has, the background (region 0) included.

Returns
The count.

◆ object()

template<class T >
const Expr< T > & EBGeometry::RegionNeighborhood< T >::object ( ) const
noexcept

The smaller expression, to compile into a tape.

Returns
It.

◆ region()

template<class T >
uint32_t EBGeometry::RegionNeighborhood< T >::region ( uint32_t  a_wholeRegion) const

Its region that a region of the whole expression is.

Parameters
[in]a_wholeRegionA region of the whole expression.
Returns
Its region, or None if that region was dropped.

◆ setup()

template<class T >
DomainSetup EBGeometry::RegionNeighborhood< T >::setup ( const DomainSetup &  a_wholeSetup) const

A setup written for the whole expression, translated to this one: regions through the map, materials and surface labels by their names, surfaces through the leaves kept.

A selector that names a region, a material, a label or a surface that was dropped selects nothing here, and is left out; every other selector selects the same surfaces of the neighborhood's regions as before. The subdomains and the surface groups keep their numbers. Every region of the setup's subdomains must be in the neighborhood (build it from them, as Language::Model::domainObject() does): aborts with a message otherwise, in every build.

Parameters
[in]a_wholeSetupA setup for the whole expression.
Returns
The setup for object().

◆ surface()

template<class T >
uint32_t EBGeometry::RegionNeighborhood< T >::surface ( uint32_t  a_wholeSurface) const

Its surface that a surface of the whole expression is (ExprIndex::getFirstSurface() numbering).

Parameters
[in]a_wholeSurfaceA surface of the whole expression.
Returns
Its surface, or None if the leaf of that surface was dropped.

◆ wholeRegion()

template<class T >
uint32_t EBGeometry::RegionNeighborhood< T >::wholeRegion ( uint32_t  a_region) const

The whole expression's region that one of its regions is.

Parameters
[in]a_regionIts region (below getNumRegions()).
Returns
The whole expression's region; 0 for the background.

◆ wholeSurface()

template<class T >
uint32_t EBGeometry::RegionNeighborhood< T >::wholeSurface ( uint32_t  a_surface) const

The whole expression's surface that one of its surfaces is.

Parameters
[in]a_surfaceIts surface.
Returns
The whole expression's surface.

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