VTK-m  2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
vtkm::filter::scalar_topology::ContourTreeAugmented Class Reference

Construct the Contour Tree for a 2D or 3D regular mesh. More...

#include <ContourTreeUniformAugmented.h>

Inheritance diagram for vtkm::filter::scalar_topology::ContourTreeAugmented:
vtkm::filter::FilterField vtkm::filter::Filter

Public Member Functions

VTKM_CONT bool CanThread () const override
 
VTKM_CONT ContourTreeAugmented (bool useMarchingCubes=false, unsigned int computeRegularStructure=1)
 Create the contour tree filter. More...
 
VTKM_CONT void SetBlockIndices (vtkm::Id3 blocksPerDim, const vtkm::cont::ArrayHandle< vtkm::Id3 > &localBlockIndices)
 Define the spatial decomposition of the data in case we run in parallel with a multi-block dataset. More...
 
const vtkm::worklet::contourtree_augmented::ContourTreeGetContourTree () const
 
const vtkm::worklet::contourtree_augmented::IdArrayTypeGetSortOrder () const
 Get the sort order for the mesh vertices. More...
 
vtkm::Id GetNumIterations () const
 Get the number of iterations used to compute the contour tree. More...
 
- Public Member Functions inherited from vtkm::filter::FilterField
 FilterField ()
 
VTKM_CONT void SetOutputFieldName (const std::string &name)
 
const VTKM_CONT std::string & GetOutputFieldName () const
 
VTKM_CONT void SetActiveField (const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any)
 
void SetActiveField (vtkm::IdComponent index, const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any)
 
const VTKM_CONT std::string & GetActiveFieldName (vtkm::IdComponent index=0) const
 
VTKM_CONT vtkm::cont::Field::Association GetActiveFieldAssociation (vtkm::IdComponent index=0) const
 
VTKM_CONT void SetActiveCoordinateSystem (vtkm::Id coord_idx)
 
VTKM_CONT void SetActiveCoordinateSystem (vtkm::IdComponent index, vtkm::Id coord_idx)
 
VTKM_CONT vtkm::Id GetActiveCoordinateSystemIndex () const
 
VTKM_CONT vtkm::Id GetActiveCoordinateSystemIndex (vtkm::IdComponent index) const
 
VTKM_CONT void SetUseCoordinateSystemAsField (bool val)
 
VTKM_CONT void SetUseCoordinateSystemAsField (vtkm::IdComponent index, bool val)
 
VTKM_CONT bool GetUseCoordinateSystemAsField (vtkm::IdComponent index=0) const
 
- Public Member Functions inherited from vtkm::filter::Filter
virtual VTKM_CONT ~Filter ()
 
VTKM_CONT void SetThreadsPerCPU (vtkm::Id numThreads)
 
VTKM_CONT void SetThreadsPerGPU (vtkm::Id numThreads)
 
VTKM_CONT vtkm::Id GetThreadsPerCPU () const
 
VTKM_CONT vtkm::Id GetThreadsPerGPU () const
 
VTKM_CONT bool GetRunMultiThreadedFilter () const
 
VTKM_CONT void SetRunMultiThreadedFilter (bool val)
 
void SetInvoker (vtkm::cont::Invoker inv)
 Specify the vtkm::cont::Invoker to be used to execute worklets by this filter instance. More...
 
VTKM_CONT void SetFieldsToPass (const vtkm::filter::FieldSelection &fieldsToPass)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (vtkm::filter::FieldSelection &&fieldsToPass)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (const vtkm::filter::FieldSelection &fieldsToPass, vtkm::filter::FieldSelection::Mode mode)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (std::initializer_list< std::string > fields, vtkm::filter::FieldSelection::Mode mode=vtkm::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (std::initializer_list< std::pair< std::string, vtkm::cont::Field::Association >> fields, vtkm::filter::FieldSelection::Mode mode=vtkm::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (const std::string &fieldname, vtkm::cont::Field::Association association, vtkm::filter::FieldSelection::Mode mode=vtkm::filter::FieldSelection::Mode::Select)
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetFieldsToPass (const std::string &fieldname, vtkm::filter::FieldSelection::Mode mode)
 Specify which fields get passed from input to output. More...
 
const VTKM_CONT vtkm::filter::FieldSelectionGetFieldsToPass () const
 Specify which fields get passed from input to output. More...
 
VTKM_CONT vtkm::filter::FieldSelectionGetFieldsToPass ()
 Specify which fields get passed from input to output. More...
 
VTKM_CONT void SetPassCoordinateSystems (bool flag)
 Specify whether to always pass coordinate systems. More...
 
VTKM_CONT bool GetPassCoordinateSystems () const
 Specify whether to always pass coordinate systems. More...
 
VTKM_CONT vtkm::cont::DataSet Execute (const vtkm::cont::DataSet &input)
 
VTKM_CONT vtkm::cont::PartitionedDataSet Execute (const vtkm::cont::PartitionedDataSet &input)
 

Private Member Functions

VTKM_CONT vtkm::cont::DataSet DoExecute (const vtkm::cont::DataSet &input) override
 Output field "saddlePeak" wich is pairs of vertex ids indicating saddle and peak of contour. More...
 
VTKM_CONT vtkm::cont::PartitionedDataSet DoExecutePartitions (const vtkm::cont::PartitionedDataSet &inData) override
 
VTKM_CONT void PreExecute (const vtkm::cont::PartitionedDataSet &input)
 
VTKM_CONT void PostExecute (const vtkm::cont::PartitionedDataSet &input, vtkm::cont::PartitionedDataSet &output)
 
template<typename T >
VTKM_CONT void DoPostExecute (const vtkm::cont::PartitionedDataSet &input, vtkm::cont::PartitionedDataSet &output)
 Internal helper function that implements the actual functionality of PostExecute. More...
 

Private Attributes

bool UseMarchingCubes
 Use marching cubes connectivity for computing the contour tree. More...
 
unsigned int ComputeRegularStructure
 
vtkm::worklet::contourtree_augmented::ContourTree ContourTreeData
 The contour tree computed by the filter. More...
 
vtkm::Id NumIterations = 0
 Number of iterations used to compute the contour tree. More...
 
vtkm::worklet::contourtree_augmented::IdArrayType MeshSortOrder
 Array with the sorted order of the mesh vertices. More...
 
std::unique_ptr< vtkm::worklet::contourtree_distributed::MultiBlockContourTreeHelperMultiBlockTreeHelper
 Helper object to help with the parallel merge when running with DIY in parallel with MulitBlock data. More...
 

Additional Inherited Members

- Protected Member Functions inherited from vtkm::filter::FilterField
const VTKM_CONT vtkm::cont::FieldGetFieldFromDataSet (const vtkm::cont::DataSet &input) const
 
const VTKM_CONT vtkm::cont::FieldGetFieldFromDataSet (vtkm::IdComponent index, const vtkm::cont::DataSet &input) const
 
template<typename Functor , typename... Args>
VTKM_CONT void CastAndCallScalarField (const vtkm::cont::UnknownArrayHandle &fieldArray, Functor &&functor, Args &&... args) const
 
template<typename Functor , typename... Args>
VTKM_CONT void CastAndCallScalarField (const vtkm::cont::Field &field, Functor &&functor, Args &&... args) const
 
template<vtkm::IdComponent VecSize, typename Functor , typename... Args>
VTKM_CONT void CastAndCallVecField (const vtkm::cont::UnknownArrayHandle &fieldArray, Functor &&functor, Args &&... args) const
 
template<vtkm::IdComponent VecSize, typename Functor , typename... Args>
VTKM_CONT void CastAndCallVecField (const vtkm::cont::Field &field, Functor &&functor, Args &&... args) const
 
VTKM_CONT vtkm::cont::DataSet CreateResultField (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::Field &resultField) const
 Create the output data set for DoExecute More...
 
VTKM_CONT vtkm::cont::DataSet CreateResultField (const vtkm::cont::DataSet &inDataSet, const std::string &resultFieldName, vtkm::cont::Field::Association resultFieldAssociation, const vtkm::cont::UnknownArrayHandle &resultFieldArray) const
 Create the output data set for DoExecute More...
 
VTKM_CONT vtkm::cont::DataSet CreateResultFieldPoint (const vtkm::cont::DataSet &inDataSet, const std::string &resultFieldName, const vtkm::cont::UnknownArrayHandle &resultFieldArray) const
 Create the output data set for DoExecute More...
 
VTKM_CONT vtkm::cont::DataSet CreateResultFieldCell (const vtkm::cont::DataSet &inDataSet, const std::string &resultFieldName, const vtkm::cont::UnknownArrayHandle &resultFieldArray) const
 Create the output data set for DoExecute More...
 
- Protected Member Functions inherited from vtkm::filter::Filter
VTKM_CONT vtkm::cont::DataSet CreateResult (const vtkm::cont::DataSet &inDataSet) const
 Create the output data set for DoExecute. More...
 
VTKM_CONT vtkm::cont::PartitionedDataSet CreateResult (const vtkm::cont::PartitionedDataSet &input, const vtkm::cont::PartitionedDataSet &resultPartitions) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
VTKM_CONT vtkm::cont::PartitionedDataSet CreateResult (const vtkm::cont::PartitionedDataSet &input, const vtkm::cont::PartitionedDataSet &resultPartitions, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
VTKM_CONT vtkm::cont::DataSet CreateResult (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::UnknownCellSet &resultCellSet, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
VTKM_CONT vtkm::cont::DataSet CreateResultCoordinateSystem (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::UnknownCellSet &resultCellSet, const vtkm::cont::CoordinateSystem &resultCoordSystem, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
template<typename FieldMapper >
VTKM_CONT vtkm::cont::DataSet CreateResultCoordinateSystem (const vtkm::cont::DataSet &inDataSet, const vtkm::cont::UnknownCellSet &resultCellSet, const std::string &coordsName, const vtkm::cont::UnknownArrayHandle &coordsData, FieldMapper &&fieldMapper) const
 Create the output data set for DoExecute. More...
 
- Protected Attributes inherited from vtkm::filter::Filter
vtkm::cont::Invoker Invoke
 

Detailed Description

Construct the Contour Tree for a 2D or 3D regular mesh.

This filter implements the parallel peak pruning algorithm. In contrast to the ContourTreeUniform filter, this filter is optimized to allow for the computation of the augmented contour tree, i.e., the contour tree including all regular mesh vertices. Augmentation with regular vertices is used in practice to compute statistics (e.g., volume), to segment the input mesh, facilitate iso-value selection, enable localization of all verticies of a mesh in the tree among others.

In addition to single-block computation, the filter also supports multi-block regular grids. The blocks are processed in parallel using DIY and then the tree are merged progressively using a binary-reduction scheme to compute the final contour tree. I.e., in the multi-block context, the final tree is constructed on rank 0.

Constructor & Destructor Documentation

◆ ContourTreeAugmented()

VTKM_CONT vtkm::filter::scalar_topology::ContourTreeAugmented::ContourTreeAugmented ( bool  useMarchingCubes = false,
unsigned int  computeRegularStructure = 1 
)
explicit

Create the contour tree filter.

Parameters
[in]useMarchingCubesBoolean indicating whether marching cubes (true) or freudenthal (false) connectivity should be used. Valid only for 3D input data. Default is false.
[in]computeRegularStructureUnsigned int indicating whether the tree should be augmented. 0=no augmentation, 1=full augmentation, 2=boundary augmentation. The latter option (=2) is mainly relevant for multi-block input data to improve efficiency by considering only boundary vertices during the merging of data blocks.

Member Function Documentation

◆ CanThread()

VTKM_CONT bool vtkm::filter::scalar_topology::ContourTreeAugmented::CanThread ( ) const
inlineoverridevirtual

Reimplemented from vtkm::filter::Filter.

◆ DoExecute()

VTKM_CONT vtkm::cont::DataSet vtkm::filter::scalar_topology::ContourTreeAugmented::DoExecute ( const vtkm::cont::DataSet input)
overrideprivatevirtual

Output field "saddlePeak" wich is pairs of vertex ids indicating saddle and peak of contour.

Implements vtkm::filter::Filter.

◆ DoExecutePartitions()

VTKM_CONT vtkm::cont::PartitionedDataSet vtkm::filter::scalar_topology::ContourTreeAugmented::DoExecutePartitions ( const vtkm::cont::PartitionedDataSet inData)
overrideprivatevirtual

Reimplemented from vtkm::filter::Filter.

◆ DoPostExecute()

template<typename T >
VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeAugmented::DoPostExecute ( const vtkm::cont::PartitionedDataSet input,
vtkm::cont::PartitionedDataSet output 
)
private

Internal helper function that implements the actual functionality of PostExecute.

In the case we operate on vtkm::cont::MultiBlock we need to merge the trees computed on the block to compute the final contour tree.

◆ GetContourTree()

const vtkm::worklet::contourtree_augmented::ContourTree& vtkm::filter::scalar_topology::ContourTreeAugmented::GetContourTree ( ) const

Get the contour tree computed by the filter

◆ GetNumIterations()

vtkm::Id vtkm::filter::scalar_topology::ContourTreeAugmented::GetNumIterations ( ) const

Get the number of iterations used to compute the contour tree.

◆ GetSortOrder()

const vtkm::worklet::contourtree_augmented::IdArrayType& vtkm::filter::scalar_topology::ContourTreeAugmented::GetSortOrder ( ) const

Get the sort order for the mesh vertices.

◆ PostExecute()

VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeAugmented::PostExecute ( const vtkm::cont::PartitionedDataSet input,
vtkm::cont::PartitionedDataSet output 
)
private

when operating on vtkm::cont::MultiBlock we want to do processing across ranks as well. Just adding pre/post handles for the same does the trick.

◆ PreExecute()

VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeAugmented::PreExecute ( const vtkm::cont::PartitionedDataSet input)
private

when operating on vtkm::cont::MultiBlock we want to do processing across ranks as well. Just adding pre/post handles for the same does the trick.

◆ SetBlockIndices()

VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeAugmented::SetBlockIndices ( vtkm::Id3  blocksPerDim,
const vtkm::cont::ArrayHandle< vtkm::Id3 > &  localBlockIndices 
)

Define the spatial decomposition of the data in case we run in parallel with a multi-block dataset.

Note: Only used when running on a multi-block dataset.

Parameters
[in]blocksPerDimNumber of data blocks used in each data dimension
[in]localBlockIndicesArray with the (x,y,z) index of each local data block with with respect to blocksPerDim

Member Data Documentation

◆ ComputeRegularStructure

unsigned int vtkm::filter::scalar_topology::ContourTreeAugmented::ComputeRegularStructure
private

◆ ContourTreeData

vtkm::worklet::contourtree_augmented::ContourTree vtkm::filter::scalar_topology::ContourTreeAugmented::ContourTreeData
private

The contour tree computed by the filter.

◆ MeshSortOrder

vtkm::worklet::contourtree_augmented::IdArrayType vtkm::filter::scalar_topology::ContourTreeAugmented::MeshSortOrder
private

Array with the sorted order of the mesh vertices.

◆ MultiBlockTreeHelper

std::unique_ptr<vtkm::worklet::contourtree_distributed::MultiBlockContourTreeHelper> vtkm::filter::scalar_topology::ContourTreeAugmented::MultiBlockTreeHelper
private

Helper object to help with the parallel merge when running with DIY in parallel with MulitBlock data.

◆ NumIterations

vtkm::Id vtkm::filter::scalar_topology::ContourTreeAugmented::NumIterations = 0
private

Number of iterations used to compute the contour tree.

◆ UseMarchingCubes

bool vtkm::filter::scalar_topology::ContourTreeAugmented::UseMarchingCubes
private

Use marching cubes connectivity for computing the contour tree.


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