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

A model read from a .ebg file and the files it includes: its object, the names of its regions, materials and labels, its materials, domains, couplings and params, and the files it read. More...

#include <EBGeometry_Language.hpp>

Public Member Functions

const Expr< T > & object () const noexcept
 The object, to compile into a tape.
 
const ExprIndex< T > & index () const noexcept
 The object's index: its regions, region groups, materials and surface labels by name.
 
uint32_t getNumMaterials () const noexcept
 How many materials: every name a region uses, numbered as the index numbers them (MaterialLabelId).
 
const Properties & materialProperties (uint32_t a_material) const
 A material's properties (none for a material no material statement declares).
 
uint32_t getNumDomains () const noexcept
 How many domains.
 
const ModelDomain & domain (uint32_t a_domain) const
 A domain by number, in the order written.
 
const ModelDomain & domain (std::string_view a_name) const
 A domain by name.
 
const std::vector< Coupling > & couplings () const noexcept
 The couplings.
 
const std::vector< Param > & params () const noexcept
 The params, in the order written.
 
const std::vector< Diagnostic > & warnings () const noexcept
 The warnings found reading it.
 
const std::vector< std::string > & files () const noexcept
 Every file read, the model's own and the meshes: what a viewer watches to reload.
 
const Properties & view () const noexcept
 The view block's properties (camera, colors): for viewers; programs ignore them.
 
const std::vector< ShapeSite > & shapes () const noexcept
 The shapes the text builds, in the order built.
 
const ShapeSite * siteOfLeaf (const uint32_t a_leaf) const noexcept
 The shape call a leaf of the object comes from: what a viewer names a picked surface by.
 
const NodeSite * siteOfNode (const uint32_t a_node) const noexcept
 The shape value that makes a node of the object: its names, where its call is written, how many places of the object use it. A value covering the same shapes as the node is taken to make it (a translated box makes both the box's node and the translation's).
 
uint32_t siteIndexOfLeaf (const uint32_t a_leaf) const noexcept
 The index among shapes() of the shape call a leaf comes from.
 
const std::vector< Syntax::File > & sources () const noexcept
 The parsed files, the model's first.
 
RegionNames names () const
 The model's names for a viewer: regions, materials and labels, every domain's setup with the names of its subdomains and surface groups, and the colors of the view block.
 
DomainObject< T > domainObject (std::string_view a_domain) const
 A domain's own object: the regions its subdomains compute in, and their neighbors (see regionNeighborhood(): regions whose bounding boxes meet theirs), with the domain's setup and the names translated.
 
template<class S , class F >
Table< S > regions (Pool &a_pool, F &&a_fill) const
 A table with one row per region of the object (region 0, outside, first), each filled from its material's properties: what a kernel indexes with Tape::region(). A region without a material, outside included, gets empty properties, so the function should give fallbacks.
 

Friends

template<class U >
class LanguageDetail::Reader
 

Detailed Description

template<class T>
class EBGeometry::Language::Model< T >

A model read from a .ebg file and the files it includes: its object, the names of its regions, materials and labels, its materials, domains, couplings and params, and the files it read.

The caller compiles the object into a tape, Tape<T, UserPrimitives...>(pool, model.object()), picking the tape's features; and builds a domain for that tape from a ModelDomain's setup, Domain(pool, tape, model.domain("cfd").setup()). Meshes the model reads are built into the pool given to read(). The model keeps the parsed files, so that it can be printed (print()) and a viewer can edit them.

Template Parameters
TPrecision; numbers are read as double and converted.

Member Function Documentation

◆ couplings()

template<class T >
const std::vector< Coupling > & EBGeometry::Language::Model< T >::couplings ( ) const
inlinenoexcept

The couplings.

Returns
They.

◆ domain() [1/2]

template<class T >
const ModelDomain & EBGeometry::Language::Model< T >::domain ( std::string_view  a_name) const

A domain by name.

Parameters
[in]a_nameThe name.
Returns
It; an Error listing the domains when the model has none of that name.

◆ domain() [2/2]

template<class T >
const ModelDomain & EBGeometry::Language::Model< T >::domain ( uint32_t  a_domain) const

A domain by number, in the order written.

Parameters
[in]a_domainThe domain.
Returns
It.

◆ domainObject()

template<class T >
DomainObject< T > EBGeometry::Language::Model< T >::domainObject ( std::string_view  a_domain) const

A domain's own object: the regions its subdomains compute in, and their neighbors (see regionNeighborhood(): regions whose bounding boxes meet theirs), with the domain's setup and the names translated.

A domain that computes in no region gets every region. Throws Error for a name no domain has.

Parameters
[in]a_domainThe domain's name.
Returns
The domain's object.

◆ files()

template<class T >
const std::vector< std::string > & EBGeometry::Language::Model< T >::files ( ) const
inlinenoexcept

Every file read, the model's own and the meshes: what a viewer watches to reload.

Returns
The paths.

◆ getNumDomains()

template<class T >
uint32_t EBGeometry::Language::Model< T >::getNumDomains ( ) const
inlinenoexcept

How many domains.

Returns
The count.

◆ getNumMaterials()

template<class T >
uint32_t EBGeometry::Language::Model< T >::getNumMaterials ( ) const
inlinenoexcept

How many materials: every name a region uses, numbered as the index numbers them (MaterialLabelId).

Returns
The count.

◆ index()

template<class T >
const ExprIndex< T > & EBGeometry::Language::Model< T >::index ( ) const
inlinenoexcept

The object's index: its regions, region groups, materials and surface labels by name.

Returns
The index.

◆ materialProperties()

template<class T >
const Properties & EBGeometry::Language::Model< T >::materialProperties ( uint32_t  a_material) const

A material's properties (none for a material no material statement declares).

Parameters
[in]a_materialThe material.
Returns
The properties.

◆ names()

template<class T >
RegionNames EBGeometry::Language::Model< T >::names ( ) const

The model's names for a viewer: regions, materials and labels, every domain's setup with the names of its subdomains and surface groups, and the colors of the view block.

Returns
The names.

◆ object()

template<class T >
const Expr< T > & EBGeometry::Language::Model< T >::object ( ) const
inlinenoexcept

The object, to compile into a tape.

Returns
The expression.

◆ params()

template<class T >
const std::vector< Param > & EBGeometry::Language::Model< T >::params ( ) const
inlinenoexcept

The params, in the order written.

Returns
They.

◆ regions()

template<class T >
template<class S , class F >
Table< S > EBGeometry::Language::Model< T >::regions ( Pool &  a_pool,
F &&  a_fill 
) const
inline

A table with one row per region of the object (region 0, outside, first), each filled from its material's properties: what a kernel indexes with Tape::region(). A region without a material, outside included, gets empty properties, so the function should give fallbacks.

Template Parameters
SThe row type: trivially copyable.
FA function S(const Properties&).
Parameters
[in,out]a_poolThe pool the table is put in.
[in]a_fillThe function filling a row.
Returns
The table.

◆ shapes()

template<class T >
const std::vector< ShapeSite > & EBGeometry::Language::Model< T >::shapes ( ) const
inlinenoexcept

The shapes the text builds, in the order built.

Returns
They.

◆ siteIndexOfLeaf()

template<class T >
uint32_t EBGeometry::Language::Model< T >::siteIndexOfLeaf ( const uint32_t  a_leaf) const
inlinenoexcept

The index among shapes() of the shape call a leaf comes from.

Parameters
[in]a_leafThe leaf.
Returns
The index, or ShapeSite::None.

◆ siteOfLeaf()

template<class T >
const ShapeSite * EBGeometry::Language::Model< T >::siteOfLeaf ( const uint32_t  a_leaf) const
inlinenoexcept

The shape call a leaf of the object comes from: what a viewer names a picked surface by.

Parameters
[in]a_leafThe leaf (ExprIndex's numbering; LeafRef::m_leaf).
Returns
Its site among shapes(), or nullptr.

◆ siteOfNode()

template<class T >
const NodeSite * EBGeometry::Language::Model< T >::siteOfNode ( const uint32_t  a_node) const
inlinenoexcept

The shape value that makes a node of the object: its names, where its call is written, how many places of the object use it. A value covering the same shapes as the node is taken to make it (a translated box makes both the box's node and the translation's).

Parameters
[in]a_nodeThe node (ExprIndex's numbering).
Returns
The site, or nullptr for a node that no value of the text makes on its own.

◆ sources()

template<class T >
const std::vector< Syntax::File > & EBGeometry::Language::Model< T >::sources ( ) const
inlinenoexcept

The parsed files, the model's first.

Returns
They.

◆ view()

template<class T >
const Properties & EBGeometry::Language::Model< T >::view ( ) const
inlinenoexcept

The view block's properties (camera, colors): for viewers; programs ignore them.

Returns
The properties.

◆ warnings()

template<class T >
const std::vector< Diagnostic > & EBGeometry::Language::Model< T >::warnings ( ) const
inlinenoexcept

The warnings found reading it.

Returns
They.

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