Commit 70fcd1d1 authored by Sujin Philip's avatar Sujin Philip
Browse files

Update CoordinateSystem to use the Virtual Array

parent 950b12b1
......@@ -104,14 +104,11 @@ int main(int argc, char* argv[])
output.AddCellSet(outputCellSet);
auto inCoords = input.GetCoordinateSystem(0).GetData();
timer.Reset();
vtkm::cont::DynamicArrayHandle coords;
{
FieldMapper<DeviceAdapter> coordMapper(coords, clip, false);
input.GetCoordinateSystem(0).GetData().CastAndCall(coordMapper);
}
auto outCoords = clip.ProcessCellField(inCoords, DeviceAdapter());
vtkm::Float64 processCoordinatesTime = timer.GetElapsedTime();
output.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", coords));
output.AddCoordinateSystem(vtkm::cont::CoordinateSystem("coordinates", outCoords));
timer.Reset();
for (vtkm::Id i = 0; i < input.GetNumberOfFields(); ++i)
......
......@@ -23,6 +23,7 @@
#endif
#include <vtkm/Math.h>
#include <vtkm/cont/ArrayCopy.h>
#include <vtkm/cont/ArrayHandle.h>
#include <vtkm/cont/DataSet.h>
#include <vtkm/worklet/DispatcherMapField.h>
......@@ -68,30 +69,6 @@ Quaternion qrot;
int lastx, lasty;
int mouse_state = 1;
//
// Functor to retrieve vertex locations from the CoordinateSystem
// Actually need a static cast to ArrayHandle from DynamicArrayHandleCoordinateSystem
// but haven't been able to figure out what that is
//
struct GetVertexArray
{
template <typename ArrayHandleType>
VTKM_CONT void operator()(ArrayHandleType array) const
{
this->GetVertexPortal(array.GetPortalConstControl());
}
private:
template <typename PortalType>
VTKM_CONT void GetVertexPortal(const PortalType& portal) const
{
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
{
vertexArray.GetPortalControl().Set(index, portal.Get(index));
}
}
};
//
// Initialize the OpenGL state
//
......@@ -145,16 +122,10 @@ void displayCall()
// Get the cell set, coordinate system and coordinate data
vtkm::cont::CellSetExplicit<> cellSet;
outDataSet.GetCellSet(0).CopyTo(cellSet);
const vtkm::cont::DynamicArrayHandleCoordinateSystem& coordArray =
outDataSet.GetCoordinateSystem().GetData();
auto coordArray = outDataSet.GetCoordinateSystem().GetData();
vtkm::Id numberOfCells = cellSet.GetNumberOfCells();
vtkm::Id numberOfPoints = coordArray.GetNumberOfValues();
// Need the actual vertex points from a static cast of the dynamic array but can't get it right
// So use cast and call on a functor that stores that dynamic array into static array we created
vertexArray.Allocate(numberOfPoints);
vtkm::cont::CastAndCall(coordArray, GetVertexArray());
vtkm::cont::ArrayCopy(coordArray, vertexArray);
// Each cell is a polyline
glColor3f(1.0f, 0.0f, 0.0f);
......
......@@ -52,9 +52,6 @@ namespace
// Takes input uniform grid and outputs unstructured grid of tets
static vtkm::cont::DataSet outDataSet;
// Point location of vertices from a CastAndCall but needs a static cast eventually
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>> vertexArray;
// OpenGL display variables
Quaternion qrot;
int lastx, lasty;
......@@ -123,30 +120,6 @@ vtkm::cont::DataSet MakeTetrahedralizeExplicitDataSet()
return builder.Create();
}
//
// Functor to retrieve vertex locations from the CoordinateSystem
// Actually need a static cast to ArrayHandle from DynamicArrayHandleCoordinateSystem
// but haven't been able to figure out what that is
//
struct GetVertexArray
{
template <typename ArrayHandleType>
VTKM_CONT void operator()(ArrayHandleType array) const
{
this->GetVertexPortal(array.GetPortalConstControl());
}
private:
template <typename PortalType>
VTKM_CONT void GetVertexPortal(const PortalType& portal) const
{
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
{
vertexArray.GetPortalControl().Set(index, portal.Get(index));
}
}
};
//
// Initialize the OpenGL state
//
......@@ -201,10 +174,7 @@ void displayCall()
outDataSet.GetCellSet(0).CopyTo(cellSet);
vtkm::Id numberOfCells = cellSet.GetNumberOfCells();
// Need the actual vertex points from a static cast of the dynamic array but can't get it right
// So use cast and call on a functor that stores that dynamic array into static array we created
vertexArray.Allocate(cellSet.GetNumberOfPoints());
vtkm::cont::CastAndCall(outDataSet.GetCoordinateSystem(), GetVertexArray());
auto vertexArray = outDataSet.GetCoordinateSystem().GetData();
// Draw the five tetrahedra belonging to each hexadron
vtkm::Float32 color[5][3] = { { 1.0f, 0.0f, 0.0f },
......@@ -223,10 +193,10 @@ void displayCall()
cellSet.GetIndices(tetra, tetIndices);
// Get the vertex points for this tetrahedron
vtkm::Vec<vtkm::Float64, 3> pt0 = vertexArray.GetPortalConstControl().Get(tetIndices[0]);
vtkm::Vec<vtkm::Float64, 3> pt1 = vertexArray.GetPortalConstControl().Get(tetIndices[1]);
vtkm::Vec<vtkm::Float64, 3> pt2 = vertexArray.GetPortalConstControl().Get(tetIndices[2]);
vtkm::Vec<vtkm::Float64, 3> pt3 = vertexArray.GetPortalConstControl().Get(tetIndices[3]);
auto pt0 = vertexArray.GetPortalConstControl().Get(tetIndices[0]);
auto pt1 = vertexArray.GetPortalConstControl().Get(tetIndices[1]);
auto pt2 = vertexArray.GetPortalConstControl().Get(tetIndices[2]);
auto pt3 = vertexArray.GetPortalConstControl().Get(tetIndices[3]);
// Draw the tetrahedron filled with alternating colors
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
......@@ -323,7 +293,6 @@ int main(int argc, char* argv[])
glutMainLoop();
outDataSet.Clear();
vertexArray.ReleaseResources();
return 0;
}
......
......@@ -52,9 +52,6 @@ static vtkm::Id cellsToDisplay = 64;
// Takes input uniform grid and outputs unstructured grid of tets
static vtkm::cont::DataSet tetDataSet;
// Point location of vertices from a CastAndCall but needs a static cast eventually
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>> vertexArray;
// OpenGL display variables
static Quaternion qrot;
static int lastx, lasty;
......@@ -87,30 +84,6 @@ vtkm::cont::DataSet MakeTetrahedralizeTestDataSet(vtkm::Id3 dim)
return dataSet;
}
//
// Functor to retrieve vertex locations from the CoordinateSystem
// Actually need a static cast to ArrayHandle from DynamicArrayHandleCoordinateSystem
// but haven't been able to figure out what that is
//
struct GetVertexArray
{
template <typename ArrayHandleType>
VTKM_CONT void operator()(ArrayHandleType array) const
{
this->GetVertexPortal(array.GetPortalConstControl());
}
private:
template <typename PortalType>
VTKM_CONT void GetVertexPortal(const PortalType& portal) const
{
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
{
vertexArray.GetPortalControl().Set(index, portal.Get(index));
}
}
};
//
// Initialize the OpenGL state
//
......@@ -165,10 +138,7 @@ void displayCall()
vtkm::cont::CellSetSingleType<> cellSet;
tetDataSet.GetCellSet(0).CopyTo(cellSet);
// Need the actual vertex points from a static cast of the dynamic array but can't get it right
// So use cast and call on a functor that stores that dynamic array into static array we created
vertexArray.Allocate(cellSet.GetNumberOfPoints());
vtkm::cont::CastAndCall(tetDataSet.GetCoordinateSystem(), GetVertexArray());
auto vertexArray = tetDataSet.GetCoordinateSystem().GetData();
// Draw the five tetrahedra belonging to each hexadron
vtkm::Id tetra = 0;
......@@ -190,10 +160,10 @@ void displayCall()
cellSet.GetIndices(tetra, tetIndices);
// Get the vertex points for this tetrahedron
vtkm::Vec<vtkm::Float64, 3> pt0 = vertexArray.GetPortalConstControl().Get(tetIndices[0]);
vtkm::Vec<vtkm::Float64, 3> pt1 = vertexArray.GetPortalConstControl().Get(tetIndices[1]);
vtkm::Vec<vtkm::Float64, 3> pt2 = vertexArray.GetPortalConstControl().Get(tetIndices[2]);
vtkm::Vec<vtkm::Float64, 3> pt3 = vertexArray.GetPortalConstControl().Get(tetIndices[3]);
auto pt0 = vertexArray.GetPortalConstControl().Get(tetIndices[0]);
auto pt1 = vertexArray.GetPortalConstControl().Get(tetIndices[1]);
auto pt2 = vertexArray.GetPortalConstControl().Get(tetIndices[2]);
auto pt3 = vertexArray.GetPortalConstControl().Get(tetIndices[3]);
// Draw the tetrahedron filled with alternating colors
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
......@@ -305,7 +275,6 @@ int main(int argc, char* argv[])
glutMainLoop();
tetDataSet.Clear();
vertexArray.ReleaseResources();
return 0;
}
......
......@@ -50,9 +50,6 @@ namespace
static vtkm::cont::DataSet outDataSet;
static vtkm::Id numberOfInPoints;
// Point location of vertices from a CastAndCall but needs a static cast eventually
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>> vertexArray;
} // anonymous namespace
//
......@@ -125,30 +122,6 @@ vtkm::cont::DataSet MakeTriangulateExplicitDataSet()
return builder.Create();
}
//
// Functor to retrieve vertex locations from the CoordinateSystem
// Actually need a static cast to ArrayHandle from DynamicArrayHandleCoordinateSystem
// but haven't been able to figure out what that is
//
struct GetVertexArray
{
template <typename ArrayHandleType>
VTKM_CONT void operator()(ArrayHandleType array) const
{
this->GetVertexPortal(array.GetPortalConstControl());
}
private:
template <typename PortalType>
VTKM_CONT void GetVertexPortal(const PortalType& portal) const
{
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
{
vertexArray.GetPortalControl().Set(index, portal.Get(index));
}
}
};
//
// Initialize the OpenGL state
//
......@@ -173,10 +146,7 @@ void displayCall()
outDataSet.GetCellSet(0).CopyTo(cellSet);
vtkm::Id numberOfCells = cellSet.GetNumberOfCells();
// Need the actual vertex points from a static cast of the dynamic array but can't get it right
// So use cast and call on a functor that stores that dynamic array into static array we created
vertexArray.Allocate(numberOfInPoints);
vtkm::cont::CastAndCall(outDataSet.GetCoordinateSystem(), GetVertexArray());
auto vertexArray = outDataSet.GetCoordinateSystem().GetData();
// Draw the two triangles belonging to each quad
vtkm::Float32 color[4][3] = {
......@@ -239,7 +209,6 @@ int main(int argc, char* argv[])
glutMainLoop();
outDataSet.Clear();
vertexArray.ReleaseResources();
return 0;
}
......
......@@ -50,9 +50,6 @@ static vtkm::Id cellsToDisplay = 16;
// Takes input uniform grid and outputs unstructured grid of triangles
static vtkm::cont::DataSet triDataSet;
// Point location of vertices from a CastAndCall but needs a static cast eventually
static vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>> vertexArray;
//
// Construct an input data set with uniform grid of indicated dimensions, origin and spacing
//
......@@ -78,30 +75,6 @@ vtkm::cont::DataSet MakeTriangulateTestDataSet(vtkm::Id2 dim)
return dataSet;
}
//
// Functor to retrieve vertex locations from the CoordinateSystem
// Actually need a static cast to ArrayHandle from DynamicArrayHandleCoordinateSystem
// but haven't been able to figure out what that is
//
struct GetVertexArray
{
template <typename ArrayHandleType>
VTKM_CONT void operator()(ArrayHandleType array) const
{
this->GetVertexPortal(array.GetPortalConstControl());
}
private:
template <typename PortalType>
VTKM_CONT void GetVertexPortal(const PortalType& portal) const
{
for (vtkm::Id index = 0; index < portal.GetNumberOfValues(); index++)
{
vertexArray.GetPortalControl().Set(index, portal.Get(index));
}
}
};
//
// Initialize the OpenGL state
//
......@@ -125,10 +98,7 @@ void displayCall()
vtkm::cont::CellSetSingleType<> cellSet;
triDataSet.GetCellSet(0).CopyTo(cellSet);
// Need the actual vertex points from a static cast of the dynamic array but can't get it right
// So use cast and call on a functor that stores that dynamic array into static array we created
vertexArray.Allocate(cellSet.GetNumberOfPoints());
vtkm::cont::CastAndCall(triDataSet.GetCoordinateSystem(), GetVertexArray());
auto vertexArray = triDataSet.GetCoordinateSystem().GetData();
// Draw the two triangles belonging to each quad
vtkm::Id triangle = 0;
......@@ -207,7 +177,6 @@ int main(int argc, char* argv[])
glutMainLoop();
triDataSet.Clear();
vertexArray.ReleaseResources();
return 0;
}
......
......@@ -71,6 +71,10 @@ VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::UInt8, 4, vtkm::cont::StorageTagBasic);
VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::Float32, 4, vtkm::cont::StorageTagBasic);
VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::Float64, 4, vtkm::cont::StorageTagBasic);
VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC(vtkm::FloatDefault,
3,
vtkm::cont::ArrayHandleVirtualCoordinates::StorageTag);
#undef VTKM_ARRAY_RANGE_COMPUTE_IMPL_T
#undef VTKM_ARRAY_RANGE_COMPUTE_IMPL_VEC
......
......@@ -26,6 +26,7 @@
#include <vtkm/cont/ArrayHandleCartesianProduct.h>
#include <vtkm/cont/ArrayHandleCompositeVector.h>
#include <vtkm/cont/ArrayHandleUniformPointCoordinates.h>
#include <vtkm/cont/ArrayHandleVirtualCoordinates.h>
#include <vtkm/cont/RuntimeDeviceTracker.h>
namespace vtkm
......@@ -97,6 +98,10 @@ VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::FloatDefault,
3,
vtkm::cont::ArrayHandleUniformPointCoordinates::StorageTag);
VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC(vtkm::FloatDefault,
3,
vtkm::cont::ArrayHandleVirtualCoordinates::StorageTag);
#undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_T
#undef VTKM_ARRAY_RANGE_COMPUTE_EXPORT_VEC
......
......@@ -102,13 +102,10 @@ set(sources
CellSet.cxx
CellSetExplicit.cxx
CellSetStructured.cxx
CoordinateSystem.cxx
DataSet.cxx
DynamicArrayHandle.cxx
EnvironmentTracker.cxx
Field.cxx
internal/SimplePolymorphicContainer.cxx
MultiBlock.cxx
internal/ArrayManagerExecutionShareWithControl.cxx
StorageBasic.cxx
)
......@@ -118,6 +115,9 @@ set(sources
set(device_sources
ArrayRangeCompute.cxx
CellSetExplicit.cxx
CoordinateSystem.cxx
DataSet.cxx
MultiBlock.cxx
RuntimeDeviceTracker.cxx
TryExecute.cxx
)
......
......@@ -496,24 +496,17 @@ public:
/// Builds the cell locator lookup structure
///
template <typename DeviceAdapter,
typename CellSetList = VTKM_DEFAULT_CELL_SET_LIST_TAG,
typename CoordsTypeList = VTKM_DEFAULT_COORDINATE_SYSTEM_TYPE_LIST_TAG,
typename CoordsStorageList = VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG>
void Build(DeviceAdapter,
CellSetList cellSetTypes = CellSetList(),
CoordsTypeList coordsValueTypes = CoordsTypeList(),
CoordsStorageList coordsStorageType = CoordsStorageList())
template <typename DeviceAdapter, typename CellSetList = VTKM_DEFAULT_CELL_SET_LIST_TAG>
void Build(DeviceAdapter, CellSetList cellSetTypes = CellSetList())
{
using Algorithm = vtkm::cont::DeviceAdapterAlgorithm<DeviceAdapter>;
auto cellset = this->CellSet.ResetCellSetList(cellSetTypes);
auto points =
this->Coordinates.GetData().ResetTypeAndStorageLists(coordsValueTypes, coordsStorageType);
const auto& coords = this->Coordinates;
TwoLevelUniformGrid ls;
// 1: Compute the top level grid
auto bounds = this->Coordinates.GetBounds(coordsValueTypes, coordsStorageType);
auto bounds = this->Coordinates.GetBounds();
FloatVec3 bmin(static_cast<vtkm::FloatDefault>(bounds.X.Min),
static_cast<vtkm::FloatDefault>(bounds.Y.Min),
static_cast<vtkm::FloatDefault>(bounds.Z.Min));
......@@ -533,7 +526,7 @@ public:
vtkm::cont::ArrayHandle<vtkm::Id> binCounts;
CountBinsL1 countL1(ls.TopLevel);
vtkm::worklet::DispatcherMapTopology<CountBinsL1, DeviceAdapter>(countL1).Invoke(
cellset, points, binCounts);
cellset, coords, binCounts);
// 3: Total number of unique (cell, bin) pairs (for pre-allocating arrays)
vtkm::Id numPairsL1 = Algorithm::ScanExclusive(binCounts, binCounts);
......@@ -543,7 +536,7 @@ public:
binIds.Allocate(numPairsL1);
FindBinsL1 findL1(ls.TopLevel);
vtkm::worklet::DispatcherMapTopology<FindBinsL1, DeviceAdapter>(findL1).Invoke(
cellset, points, binCounts, binIds);
cellset, coords, binCounts, binIds);
binCounts.ReleaseResources();
// 5: From above, find the number of cells that intersect each top level bin
......@@ -577,7 +570,7 @@ public:
// 8: For each cell, find the number of l2 bins they intersect
CountBinsL2 countL2(ls.TopLevel);
vtkm::worklet::DispatcherMapTopology<CountBinsL2, DeviceAdapter>(countL2).Invoke(
cellset, points, ls.LeafDimensions, binCounts);
cellset, coords, ls.LeafDimensions, binCounts);
// 9: Total number of unique (cell, bin) pairs (for pre-allocating arrays)
vtkm::Id numPairsL2 = Algorithm::ScanExclusive(binCounts, binCounts);
......@@ -587,7 +580,7 @@ public:
ls.CellIds.Allocate(numPairsL2);
FindBinsL2 findL2(ls.TopLevel);
vtkm::worklet::DispatcherMapTopology<FindBinsL2, DeviceAdapter>(findL2).Invoke(
cellset, points, ls.LeafDimensions, ls.LeafStartIndex, binCounts, binIds, ls.CellIds);
cellset, coords, ls.LeafDimensions, ls.LeafStartIndex, binCounts, binIds, ls.CellIds);
binCounts.ReleaseResources();
// 11: From above, find the cells that each l2 bin intersects
......@@ -710,22 +703,18 @@ public:
template <typename PointComponentType,
typename PointStorageType,
typename DeviceAdapter,
typename CellSetList = VTKM_DEFAULT_CELL_SET_LIST_TAG,
typename CoordsTypeList = VTKM_DEFAULT_COORDINATE_SYSTEM_TYPE_LIST_TAG,
typename CoordsStorageList = VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG>
typename CellSetList = VTKM_DEFAULT_CELL_SET_LIST_TAG>
void FindCells(
const vtkm::cont::ArrayHandle<vtkm::Vec<PointComponentType, 3>, PointStorageType>& points,
vtkm::cont::ArrayHandle<vtkm::Id>& cellIds,
vtkm::cont::ArrayHandle<FloatVec3>& parametricCoords,
DeviceAdapter device,
CellSetList cellSetTypes = CellSetList(),
CoordsTypeList coordsValueTypes = CoordsTypeList(),
CoordsStorageList coordsStorageType = CoordsStorageList()) const
CellSetList cellSetTypes = CellSetList()) const
{
vtkm::worklet::DispatcherMapField<FindCellWorklet, DeviceAdapter>().Invoke(
points,
this->CellSet.ResetCellSetList(cellSetTypes),
this->Coordinates.GetData().ResetTypeAndStorageLists(coordsValueTypes, coordsStorageType),
this->Coordinates,
this->PrepareForDevice(device),
cellIds,
parametricCoords);
......
......@@ -25,6 +25,10 @@ namespace vtkm
namespace cont
{
using CoordinatesTypeList = vtkm::ListTagBase<vtkm::cont::ArrayHandleVirtualCoordinates::ValueType>;
using CoordinatesStorageList =
vtkm::ListTagBase<vtkm::cont::ArrayHandleVirtualCoordinates::StorageTag>;
VTKM_CONT
void CoordinateSystem::PrintSummary(std::ostream& out) const
{
......@@ -35,23 +39,21 @@ void CoordinateSystem::PrintSummary(std::ostream& out) const
VTKM_CONT
void CoordinateSystem::GetRange(vtkm::Range* range) const
{
this->Superclass::GetRange(range,
VTKM_DEFAULT_COORDINATE_SYSTEM_TYPE_LIST_TAG(),
VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG());
this->Superclass::GetRange(range, CoordinatesTypeList(), CoordinatesStorageList());
}
VTKM_CONT
const vtkm::cont::ArrayHandle<vtkm::Range>& CoordinateSystem::GetRange() const
{
return this->Superclass::GetRange(VTKM_DEFAULT_COORDINATE_SYSTEM_TYPE_LIST_TAG(),
VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG());
return this->Superclass::GetRange(CoordinatesTypeList(), CoordinatesStorageList());
}
VTKM_CONT
vtkm::Bounds CoordinateSystem::GetBounds() const
{
return this->GetBounds(VTKM_DEFAULT_COORDINATE_SYSTEM_TYPE_LIST_TAG(),
VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG());
vtkm::Range ranges[3];
this->GetRange(ranges);
return vtkm::Bounds(ranges[0], ranges[1], ranges[2]);
}
}
} // namespace vtkm::cont
......@@ -22,20 +22,11 @@
#include <vtkm/Bounds.h>
#include <vtkm/cont/ArrayHandleCartesianProduct.h>
#include <vtkm/cont/ArrayHandleCompositeVector.h>
#include <vtkm/cont/ArrayHandleCast.h>
#include <vtkm/cont/ArrayHandleUniformPointCoordinates.h>
#include <vtkm/cont/ArrayHandleVirtualCoordinates.h>
#include <vtkm/cont/Field.h>
#ifndef VTKM_DEFAULT_COORDINATE_SYSTEM_TYPE_LIST_TAG
#define VTKM_DEFAULT_COORDINATE_SYSTEM_TYPE_LIST_TAG ::vtkm::TypeListTagFieldVec3
#endif
#ifndef VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG
#define VTKM_DEFAULT_COORDINATE_SYSTEM_STORAGE_LIST_TAG \
::vtkm::cont::StorageListTagCoordinateSystemDefault
#endif
namespace vtkm
{
namespace cont
......@@ -44,48 +35,48 @@ namespace cont
namespace detail
{
using ArrayHandleCompositeVectorFloat32_3Default =
vtkm::cont::ArrayHandleCompositeVectorType<vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>,
vtkm::cont::ArrayHandle<vtkm::Float32>>::type;
struct MakeArrayHandleVirtualCoordinatesFunctor
{
VTKM_CONT explicit MakeArrayHandleVirtualCoordinatesFunctor(
vtkm::cont::ArrayHandleVirtualCoordinates& out)
: Out(&out)
{
}
using ArrayHandleCompositeVectorFloat64_3Default =
vtkm::cont::ArrayHandleCompositeVectorType<vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>,
vtkm::cont::ArrayHandle<vtkm::Float64>>::type;
template <typename StorageTag>
VTKM_CONT void operator()(
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float32, 3>, StorageTag>& array) const
{
*this->Out = vtkm::cont::ArrayHandleVirtualCoordinates(array);
}
} // namespace detail
template <typename StorageTag>
VTKM_CONT void operator()(
const vtkm::cont::ArrayHandle<vtkm::Vec<vtkm::Float64, 3>, StorageTag>& array) const
{
*this->Out = vtkm::cont::ArrayHandleVirtualCoordinates(array);
}
/// \brief Default