VTK-m  2.1
Public Member Functions | Public Attributes | List of all members
vtkm::exec::BoundaryState Struct Reference

Provides a neighborhood's placement with respect to the mesh's boundary. More...

#include <BoundaryState.h>

Public Member Functions

 BoundaryState (const vtkm::Id3 &ijk, const vtkm::Id3 &pdims)
 
const vtkm::Id3GetCenterIndex () const
 Returns the center index of the neighborhood. More...
 
bool IsRadiusInBoundary (vtkm::IdComponent radius) const
 Returns true if a neighborhood of the given radius is contained within the bounds of the cell set. More...
 
bool IsNeighborInBoundary (const vtkm::IdComponent3 &neighbor) const
 Returns true if the neighbor at the specified offset vector is contained within the bounds of the cell set. More...
 
vtkm::IdComponent3 MinNeighborIndices (vtkm::IdComponent radius) const
 Returns the minimum neighborhood indices that are within the bounds of the data. More...
 
vtkm::IdComponent3 MaxNeighborIndices (vtkm::IdComponent radius) const
 Returns the minimum neighborhood indices that are within the bounds of the data. More...
 
vtkm::Id3 NeighborIndexToFullIndexClamp (const vtkm::IdComponent3 &neighbor) const
 Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the ijk of the equivalent point in the full data set. More...
 
vtkm::Id3 NeighborIndexToFullIndexClamp (vtkm::IdComponent neighborI, vtkm::IdComponent neighborJ, vtkm::IdComponent neighborK) const
 Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the ijk of the equivalent point in the full data set. More...
 
vtkm::Id3 NeighborIndexToFullIndex (const vtkm::IdComponent3 &neighbor) const
 Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the ijk of the equivalent point in the full data set. More...
 
vtkm::Id3 NeighborIndexToFullIndex (vtkm::IdComponent neighborI, vtkm::IdComponent neighborJ, vtkm::IdComponent neighborK) const
 Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the ijk of the equivalent point in the full data set. More...
 
vtkm::IdComponent3 ClampNeighborIndex (const vtkm::IdComponent3 &neighbor) const
 Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size), clamps it to the dataset bounds, and returns a new neighborhood index. More...
 
vtkm::IdComponent3 ClampNeighborIndex (vtkm::IdComponent neighborI, vtkm::IdComponent neighborJ, vtkm::IdComponent neighborK) const
 Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size), clamps it to the dataset bounds, and returns a new neighborhood index. More...
 
vtkm::Id NeighborIndexToFlatIndexClamp (const vtkm::IdComponent3 &neighbor) const
 Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the flat index of the equivalent point in the full data set. More...
 
vtkm::Id NeighborIndexToFlatIndexClamp (vtkm::IdComponent neighborI, vtkm::IdComponent neighborJ, vtkm::IdComponent neighborK) const
 Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the flat index of the equivalent point in the full data set. More...
 
vtkm::Id NeighborIndexToFlatIndex (const vtkm::IdComponent3 &neighbor) const
 Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the flat index of the equivalent point in the full data set. More...
 
vtkm::Id NeighborIndexToFlatIndex (vtkm::IdComponent neighborI, vtkm::IdComponent neighborJ, vtkm::IdComponent neighborK) const
 Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the flat index of the equivalent point in the full data set. More...
 
bool IsRadiusInXBoundary (vtkm::IdComponent radius) const
 
bool IsRadiusInYBoundary (vtkm::IdComponent radius) const
 
bool IsRadiusInZBoundary (vtkm::IdComponent radius) const
 
bool IsNeighborInXBoundary (vtkm::IdComponent offset) const
 
bool IsNeighborInYBoundary (vtkm::IdComponent offset) const
 
bool IsNeighborInZBoundary (vtkm::IdComponent offset) const
 

Public Attributes

vtkm::Id3 IJK
 The 3D index of the visited element. More...
 
vtkm::Id3 PointDimensions
 The dimensions of the elements in the mesh. More...
 

Detailed Description

Provides a neighborhood's placement with respect to the mesh's boundary.

BoundaryState provides functionality for vtkm::worklet::WorkletPointNeighborhood algorithms to determine if they are operating on a point near the boundary. It allows you to query about overlaps of the neighborhood and the mesh boundary. It also helps convert local neighborhood ids to the corresponding location in the mesh.

This class is typically constructed using the Boundary tag in an ExecutionSignature. There is little reason to construct this in user code.

Constructor & Destructor Documentation

◆ BoundaryState()

vtkm::exec::BoundaryState::BoundaryState ( const vtkm::Id3 ijk,
const vtkm::Id3 pdims 
)
inline

Member Function Documentation

◆ ClampNeighborIndex() [1/2]

vtkm::IdComponent3 vtkm::exec::BoundaryState::ClampNeighborIndex ( const vtkm::IdComponent3 neighbor) const
inline

Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size), clamps it to the dataset bounds, and returns a new neighborhood index.

For example, if given a neighbor index that is past the minimum x range of the data, the neighbor index of the minimum x boundary is returned.

◆ ClampNeighborIndex() [2/2]

vtkm::IdComponent3 vtkm::exec::BoundaryState::ClampNeighborIndex ( vtkm::IdComponent  neighborI,
vtkm::IdComponent  neighborJ,
vtkm::IdComponent  neighborK 
) const
inline

Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size), clamps it to the dataset bounds, and returns a new neighborhood index.

For example, if given a neighbor index that is past the minimum x range of the data, the neighbor index of the minimum x boundary is returned.

◆ GetCenterIndex()

const vtkm::Id3& vtkm::exec::BoundaryState::GetCenterIndex ( ) const
inline

Returns the center index of the neighborhood.

This is typically the position of the invocation of the worklet given this boundary condition.

◆ IsNeighborInBoundary()

bool vtkm::exec::BoundaryState::IsNeighborInBoundary ( const vtkm::IdComponent3 neighbor) const
inline

Returns true if the neighbor at the specified offset vector is contained within the bounds of the cell set.

Returns false if the neighbor falls outside of the boundary of the data.

◆ IsNeighborInXBoundary()

bool vtkm::exec::BoundaryState::IsNeighborInXBoundary ( vtkm::IdComponent  offset) const
inline

Returns true if the neighbor at the specified offset is contained within the bounds of the cell set in the X, Y, or Z direction. Returns false if the neighbor falls outside of the boundary of the data in the X, Y, or Z direction.

◆ IsNeighborInYBoundary()

bool vtkm::exec::BoundaryState::IsNeighborInYBoundary ( vtkm::IdComponent  offset) const
inline

Returns true if the neighbor at the specified offset is contained within the bounds of the cell set in the X, Y, or Z direction. Returns false if the neighbor falls outside of the boundary of the data in the X, Y, or Z direction.

◆ IsNeighborInZBoundary()

bool vtkm::exec::BoundaryState::IsNeighborInZBoundary ( vtkm::IdComponent  offset) const
inline

Returns true if the neighbor at the specified offset is contained within the bounds of the cell set in the X, Y, or Z direction. Returns false if the neighbor falls outside of the boundary of the data in the X, Y, or Z direction.

◆ IsRadiusInBoundary()

bool vtkm::exec::BoundaryState::IsRadiusInBoundary ( vtkm::IdComponent  radius) const
inline

Returns true if a neighborhood of the given radius is contained within the bounds of the cell set.

Returns false if the neighborhood extends outside of the boundary of the data.

The radius defines the size of the neighborhood in terms of how far away it extends from the center. So if there is a radius of 1, the neighborhood extends 1 unit away from the center in each direction and is 3x3x3. If there is a radius of 2, the neighborhood extends 2 units for a size of 5x5x5.

◆ IsRadiusInXBoundary()

bool vtkm::exec::BoundaryState::IsRadiusInXBoundary ( vtkm::IdComponent  radius) const
inline

Returns true if a neighborhood of the given radius is contained within the bounds of the cell set in the X, Y, or Z direction. Returns false if the neighborhood extends outside of the boundary of the data in the X, Y, or Z direction.

The radius defines the size of the neighborhood in terms of how far away it extends from the center. So if there is a radius of 1, the neighborhood extends 1 unit away from the center in each direction and is 3x3x3. If there is a radius of 2, the neighborhood extends 2 units for a size of 5x5x5.

◆ IsRadiusInYBoundary()

bool vtkm::exec::BoundaryState::IsRadiusInYBoundary ( vtkm::IdComponent  radius) const
inline

Returns true if a neighborhood of the given radius is contained within the bounds of the cell set in the X, Y, or Z direction. Returns false if the neighborhood extends outside of the boundary of the data in the X, Y, or Z direction.

The radius defines the size of the neighborhood in terms of how far away it extends from the center. So if there is a radius of 1, the neighborhood extends 1 unit away from the center in each direction and is 3x3x3. If there is a radius of 2, the neighborhood extends 2 units for a size of 5x5x5.

◆ IsRadiusInZBoundary()

bool vtkm::exec::BoundaryState::IsRadiusInZBoundary ( vtkm::IdComponent  radius) const
inline

Returns true if a neighborhood of the given radius is contained within the bounds of the cell set in the X, Y, or Z direction. Returns false if the neighborhood extends outside of the boundary of the data in the X, Y, or Z direction.

The radius defines the size of the neighborhood in terms of how far away it extends from the center. So if there is a radius of 1, the neighborhood extends 1 unit away from the center in each direction and is 3x3x3. If there is a radius of 2, the neighborhood extends 2 units for a size of 5x5x5.

◆ MaxNeighborIndices()

vtkm::IdComponent3 vtkm::exec::BoundaryState::MaxNeighborIndices ( vtkm::IdComponent  radius) const
inline

Returns the minimum neighborhood indices that are within the bounds of the data.

Given a radius for the neighborhood, returns a vtkm::IdComponent3 for the "upper right" (maximum) index. If the visited point is in the middle of the mesh, the returned triplet is the positive radius for all components. But if the visited point is near the mesh boundary, then the maximum index will be clipped.

For example, if the visited point is at [5,5,5] in a 10 by 10 by 10 mesh and MaxNeighborIndices(2) is called, then [2,2,2] is returned. However, if the visited point is at [7, 8, 9] in the same mesh and MaxNeighborIndices(2) is called, then [2, 1, 0] is returned.

◆ MinNeighborIndices()

vtkm::IdComponent3 vtkm::exec::BoundaryState::MinNeighborIndices ( vtkm::IdComponent  radius) const
inline

Returns the minimum neighborhood indices that are within the bounds of the data.

Given a radius for the neighborhood, returns a vtkm::IdComponent3 for the "lower left" (minimum) index. If the visited point is in the middle of the mesh, the returned triplet is the negative radius for all components. But if the visited point is near the mesh boundary, then the minimum index will be clipped.

For example, if the visited point is at [5,5,5] and MinNeighborIndices(2) is called, then [-2,-2,-2] is returned. However, if the visited point is at [0,1,2] and MinNeighborIndices(2) is called, then [0,-1,-2] is returned.

◆ NeighborIndexToFlatIndex() [1/2]

vtkm::Id vtkm::exec::BoundaryState::NeighborIndexToFlatIndex ( const vtkm::IdComponent3 neighbor) const
inline

Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the flat index of the equivalent point in the full data set.

If the given value is out of range, the result is undefined.

◆ NeighborIndexToFlatIndex() [2/2]

vtkm::Id vtkm::exec::BoundaryState::NeighborIndexToFlatIndex ( vtkm::IdComponent  neighborI,
vtkm::IdComponent  neighborJ,
vtkm::IdComponent  neighborK 
) const
inline

Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the flat index of the equivalent point in the full data set.

If the given value is out of range, the result is undefined.

◆ NeighborIndexToFlatIndexClamp() [1/2]

vtkm::Id vtkm::exec::BoundaryState::NeighborIndexToFlatIndexClamp ( const vtkm::IdComponent3 neighbor) const
inline

Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the flat index of the equivalent point in the full data set.

If the given value is out of range, the value is clamped to the nearest boundary. For example, if given a neighbor index that is past the minimum x range of the data, the index at the minimum x boundary is returned.

◆ NeighborIndexToFlatIndexClamp() [2/2]

vtkm::Id vtkm::exec::BoundaryState::NeighborIndexToFlatIndexClamp ( vtkm::IdComponent  neighborI,
vtkm::IdComponent  neighborJ,
vtkm::IdComponent  neighborK 
) const
inline

Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the flat index of the equivalent point in the full data set.

If the given value is out of range, the value is clamped to the nearest boundary. For example, if given a neighbor index that is past the minimum x range of the data, the index at the minimum x boundary is returned.

◆ NeighborIndexToFullIndex() [1/2]

vtkm::Id3 vtkm::exec::BoundaryState::NeighborIndexToFullIndex ( const vtkm::IdComponent3 neighbor) const
inline

Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the ijk of the equivalent point in the full data set.

If the given value is out of range, the returned value is undefined.

◆ NeighborIndexToFullIndex() [2/2]

vtkm::Id3 vtkm::exec::BoundaryState::NeighborIndexToFullIndex ( vtkm::IdComponent  neighborI,
vtkm::IdComponent  neighborJ,
vtkm::IdComponent  neighborK 
) const
inline

Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the ijk of the equivalent point in the full data set.

If the given value is out of range, the returned value is undefined.

◆ NeighborIndexToFullIndexClamp() [1/2]

vtkm::Id3 vtkm::exec::BoundaryState::NeighborIndexToFullIndexClamp ( const vtkm::IdComponent3 neighbor) const
inline

Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the ijk of the equivalent point in the full data set.

If the given value is out of range, the value is clamped to the nearest boundary. For example, if given a neighbor index that is past the minimum x range of the data, the index at the minimum x boundary is returned.

◆ NeighborIndexToFullIndexClamp() [2/2]

vtkm::Id3 vtkm::exec::BoundaryState::NeighborIndexToFullIndexClamp ( vtkm::IdComponent  neighborI,
vtkm::IdComponent  neighborJ,
vtkm::IdComponent  neighborK 
) const
inline

Takes a local neighborhood index (in the ranges of -neighborhood size to neighborhood size) and returns the ijk of the equivalent point in the full data set.

If the given value is out of range, the value is clamped to the nearest boundary. For example, if given a neighbor index that is past the minimum x range of the data, the index at the minimum x boundary is returned.

Member Data Documentation

◆ IJK

vtkm::Id3 vtkm::exec::BoundaryState::IJK

The 3D index of the visited element.

◆ PointDimensions

vtkm::Id3 vtkm::exec::BoundaryState::PointDimensions

The dimensions of the elements in the mesh.


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