mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
tidy-up language usage
This commit is contained in:
parent
e48cc867b2
commit
6a465e8bed
@ -175,7 +175,7 @@ vtkm::cont::DataSet CleanGrid::GenerateOutput(const vtkm::cont::DataSet& inData,
|
||||
//
|
||||
// For filters that do not need to do interpolation for mapping fields, we provide an overload
|
||||
// that does not take the extra arguments and just AddField.
|
||||
auto mapper = [&, this](auto& outDataSet, const auto& f) {
|
||||
auto mapper = [&](auto& outDataSet, const auto& f) {
|
||||
DoMapField(outDataSet, f, *this, worklets);
|
||||
};
|
||||
return this->CreateResult(inData, outputCellSet, outputCoordinateSystems, mapper);
|
||||
|
@ -332,7 +332,8 @@ private:
|
||||
bool fastCheck, // If true, approximate distances are used
|
||||
const BinLocator& binLocator, // Used to find nearby points
|
||||
vtkm::cont::ArrayHandle<vtkm::Vec<T, 3>>& points, // coordinates, modified to merge close
|
||||
vtkm::cont::ArrayHandle<vtkm::Id> indexNeighborMap) // identifies each neighbor group, updated
|
||||
const vtkm::cont::ArrayHandle<vtkm::Id>&
|
||||
indexNeighborMap) // identifies each neighbor group, updated
|
||||
{
|
||||
vtkm::cont::Invoker invoker;
|
||||
|
||||
|
@ -76,10 +76,10 @@ public:
|
||||
|
||||
public:
|
||||
VTKM_CONT
|
||||
RemoveUnusedPoints() {}
|
||||
RemoveUnusedPoints() = default;
|
||||
|
||||
template <typename ShapeStorage, typename ConnectivityStorage, typename OffsetsStorage>
|
||||
VTKM_CONT RemoveUnusedPoints(
|
||||
VTKM_CONT explicit RemoveUnusedPoints(
|
||||
const vtkm::cont::CellSetExplicit<ShapeStorage, ConnectivityStorage, OffsetsStorage>& inCellSet)
|
||||
{
|
||||
this->FindPointsStart();
|
||||
@ -305,10 +305,7 @@ public:
|
||||
VTKM_DEPRECATED_SUPPRESS_END
|
||||
///@}
|
||||
|
||||
const vtkm::worklet::ScatterCounting& GetPointScatter() const
|
||||
{
|
||||
return *this->PointScatter.get();
|
||||
}
|
||||
const vtkm::worklet::ScatterCounting& GetPointScatter() const { return *this->PointScatter; }
|
||||
|
||||
private:
|
||||
vtkm::cont::ArrayHandle<vtkm::IdComponent> MaskArray;
|
||||
|
@ -36,8 +36,6 @@ public:
|
||||
private:
|
||||
VTKM_CONT
|
||||
vtkm::cont::DataSet DoExecute(const vtkm::cont::DataSet& input) override;
|
||||
|
||||
std::string OutputFieldName;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -32,8 +32,7 @@ VTKM_CONT vtkm::cont::DataSet ImageConnectivity::DoExecute(const vtkm::cont::Dat
|
||||
auto resolveType = [&](const auto& concrete) {
|
||||
vtkm::worklet::connectivity::ImageConnectivity().Run(input.GetCellSet(), concrete, component);
|
||||
};
|
||||
const auto& fieldArray = field.GetData();
|
||||
this->CastAndCallScalarField(fieldArray, resolveType);
|
||||
this->CastAndCallScalarField(field, resolveType);
|
||||
|
||||
return this->CreateResultFieldPoint(input, this->GetOutputFieldName(), component);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ namespace
|
||||
class TestCellSetConnectivity
|
||||
{
|
||||
public:
|
||||
void TestTangleIsosurface() const
|
||||
static void TestTangleIsosurface()
|
||||
{
|
||||
vtkm::Id3 dims(4, 4, 4);
|
||||
vtkm::source::Tangle tangle(dims);
|
||||
@ -49,7 +49,7 @@ public:
|
||||
"Wrong number of connected components");
|
||||
}
|
||||
|
||||
void TestExplicitDataSet() const
|
||||
static void TestExplicitDataSet()
|
||||
{
|
||||
vtkm::cont::DataSet dataSet = vtkm::cont::testing::MakeTestDataSet().Make3DExplicitDataSet5();
|
||||
|
||||
@ -67,7 +67,7 @@ public:
|
||||
"Wrong number of connected components");
|
||||
}
|
||||
|
||||
void TestUniformDataSet() const
|
||||
static void TestUniformDataSet()
|
||||
{
|
||||
vtkm::cont::DataSet dataSet = vtkm::cont::testing::MakeTestDataSet().Make3DUniformDataSet1();
|
||||
vtkm::filter::connected_components::CellSetConnectivity connectivity;
|
||||
@ -86,9 +86,9 @@ public:
|
||||
|
||||
void operator()() const
|
||||
{
|
||||
this->TestTangleIsosurface();
|
||||
this->TestExplicitDataSet();
|
||||
this->TestUniformDataSet();
|
||||
TestCellSetConnectivity::TestTangleIsosurface();
|
||||
TestCellSetConnectivity::TestExplicitDataSet();
|
||||
TestCellSetConnectivity::TestUniformDataSet();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -27,8 +27,7 @@ vtkm::cont::DataSet MakeTestDataSet()
|
||||
0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0,
|
||||
};
|
||||
|
||||
vtkm::cont::DataSetBuilderUniform builder;
|
||||
vtkm::cont::DataSet dataSet = builder.Create(vtkm::Id3(8, 8, 1));
|
||||
vtkm::cont::DataSet dataSet = vtkm::cont::DataSetBuilderUniform::Create(vtkm::Id3(8, 8, 1));
|
||||
|
||||
dataSet.AddPointField("color", pixels);
|
||||
|
||||
|
@ -51,9 +51,9 @@ bool DoMapField(vtkm::cont::DataSet& result,
|
||||
result.AddPointField(field.GetName(), outputArray);
|
||||
};
|
||||
|
||||
auto inputArray = field.GetData();
|
||||
inputArray.CastAndCallForTypesWithFloatFallback<vtkm::TypeListField, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
resolve);
|
||||
field.GetData()
|
||||
.CastAndCallForTypesWithFloatFallback<vtkm::TypeListField, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
resolve);
|
||||
return true;
|
||||
}
|
||||
else if (field.IsFieldCell())
|
||||
@ -77,7 +77,7 @@ bool DoMapField(vtkm::cont::DataSet& result,
|
||||
//-----------------------------------------------------------------------------
|
||||
vtkm::cont::DataSet ClipWithField::DoExecute(const vtkm::cont::DataSet& input)
|
||||
{
|
||||
auto field = this->GetFieldFromDataSet(input);
|
||||
const auto& field = this->GetFieldFromDataSet(input);
|
||||
if (!field.IsFieldPoint())
|
||||
{
|
||||
throw vtkm::cont::ErrorFilterExecution("Point field expected.");
|
||||
@ -88,7 +88,7 @@ vtkm::cont::DataSet ClipWithField::DoExecute(const vtkm::cont::DataSet& input)
|
||||
const vtkm::cont::UnknownCellSet& inputCellSet = input.GetCellSet();
|
||||
vtkm::cont::CellSetExplicit<> outputCellSet;
|
||||
|
||||
auto resolveFieldType = [&, this](const auto& concrete) {
|
||||
auto resolveFieldType = [&](const auto& concrete) {
|
||||
outputCellSet = worklet.Run(inputCellSet, concrete, this->ClipValue, this->Invert);
|
||||
};
|
||||
this->CastAndCallScalarField(this->GetFieldFromDataSet(input).GetData(), resolveFieldType);
|
||||
|
@ -51,9 +51,9 @@ bool DoMapField(vtkm::cont::DataSet& result,
|
||||
result.AddPointField(field.GetName(), outputArray);
|
||||
};
|
||||
|
||||
auto inputArray = field.GetData();
|
||||
inputArray.CastAndCallForTypesWithFloatFallback<vtkm::TypeListField, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
resolve);
|
||||
field.GetData()
|
||||
.CastAndCallForTypesWithFloatFallback<vtkm::TypeListField, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
resolve);
|
||||
return true;
|
||||
}
|
||||
else if (field.IsFieldCell())
|
||||
|
@ -46,14 +46,13 @@ VTKM_CONT bool DoMapField(vtkm::cont::DataSet& result,
|
||||
{
|
||||
if (field.IsFieldPoint())
|
||||
{
|
||||
auto array = field.GetData();
|
||||
|
||||
auto functor = [&](const auto& concrete) {
|
||||
auto fieldArray = worklet.ProcessPointField(concrete);
|
||||
result.AddPointField(field.GetName(), fieldArray);
|
||||
};
|
||||
array.CastAndCallForTypesWithFloatFallback<vtkm::TypeListField, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
functor);
|
||||
field.GetData()
|
||||
.CastAndCallForTypesWithFloatFallback<vtkm::TypeListField, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
functor);
|
||||
return true;
|
||||
}
|
||||
else if (field.IsFieldCell())
|
||||
@ -110,8 +109,6 @@ vtkm::cont::DataSet Contour::DoExecute(const vtkm::cont::DataSet& inDataSet)
|
||||
const vtkm::cont::CoordinateSystem& inputCoords =
|
||||
inDataSet.GetCoordinateSystem(this->GetActiveCoordinateSystemIndex());
|
||||
|
||||
const auto& fieldArray = this->GetFieldFromDataSet(inDataSet).GetData();
|
||||
|
||||
using Vec3HandleType = vtkm::cont::ArrayHandle<vtkm::Vec3f>;
|
||||
Vec3HandleType vertices;
|
||||
Vec3HandleType normals;
|
||||
@ -122,7 +119,7 @@ vtkm::cont::DataSet Contour::DoExecute(const vtkm::cont::DataSet& inDataSet)
|
||||
? !this->ComputeFastNormalsForStructured
|
||||
: !this->ComputeFastNormalsForUnstructured;
|
||||
|
||||
auto resolveFieldType = [&, this](const auto& concrete) {
|
||||
auto resolveFieldType = [&](const auto& concrete) {
|
||||
// use std::decay to remove const ref from the decltype of concrete.
|
||||
using T = typename std::decay_t<decltype(concrete)>::ValueType;
|
||||
std::vector<T> ivalues(this->IsoValues.size());
|
||||
@ -142,8 +139,10 @@ vtkm::cont::DataSet Contour::DoExecute(const vtkm::cont::DataSet& inDataSet)
|
||||
}
|
||||
};
|
||||
|
||||
fieldArray.CastAndCallForTypesWithFloatFallback<SupportedTypes, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
resolveFieldType);
|
||||
this->GetFieldFromDataSet(inDataSet)
|
||||
.GetData()
|
||||
.CastAndCallForTypesWithFloatFallback<SupportedTypes, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
resolveFieldType);
|
||||
|
||||
auto mapper = [&](auto& result, const auto& f) { DoMapField(result, f, worklet); };
|
||||
vtkm::cont::DataSet output = this->CreateResult(
|
||||
|
@ -29,10 +29,9 @@ vtkm::cont::DataSet Slice::DoExecute(const vtkm::cont::DataSet& input)
|
||||
vtkm::cont::make_ArrayHandleTransform(coords.GetDataAsMultiplexer(), impFuncEval);
|
||||
vtkm::cont::ArrayHandle<vtkm::FloatDefault> sliceScalars;
|
||||
vtkm::cont::ArrayCopyDevice(coordTransform, sliceScalars);
|
||||
auto field = vtkm::cont::make_FieldPoint("sliceScalars", sliceScalars);
|
||||
// input is a const, we can not AddField to it.
|
||||
vtkm::cont::DataSet clone = input;
|
||||
clone.AddField(field);
|
||||
clone.AddField(vtkm::cont::make_FieldPoint("sliceScalars", sliceScalars));
|
||||
|
||||
this->Contour::SetIsoValue(0.0);
|
||||
this->Contour::SetActiveField("sliceScalars");
|
||||
|
@ -10,24 +10,25 @@
|
||||
|
||||
set(headers
|
||||
Clip.h
|
||||
CommonState.h
|
||||
contour/CommonState.h
|
||||
Contour.h
|
||||
FieldPropagation.h
|
||||
FlyingEdges.h
|
||||
FlyingEdgesHelpers.h
|
||||
FlyingEdgesPass1.h
|
||||
FlyingEdgesPass2.h
|
||||
FlyingEdgesPass4.h
|
||||
FlyingEdgesPass4Common.h
|
||||
FlyingEdgesPass4X.h
|
||||
FlyingEdgesPass4XWithNormals.h
|
||||
FlyingEdgesPass4Y.h
|
||||
FlyingEdgesTables.h
|
||||
MarchingCellTables.h
|
||||
MarchingCells.h
|
||||
contour/FieldPropagation.h
|
||||
contour/FlyingEdges.h
|
||||
contour/FlyingEdgesHelpers.h
|
||||
contour/FlyingEdgesPass1.h
|
||||
contour/FlyingEdgesPass2.h
|
||||
contour/FlyingEdgesPass4.h
|
||||
contour/FlyingEdgesPass4Common.h
|
||||
contour/FlyingEdgesPass4X.h
|
||||
contour/FlyingEdgesPass4XWithNormals.h
|
||||
contour/FlyingEdgesPass4Y.h
|
||||
contour/FlyingEdgesTables.h
|
||||
contour/MarchingCellTables.h
|
||||
contour/MarchingCells.h
|
||||
)
|
||||
|
||||
add_subdirectory(clip)
|
||||
add_subdirectory(contour)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
vtkm_declare_headers(${headers})
|
||||
|
@ -15,10 +15,10 @@
|
||||
#include <vtkm/cont/ArrayHandlePermutation.h>
|
||||
#include <vtkm/cont/ArrayHandleUniformPointCoordinates.h>
|
||||
|
||||
#include <vtkm/filter/contour/worklet/CommonState.h>
|
||||
#include <vtkm/filter/contour/worklet/FieldPropagation.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdges.h>
|
||||
#include <vtkm/filter/contour/worklet/MarchingCells.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/CommonState.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FieldPropagation.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdges.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/MarchingCells.h>
|
||||
|
||||
|
||||
namespace vtkm
|
||||
|
29
vtkm/filter/contour/worklet/contour/CMakeLists.txt
Normal file
29
vtkm/filter/contour/worklet/contour/CMakeLists.txt
Normal file
@ -0,0 +1,29 @@
|
||||
##============================================================================
|
||||
## 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.
|
||||
##============================================================================
|
||||
|
||||
set(headers
|
||||
CommonState.h
|
||||
FieldPropagation.h
|
||||
FlyingEdges.h
|
||||
FlyingEdgesHelpers.h
|
||||
FlyingEdgesPass1.h
|
||||
FlyingEdgesPass2.h
|
||||
FlyingEdgesPass4.h
|
||||
FlyingEdgesPass4Common.h
|
||||
FlyingEdgesPass4X.h
|
||||
FlyingEdgesPass4XWithNormals.h
|
||||
FlyingEdgesPass4Y.h
|
||||
FlyingEdgesTables.h
|
||||
MarchingCellTables.h
|
||||
MarchingCells.h
|
||||
)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
vtkm_declare_headers(${headers})
|
@ -12,10 +12,10 @@
|
||||
#ifndef vtk_m_worklet_contour_flyingedges_h
|
||||
#define vtk_m_worklet_contour_flyingedges_h
|
||||
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesPass1.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesPass2.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesPass4.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesPass1.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesPass2.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesPass4.h>
|
||||
|
||||
#include <vtkm/cont/Algorithm.h>
|
||||
#include <vtkm/cont/ArrayHandleGroupVec.h>
|
@ -13,7 +13,7 @@
|
||||
#ifndef vtk_m_worklet_contour_flyingedges_pass1_h
|
||||
#define vtk_m_worklet_contour_flyingedges_pass1_h
|
||||
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/worklet/WorkletMapTopology.h>
|
||||
|
||||
namespace vtkm
|
@ -13,8 +13,8 @@
|
||||
#ifndef vtk_m_worklet_contour_flyingedges_pass2_h
|
||||
#define vtk_m_worklet_contour_flyingedges_pass2_h
|
||||
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesTables.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesTables.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
@ -13,10 +13,10 @@
|
||||
#ifndef vtk_m_worklet_contour_flyingedges_pass4_h
|
||||
#define vtk_m_worklet_contour_flyingedges_pass4_h
|
||||
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesPass4Common.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesPass4X.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesPass4XWithNormals.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesPass4Y.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesPass4Common.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesPass4X.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesPass4XWithNormals.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesPass4Y.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
@ -13,8 +13,8 @@
|
||||
#ifndef vtk_m_worklet_contour_flyingedges_pass4_common_h
|
||||
#define vtk_m_worklet_contour_flyingedges_pass4_common_h
|
||||
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesTables.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesTables.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
@ -14,8 +14,8 @@
|
||||
#define vtk_m_worklet_contour_flyingedges_pass4x_h
|
||||
|
||||
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesTables.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesTables.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
@ -14,10 +14,10 @@
|
||||
#define vtk_m_worklet_contour_flyingedges_pass4x_with_norms_h
|
||||
|
||||
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesTables.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesTables.h>
|
||||
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesPass4.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesPass4.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
@ -14,8 +14,8 @@
|
||||
#define vtk_m_worklet_contour_flyingedges_pass4y_h
|
||||
|
||||
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesTables.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesTables.h>
|
||||
|
||||
#include <vtkm/VectorAnalysis.h>
|
||||
#include <vtkm/filter/vector_analysis/worklet/gradient/StructuredPointGradient.h>
|
@ -12,7 +12,7 @@
|
||||
#ifndef vtk_m_worklet_contour_flyingedges_tables_h
|
||||
#define vtk_m_worklet_contour_flyingedges_tables_h
|
||||
|
||||
#include <vtkm/filter/contour/worklet/FlyingEdgesHelpers.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/FlyingEdgesHelpers.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
@ -28,8 +28,8 @@
|
||||
#include <vtkm/worklet/ScatterCounting.h>
|
||||
#include <vtkm/worklet/ScatterPermutation.h>
|
||||
|
||||
#include <vtkm/filter/contour/worklet/CommonState.h>
|
||||
#include <vtkm/filter/contour/worklet/MarchingCellTables.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/CommonState.h>
|
||||
#include <vtkm/filter/contour/worklet/contour/MarchingCellTables.h>
|
||||
#include <vtkm/filter/vector_analysis/worklet/gradient/PointGradient.h>
|
||||
#include <vtkm/filter/vector_analysis/worklet/gradient/StructuredPointGradient.h>
|
||||
#include <vtkm/worklet/WorkletReduceByKey.h>
|
@ -73,7 +73,7 @@ class DistributedHistogram
|
||||
std::vector<vtkm::cont::ArrayHandle<vtkm::Id>> LocalBlocks;
|
||||
|
||||
public:
|
||||
DistributedHistogram(vtkm::Id numLocalBlocks)
|
||||
explicit DistributedHistogram(vtkm::Id numLocalBlocks)
|
||||
: LocalBlocks(static_cast<size_t>(numLocalBlocks))
|
||||
{
|
||||
}
|
||||
@ -134,7 +134,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void Broadcast(vtkm::cont::ArrayHandle<vtkm::Id>& data) const
|
||||
static void Broadcast(vtkm::cont::ArrayHandle<vtkm::Id>& data)
|
||||
{
|
||||
// broadcast to all ranks (and not blocks).
|
||||
auto comm = vtkm::cont::EnvironmentTracker::GetCommunicator();
|
||||
|
@ -99,7 +99,7 @@ VTKM_CONT vtkm::cont::DataSet ParticleDensityCloudInCell::DoExecute(const cont::
|
||||
|
||||
auto coords = input.GetCoordinateSystem().GetDataAsMultiplexer();
|
||||
|
||||
auto resolveType = [&, this](const auto& concrete) {
|
||||
auto resolveType = [&](const auto& concrete) {
|
||||
// use std::decay to remove const ref from the decltype of concrete.
|
||||
using T = typename std::decay_t<decltype(concrete)>::ValueType;
|
||||
|
||||
@ -127,7 +127,7 @@ VTKM_CONT vtkm::cont::DataSet ParticleDensityCloudInCell::DoExecute(const cont::
|
||||
// a lambda expression and immediately call it at the end. This allows us to not declare an
|
||||
// UnknownArrayHandle first and then assign it in the if-else statement. If I really want to
|
||||
// show-off, I can even inline the `fieldArray` variable and turn it into a long expression.
|
||||
auto fieldArray = [&, this]() -> vtkm::cont::UnknownArrayHandle {
|
||||
auto fieldArray = [&]() -> vtkm::cont::UnknownArrayHandle {
|
||||
if (this->ComputeNumberDensity)
|
||||
{
|
||||
return vtkm::cont::make_ArrayHandleConstant(vtkm::FloatDefault{ 1 },
|
||||
|
@ -90,7 +90,7 @@ VTKM_CONT vtkm::cont::DataSet ParticleDensityNearestGridPoint::DoExecute(
|
||||
|
||||
auto coords = input.GetCoordinateSystem().GetDataAsMultiplexer();
|
||||
|
||||
auto resolveType = [&, this](const auto& concrete) {
|
||||
auto resolveType = [&](const auto& concrete) {
|
||||
// use std::decay to remove const ref from the decltype of concrete.
|
||||
using T = typename std::decay_t<decltype(concrete)>::ValueType;
|
||||
|
||||
@ -113,7 +113,7 @@ VTKM_CONT vtkm::cont::DataSet ParticleDensityNearestGridPoint::DoExecute(
|
||||
// a lambda expression and immediately call it at the end. This allows us to not declare an
|
||||
// UnknownArrayHandle first and then assign it in the if-else statement. If I really want to
|
||||
// show-off, I can even inline the `fieldArray` variable and turn it into a long expression.
|
||||
auto fieldArray = [&, this]() -> vtkm::cont::UnknownArrayHandle {
|
||||
auto fieldArray = [&]() -> vtkm::cont::UnknownArrayHandle {
|
||||
if (this->ComputeNumberDensity)
|
||||
{
|
||||
return vtkm::cont::make_ArrayHandleConstant(vtkm::FloatDefault{ 1 },
|
||||
|
@ -10,7 +10,6 @@
|
||||
|
||||
#include <vtkm/filter/density_estimate/NDEntropy.h>
|
||||
|
||||
#include <vtkm/cont/testing/MakeTestDataSet.h>
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
|
||||
namespace
|
||||
|
@ -18,12 +18,11 @@
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <random>
|
||||
#include <utility>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
static unsigned int uid = 1;
|
||||
unsigned int uid = 1;
|
||||
|
||||
template <typename T>
|
||||
vtkm::cont::ArrayHandle<T> CreateArrayHandle(T min, T max, vtkm::Id numVals)
|
||||
@ -125,7 +124,7 @@ static void TestPartitionedDataSetHistogram()
|
||||
std::cout << " " << binsPortal.Get(cc);
|
||||
}
|
||||
std::cout << std::endl;
|
||||
};
|
||||
}
|
||||
|
||||
int UnitTestPartitionedDataSetHistogramFilter(int argc, char* argv[])
|
||||
{
|
||||
|
@ -40,7 +40,7 @@ public:
|
||||
vtkm::Float64 FreqSum;
|
||||
|
||||
VTKM_CONT
|
||||
SetBinInformationContent(vtkm::Float64 _freqSum)
|
||||
explicit SetBinInformationContent(vtkm::Float64 _freqSum)
|
||||
: FreqSum(_freqSum)
|
||||
{
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
|
||||
private:
|
||||
vtkm::worklet::NDimsHistogram NdHistogram;
|
||||
vtkm::Id NumDataPoints;
|
||||
vtkm::Id NumDataPoints{};
|
||||
};
|
||||
}
|
||||
} // namespace vtkm::worklet
|
||||
|
@ -29,7 +29,7 @@ public:
|
||||
vtkm::Float64 FreqSum;
|
||||
|
||||
VTKM_CONT
|
||||
SetBinInformationContent(vtkm::Float64 _freqSum)
|
||||
explicit SetBinInformationContent(vtkm::Float64 _freqSum)
|
||||
: FreqSum(_freqSum)
|
||||
{
|
||||
}
|
||||
|
@ -148,7 +148,7 @@ public:
|
||||
vtkm::Id numberOfBins;
|
||||
|
||||
VTKM_CONT
|
||||
ConvertHistBinToND(vtkm::Id numberOfBins0)
|
||||
explicit ConvertHistBinToND(vtkm::Id numberOfBins0)
|
||||
: numberOfBins(numberOfBins0)
|
||||
{
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ class ConditionalFreq : public vtkm::worklet::WorkletMapField
|
||||
{
|
||||
public:
|
||||
VTKM_CONT
|
||||
ConditionalFreq(BinaryCompare _bop)
|
||||
explicit ConditionalFreq(BinaryCompare _bop)
|
||||
: bop(_bop)
|
||||
{
|
||||
}
|
||||
@ -34,7 +34,7 @@ public:
|
||||
void setVar(vtkm::Id _var) { var = _var; }
|
||||
|
||||
BinaryCompare bop;
|
||||
vtkm::Id var;
|
||||
vtkm::Id var{};
|
||||
|
||||
using ControlSignature = void(FieldIn, FieldIn, FieldOut);
|
||||
using ExecutionSignature = void(_1, _2, _3);
|
||||
@ -60,7 +60,7 @@ public:
|
||||
vtkm::Id numberOfBins;
|
||||
|
||||
VTKM_CONT
|
||||
To1DIndex(vtkm::Id numberOfBins0)
|
||||
explicit To1DIndex(vtkm::Id numberOfBins0)
|
||||
: numberOfBins(numberOfBins0)
|
||||
{
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ vtkm::cont::DataSet ExternalFaces::GenerateOutput(const vtkm::cont::DataSet& inp
|
||||
}
|
||||
|
||||
//4. create the output dataset
|
||||
auto mapper = [&, this](auto& result, const auto& f) {
|
||||
auto mapper = [&](auto& result, const auto& f) {
|
||||
// New Design: We are still using the old MapFieldOntoOutput to demonstrate the transition
|
||||
this->MapFieldOntoOutput(result, f);
|
||||
};
|
||||
|
@ -17,12 +17,6 @@
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace worklet
|
||||
{
|
||||
// Forward declaration for the worklet so we don't need to include the worklet header file
|
||||
// which would require user code to be compilerd by device compiler.
|
||||
class ExtractGeometry;
|
||||
}
|
||||
namespace filter
|
||||
{
|
||||
namespace entity_extraction
|
||||
|
@ -7,7 +7,6 @@
|
||||
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
// PURPOSE. See the above copyright notice for more information.
|
||||
//============================================================================
|
||||
#include <vtkm/cont/UncertainCellSet.h>
|
||||
#include <vtkm/cont/UnknownCellSet.h>
|
||||
#include <vtkm/filter/clean_grid/CleanGrid.h>
|
||||
#include <vtkm/filter/entity_extraction/ExtractPoints.h>
|
||||
|
@ -82,7 +82,7 @@ vtkm::cont::DataSet Threshold::DoExecute(const vtkm::cont::DataSet& input)
|
||||
vtkm::worklet::Threshold worklet;
|
||||
vtkm::cont::UnknownCellSet cellOut;
|
||||
|
||||
auto resolveArrayType = [&, this](const auto& concrete) {
|
||||
auto resolveArrayType = [&](const auto& concrete) {
|
||||
// Note: there are two overloads of .Run, the first one taking an UncertainCellSet, which is
|
||||
// the desired entry point in the following call. The other is a function template on the input
|
||||
// CellSet. Without the call to .ResetCellSetList to turn an UnknownCellSet to an UncertainCellSet,
|
||||
@ -94,8 +94,7 @@ vtkm::cont::DataSet Threshold::DoExecute(const vtkm::cont::DataSet& input)
|
||||
this->GetAllInRange());
|
||||
};
|
||||
|
||||
const auto& fieldArray = field.GetData();
|
||||
fieldArray.CastAndCallForTypes<vtkm::TypeListScalarAll, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
field.GetData().CastAndCallForTypes<vtkm::TypeListScalarAll, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
resolveArrayType);
|
||||
|
||||
auto mapper = [&](auto& result, const auto& f) { DoMapField(result, f, worklet); };
|
||||
|
@ -147,7 +147,7 @@ VTKM_CONT vtkm::cont::DataSet ThresholdPoints::DoExecute(const vtkm::cont::DataS
|
||||
vtkm::cont::CellSetSingleType<> outCellSet;
|
||||
vtkm::worklet::ThresholdPoints worklet;
|
||||
|
||||
auto resolveType = [&, this](const auto& concrete) {
|
||||
auto resolveType = [&](const auto& concrete) {
|
||||
switch (this->ThresholdType)
|
||||
{
|
||||
case THRESHOLD_BELOW:
|
||||
|
@ -21,7 +21,7 @@ namespace
|
||||
class TestingExtractGeometry
|
||||
{
|
||||
public:
|
||||
void TestUniformByBox0() const
|
||||
static void TestUniformByBox0()
|
||||
{
|
||||
std::cout << "Testing extract geometry with implicit function (box):" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -48,7 +48,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(7) == 42.f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniformByBox1() const
|
||||
static void TestUniformByBox1()
|
||||
{
|
||||
std::cout << "Testing extract geometry with implicit function (box):" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -75,7 +75,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(55) == 63.f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniformByBox2() const
|
||||
static void TestUniformByBox2()
|
||||
{
|
||||
std::cout << "Testing extract geometry with implicit function (box):" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -101,7 +101,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(0) == 0.f, "Wrong cell field data");
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(63) == 63.f, "Wrong cell field data");
|
||||
}
|
||||
void TestUniformByBox3() const
|
||||
static void TestUniformByBox3()
|
||||
{
|
||||
std::cout << "Testing extract geometry with implicit function (box):" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -130,10 +130,10 @@ public:
|
||||
|
||||
void operator()() const
|
||||
{
|
||||
this->TestUniformByBox0();
|
||||
this->TestUniformByBox1();
|
||||
this->TestUniformByBox2();
|
||||
this->TestUniformByBox3();
|
||||
TestingExtractGeometry::TestUniformByBox0();
|
||||
TestingExtractGeometry::TestUniformByBox1();
|
||||
TestingExtractGeometry::TestUniformByBox2();
|
||||
TestingExtractGeometry::TestUniformByBox3();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace
|
||||
class TestingExtractPoints
|
||||
{
|
||||
public:
|
||||
void TestUniformByBox0() const
|
||||
static void TestUniformByBox0()
|
||||
{
|
||||
std::cout << "Testing extract points with implicit function (box):" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -51,7 +51,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outPointData.ReadPortal().Get(26) == 97.0f, "Wrong point field data");
|
||||
}
|
||||
|
||||
void TestUniformByBox1() const
|
||||
static void TestUniformByBox1()
|
||||
{
|
||||
std::cout << "Testing extract points with implicit function (box):" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -83,7 +83,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void TestUniformBySphere() const
|
||||
static void TestUniformBySphere()
|
||||
{
|
||||
std::cout << "Testing extract points with implicit function (sphere):" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -102,7 +102,7 @@ public:
|
||||
VTKM_TEST_ASSERT(test_equal(output.GetNumberOfCells(), 27), "Wrong result for ExtractPoints");
|
||||
}
|
||||
|
||||
void TestExplicitByBox0() const
|
||||
static void TestExplicitByBox0()
|
||||
{
|
||||
std::cout << "Testing extract points with implicit function (box):" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet5();
|
||||
@ -121,7 +121,7 @@ public:
|
||||
VTKM_TEST_ASSERT(test_equal(output.GetNumberOfCells(), 8), "Wrong result for ExtractPoints");
|
||||
}
|
||||
|
||||
void TestExplicitByBox1() const
|
||||
static void TestExplicitByBox1()
|
||||
{
|
||||
std::cout << "Testing extract points with implicit function (box):" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet5();
|
||||
@ -142,11 +142,11 @@ public:
|
||||
|
||||
void operator()() const
|
||||
{
|
||||
this->TestUniformByBox0();
|
||||
this->TestUniformByBox1();
|
||||
this->TestUniformBySphere();
|
||||
this->TestExplicitByBox0();
|
||||
this->TestExplicitByBox1();
|
||||
TestingExtractPoints::TestUniformByBox0();
|
||||
TestingExtractPoints::TestUniformByBox1();
|
||||
TestingExtractPoints::TestUniformBySphere();
|
||||
TestingExtractPoints::TestExplicitByBox0();
|
||||
TestingExtractPoints::TestExplicitByBox1();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace
|
||||
class TestingExtractStructured
|
||||
{
|
||||
public:
|
||||
void TestUniform2D() const
|
||||
static void TestUniform2D()
|
||||
{
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make2DUniformDataSet1();
|
||||
@ -58,7 +58,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(3) == 10.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniform3D0() const
|
||||
static void TestUniform3D0()
|
||||
{
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -94,7 +94,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(7) == 42.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniform3D1() const
|
||||
static void TestUniform3D1()
|
||||
{
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -132,7 +132,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(63) == 63.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniform3D2() const
|
||||
static void TestUniform3D2()
|
||||
{
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -169,7 +169,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(7) == 21.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniform3D3() const
|
||||
static void TestUniform3D3()
|
||||
{
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -206,7 +206,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(26) == 63.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniform3D4() const
|
||||
static void TestUniform3D4()
|
||||
{
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -244,7 +244,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(7) == 43.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniform3D5() const
|
||||
static void TestUniform3D5()
|
||||
{
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -282,7 +282,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(3) == 39.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniform3D6() const
|
||||
static void TestUniform3D6()
|
||||
{
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -320,7 +320,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(3) == 26.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniform3D7() const
|
||||
static void TestUniform3D7()
|
||||
{
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -357,7 +357,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(0) == 16.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestUniform3D8() const
|
||||
static void TestUniform3D8()
|
||||
{
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -396,7 +396,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(3) == 31.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestRectilinear2D() const
|
||||
static void TestRectilinear2D()
|
||||
{
|
||||
std::cout << "Testing extract structured rectilinear" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make2DRectilinearDataSet0();
|
||||
@ -433,7 +433,7 @@ public:
|
||||
VTKM_TEST_ASSERT(outCellData.ReadPortal().Get(0) == 0.0f, "Wrong cell field data");
|
||||
}
|
||||
|
||||
void TestRectilinear3D() const
|
||||
static void TestRectilinear3D()
|
||||
{
|
||||
std::cout << "Testing extract structured rectilinear" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DRectilinearDataSet0();
|
||||
@ -472,18 +472,18 @@ public:
|
||||
|
||||
void operator()() const
|
||||
{
|
||||
this->TestUniform2D();
|
||||
this->TestUniform3D0();
|
||||
this->TestUniform3D1();
|
||||
this->TestUniform3D2();
|
||||
this->TestUniform3D3();
|
||||
this->TestUniform3D4();
|
||||
this->TestUniform3D5();
|
||||
this->TestUniform3D6();
|
||||
this->TestUniform3D7();
|
||||
this->TestUniform3D8();
|
||||
this->TestRectilinear2D();
|
||||
this->TestRectilinear3D();
|
||||
TestingExtractStructured::TestUniform2D();
|
||||
TestingExtractStructured::TestUniform3D0();
|
||||
TestingExtractStructured::TestUniform3D1();
|
||||
TestingExtractStructured::TestUniform3D2();
|
||||
TestingExtractStructured::TestUniform3D3();
|
||||
TestingExtractStructured::TestUniform3D4();
|
||||
TestingExtractStructured::TestUniform3D5();
|
||||
TestingExtractStructured::TestUniform3D6();
|
||||
TestingExtractStructured::TestUniform3D7();
|
||||
TestingExtractStructured::TestUniform3D8();
|
||||
TestingExtractStructured::TestRectilinear2D();
|
||||
TestingExtractStructured::TestRectilinear3D();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -106,8 +106,8 @@ vtkm::cont::DataSet MakeRectilinear(vtkm::Id numI,
|
||||
bool addMidGhost = false)
|
||||
{
|
||||
vtkm::cont::DataSet ds;
|
||||
std::size_t nx(static_cast<std::size_t>(numI + 1));
|
||||
std::size_t ny(static_cast<std::size_t>(numJ + 1));
|
||||
auto nx(static_cast<std::size_t>(numI + 1));
|
||||
auto ny(static_cast<std::size_t>(numJ + 1));
|
||||
|
||||
std::vector<float> x(nx), y(ny);
|
||||
for (std::size_t i = 0; i < nx; i++)
|
||||
@ -119,7 +119,7 @@ vtkm::cont::DataSet MakeRectilinear(vtkm::Id numI,
|
||||
ds = vtkm::cont::DataSetBuilderRectilinear::Create(x, y);
|
||||
else
|
||||
{
|
||||
std::size_t nz(static_cast<std::size_t>(numK + 1));
|
||||
auto nz(static_cast<std::size_t>(numK + 1));
|
||||
std::vector<float> z(nz);
|
||||
for (std::size_t i = 0; i < nz; i++)
|
||||
z[i] = static_cast<float>(i);
|
||||
|
@ -21,7 +21,7 @@ namespace
|
||||
class TestingMask
|
||||
{
|
||||
public:
|
||||
void TestUniform2D() const
|
||||
static void TestUniform2D()
|
||||
{
|
||||
std::cout << "Testing mask cells uniform grid :" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make2DUniformDataSet1();
|
||||
@ -44,7 +44,7 @@ public:
|
||||
"Wrong mask data");
|
||||
}
|
||||
|
||||
void TestUniform3D() const
|
||||
static void TestUniform3D()
|
||||
{
|
||||
std::cout << "Testing mask cells uniform grid :" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -65,7 +65,7 @@ public:
|
||||
"Wrong mask data");
|
||||
}
|
||||
|
||||
void TestExplicit() const
|
||||
static void TestExplicit()
|
||||
{
|
||||
std::cout << "Testing mask cells explicit:" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet5();
|
||||
@ -88,9 +88,9 @@ public:
|
||||
|
||||
void operator()() const
|
||||
{
|
||||
this->TestUniform2D();
|
||||
this->TestUniform3D();
|
||||
this->TestExplicit();
|
||||
TestingMask::TestUniform2D();
|
||||
TestingMask::TestUniform3D();
|
||||
TestingMask::TestExplicit();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace
|
||||
class TestingMaskPoints
|
||||
{
|
||||
public:
|
||||
void TestRegular2D() const
|
||||
static void TestRegular2D()
|
||||
{
|
||||
std::cout << "Testing mask points on 2D regular dataset" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make2DUniformDataSet1();
|
||||
@ -36,7 +36,7 @@ public:
|
||||
"Wrong number of points for MaskPoints");
|
||||
}
|
||||
|
||||
void TestRegular3D() const
|
||||
static void TestRegular3D()
|
||||
{
|
||||
std::cout << "Testing mask points on 3D regular dataset" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -51,7 +51,7 @@ public:
|
||||
"Wrong number of points for MaskPoints");
|
||||
}
|
||||
|
||||
void TestExplicit3D() const
|
||||
static void TestExplicit3D()
|
||||
{
|
||||
std::cout << "Testing mask points on 3D explicit dataset" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet5();
|
||||
@ -69,9 +69,9 @@ public:
|
||||
|
||||
void operator()() const
|
||||
{
|
||||
this->TestRegular2D();
|
||||
this->TestRegular3D();
|
||||
this->TestExplicit3D();
|
||||
TestingMaskPoints::TestRegular2D();
|
||||
TestingMaskPoints::TestRegular3D();
|
||||
TestingMaskPoints::TestExplicit3D();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace
|
||||
class TestingThreshold
|
||||
{
|
||||
public:
|
||||
void TestRegular2D(bool returnAllInRange) const
|
||||
static void TestRegular2D(bool returnAllInRange)
|
||||
{
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make2DUniformDataSet0();
|
||||
vtkm::filter::entity_extraction::Threshold threshold;
|
||||
@ -77,7 +77,7 @@ public:
|
||||
clean.Execute(output);
|
||||
}
|
||||
|
||||
void TestRegular3D(bool returnAllInRange) const
|
||||
static void TestRegular3D(bool returnAllInRange)
|
||||
{
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet0();
|
||||
vtkm::filter::entity_extraction::Threshold threshold;
|
||||
@ -136,7 +136,7 @@ public:
|
||||
clean.Execute(output);
|
||||
}
|
||||
|
||||
void TestExplicit3D() const
|
||||
static void TestExplicit3D()
|
||||
{
|
||||
std::cout << "Testing threshold on 3D explicit dataset" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet1();
|
||||
@ -166,7 +166,7 @@ public:
|
||||
clean.Execute(output);
|
||||
}
|
||||
|
||||
void TestExplicit3DZeroResults() const
|
||||
static void TestExplicit3DZeroResults()
|
||||
{
|
||||
std::cout << "Testing threshold on 3D explicit dataset with empty results" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet1();
|
||||
@ -195,12 +195,12 @@ public:
|
||||
|
||||
void operator()() const
|
||||
{
|
||||
this->TestRegular2D(false);
|
||||
this->TestRegular2D(true);
|
||||
this->TestRegular3D(false);
|
||||
this->TestRegular3D(true);
|
||||
this->TestExplicit3D();
|
||||
this->TestExplicit3DZeroResults();
|
||||
TestingThreshold::TestRegular2D(false);
|
||||
TestingThreshold::TestRegular2D(true);
|
||||
TestingThreshold::TestRegular3D(false);
|
||||
TestingThreshold::TestRegular3D(true);
|
||||
TestingThreshold::TestExplicit3D();
|
||||
TestingThreshold::TestExplicit3DZeroResults();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace
|
||||
class TestingThresholdPoints
|
||||
{
|
||||
public:
|
||||
void TestRegular2D() const
|
||||
static void TestRegular2D()
|
||||
{
|
||||
std::cout << "Testing threshold points on 2D regular dataset" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make2DUniformDataSet1();
|
||||
@ -42,7 +42,7 @@ public:
|
||||
VTKM_TEST_ASSERT(pointFieldArray.ReadPortal().Get(12) == 50.0f, "Wrong point field data");
|
||||
}
|
||||
|
||||
void TestRegular3D() const
|
||||
static void TestRegular3D()
|
||||
{
|
||||
std::cout << "Testing threshold points on 3D regular dataset" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DUniformDataSet1();
|
||||
@ -64,7 +64,7 @@ public:
|
||||
VTKM_TEST_ASSERT(pointFieldArray.ReadPortal().Get(0) == 99.0f, "Wrong point field data");
|
||||
}
|
||||
|
||||
void TestExplicit3D() const
|
||||
static void TestExplicit3D()
|
||||
{
|
||||
std::cout << "Testing threshold points on 3D explicit dataset" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet5();
|
||||
@ -86,7 +86,7 @@ public:
|
||||
VTKM_TEST_ASSERT(pointFieldArray.ReadPortal().Get(4) == 10.f, "Wrong point field data");
|
||||
}
|
||||
|
||||
void TestExplicit3DZeroResults() const
|
||||
static void TestExplicit3DZeroResults()
|
||||
{
|
||||
std::cout << "Testing threshold on 3D explicit dataset with empty results" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make3DExplicitDataSet1();
|
||||
@ -104,10 +104,10 @@ public:
|
||||
|
||||
void operator()() const
|
||||
{
|
||||
this->TestRegular2D();
|
||||
this->TestRegular3D();
|
||||
this->TestExplicit3D();
|
||||
this->TestExplicit3DZeroResults();
|
||||
TestingThresholdPoints::TestRegular2D();
|
||||
TestingThresholdPoints::TestRegular3D();
|
||||
TestingThresholdPoints::TestExplicit3D();
|
||||
TestingThresholdPoints::TestExplicit3DZeroResults();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -68,10 +68,10 @@ struct ExternalFaces
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
inline vtkm::IdComponent CountExternalFacesOnDimension(vtkm::Float64 grid_min,
|
||||
vtkm::Float64 grid_max,
|
||||
vtkm::Float64 cell_min,
|
||||
vtkm::Float64 cell_max) const
|
||||
static inline vtkm::IdComponent CountExternalFacesOnDimension(vtkm::Float64 grid_min,
|
||||
vtkm::Float64 grid_max,
|
||||
vtkm::Float64 cell_min,
|
||||
vtkm::Float64 cell_max)
|
||||
{
|
||||
vtkm::IdComponent count = 0;
|
||||
|
||||
@ -159,14 +159,14 @@ struct ExternalFaces
|
||||
};
|
||||
|
||||
VTKM_EXEC
|
||||
inline bool FoundFaceOnDimension(vtkm::Float64 grid_min,
|
||||
vtkm::Float64 grid_max,
|
||||
vtkm::Float64 cell_min,
|
||||
vtkm::Float64 cell_max,
|
||||
vtkm::IdComponent& faceIndex,
|
||||
vtkm::IdComponent& count,
|
||||
vtkm::IdComponent dimensionFaceOffset,
|
||||
vtkm::IdComponent visitIndex) const
|
||||
static inline bool FoundFaceOnDimension(vtkm::Float64 grid_min,
|
||||
vtkm::Float64 grid_max,
|
||||
vtkm::Float64 cell_min,
|
||||
vtkm::Float64 cell_max,
|
||||
vtkm::IdComponent& faceIndex,
|
||||
vtkm::IdComponent& count,
|
||||
vtkm::IdComponent dimensionFaceOffset,
|
||||
vtkm::IdComponent visitIndex)
|
||||
{
|
||||
bool cell_min_at_grid_boundary = cell_min <= grid_min;
|
||||
bool cell_max_at_grid_boundary = cell_max >= grid_max;
|
||||
@ -648,7 +648,7 @@ public:
|
||||
struct BiasFunctor
|
||||
{
|
||||
VTKM_EXEC_CONT
|
||||
BiasFunctor(T bias = T(0))
|
||||
explicit BiasFunctor(T bias = T(0))
|
||||
: Bias(bias)
|
||||
{
|
||||
}
|
||||
|
@ -41,8 +41,6 @@ public:
|
||||
FieldOutCell passFlags);
|
||||
using ExecutionSignature = _4(PointCount, PointIndices, _2, _3);
|
||||
|
||||
ExtractCellsByVOI() = default;
|
||||
|
||||
VTKM_CONT
|
||||
ExtractCellsByVOI(bool extractInside, bool extractBoundaryCells, bool extractOnlyBoundaryCells)
|
||||
: ExtractInside(extractInside)
|
||||
|
@ -115,27 +115,28 @@ private:
|
||||
using CellIndexArray = vtkm::cont::
|
||||
ArrayHandleCartesianProduct<AxisIndexArrayCells, AxisIndexArrayCells, AxisIndexArrayCells>;
|
||||
|
||||
inline AxisIndexArrayPoints MakeAxisIndexArrayPoints(vtkm::Id count,
|
||||
vtkm::Id first,
|
||||
vtkm::Id last,
|
||||
vtkm::Id stride,
|
||||
bool includeBoundary)
|
||||
static inline AxisIndexArrayPoints MakeAxisIndexArrayPoints(vtkm::Id count,
|
||||
vtkm::Id first,
|
||||
vtkm::Id last,
|
||||
vtkm::Id stride,
|
||||
bool includeBoundary)
|
||||
{
|
||||
auto fnctr = extractstructured::internal::SubArrayPermutePoints(
|
||||
count, first, last, stride, includeBoundary);
|
||||
return vtkm::cont::make_ArrayHandleImplicit(fnctr, count);
|
||||
}
|
||||
|
||||
inline AxisIndexArrayCells MakeAxisIndexArrayCells(vtkm::Id count,
|
||||
vtkm::Id start,
|
||||
vtkm::Id stride)
|
||||
static inline AxisIndexArrayCells MakeAxisIndexArrayCells(vtkm::Id count,
|
||||
vtkm::Id start,
|
||||
vtkm::Id stride)
|
||||
{
|
||||
return vtkm::cont::make_ArrayHandleCounting(start, stride, count);
|
||||
}
|
||||
|
||||
UncertainCellSetStructured MakeCellSetStructured(const vtkm::Id3& inputPointDims,
|
||||
const vtkm::Id3& inputOffsets,
|
||||
vtkm::IdComponent forcedDimensionality = 0)
|
||||
static UncertainCellSetStructured MakeCellSetStructured(
|
||||
const vtkm::Id3& inputPointDims,
|
||||
const vtkm::Id3& inputOffsets,
|
||||
vtkm::IdComponent forcedDimensionality = 0)
|
||||
{
|
||||
// when the point dimension for a given axis is 1 we
|
||||
// need to lower the dimensonality by 1. So a Plane
|
||||
|
@ -21,7 +21,7 @@ namespace field_conversion
|
||||
//-----------------------------------------------------------------------------
|
||||
vtkm::cont::DataSet CellAverage::DoExecute(const vtkm::cont::DataSet& input)
|
||||
{
|
||||
auto field = GetFieldFromDataSet(input);
|
||||
const auto& field = GetFieldFromDataSet(input);
|
||||
if (!field.IsFieldPoint())
|
||||
{
|
||||
throw vtkm::cont::ErrorFilterExecution("Point field expected.");
|
||||
@ -30,7 +30,7 @@ vtkm::cont::DataSet CellAverage::DoExecute(const vtkm::cont::DataSet& input)
|
||||
vtkm::cont::UnknownCellSet inputCellSet = input.GetCellSet();
|
||||
vtkm::cont::UnknownArrayHandle outArray;
|
||||
|
||||
auto resolveType = [&, this](const auto& concrete) {
|
||||
auto resolveType = [&](const auto& concrete) {
|
||||
using T = typename std::decay_t<decltype(concrete)>::ValueType;
|
||||
vtkm::cont::ArrayHandle<T> result;
|
||||
this->Invoke(vtkm::worklet::CellAverage{}, inputCellSet, concrete, result);
|
||||
|
@ -22,7 +22,7 @@ namespace field_conversion
|
||||
{
|
||||
vtkm::cont::DataSet PointAverage::DoExecute(const vtkm::cont::DataSet& input)
|
||||
{
|
||||
auto field = GetFieldFromDataSet(input);
|
||||
const auto& field = GetFieldFromDataSet(input);
|
||||
if (!field.IsFieldCell())
|
||||
{
|
||||
throw vtkm::cont::ErrorFilterExecution("Cell field expected.");
|
||||
@ -31,7 +31,7 @@ vtkm::cont::DataSet PointAverage::DoExecute(const vtkm::cont::DataSet& input)
|
||||
vtkm::cont::UnknownCellSet cellSet = input.GetCellSet();
|
||||
vtkm::cont::UnknownArrayHandle outArray;
|
||||
|
||||
auto resolveType = [&, this](const auto& concrete) {
|
||||
auto resolveType = [&](const auto& concrete) {
|
||||
using T = typename std::decay_t<decltype(concrete)>::ValueType;
|
||||
using SupportedCellSets =
|
||||
vtkm::ListAppend<vtkm::List<vtkm::cont::CellSetExtrude>, VTKM_DEFAULT_CELL_SET_LIST>;
|
||||
|
@ -63,7 +63,7 @@ VTKM_CONT vtkm::cont::DataSet CrossProduct::DoExecute(const vtkm::cont::DataSet&
|
||||
// type and storage to a concrete ArrayHandle<T, S> with T from the `TypeList` and S from
|
||||
// `StorageList`. It then passes the concrete array to the lambda as the first argument.
|
||||
// We can later recover the concrete ValueType, T, from the concrete array.
|
||||
auto resolveType = [&, this](const auto& concrete) {
|
||||
auto resolveType = [&](const auto& concrete) {
|
||||
// use std::decay to remove const ref from the decltype of concrete.
|
||||
using T = typename std::decay_t<decltype(concrete)>::ValueType;
|
||||
const auto& secondaryField = this->GetFieldFromDataSet(1, inDataSet);
|
||||
|
@ -39,7 +39,7 @@ namespace vector_analysis
|
||||
//-----------------------------------------------------------------------------
|
||||
vtkm::cont::DataSet Gradient::DoExecute(const vtkm::cont::DataSet& inputDataSet)
|
||||
{
|
||||
auto field = this->GetFieldFromDataSet(inputDataSet);
|
||||
const auto& field = this->GetFieldFromDataSet(inputDataSet);
|
||||
if (!field.IsFieldPoint())
|
||||
{
|
||||
throw vtkm::cont::ErrorFilterExecution("Point field expected.");
|
||||
@ -67,7 +67,7 @@ vtkm::cont::DataSet Gradient::DoExecute(const vtkm::cont::DataSet& inputDataSet)
|
||||
// TODO: there are a humungous number of (weak) symbols in the .o file. Investigate if
|
||||
// they are all legit.
|
||||
|
||||
auto resolveType = [&, this](const auto& concrete) {
|
||||
auto resolveType = [&](const auto& concrete) {
|
||||
// use std::decay to remove const ref from the decltype of concrete.
|
||||
using T = typename std::decay_t<decltype(concrete)>::ValueType;
|
||||
vtkm::worklet::GradientOutputFields<T> gradientfields(this->GetComputeGradient(),
|
||||
|
@ -24,10 +24,9 @@ VectorMagnitude::VectorMagnitude()
|
||||
|
||||
VTKM_CONT vtkm::cont::DataSet VectorMagnitude::DoExecute(const vtkm::cont::DataSet& inDataSet)
|
||||
{
|
||||
auto field = this->GetFieldFromDataSet(inDataSet);
|
||||
vtkm::cont::UnknownArrayHandle outArray;
|
||||
|
||||
auto resolveType = [&, this](const auto& concrete) {
|
||||
auto resolveType = [&](const auto& concrete) {
|
||||
// use std::decay to remove const ref from the decltype of concrete.
|
||||
using T = typename std::decay_t<decltype(concrete)>::ValueType;
|
||||
using ReturnType = typename ::vtkm::detail::FloatingPointReturnType<T>::Type;
|
||||
@ -36,6 +35,7 @@ VTKM_CONT vtkm::cont::DataSet VectorMagnitude::DoExecute(const vtkm::cont::DataS
|
||||
this->Invoke(vtkm::worklet::Magnitude{}, concrete, result);
|
||||
outArray = result;
|
||||
};
|
||||
const auto& field = this->GetFieldFromDataSet(inDataSet);
|
||||
field.GetData()
|
||||
.CastAndCallForTypesWithFloatFallback<vtkm::TypeListVecCommon, VTKM_DEFAULT_STORAGE_LIST>(
|
||||
resolveType);
|
||||
|
@ -9,7 +9,6 @@
|
||||
//============================================================================
|
||||
|
||||
#include <vtkm/Math.h>
|
||||
#include <vtkm/cont/DataSet.h>
|
||||
#include <vtkm/cont/testing/Testing.h>
|
||||
#include <vtkm/io/VTKDataSetReader.h>
|
||||
|
||||
|
@ -71,8 +71,6 @@ struct GradientScalarOutput : public vtkm::cont::ExecutionObjectBase
|
||||
this->Gradient, this->Size, device, token);
|
||||
}
|
||||
|
||||
GradientScalarOutput() = default;
|
||||
|
||||
GradientScalarOutput(bool,
|
||||
bool,
|
||||
bool,
|
||||
|
Loading…
Reference in New Issue
Block a user