VTK-m  2.1
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::Filter

Public Member Functions

bool CanThread () const override
 Returns whether the filter can execute on partitions in concurrent threads. More...
 
 ContourTreeAugmented (bool useMarchingCubes=false, unsigned int computeRegularStructure=1)
 Create the contour tree filter. More...
 
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::ContourTree & GetContourTree () const
 
const vtkm::worklet::contourtree_augmented::IdArrayType & GetSortOrder () 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::Filter
 Filter ()
 
virtual ~Filter ()
 
vtkm::cont::DataSet Execute (const vtkm::cont::DataSet &input)
 Executes the filter on the input and produces a result dataset. More...
 
vtkm::cont::PartitionedDataSet Execute (const vtkm::cont::PartitionedDataSet &input)
 Executes the filter on the input PartitionedDataSet and produces a result PartitionedDataSet. More...
 
void SetFieldsToPass (const vtkm::filter::FieldSelection &fieldsToPass)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (vtkm::filter::FieldSelection &&fieldsToPass)
 Specify which fields get passed from input to output. More...
 
void SetFieldsToPass (const vtkm::filter::FieldSelection &fieldsToPass, vtkm::filter::FieldSelection::Mode mode)
 
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...
 
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...
 
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...
 
void SetFieldsToPass (const std::string &fieldname, vtkm::filter::FieldSelection::Mode mode)
 Specify which fields get passed from input to output. More...
 
const vtkm::filter::FieldSelectionGetFieldsToPass () const
 Specify which fields get passed from input to output. More...
 
vtkm::filter::FieldSelectionGetFieldsToPass ()
 Specify which fields get passed from input to output. More...
 
void SetPassCoordinateSystems (bool flag)
 Specify whether to always pass coordinate systems. More...
 
bool GetPassCoordinateSystems () const
 Specify whether to always pass coordinate systems. More...
 
void SetOutputFieldName (const std::string &name)
 Specifies the name of the output field generated. More...
 
const std::string & GetOutputFieldName () const
 Specifies the name of the output field generated. More...
 
void SetActiveField (const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any)
 Specifies a field to operate on. More...
 
void SetActiveField (vtkm::IdComponent index, const std::string &name, vtkm::cont::Field::Association association=vtkm::cont::Field::Association::Any)
 Specifies a field to operate on. More...
 
const std::string & GetActiveFieldName (vtkm::IdComponent index=0) const
 Specifies a field to operate on. More...
 
vtkm::cont::Field::Association GetActiveFieldAssociation (vtkm::IdComponent index=0) const
 Specifies a field to operate on. More...
 
void SetActiveCoordinateSystem (vtkm::Id coord_idx)
 Specifies the coordinate system index to make active to use when processing the input vtkm::cont::DataSet. More...
 
void SetActiveCoordinateSystem (vtkm::IdComponent index, vtkm::Id coord_idx)
 Specifies the coordinate system index to make active to use when processing the input vtkm::cont::DataSet. More...
 
vtkm::Id GetActiveCoordinateSystemIndex (vtkm::IdComponent index=0) const
 Specifies the coordinate system index to make active to use when processing the input vtkm::cont::DataSet. More...
 
void SetUseCoordinateSystemAsField (bool val)
 Specifies whether to use point coordinates as the input field. More...
 
void SetUseCoordinateSystemAsField (vtkm::IdComponent index, bool val)
 Specifies whether to use point coordinates as the input field. More...
 
bool GetUseCoordinateSystemAsField (vtkm::IdComponent index=0) const
 Specifies whether to use point coordinates as the input field. More...
 
vtkm::IdComponent GetNumberOfActiveFields () const
 Return the number of active fields currently set. More...
 
void SetThreadsPerCPU (vtkm::Id numThreads)
 
void SetThreadsPerGPU (vtkm::Id numThreads)
 
vtkm::Id GetThreadsPerCPU () const
 
vtkm::Id GetThreadsPerGPU () const
 
bool GetRunMultiThreadedFilter () const
 
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...
 

Private Member Functions

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::PartitionedDataSet DoExecutePartitions (const vtkm::cont::PartitionedDataSet &inData) override
 
void PreExecute (const vtkm::cont::PartitionedDataSet &input)
 
void PostExecute (const vtkm::cont::PartitionedDataSet &input, vtkm::cont::PartitionedDataSet &output)
 
template<typename T >
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::MultiBlockContourTreeHelper > MultiBlockTreeHelper
 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::Filter
vtkm::cont::DataSet CreateResult (const vtkm::cont::DataSet &inDataSet) const
 Create the output data set for DoExecute. More...
 
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::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::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::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...
 
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::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::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::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::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...
 
const vtkm::cont::FieldGetFieldFromDataSet (const vtkm::cont::DataSet &input) const
 Retrieve an input field from a vtkm::cont::DataSet object. More...
 
const vtkm::cont::FieldGetFieldFromDataSet (vtkm::IdComponent index, const vtkm::cont::DataSet &input) const
 Retrieve an input field from a vtkm::cont::DataSet object. More...
 
template<typename Functor , typename... Args>
void CastAndCallScalarField (const vtkm::cont::UnknownArrayHandle &fieldArray, Functor &&functor, Args &&... args) const
 Convenience method to get the array from a filter's input scalar field. More...
 
template<typename Functor , typename... Args>
void CastAndCallScalarField (const vtkm::cont::Field &field, Functor &&functor, Args &&... args) const
 Convenience method to get the array from a filter's input scalar field. More...
 
template<vtkm::IdComponent VecSize, typename Functor , typename... Args>
void CastAndCallVecField (const vtkm::cont::UnknownArrayHandle &fieldArray, Functor &&functor, Args &&... args) const
 Convenience method to get the array from a filter's input vector field. More...
 
template<vtkm::IdComponent VecSize, typename Functor , typename... Args>
void CastAndCallVecField (const vtkm::cont::Field &field, Functor &&functor, Args &&... args) const
 Convenience method to get the array from a filter's input vector field. More...
 
template<typename Functor , typename... Args>
void CastAndCallVariableVecField (const vtkm::cont::UnknownArrayHandle &fieldArray, Functor &&functor, Args &&... args) const
 This method is like CastAndCallVecField except that it can be used for a field of unknown vector size (or scalars). More...
 
template<typename Functor , typename... Args>
void CastAndCallVariableVecField (const vtkm::cont::Field &field, Functor &&functor, Args &&... args) const
 This method is like CastAndCallVecField except that it can be used for a field of unknown vector size (or scalars). 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::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()

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

Returns whether the filter can execute on partitions in concurrent threads.

If a derived class's implementation of DoExecute cannot run on multiple threads, then the derived class should override this method to return false.

Reimplemented from vtkm::filter::Filter.

◆ DoExecute()

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::PartitionedDataSet vtkm::filter::scalar_topology::ContourTreeAugmented::DoExecutePartitions ( const vtkm::cont::PartitionedDataSet inData)
overrideprivatevirtual

Reimplemented from vtkm::filter::Filter.

◆ DoPostExecute()

template<typename T >
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()

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()

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()

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: