migrate ContourTreeUniform filter

This commit is contained in:
Li-Ta Lo 2022-06-09 11:49:49 -06:00
parent 33cd0b9e2c
commit 579b75bb04
63 changed files with 249 additions and 403 deletions

@ -18,6 +18,7 @@ set(deprecated_headers
ClipWithImplicitFunction.h
ComputeMoments.h
Contour.h
ContourTreeUniform.h
CoordinateSystemTransform.h
CrossProduct.h
DotProduct.h
@ -101,7 +102,6 @@ vtkm_declare_headers(${common_header_template_sources})
set(extra_headers
ContourTreeUniformAugmented.h
ContourTreeUniformDistributed.h
ContourTreeUniform.h
Lagrangian.h
LagrangianStructures.h
ParticleAdvection.h
@ -114,7 +114,6 @@ set(extra_headers
set(extra_header_template_sources
ContourTreeUniformAugmented.hxx
ContourTreeUniformDistributed.hxx
ContourTreeUniform.hxx
Lagrangian.hxx
LagrangianStructures.hxx
ParticleAdvection.hxx

@ -7,109 +7,28 @@
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
// Copyright (c) 2016, Los Alamos National Security, LLC
// All rights reserved.
//
// Copyright 2016. Los Alamos National Security, LLC.
// This software was produced under U.S. Government contract DE-AC52-06NA25396
// for Los Alamos National Laboratory (LANL), which is operated by
// Los Alamos National Security, LLC for the U.S. Department of Energy.
// The U.S. Government has rights to use, reproduce, and distribute this
// software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, LLC
// MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE
// USE OF THIS SOFTWARE. If software is modified to produce derivative works,
// such modified software should be clearly marked, so as not to confuse it
// with the version available from LANL.
//
// Additionally, redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of Los Alamos National Security, LLC, Los Alamos
// National Laboratory, LANL, the U.S. Government, nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND
// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS
// NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//============================================================================
// This code is based on the algorithm presented in the paper:
// “Parallel Peak Pruning for Scalable SMP Contour Tree Computation.”
// Hamish Carr, Gunther Weber, Christopher Sewell, and James Ahrens.
// Proceedings of the IEEE Symposium on Large Data Analysis and Visualization
// (LDAV), October 2016, Baltimore, Maryland.
#ifndef vtk_m_filter_ContourTreeUniform_h
#define vtk_m_filter_ContourTreeUniform_h
#include <vtkm/filter/FilterField.h>
#include <vtkm/Deprecated.h>
#include <vtkm/filter/scalar_topology/ContourTreeUniform.h>
namespace vtkm
{
namespace filter
{
/// \brief Construct the ContourTree for a 2D Mesh
///
/// Output field "saddlePeak" which is pairs of vertex ids indicating saddle and
/// peak of contour
/// Based on the algorithm presented in the paper:
// “Parallel Peak Pruning for Scalable SMP Contour Tree Computation.”
class ContourTreeMesh2D : public vtkm::filter::FilterField<ContourTreeMesh2D>
VTKM_DEPRECATED(1.8,
"Use vtkm/filter/scalar_topology/ContourTreeUniform.h instead of "
"vtkm/filter/ContourTreeUniform.h.")
inline void ContourTreeUniform_deprecated() {}
inline void ContourTreeUniform_deprecated_warning()
{
public:
using SupportedTypes = TypeListScalarAll;
ContourTreeUniform_deprecated();
}
VTKM_CONT
ContourTreeMesh2D();
/// Output field
template <typename T, typename StorageType, typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<T, StorageType>& field,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
};
/// \brief Construct the ContourTree for a 3D Mesh
///
/// Output field "saddlePeak" which is pairs of vertex ids indicating saddle and
/// peak of contour
/// Based on the algorithm presented in the paper:
// “Parallel Peak Pruning for Scalable SMP Contour Tree Computation.”
class ContourTreeMesh3D : public vtkm::filter::FilterField<ContourTreeMesh3D>
{
public:
using SupportedTypes = TypeListScalarAll;
VTKM_CONT
ContourTreeMesh3D();
/// Output field "saddlePeak" which is pairs of vertex ids indicating saddle and peak of contour
template <typename T, typename StorageType, typename DerivedPolicy>
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<T, StorageType>& field,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>& policy);
};
}
} // namespace vtkm::filter
#include <vtkm/filter/ContourTreeUniform.hxx>
#endif // vtk_m_filter_ContourTreeUniform_h
#endif //vtk_m_filter_ContourTreeUniform_h

@ -8,12 +8,14 @@
## PURPOSE. See the above copyright notice for more information.
##============================================================================
set(scalar_topology_headers
ContourTreeUniform.h
DistributedBranchDecompositionFilter.h
)
set(scalar_topology_sources
internal/BranchDecompositionBlock.cxx
internal/ComputeDistributedBranchDecompositionFunctor.cxx
ContourTreeUniform.cxx
DistributedBranchDecompositionFilter.cxx
)

@ -54,43 +54,34 @@
// Proceedings of the IEEE Symposium on Large Data Analysis and Visualization
// (LDAV), October 2016, Baltimore, Maryland.
#ifndef vtk_m_filter_ContourTreeUniform_hxx
#define vtk_m_filter_ContourTreeUniform_hxx
#include <vtkm/cont/ErrorFilterExecution.h>
#include <vtkm/worklet/ContourTreeUniform.h>
#include <vtkm/filter/scalar_topology/ContourTreeUniform.h>
#include <vtkm/filter/scalar_topology/worklet/ContourTreeUniform.h>
namespace vtkm
{
namespace filter
{
namespace scalar_topology
{
//-----------------------------------------------------------------------------
ContourTreeMesh2D::ContourTreeMesh2D()
: vtkm::filter::FilterField<ContourTreeMesh2D>()
{
this->SetOutputFieldName("saddlePeak");
}
//-----------------------------------------------------------------------------
template <typename T, typename StorageType, typename DerivedPolicy>
vtkm::cont::DataSet ContourTreeMesh2D::DoExecute(
const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<T, StorageType>& field,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>&)
vtkm::cont::DataSet ContourTreeMesh2D::DoExecute(const vtkm::cont::DataSet& input)
{
if (fieldMeta.IsPointField() == false)
const auto& field = this->GetFieldFromDataSet(input);
if (!field.IsFieldPoint())
{
throw vtkm::cont::ErrorFilterExecution("ContourTreeMesh2D expects point field input.");
}
// Collect sizing information from the dataset
const auto& dynamicCellSet = input.GetCellSet();
vtkm::cont::CellSetStructured<2> cellSet;
dynamicCellSet.AsCellSet(cellSet);
input.GetCellSet().AsCellSet(cellSet);
vtkm::Id2 pointDimensions = cellSet.GetPointDimensions();
vtkm::Id nRows = pointDimensions[0];
@ -98,27 +89,27 @@ vtkm::cont::DataSet ContourTreeMesh2D::DoExecute(
vtkm::cont::ArrayHandle<vtkm::Pair<vtkm::Id, vtkm::Id>> saddlePeak;
vtkm::worklet::ContourTreeMesh2D worklet;
worklet.Run(field, nRows, nCols, saddlePeak);
auto resolveType = [&](const auto& concrete) {
vtkm::worklet::ContourTreeMesh2D worklet;
worklet.Run(concrete, nRows, nCols, saddlePeak);
};
this->CastAndCallScalarField(field, resolveType);
return CreateResultFieldCell(input, saddlePeak, this->GetOutputFieldName());
return this->CreateResultField(
input, this->GetOutputFieldName(), vtkm::cont::Field::Association::WholeMesh, saddlePeak);
}
//-----------------------------------------------------------------------------
ContourTreeMesh3D::ContourTreeMesh3D()
: vtkm::filter::FilterField<ContourTreeMesh3D>()
{
this->SetOutputFieldName("saddlePeak");
}
//-----------------------------------------------------------------------------
template <typename T, typename StorageType, typename DerivedPolicy>
vtkm::cont::DataSet ContourTreeMesh3D::DoExecute(
const vtkm::cont::DataSet& input,
const vtkm::cont::ArrayHandle<T, StorageType>& field,
const vtkm::filter::FieldMetadata& fieldMeta,
const vtkm::filter::PolicyBase<DerivedPolicy>&)
vtkm::cont::DataSet ContourTreeMesh3D::DoExecute(const vtkm::cont::DataSet& input)
{
if (fieldMeta.IsPointField() == false)
const auto& field = this->GetFieldFromDataSet(input);
if (!field.IsFieldPoint())
{
throw vtkm::cont::ErrorFilterExecution("Point field expected.");
}
@ -134,12 +125,15 @@ vtkm::cont::DataSet ContourTreeMesh3D::DoExecute(
vtkm::cont::ArrayHandle<vtkm::Pair<vtkm::Id, vtkm::Id>> saddlePeak;
vtkm::worklet::ContourTreeMesh3D worklet;
worklet.Run(field, nRows, nCols, nSlices, saddlePeak);
auto resolveType = [&](const auto& concrete) {
vtkm::worklet::ContourTreeMesh3D worklet;
worklet.Run(concrete, nRows, nCols, nSlices, saddlePeak);
};
this->CastAndCallScalarField(field, resolveType);
return CreateResult(input, saddlePeak, this->GetOutputFieldName(), fieldMeta);
return this->CreateResultField(
input, this->GetOutputFieldName(), vtkm::cont::Field::Association::WholeMesh, saddlePeak);
}
}
} // namespace vtkm::filter
#endif
} // namespace scalar_topology
} // namespace filter
} // namespace vtkm

@ -0,0 +1,116 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
// Copyright (c) 2016, Los Alamos National Security, LLC
// All rights reserved.
//
// Copyright 2016. Los Alamos National Security, LLC.
// This software was produced under U.S. Government contract DE-AC52-06NA25396
// for Los Alamos National Laboratory (LANL), which is operated by
// Los Alamos National Security, LLC for the U.S. Department of Energy.
// The U.S. Government has rights to use, reproduce, and distribute this
// software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, LLC
// MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE
// USE OF THIS SOFTWARE. If software is modified to produce derivative works,
// such modified software should be clearly marked, so as not to confuse it
// with the version available from LANL.
//
// Additionally, redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of Los Alamos National Security, LLC, Los Alamos
// National Laboratory, LANL, the U.S. Government, nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND
// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS
// NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//============================================================================
// This code is based on the algorithm presented in the paper:
// “Parallel Peak Pruning for Scalable SMP Contour Tree Computation.”
// Hamish Carr, Gunther Weber, Christopher Sewell, and James Ahrens.
// Proceedings of the IEEE Symposium on Large Data Analysis and Visualization
// (LDAV), October 2016, Baltimore, Maryland.
#ifndef vtk_m_filter_scalar_topology_ContourTreeUniform_h
#define vtk_m_filter_scalar_topology_ContourTreeUniform_h
#include <vtkm/filter/NewFilterField.h>
#include <vtkm/filter/scalar_topology/vtkm_filter_scalar_topology_export.h>
namespace vtkm
{
namespace filter
{
namespace scalar_topology
{
/// \brief Construct the ContourTree for a 2D Mesh
///
/// Output field "saddlePeak" which is pairs of vertex ids indicating saddle and
/// peak of contour
/// Based on the algorithm presented in the paper:
// “Parallel Peak Pruning for Scalable SMP Contour Tree Computation.”
class VTKM_FILTER_SCALAR_TOPOLOGY_EXPORT ContourTreeMesh2D : public vtkm::filter::NewFilterField
{
public:
VTKM_CONT
ContourTreeMesh2D();
private:
/// Output field
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
};
/// \brief Construct the ContourTree for a 3D Mesh
///
/// Output field "saddlePeak" which is pairs of vertex ids indicating saddle and
/// peak of contour
/// Based on the algorithm presented in the paper:
// “Parallel Peak Pruning for Scalable SMP Contour Tree Computation.”
class VTKM_FILTER_SCALAR_TOPOLOGY_EXPORT ContourTreeMesh3D : public vtkm::filter::NewFilterField
{
public:
VTKM_CONT
ContourTreeMesh3D();
private:
/// Output field "saddlePeak" which is pairs of vertex ids indicating saddle and peak of contour
VTKM_CONT vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
};
} // namespace scalar_topology
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::scalar_topology::ContourTree2D.") ContourTree2D
: public vtkm::filter::scalar_topology::ContourTreeMesh2D
{
using scalar_topology::ContourTreeMesh2D::ContourTreeMesh2D;
};
class VTKM_DEPRECATED(1.8, "Use vtkm::filter::scalar_topology::ContourTree3D.") ContourTree3D
: public vtkm::filter::scalar_topology::ContourTreeMesh3D
{
using scalar_topology::ContourTreeMesh3D::ContourTreeMesh3D;
};
} // namespace filter
} // namespace vtkm
#endif // vtk_m_filter_scalar_topology_ContourTreeUniform_h

@ -53,9 +53,6 @@
#include <vtkm/cont/ArrayCopy.h>
#include <vtkm/filter/scalar_topology/internal/BranchDecompositionBlock.h>
// Contour tree includes, not ye moved to new filter design
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{
namespace filter

@ -11,6 +11,7 @@
##=============================================================================
set(unit_tests
UnitTestContourTreeUniformFilter.cxx
UnitTestDistributedBranchDecompositionFilter.cxx
)

@ -54,7 +54,7 @@
// Proceedings of the IEEE Symposium on Large Data Analysis and Visualization
// (LDAV), October 2016, Baltimore, Maryland.
#include <vtkm/filter/ContourTreeUniform.h>
#include <vtkm/filter/scalar_topology/ContourTreeUniform.h>
#include <vtkm/cont/testing/MakeTestDataSet.h>
#include <vtkm/cont/testing/Testing.h>
@ -79,7 +79,7 @@ public:
// Convert 2D mesh of values into contour tree, pairs of vertex ids
vtkm::filter::ContourTreeMesh2D contourTreeMesh2D;
vtkm::filter::scalar_topology::ContourTreeMesh2D contourTreeMesh2D;
contourTreeMesh2D.SetActiveField("pointvar");
// Output data set is pairs of saddle and peak vertex IDs
@ -118,7 +118,7 @@ public:
vtkm::cont::DataSet inDataSet = MakeTestDataSet().Make3DUniformDataSet1();
// Convert 2D mesh of values into contour tree, pairs of vertex ids
vtkm::filter::ContourTreeMesh3D contourTreeMesh3D;
vtkm::filter::scalar_topology::ContourTreeMesh3D contourTreeMesh3D;
contourTreeMesh3D.SetActiveField("pointvar");
// Output data set is pairs of saddle and peak vertex IDs

@ -50,7 +50,7 @@
// Oliver Ruebel (LBNL)
//==============================================================================
#include "vtkm/filter/testing/TestingContourTreeUniformDistributedFilter.h"
#include <vtkm/filter/testing/TestingContourTreeUniformDistributedFilter.h>
namespace
{

@ -9,3 +9,4 @@
##============================================================================
add_subdirectory(branch_decomposition)
add_subdirectory(contourtree)

@ -73,11 +73,11 @@
#pragma GCC diagnostic ignored "-Wstrict-overflow"
#endif
#include <vtkm/worklet/contourtree/ChainGraph.h>
#include <vtkm/worklet/contourtree/ContourTree.h>
#include <vtkm/worklet/contourtree/MergeTree.h>
#include <vtkm/worklet/contourtree/Mesh2D_DEM_Triangulation.h>
#include <vtkm/worklet/contourtree/Mesh3D_DEM_Triangulation.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/ChainGraph.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/ContourTree.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/MergeTree.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh2D_DEM_Triangulation.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh3D_DEM_Triangulation.h>
const bool JOIN = true;
const bool SPLIT = false;

@ -71,17 +71,17 @@
#ifndef vtkm_worklet_contourtree_chaingraph_h
#define vtkm_worklet_contourtree_chaingraph_h
#include <vtkm/worklet/contourtree/ActiveEdgeTransferrer.h>
#include <vtkm/worklet/contourtree/ChainDoubler.h>
#include <vtkm/worklet/contourtree/EdgePeakComparator.h>
#include <vtkm/worklet/contourtree/GoverningSaddleFinder.h>
#include <vtkm/worklet/contourtree/JoinTreeTransferrer.h>
#include <vtkm/worklet/contourtree/PrintVectors.h>
#include <vtkm/worklet/contourtree/RegularPointTransferrer.h>
#include <vtkm/worklet/contourtree/SaddleAscentFunctor.h>
#include <vtkm/worklet/contourtree/SaddleAscentTransferrer.h>
#include <vtkm/worklet/contourtree/TrunkBuilder.h>
#include <vtkm/worklet/contourtree/VertexDegreeUpdater.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/ActiveEdgeTransferrer.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/ChainDoubler.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/EdgePeakComparator.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/GoverningSaddleFinder.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/JoinTreeTransferrer.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/PrintVectors.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/RegularPointTransferrer.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/SaddleAscentFunctor.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/SaddleAscentTransferrer.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/TrunkBuilder.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/VertexDegreeUpdater.h>
#include <vtkm/cont/Algorithm.h>
#include <vtkm/cont/ArrayCopy.h>

@ -121,26 +121,26 @@
#define vtkm_worklet_contourtree_contourtree_h
// local includes
#include <vtkm/worklet/contourtree/ChainGraph.h>
#include <vtkm/worklet/contourtree/CopyJoinSplit.h>
#include <vtkm/worklet/contourtree/CopyNeighbors.h>
#include <vtkm/worklet/contourtree/CopySupernodes.h>
#include <vtkm/worklet/contourtree/DegreeDelta.h>
#include <vtkm/worklet/contourtree/DegreeSubrangeOffset.h>
#include <vtkm/worklet/contourtree/FillSupernodes.h>
#include <vtkm/worklet/contourtree/FindLeaves.h>
#include <vtkm/worklet/contourtree/MergeTree.h>
#include <vtkm/worklet/contourtree/PrintVectors.h>
#include <vtkm/worklet/contourtree/RegularToCandidate.h>
#include <vtkm/worklet/contourtree/RegularToCriticalDown.h>
#include <vtkm/worklet/contourtree/RegularToCriticalUp.h>
#include <vtkm/worklet/contourtree/ResetDegrees.h>
#include <vtkm/worklet/contourtree/SetJoinAndSplitArcs.h>
#include <vtkm/worklet/contourtree/SetSupernodeInward.h>
#include <vtkm/worklet/contourtree/SkipVertex.h>
#include <vtkm/worklet/contourtree/SubrangeOffset.h>
#include <vtkm/worklet/contourtree/Types.h>
#include <vtkm/worklet/contourtree/UpdateOutbound.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/ChainGraph.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/CopyJoinSplit.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/CopyNeighbors.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/CopySupernodes.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/DegreeDelta.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/DegreeSubrangeOffset.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/FillSupernodes.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/FindLeaves.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/MergeTree.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/PrintVectors.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/RegularToCandidate.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/RegularToCriticalDown.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/RegularToCriticalUp.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/ResetDegrees.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/SetJoinAndSplitArcs.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/SetSupernodeInward.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/SkipVertex.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/SubrangeOffset.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/UpdateOutbound.h>
#include <vtkm/Pair.h>
#include <vtkm/cont/ArrayGetValues.h>

@ -57,8 +57,8 @@
#ifndef vtkm_worklet_contourtree_copy_join_split_h
#define vtkm_worklet_contourtree_copy_join_split_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -57,8 +57,8 @@
#ifndef vtkm_worklet_contourtree_copy_neighbors_h
#define vtkm_worklet_contourtree_copy_neighbors_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -57,8 +57,8 @@
#ifndef vtkm_worklet_contourtree_degree_subrange_offset_h
#define vtkm_worklet_contourtree_degree_subrange_offset_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -57,8 +57,8 @@
#ifndef vtkm_worklet_contourtree_find_leaves_h
#define vtkm_worklet_contourtree_find_leaves_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -77,9 +77,9 @@
#ifndef vtkm_worklet_contourtree_join_super_arc_finder_h
#define vtkm_worklet_contourtree_join_super_arc_finder_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/VertexValueComparator.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
#include <vtkm/worklet/contourtree/VertexValueComparator.h>
namespace vtkm
{

@ -74,8 +74,8 @@
#ifndef vtkm_worklet_contourtree_join_tree_transferrer_h
#define vtkm_worklet_contourtree_join_tree_transferrer_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -58,7 +58,7 @@
#define vtkm_worklet_contourtree_link_component_case_table_2d_h
#include <vtkm/Types.h>
#include <vtkm/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
namespace vtkm
{

@ -58,7 +58,7 @@
#define vtkm_worklet_contourtree_link_component_case_table_3d_h
#include <vtkm/Types.h>
#include <vtkm/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
namespace vtkm
{

@ -105,11 +105,11 @@
#include <vtkm/cont/ArrayHandleConstant.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/worklet/contourtree/ChainDoubler.h>
#include <vtkm/worklet/contourtree/JoinArcConnector.h>
#include <vtkm/worklet/contourtree/JoinSuperArcFinder.h>
#include <vtkm/worklet/contourtree/PrintVectors.h>
#include <vtkm/worklet/contourtree/VertexMergeComparator.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/ChainDoubler.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/JoinArcConnector.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/JoinSuperArcFinder.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/PrintVectors.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/VertexMergeComparator.h>
//#define DEBUG_PRINT 1
//#define DEBUG_FUNCTION_ENTRY 1

@ -73,8 +73,8 @@
#ifndef vtkm_worklet_contourtree_mesh2d_dem_saddle_starter_h
#define vtkm_worklet_contourtree_mesh2d_dem_saddle_starter_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
namespace vtkm
{

@ -81,12 +81,12 @@
#include <vtkm/cont/ArrayHandleZip.h>
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkm/worklet/contourtree/ChainGraph.h>
#include <vtkm/worklet/contourtree/Mesh2D_DEM_SaddleStarter.h>
#include <vtkm/worklet/contourtree/Mesh2D_DEM_VertexOutdegreeStarter.h>
#include <vtkm/worklet/contourtree/Mesh2D_DEM_VertexStarter.h>
#include <vtkm/worklet/contourtree/PrintVectors.h>
#include <vtkm/worklet/contourtree/Types.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/ChainGraph.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh2D_DEM_SaddleStarter.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh2D_DEM_VertexOutdegreeStarter.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh2D_DEM_VertexStarter.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/PrintVectors.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
//#define DEBUG_PRINT 1
//#define DEBUG_TIMING 1

@ -73,8 +73,8 @@
#ifndef vtkm_worklet_contourtree_mesh2d_dem_vertex_outdegree_starter_h
#define vtkm_worklet_contourtree_mesh2d_dem_vertex_outdegree_starter_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
namespace vtkm
{

@ -73,9 +73,9 @@
#ifndef vtkm_worklet_contourtree_mesh2d_dem_vertex_starter_h
#define vtkm_worklet_contourtree_mesh2d_dem_vertex_starter_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/VertexValueComparator.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
#include <vtkm/worklet/contourtree/VertexValueComparator.h>
namespace vtkm
{

@ -73,9 +73,9 @@
#ifndef vtkm_worklet_contourtree_mesh3d_dem_saddle_starter_h
#define vtkm_worklet_contourtree_mesh3d_dem_saddle_starter_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/LinkComponentCaseTable3D.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/LinkComponentCaseTable3D.h>
#include <vtkm/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
namespace vtkm
{

@ -80,13 +80,13 @@
#include <vtkm/cont/ArrayHandleZip.h>
#include <vtkm/worklet/DispatcherMapField.h>
#include <vtkm/worklet/contourtree/ChainGraph.h>
#include <vtkm/worklet/contourtree/LinkComponentCaseTable3D.h>
#include <vtkm/worklet/contourtree/Mesh3D_DEM_SaddleStarter.h>
#include <vtkm/worklet/contourtree/Mesh3D_DEM_VertexOutdegreeStarter.h>
#include <vtkm/worklet/contourtree/Mesh3D_DEM_VertexStarter.h>
#include <vtkm/worklet/contourtree/PrintVectors.h>
#include <vtkm/worklet/contourtree/Types.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/ChainGraph.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/LinkComponentCaseTable3D.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh3D_DEM_SaddleStarter.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh3D_DEM_VertexOutdegreeStarter.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh3D_DEM_VertexStarter.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/PrintVectors.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
//#define DEBUG_PRINT 1
//#define DEBUG_TIMING 1

@ -73,9 +73,9 @@
#ifndef vtkm_worklet_contourtree_mesh3d_dem_vertex_outdegree_starter_h
#define vtkm_worklet_contourtree_mesh3d_dem_vertex_outdegree_starter_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/LinkComponentCaseTable3D.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/LinkComponentCaseTable3D.h>
#include <vtkm/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
namespace vtkm
{

@ -73,10 +73,9 @@
#ifndef vtkm_worklet_contourtree_mesh3d_dem_vertex_starter_h
#define vtkm_worklet_contourtree_mesh3d_dem_vertex_starter_h
#include <iostream>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/VertexValueComparator.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Mesh3D_DEM_Triangulation_Macros.h>
#include <vtkm/worklet/contourtree/VertexValueComparator.h>
namespace vtkm
{

@ -73,10 +73,10 @@
#ifndef vtkm_worklet_contourtree_regular_point_transferrer_h
#define vtkm_worklet_contourtree_regular_point_transferrer_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/filter/scalar_topology/worklet/contourtree/VertexValueComparator.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Mesh2D_DEM_Triangulation_Macros.h>
#include <vtkm/worklet/contourtree/Types.h>
#include <vtkm/worklet/contourtree/VertexValueComparator.h>
namespace vtkm
{

@ -57,8 +57,8 @@
#ifndef vtkm_worklet_contourtree_regular_to_candidate_h
#define vtkm_worklet_contourtree_regular_to_candidate_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -57,8 +57,8 @@
#ifndef vtkm_worklet_contourtree_regular_to_critical_down_h
#define vtkm_worklet_contourtree_regular_to_critical_down_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -70,8 +70,8 @@
#ifndef vtkm_worklet_contourtree_saddle_ascent_functor_h
#define vtkm_worklet_contourtree_saddle_ascent_functor_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -57,8 +57,8 @@
#ifndef vtkm_worklet_contourtree_set_join_and_split_arcs_h
#define vtkm_worklet_contourtree_set_join_and_split_arcs_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -57,8 +57,8 @@
#ifndef vtkm_worklet_contourtree_set_supernode_inward_h
#define vtkm_worklet_contourtree_set_supernode_inward_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -57,8 +57,8 @@
#ifndef vtkm_worklet_contourtree_skip_vertex_h
#define vtkm_worklet_contourtree_skip_vertex_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -74,8 +74,8 @@
#ifndef vtkm_worklet_contourtree_trunk_builder_h
#define vtkm_worklet_contourtree_trunk_builder_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -57,8 +57,8 @@
#ifndef vtkm_worklet_contourtree_update_outbound_h
#define vtkm_worklet_contourtree_update_outbound_h
#include <vtkm/filter/scalar_topology/worklet/contourtree/Types.h>
#include <vtkm/worklet/WorkletMapField.h>
#include <vtkm/worklet/contourtree/Types.h>
namespace vtkm
{

@ -15,7 +15,6 @@ set(headers
)
set(unit_tests
UnitTestContourTreeUniformFilter.cxx
UnitTestContourTreeUniformAugmentedFilter.cxx
UnitTestContourTreeUniformDistributedFilter.cxx
UnitTestFieldMetadata.cxx

@ -13,7 +13,6 @@ set(headers
BoundaryTypes.h
AveragePointNeighborhood.h
CellDeepCopy.h
ContourTreeUniform.h
ContourTreeUniformAugmented.h
CosmoTools.h
DispatcherMapField.h
@ -76,7 +75,6 @@ set(sources_device
#-----------------------------------------------------------------------------
add_subdirectory(internal)
add_subdirectory(colorconversion)
add_subdirectory(contourtree)
add_subdirectory(contourtree_augmented)
add_subdirectory(contourtree_distributed)
add_subdirectory(cosmotools)

@ -17,7 +17,6 @@ set(unit_tests
UnitTestAverageByKey.cxx
UnitTestBoundingIntervalHierarchy.cxx
UnitTestCellDeepCopy.cxx
UnitTestContourTreeUniform.cxx
UnitTestContourTreeUniformAugmented.cxx
UnitTestContourTreeUniformDistributed.cxx
UnitTestCosmoTools.cxx

@ -1,178 +0,0 @@
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
// Copyright (c) 2016, Los Alamos National Security, LLC
// All rights reserved.
//
// Copyright 2016. Los Alamos National Security, LLC.
// This software was produced under U.S. Government contract DE-AC52-06NA25396
// for Los Alamos National Laboratory (LANL), which is operated by
// Los Alamos National Security, LLC for the U.S. Department of Energy.
// The U.S. Government has rights to use, reproduce, and distribute this
// software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, LLC
// MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LIABILITY FOR THE
// USE OF THIS SOFTWARE. If software is modified to produce derivative works,
// such modified software should be clearly marked, so as not to confuse it
// with the version available from LANL.
//
// Additionally, redistribution and use in source and binary forms, with or
// without modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of Los Alamos National Security, LLC, Los Alamos
// National Laboratory, LANL, the U.S. Government, nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY LOS ALAMOS NATIONAL SECURITY, LLC AND
// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
// FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL LOS ALAMOS
// NATIONAL SECURITY, LLC OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
// INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
// BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
// USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//============================================================================
// This code is based on the algorithm presented in the paper:
// “Parallel Peak Pruning for Scalable SMP Contour Tree Computation.”
// Hamish Carr, Gunther Weber, Christopher Sewell, and James Ahrens.
// Proceedings of the IEEE Symposium on Large Data Analysis and Visualization
// (LDAV), October 2016, Baltimore, Maryland.
#include <vtkm/worklet/ContourTreeUniform.h>
#include <vtkm/cont/testing/MakeTestDataSet.h>
#include <vtkm/cont/testing/Testing.h>
namespace
{
using vtkm::cont::testing::MakeTestDataSet;
class TestContourTreeUniform
{
public:
//
// Create a uniform 2D structured cell set as input with values for contours
//
void TestContourTree_Mesh2D_DEM_Triangulation() const
{
std::cout << "Testing ContourTree_Mesh2D Filter" << std::endl;
// Create the input uniform cell set with values to contour
vtkm::cont::DataSet dataSet = MakeTestDataSet().Make2DUniformDataSet1();
vtkm::cont::CellSetStructured<2> cellSet;
dataSet.GetCellSet().AsCellSet(cellSet);
vtkm::Id2 pointDimensions = cellSet.GetPointDimensions();
vtkm::Id nRows = pointDimensions[0];
vtkm::Id nCols = pointDimensions[1];
vtkm::cont::ArrayHandle<vtkm::Float32> fieldArray;
dataSet.GetField("pointvar").GetData().AsArrayHandle(fieldArray);
// Output saddle peak pairs array
vtkm::cont::ArrayHandle<vtkm::Pair<vtkm::Id, vtkm::Id>> saddlePeak;
// Create the worklet and run it
vtkm::worklet::ContourTreeMesh2D contourTreeMesh2D;
contourTreeMesh2D.Run(fieldArray, nRows, nCols, saddlePeak);
VTKM_TEST_ASSERT(test_equal(saddlePeak.GetNumberOfValues(), 7),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(0), vtkm::make_Pair(0, 12)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(1), vtkm::make_Pair(4, 13)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(2), vtkm::make_Pair(12, 13)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(3), vtkm::make_Pair(12, 18)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(4), vtkm::make_Pair(12, 20)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(5), vtkm::make_Pair(13, 14)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(6), vtkm::make_Pair(13, 19)),
"Wrong result for ContourTree filter");
}
//
// Create a uniform 3D structured cell set as input with values for contours
//
void TestContourTree_Mesh3D_DEM_Triangulation() const
{
std::cout << "Testing ContourTree_Mesh3D Filter" << std::endl;
// Create the input uniform cell set with values to contour
vtkm::cont::DataSet dataSet = MakeTestDataSet().Make3DUniformDataSet1();
vtkm::cont::CellSetStructured<3> cellSet;
dataSet.GetCellSet().AsCellSet(cellSet);
vtkm::Id3 pointDimensions = cellSet.GetPointDimensions();
vtkm::Id nRows = pointDimensions[0];
vtkm::Id nCols = pointDimensions[1];
vtkm::Id nSlices = pointDimensions[2];
vtkm::cont::ArrayHandle<vtkm::Float32> fieldArray;
dataSet.GetField("pointvar").GetData().AsArrayHandle(fieldArray);
// Output saddle peak pairs array
vtkm::cont::ArrayHandle<vtkm::Pair<vtkm::Id, vtkm::Id>> saddlePeak;
// Create the worklet and run it
vtkm::worklet::ContourTreeMesh3D contourTreeMesh3D;
contourTreeMesh3D.Run(fieldArray, nRows, nCols, nSlices, saddlePeak);
VTKM_TEST_ASSERT(test_equal(saddlePeak.GetNumberOfValues(), 9),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(0), vtkm::make_Pair(0, 67)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(1), vtkm::make_Pair(31, 42)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(2), vtkm::make_Pair(42, 43)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(3), vtkm::make_Pair(42, 56)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(4), vtkm::make_Pair(56, 67)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(5), vtkm::make_Pair(56, 92)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(6), vtkm::make_Pair(62, 67)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(7), vtkm::make_Pair(81, 92)),
"Wrong result for ContourTree filter");
VTKM_TEST_ASSERT(test_equal(saddlePeak.WritePortal().Get(8), vtkm::make_Pair(92, 93)),
"Wrong result for ContourTree filter");
}
void operator()() const
{
this->TestContourTree_Mesh2D_DEM_Triangulation();
this->TestContourTree_Mesh3D_DEM_Triangulation();
}
};
}
int UnitTestContourTreeUniform(int argc, char* argv[])
{
return vtkm::cont::testing::Testing::Run(TestContourTreeUniform(), argc, argv);
}