mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Add test for GlobalPointIndexStart to TestingExtractStructured
This commit is contained in:
parent
bce19a2e4c
commit
e013ad126f
@ -26,6 +26,13 @@ public:
|
||||
std::cout << "Testing extract structured uniform" << std::endl;
|
||||
vtkm::cont::DataSet dataset = MakeTestDataSet().Make2DUniformDataSet1();
|
||||
|
||||
// Change point index start from 0, 0 to 10, 14
|
||||
vtkm::cont::CellSetStructured<2> cellSet;
|
||||
dataset.GetCellSet().AsCellSet(cellSet);
|
||||
cellSet.SetGlobalPointIndexStart(vtkm::Id2{ 10, 14 });
|
||||
dataset.SetCellSet(cellSet);
|
||||
dataset.PrintSummary(std::cout);
|
||||
|
||||
vtkm::RangeId3 range(1, 4, 1, 4, 0, 1);
|
||||
vtkm::Id3 sample(1, 1, 1);
|
||||
|
||||
@ -35,10 +42,17 @@ public:
|
||||
|
||||
extract.SetFieldsToPass({ "pointvar", "cellvar" });
|
||||
vtkm::cont::DataSet output = extract.Execute(dataset);
|
||||
output.PrintSummary(std::cout);
|
||||
VTKM_TEST_ASSERT(test_equal(output.GetCellSet().GetNumberOfPoints(), 9),
|
||||
"Wrong result for ExtractStructured worklet");
|
||||
VTKM_TEST_ASSERT(test_equal(output.GetNumberOfCells(), 4),
|
||||
"Wrong result for ExtractStructured worklet");
|
||||
vtkm::cont::CellSetStructured<2> outputCellSet;
|
||||
output.GetCellSet().AsCellSet(outputCellSet);
|
||||
VTKM_TEST_ASSERT(test_equal(outputCellSet.GetGlobalPointIndexStart()[0], 11),
|
||||
"Wrong result for ExtractStructured PointIndexStart");
|
||||
VTKM_TEST_ASSERT(test_equal(outputCellSet.GetGlobalPointIndexStart()[1], 15),
|
||||
"Wrong result for ExtractStructured PointIndexStart");
|
||||
|
||||
vtkm::cont::ArrayHandle<vtkm::Float32> outPointData;
|
||||
output.GetField("pointvar").GetData().AsArrayHandle(outPointData);
|
||||
|
Loading…
Reference in New Issue
Block a user