EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
EBGeometry::Language::Table< S > Class Template Reference

A table of a program's own rows in a pool, one per region, subdomain or surface group, read on the host and on a device by the numbers EBGeometry computes there (Tape::region(), Domain::subdomainAt(), Domain::surfaceGroupOf()). More...

#include <EBGeometry_Language.hpp>

Inheritance diagram for EBGeometry::Language::Table< S >:
Inheritance graph
[legend]
Collaboration diagram for EBGeometry::Language::Table< S >:
Collaboration graph
[legend]

Classes

struct  Layout
 Where the rows are in the pool. More...
 

Public Member Functions

 Table () noexcept=default
 An empty table in no pool.
 
 Table (Pool &a_pool, const std::vector< S > &a_rows)
 Rows copied into a pool.
 
 Table (const Layout &a_layout, const PoolLocation &a_location) noexcept
 A table at a location.
 
const S & operator[] (const uint32_t a_row) const noexcept
 A row.
 
uint32_t size () const noexcept
 How many rows.
 
const Layout & layout () const noexcept
 Where the rows are.
 
Table rebasedView (const Pool &a_pool) const noexcept
 The same table in another pool with the same layout (a mirror).
 
- 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.
 

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

template<class S>
class EBGeometry::Language::Table< S >

A table of a program's own rows in a pool, one per region, subdomain or surface group, read on the host and on a device by the numbers EBGeometry computes there (Tape::region(), Domain::subdomainAt(), Domain::surfaceGroupOf()).

A pool handle like every other: copying it copies a view, the pool must outlive it and every copy, and rebasedView() moves it to a mirror of its pool. Built by Model::regions(), ModelDomain::volumes() and ModelDomain::surfaces(), each row filled on the host from its properties.

Template Parameters
SThe row type: trivially copyable.

Constructor & Destructor Documentation

◆ Table() [1/2]

template<class S >
EBGeometry::Language::Table< S >::Table ( Pool &  a_pool,
const std::vector< S > &  a_rows 
)
inline

Rows copied into a pool.

Parameters
[in,out]a_poolThe pool; not frozen, and it must outlive the table.
[in]a_rowsThe rows.

◆ Table() [2/2]

template<class S >
EBGeometry::Language::Table< S >::Table ( const Layout &  a_layout,
const PoolLocation &  a_location 
)
inlinenoexcept

A table at a location.

Parameters
[in]a_layoutWhere the rows are.
[in]a_locationThe pool's location.

Member Function Documentation

◆ layout()

template<class S >
const Layout & EBGeometry::Language::Table< S >::layout ( ) const
inlinenoexcept

Where the rows are.

Returns
The layout.

◆ operator[]()

template<class S >
const S & EBGeometry::Language::Table< S >::operator[] ( const uint32_t  a_row) const
inlinenoexcept

A row.

Parameters
[in]a_rowThe row's number, below size().
Returns
The row.

◆ rebasedView()

template<class S >
Table EBGeometry::Language::Table< S >::rebasedView ( const Pool &  a_pool) const
inlinenoexcept

The same table in another pool with the same layout (a mirror).

Parameters
[in]a_poolThe pool.
Returns
The view.

◆ size()

template<class S >
uint32_t EBGeometry::Language::Table< S >::size ( ) const
inlinenoexcept

How many rows.

Returns
The count.

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