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

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

#include <ContourTreeUniformDistributed.h>

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

Public Member Functions

VTKM_CONT bool CanThread () const override
 
 ContourTreeUniformDistributed (vtkm::cont::LogLevel timingsLogLevel=vtkm::cont::LogLevel::Perf, vtkm::cont::LogLevel treeLogLevel=vtkm::cont::LogLevel::Info)
 
VTKM_CONT void SetUseBoundaryExtremaOnly (bool useBoundaryExtremaOnly)
 
VTKM_CONT bool GetUseBoundaryExtremaOnly ()
 
VTKM_CONT void SetUseMarchingCubes (bool useMarchingCubes)
 
VTKM_CONT bool GetUseMarchingCubes ()
 
VTKM_CONT void SetAugmentHierarchicalTree (bool augmentHierarchicalTree)
 
VTKM_CONT void SetBlockIndices (vtkm::Id3 blocksPerDim, const vtkm::cont::ArrayHandle< vtkm::Id3 > &localBlockIndices)
 
VTKM_CONT bool GetAugmentHierarchicalTree ()
 
VTKM_CONT void SetSaveDotFiles (bool saveDotFiles)
 
VTKM_CONT bool GetSaveDotFiles ()
 
template<typename T , typename StorageType >
VTKM_CONT void ComputeLocalTree (const vtkm::Id blockIndex, const vtkm::cont::DataSet &input, const vtkm::cont::ArrayHandle< T, StorageType > &fieldArray)
 
template<typename T , typename StorageType , typename MeshType , typename MeshBoundaryExecType >
VTKM_CONT void ComputeLocalTreeImpl (const vtkm::Id blockIndex, const vtkm::cont::DataSet &input, const vtkm::cont::ArrayHandle< T, StorageType > &field, MeshType &mesh, MeshBoundaryExecType &meshBoundaryExecObject)
 Implement per block contour tree computation after the MeshType has been discovered. 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
 
VTKM_CONT vtkm::cont::PartitionedDataSet DoExecutePartitions (const vtkm::cont::PartitionedDataSet &input) 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 FieldType >
VTKM_CONT void ComputeVolumeMetric (vtkmdiy::Master &inputContourTreeMaster, vtkmdiy::DynamicAssigner &assigner, vtkmdiy::RegularSwapPartners &partners, const FieldType &, std::stringstream &timingsStream, std::vector< vtkm::cont::DataSet > &hierarchicalTreeOutputDataSet)
 
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 UseBoundaryExtremaOnly
 Use only boundary critical points in the parallel merge to reduce communication. More...
 
bool UseMarchingCubes
 Use marching cubes connectivity for computing the contour tree. More...
 
bool AugmentHierarchicalTree
 Augment hierarchical tree. More...
 
bool SaveDotFiles
 Save dot files for all tree computations. More...
 
vtkm::cont::LogLevel TimingsLogLevel = vtkm::cont::LogLevel::Perf
 Log level to be used for outputting timing information. Default is vtkm::cont::LogLevel::Perf. More...
 
vtkm::cont::LogLevel TreeLogLevel = vtkm::cont::LogLevel::Info
 Log level to be used for outputting metadata about the trees. Default is vtkm::cont::LogLevel::Info. More...
 
vtkm::Id3 BlocksPerDimension
 Information about block decomposition TODO/FIXME: Remove need for this information. More...
 
vtkm::cont::ArrayHandle< vtkm::Id3LocalBlockIndices
 
std::vector< vtkm::worklet::contourtree_augmented::DataSetMeshLocalMeshes
 Intermediate results (one per local data block)... More...
 
std::vector< vtkm::worklet::contourtree_augmented::ContourTreeLocalContourTrees
 ... local contour trees etc. computed during fan in and used during fan out More...
 
std::vector< vtkm::worklet::contourtree_distributed::BoundaryTreeLocalBoundaryTrees
 
std::vector< vtkm::worklet::contourtree_distributed::InteriorForestLocalInteriorForests
 
vtkm::Id NumIterations
 The hierarchical trees computed by the filter (array with one entry per block) 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

◆ ContourTreeUniformDistributed()

vtkm::filter::scalar_topology::ContourTreeUniformDistributed::ContourTreeUniformDistributed ( vtkm::cont::LogLevel  timingsLogLevel = vtkm::cont::LogLevel::Perf,
vtkm::cont::LogLevel  treeLogLevel = vtkm::cont::LogLevel::Info 
)

Member Function Documentation

◆ CanThread()

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

Reimplemented from vtkm::filter::Filter.

◆ ComputeLocalTree()

template<typename T , typename StorageType >
VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeUniformDistributed::ComputeLocalTree ( const vtkm::Id  blockIndex,
const vtkm::cont::DataSet input,
const vtkm::cont::ArrayHandle< T, StorageType > &  fieldArray 
)

◆ ComputeLocalTreeImpl()

template<typename T , typename StorageType , typename MeshType , typename MeshBoundaryExecType >
VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeUniformDistributed::ComputeLocalTreeImpl ( const vtkm::Id  blockIndex,
const vtkm::cont::DataSet input,
const vtkm::cont::ArrayHandle< T, StorageType > &  field,
MeshType &  mesh,
MeshBoundaryExecType &  meshBoundaryExecObject 
)

Implement per block contour tree computation after the MeshType has been discovered.

◆ ComputeVolumeMetric()

template<typename FieldType >
VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeUniformDistributed::ComputeVolumeMetric ( vtkmdiy::Master &  inputContourTreeMaster,
vtkmdiy::DynamicAssigner &  assigner,
vtkmdiy::RegularSwapPartners &  partners,
const FieldType &  ,
std::stringstream &  timingsStream,
std::vector< vtkm::cont::DataSet > &  hierarchicalTreeOutputDataSet 
)
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.

◆ DoExecute()

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

Implements vtkm::filter::Filter.

◆ DoExecutePartitions()

VTKM_CONT vtkm::cont::PartitionedDataSet vtkm::filter::scalar_topology::ContourTreeUniformDistributed::DoExecutePartitions ( const vtkm::cont::PartitionedDataSet input)
overrideprivatevirtual

Reimplemented from vtkm::filter::Filter.

◆ DoPostExecute()

template<typename T >
VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeUniformDistributed::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.

◆ GetAugmentHierarchicalTree()

VTKM_CONT bool vtkm::filter::scalar_topology::ContourTreeUniformDistributed::GetAugmentHierarchicalTree ( )
inline

◆ GetSaveDotFiles()

VTKM_CONT bool vtkm::filter::scalar_topology::ContourTreeUniformDistributed::GetSaveDotFiles ( )
inline

◆ GetUseBoundaryExtremaOnly()

VTKM_CONT bool vtkm::filter::scalar_topology::ContourTreeUniformDistributed::GetUseBoundaryExtremaOnly ( )
inline

◆ GetUseMarchingCubes()

VTKM_CONT bool vtkm::filter::scalar_topology::ContourTreeUniformDistributed::GetUseMarchingCubes ( )
inline

◆ PostExecute()

VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeUniformDistributed::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::ContourTreeUniformDistributed::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.

◆ SetAugmentHierarchicalTree()

VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeUniformDistributed::SetAugmentHierarchicalTree ( bool  augmentHierarchicalTree)
inline

◆ SetBlockIndices()

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

◆ SetSaveDotFiles()

VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeUniformDistributed::SetSaveDotFiles ( bool  saveDotFiles)
inline

◆ SetUseBoundaryExtremaOnly()

VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeUniformDistributed::SetUseBoundaryExtremaOnly ( bool  useBoundaryExtremaOnly)
inline

◆ SetUseMarchingCubes()

VTKM_CONT void vtkm::filter::scalar_topology::ContourTreeUniformDistributed::SetUseMarchingCubes ( bool  useMarchingCubes)
inline

Member Data Documentation

◆ AugmentHierarchicalTree

bool vtkm::filter::scalar_topology::ContourTreeUniformDistributed::AugmentHierarchicalTree
private

Augment hierarchical tree.

◆ BlocksPerDimension

vtkm::Id3 vtkm::filter::scalar_topology::ContourTreeUniformDistributed::BlocksPerDimension
private

Information about block decomposition TODO/FIXME: Remove need for this information.

◆ LocalBlockIndices

vtkm::cont::ArrayHandle<vtkm::Id3> vtkm::filter::scalar_topology::ContourTreeUniformDistributed::LocalBlockIndices
private

◆ LocalBoundaryTrees

std::vector<vtkm::worklet::contourtree_distributed::BoundaryTree> vtkm::filter::scalar_topology::ContourTreeUniformDistributed::LocalBoundaryTrees
private

◆ LocalContourTrees

std::vector<vtkm::worklet::contourtree_augmented::ContourTree> vtkm::filter::scalar_topology::ContourTreeUniformDistributed::LocalContourTrees
private

... local contour trees etc. computed during fan in and used during fan out

◆ LocalInteriorForests

std::vector<vtkm::worklet::contourtree_distributed::InteriorForest> vtkm::filter::scalar_topology::ContourTreeUniformDistributed::LocalInteriorForests
private

◆ LocalMeshes

std::vector<vtkm::worklet::contourtree_augmented::DataSetMesh> vtkm::filter::scalar_topology::ContourTreeUniformDistributed::LocalMeshes
private

Intermediate results (one per local data block)...

... local mesh information needed at end of fan out

◆ NumIterations

vtkm::Id vtkm::filter::scalar_topology::ContourTreeUniformDistributed::NumIterations
private

The hierarchical trees computed by the filter (array with one entry per block)

Number of iterations used to compute the contour tree

◆ SaveDotFiles

bool vtkm::filter::scalar_topology::ContourTreeUniformDistributed::SaveDotFiles
private

Save dot files for all tree computations.

◆ TimingsLogLevel

vtkm::cont::LogLevel vtkm::filter::scalar_topology::ContourTreeUniformDistributed::TimingsLogLevel = vtkm::cont::LogLevel::Perf
private

Log level to be used for outputting timing information. Default is vtkm::cont::LogLevel::Perf.

◆ TreeLogLevel

vtkm::cont::LogLevel vtkm::filter::scalar_topology::ContourTreeUniformDistributed::TreeLogLevel = vtkm::cont::LogLevel::Info
private

Log level to be used for outputting metadata about the trees. Default is vtkm::cont::LogLevel::Info.

◆ UseBoundaryExtremaOnly

bool vtkm::filter::scalar_topology::ContourTreeUniformDistributed::UseBoundaryExtremaOnly
private

Use only boundary critical points in the parallel merge to reduce communication.

Disabling this should only be needed for performance testing.

◆ UseMarchingCubes

bool vtkm::filter::scalar_topology::ContourTreeUniformDistributed::UseMarchingCubes
private

Use marching cubes connectivity for computing the contour tree.


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