Consolidated two copies of NotNoSuchElementPredicate.h

This commit is contained in:
Gunther H. Weber 2021-11-03 16:14:27 -07:00
parent 65352d7f07
commit f96020a24a
7 changed files with 9 additions and 109 deletions

@ -16,6 +16,7 @@ set(headers
DataSetMesh.h
MergeTree.h
MeshExtrema.h
NotNoSuchElementPredicate.h
PrintVectors.h
ProcessContourTree.h
Types.h

@ -78,11 +78,11 @@
#include <vtkm/cont/ArrayHandlePermutation.h>
#include <vtkm/cont/Invoker.h>
#include <vtkm/worklet/contourtree_augmented/NotNoSuchElementPredicate.h>
#include <vtkm/worklet/contourtree_augmented/PrintVectors.h>
#include <vtkm/worklet/contourtree_augmented/Types.h>
#include <vtkm/worklet/contourtree_augmented/data_set_mesh/GetOwnedVerticesByGlobalIdWorklet.h>
#include <vtkm/worklet/contourtree_augmented/data_set_mesh/IdRelabeler.h>
#include <vtkm/worklet/contourtree_augmented/data_set_mesh/NotNoSuchElementPredicate.h>
#include <vtkm/worklet/contourtree_augmented/data_set_mesh/SimulatedSimplicityComperator.h>
#include <vtkm/worklet/contourtree_augmented/data_set_mesh/SortIndices.h>
@ -233,8 +233,7 @@ void DataSetMesh::GetOwnedVerticesByGlobalIdImpl(
tempOwnedVertices // output
);
// now compress out the NO_SUCH_ELEMENT ones
auto notNoSuchElementPredicate =
vtkm::worklet::contourtree_augmented::data_set_mesh::NotNoSuchElementPredicate();
vtkm::worklet::contourtree_augmented::NotNoSuchElementPredicate notNoSuchElementPredicate;
// compress the array
vtkm::cont::Algorithm::CopyIf(
tempOwnedVertices, // compress the array of owned vertices

@ -50,8 +50,8 @@
// Oliver Ruebel (LBNL)
//==============================================================================
#ifndef vtk_m_worklet_contourtree_distributed_data_set_mesh_not_no_such_element_predicate_h
#define vtk_m_worklet_contourtree_distributed_data_set_mesh_not_no_such_element_predicate_h
#ifndef vtk_m_worklet_contourtree_augmented_not_no_such_element_predicate_h
#define vtk_m_worklet_contourtree_augmented_not_no_such_element_predicate_h
#include <vtkm/worklet/contourtree_augmented/Types.h>
@ -61,9 +61,6 @@ namespace worklet
{
namespace contourtree_augmented
{
namespace data_set_mesh
{
//Simple functor to subset a VTKm ArrayHandle
class NotNoSuchElementPredicate
@ -73,15 +70,11 @@ public:
NotNoSuchElementPredicate() {}
VTKM_EXEC_CONT
bool operator()(const vtkm::Id& meshVertexId) const
{
return !vtkm::worklet::contourtree_augmented::NoSuchElement(meshVertexId);
}
bool operator()(const vtkm::Id& vertexId) const { return !NoSuchElement(vertexId); }
private:
};
} // namespace data_set_mesh
} // namespace contourtree_augmented
} // namespace worklet
} // namespace vtkm

@ -12,7 +12,6 @@ set(headers
IdRelabeler.h
MeshStructure2D.h
MeshStructure3D.h
NotNoSuchElementPredicate.h
SimulatedSimplicityComperator.h
SortIndices.h
)

@ -93,6 +93,7 @@
#include <iomanip>
#include <string>
#include <vtkm/worklet/contourtree_augmented/NotNoSuchElementPredicate.h>
#include <vtkm/worklet/contourtree_augmented/PrintVectors.h>
#include <vtkm/worklet/contourtree_augmented/Types.h>
#include <vtkm/worklet/contourtree_distributed/PrintGraph.h>
@ -106,7 +107,6 @@
#include <vtkm/worklet/contourtree_distributed/hierarchical_augmenter/IsAscendingDecorator.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_augmenter/IsAttachementPointNeededPredicate.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_augmenter/IsAttachementPointPredicate.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_augmenter/NotNoSuchElementPredicate.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_augmenter/ResizeArraysBuildNewSupernodeIdsWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_augmenter/SetFirstAttachmentPointInRoundWorklet.h>
#include <vtkm/worklet/contourtree_distributed/hierarchical_augmenter/SetSuperparentSetDecorator.h>
@ -746,8 +746,7 @@ void HierarchicalAugmenter<FieldType>::CopyBaseRegularStructure()
);
// We now compress to get the set of nodes to transfer. I.e., remove all
// NO_SUCH_ELEMENT entires and copy the values to keep to our proper arrays
vtkm::worklet::contourtree_distributed::hierarchical_augmenter::NotNoSuchElementPredicate
notNoSuchElementPredicate;
vtkm::worklet::contourtree_augmented::NotNoSuchElementPredicate notNoSuchElementPredicate;
vtkm::cont::Algorithm::CopyIf(
tempRegularNodesNeeded, // input data
tempRegularNodesNeeded, // stencil (same as input)
@ -872,8 +871,7 @@ void HierarchicalAugmenter<FieldType>::RetrieveOldSupernodes(vtkm::Id roundNumbe
// target array
this->KeptSupernodes);
// Create the predicate for the CopyIf
vtkm::worklet::contourtree_distributed::hierarchical_augmenter::NotNoSuchElementPredicate
notNoSuchElementPredicate;
vtkm::worklet::contourtree_augmented::NotNoSuchElementPredicate notNoSuchElementPredicate;
// Copy supernodeId to this->KeptSupernodes
vtkm::cont::Algorithm::CopyIf(
// first we generate a list of supernodeIds

@ -19,7 +19,6 @@ set(headers
UpdateHyperstructureSetSuperchildrenWorklet.h
FindSuperparentForNecessaryNodesWorklet.h
CopyBaseRegularStructureWorklet.h
NotNoSuchElementPredicate.h
SetSuperparentSetDecorator.h
AttachmentAndSupernodeComparator.h
ResizeArraysBuildNewSupernodeIdsWorklet.h

@ -1,89 +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) 2018, The Regents of the University of California, through
// Lawrence Berkeley National Laboratory (subject to receipt of any required approvals
// from the U.S. Dept. of Energy). All rights reserved.
//
// 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 the University of California, Lawrence Berkeley National
// Laboratory, U.S. Dept. of Energy 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 THE COPYRIGHT HOLDERS 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 THE COPYRIGHT OWNER 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 an extension of 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.
//
// The PPP2 algorithm and software were jointly developed by
// Hamish Carr (University of Leeds), Gunther H. Weber (LBNL), and
// Oliver Ruebel (LBNL)
//==============================================================================
#ifndef vtk_m_worklet_contourtree_distributed_hierarchical_augmenter_not_no_such_element_predicate_h
#define vtk_m_worklet_contourtree_distributed_hierarchical_augmenter_not_no_such_element_predicate_h
#include <vtkm/worklet/contourtree_augmented/Types.h>
namespace vtkm
{
namespace worklet
{
namespace contourtree_distributed
{
namespace hierarchical_augmenter
{
//Simple functor to subset a VTKm ArrayHandle
class NotNoSuchElementPredicate
{
public:
VTKM_EXEC_CONT
NotNoSuchElementPredicate() {}
VTKM_EXEC_CONT
bool operator()(const vtkm::Id& inId) const
{
return !vtkm::worklet::contourtree_augmented::NoSuchElement(inId);
}
private:
};
} // namespace data_set_mesh
} // namespace contourtree_distributed
} // namespace worklet
} // namespace vtkm
#endif