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

Public Member Functions

bool CanThread () const override
 Returns whether the filter can execute on partitions in concurrent threads. More...
 
 ContourTreeUniformDistributed (vtkm::cont::LogLevel timingsLogLevel=vtkm::cont::LogLevel::Perf, vtkm::cont::LogLevel treeLogLevel=vtkm::cont::LogLevel::Info)
 
void SetUseBoundaryExtremaOnly (bool useBoundaryExtremaOnly)
 
bool GetUseBoundaryExtremaOnly ()
 
void SetUseMarchingCubes (bool useMarchingCubes)
 
bool GetUseMarchingCubes ()
 
void SetAugmentHierarchicalTree (bool augmentHierarchicalTree)
 
void SetBlockIndices (vtkm::Id3 blocksPerDim, const vtkm::cont::ArrayHandle< vtkm::Id3 > &localBlockIndices)
 
bool GetAugmentHierarchicalTree ()
 
void SetSaveDotFiles (bool saveDotFiles)
 
bool GetSaveDotFiles ()
 
template<typename T , typename StorageType >
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 >
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::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
 
vtkm::cont::PartitionedDataSet DoExecutePartitions (const vtkm::cont::PartitionedDataSet &input) override
 
void PreExecute (const vtkm::cont::PartitionedDataSet &input)
 
void PostExecute (const vtkm::cont::PartitionedDataSet &input, vtkm::cont::PartitionedDataSet &output)
 
template<typename FieldType >
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 >
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::DataSetMesh > LocalMeshes
 Intermediate results (one per local data block)... More...
 
std::vector< vtkm::worklet::contourtree_augmented::ContourTree > LocalContourTrees
 ... local contour trees etc. computed during fan in and used during fan out More...
 
std::vector< vtkm::worklet::contourtree_distributed::BoundaryTree > LocalBoundaryTrees
 
std::vector< vtkm::worklet::contourtree_distributed::InteriorForest > LocalInteriorForests
 
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::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

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

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

◆ ComputeLocalTree()

template<typename T , typename StorageType >
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 >
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 >
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::DataSet vtkm::filter::scalar_topology::ContourTreeUniformDistributed::DoExecute ( const vtkm::cont::DataSet input)
overrideprivatevirtual

Implements vtkm::filter::Filter.

◆ DoExecutePartitions()

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

Reimplemented from vtkm::filter::Filter.

◆ DoPostExecute()

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

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

◆ GetSaveDotFiles()

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

◆ GetUseBoundaryExtremaOnly()

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

◆ GetUseMarchingCubes()

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

◆ PostExecute()

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

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

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

◆ SetBlockIndices()

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

◆ SetSaveDotFiles()

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

◆ SetUseBoundaryExtremaOnly()

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

◆ SetUseMarchingCubes()

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: