The nodes of an expression, numbered, with the leaves below each and their labels: on the host, the way from what a Tape reports (a leaf, see LeafRef::m_leaf and HitT::m_primitive) back to the expression.
More...
|
|
| ExprIndex ()=delete |
| | No empty index.
|
| |
| | ExprIndex (const Expr< T > &a_expr) |
| | Number the nodes, leaves and labels of an expression.
|
| |
| uint32_t | getNumNodes () const noexcept |
| | The number of nodes.
|
| |
| const Node & | getNode (uint32_t a_node) const |
| | A node.
|
| |
| uint32_t | getNumLeaves () const noexcept |
| | The number of leaves: Tape::getNumPrimitives() of a tape compiled from the expression.
|
| |
| uint32_t | getLeafNode (uint32_t a_leaf) const |
| | The node of a leaf.
|
| |
| std::vector< uint32_t > | pathOf (uint32_t a_leaf) const |
| | The nodes from the root down to a leaf: the levels a surface belongs to, from the whole object to the shape.
|
| |
| uint32_t | getNumSurfaces () const noexcept |
| | The number of surfaces: Tape::getNumSurfaces() of a tape compiled from the expression.
|
| |
| uint32_t | getFirstSurface (uint32_t a_leaf) const |
| | A leaf's first surface: the leaf covers [getFirstSurface(leaf), getFirstSurface(leaf + 1)), as Tape::getFirstSurface() numbers them.
|
| |
| uint32_t | getLeafOfSurface (uint32_t a_surface) const |
| | The leaf a surface belongs to: SurfaceRef::m_leaf of a tape's closestSurface() that reported it.
|
| |
| SurfaceLabelId | getSurfaceLabel (uint32_t a_leaf) const |
| | A leaf's label: that of the nearest labeled node on its path, the leaf's own included, except that a label above a chain of maps relabels the object below them (see SurfaceLabel()).
|
| |
| uint32_t | getNumPartsOfLeaf (uint32_t a_leaf) const |
| | How many parts a leaf's shape has (see hasParts): one for a shape without parts, a mesh's faces, a box's six; 0 for a collection (a cloud, a BVH union, a tape), whose surfaces are its members, each with its own parts.
|
| |
| SurfaceLabelId | getPartSurfaceLabel (uint32_t a_leaf, uint32_t a_part) const |
| | The label of a part of a leaf (see hasParts): its face group's label when SurfaceLabel(shape, FaceGroups) put it in one, and otherwise the leaf's (getSurfaceLabel()).
|
| |
| const std::vector< SurfaceLabelId > & | getPartSurfaceLabels (uint32_t a_leaf) const |
| | The labels of a leaf's parts, one per part, as getPartSurfaceLabel() gives them; empty for a leaf whose parts SurfaceLabel(shape, FaceGroups) did not name.
|
| |
| uint32_t | getNumSurfaceLabels () const noexcept |
| | The number of distinct labels.
|
| |
| const std::string & | getSurfaceLabelName (SurfaceLabelId a_label) const |
| | A label's name.
|
| |
| SurfaceLabelId | findSurfaceLabel (std::string_view a_name) const |
| | The label of a name.
|
| |
| uint32_t | getNumRegions () const noexcept |
| | The number of regions: the background (region 0), and one per operand of the Overlays, flattened into one priority order depth first (later regions on top); an expression with no Overlay has one, the whole object.
|
| |
| const Region & | getRegion (uint32_t a_region) const |
| | A region.
|
| |
| uint32_t | getRegionOfLeaf (uint32_t a_leaf) const |
| | The region a leaf belongs to: the region whose operand holds it.
|
| |
| MaterialLabelId | getMaterialOf (uint32_t a_region) const |
| | A region's material (see Region::m_material).
|
| |
| std::vector< uint32_t > | getRegionsOfRegionGroup (uint32_t a_group) const |
| | The regions of a group, for a subdomain (Subdomains::addSubdomain()).
|
| |
| std::vector< uint32_t > | getRegionsOfMaterial (MaterialLabelId a_material) const |
| | The regions of a material, for a subdomain (Subdomains::addSubdomain()).
|
| |
| const std::vector< std::pair< uint32_t, uint32_t > > & | getSidesOfLeaf (uint32_t a_leaf) const |
| | The pairs of regions a leaf's surface may separate, conservatively: every pair it does is listed, and some listed may not occur (the boxes overlap, the shapes need not meet). A region's own surface separates it from the background and from earlier regions whose boxes meet its own (a later region covers it, and the interface is that region's surface); a mask's separates a region it cuts from the background or a region outside the masked Overlay. Each pair smaller region first, sorted. For an expression with no Overlay: (0, 1).
|
| |
| std::vector< std::pair< uint32_t, uint32_t > > | getInterfaces () const |
| | The pairs of regions any surface may separate (see getSidesOfLeaf()): the interfaces a solver can meet.
|
| |
| uint32_t | getNumRegionGroups () const noexcept |
| | The number of groups: one per Overlay, numbered depth first.
|
| |
| const RegionGroup & | getRegionGroup (uint32_t a_group) const |
| | A group.
|
| |
| uint32_t | getNumMaterialLabels () const noexcept |
| | The number of distinct material labels.
|
| |
| const std::string & | getMaterialLabelName (MaterialLabelId a_label) const |
| | A material label's name.
|
| |
| MaterialLabelId | findMaterialLabel (std::string_view a_name) const |
| | The material label of a name.
|
| |
| uint32_t | findRegion (std::string_view a_name) const |
| | The region with a name (RegionName()).
|
| |
| template<class TapeType > |
| std::vector< std::string > | checkLabels (const Expr< T > &a_expr, const TapeType &a_tape) const |
| | Warnings about names that cannot appear on the object: a surface label none of whose leaves (or parts named through face groups) can reach the object's boundary, or that every leaf below it overrides with a label of its own; a region with no volume (covered by later regions of its Overlay, or outside a mask); a material all of whose regions have none.
|
| |
template<class T>
class EBGeometry::ExprIndex< T >
The nodes of an expression, numbered, with the leaves below each and their labels: on the host, the way from what a Tape reports (a leaf, see LeafRef::m_leaf and HitT::m_primitive) back to the expression.
The nodes are numbered from 0 at the root, depth first, the operands in order, each occurrence of a shared subexpression counted; the leaves (the shapes) are numbered the same way, as a Tape compiled from the expression numbers them. So the leaves below a node are a contiguous range, [m_firstLeaf, m_firstLeaf + m_numLeaves), and so are its surfaces, [m_firstSurface, m_firstSurface + m_numSurfaces): one per leaf, or all of a container leaf's (a sphere cloud's spheres, a BVH union's members). A group of surfaces can be handed to a device as two numbers. The nodes The labels are numbered in the order their names first appear, depth first, a leaf's face groups (SurfaceLabel(shape,
FaceGroups)) after the leaf's own label. The nodes are those the builder functions made: Difference(a, b) is an Intersection of a and a Complement of b, and nested maps (Translate, Rotate, Scale, ...) are one Transform node.
- Template Parameters
-
| T | Floating-point precision. |
template<class T >
template<class TapeType >
| std::vector< std::string > EBGeometry::ExprIndex< T >::checkLabels |
( |
const Expr< T > & |
a_expr, |
|
|
const TapeType & |
a_tape |
|
) |
| const |
Warnings about names that cannot appear on the object: a surface label none of whose leaves (or parts named through face groups) can reach the object's boundary, or that every leaf below it overrides with a label of its own; a region with no volume (covered by later regions of its Overlay, or outside a mask); a material all of whose regions have none.
A diagnostic only: it changes nothing, and the expression is evaluated as written; a correct geometry is the user's to make. It is conservative: it reports only what it has proved, so a lost name can go unreported (surfaces that coincide exactly, as a core filling a cavity, are never reported), but a reported one is lost. The shapes are evaluated through the tape compiled from the expression (Tape::leafValue()), on the host, a few times per leaf; a leaf the tape does not hold (inside a collection) is never evaluated.
A leaf is proved hidden when, on its way to the root, its box lies strictly inside another operand of a union, strictly inside later operands of an Overlay (its region has no volume; an earlier operand only lies under it, which leaves an interface), or strictly outside another operand of an intersection (a mask included), and only maps, Elongate, FiniteRepetition, complements, unions, Overlays and intersections lie on that way. An operation that acts on values (Offset, Annular, Blur, Mollify, the smooth operations) on the way leaves it unproved. Inside and outside are proved with bounds of the other operand's value over a ball around the box (a shape's value at the center, plus or minus the radius, for a shape whose value is a distance or a bound), the box split into up to 64 pieces when it is not proved whole. A region is proved empty the same way, from its operand. The index does not hold the expression, so it is given again; it must be the one the index was built from (aborts with a message, in every build, when its nodes do not match).
- Template Parameters
-
| TapeType | The Tape compiled from the same expression, its pool readable on the host. |
- Parameters
-
| [in] | a_expr | The expression the index was built from. |
| [in] | a_tape | The tape compiled from it. |
- Returns
- The warnings, empty when there are none.