Update tetrahedralize to output dataset

This commit is contained in:
Patricia Kroll Fasel - 090207 2015-09-14 14:45:59 -06:00
parent d602ec3aad
commit 22c95f102a
5 changed files with 12 additions and 7 deletions

@ -21,4 +21,5 @@
##=============================================================================
add_subdirectory(hello_world)
add_subdirectory(isosurface)
add_subdirectory(isosurface)
add_subdirectory(tetrahedra)

@ -27,9 +27,12 @@ set(headers
CellAverage.h
Clip.h
ExternalFaces.h
FieldHistogram.h
FieldStatistics.h
IsosurfaceUniformGrid.h
MarchingCubesDataTables.h
PointElevation.h
TetrahedralizeUniformGrid.h
VertexClustering.h
)

@ -79,8 +79,6 @@ public:
// Calculate the type of tetrahedron generated because it alternates
vtkm::Id indexType = (x + y + z) % 2;
printf("CellID %ld x %ld y %ld z %ld indexType %ld\n", inputCellId, x, y, z, indexType);
// Compute indices for the eight vertices of this cell
const vtkm::Id i0 = x + y*(xdim+1) + z * pointsPerLayer;
const vtkm::Id i1 = i0 + 1;
@ -93,7 +91,7 @@ printf("CellID %ld x %ld y %ld z %ld indexType %ld\n", inputCellId, x, y, z, ind
// Set the tetrahedra for this cell based on vertex index and index type of cell
vtkm::Id startIndex = inputCellId * 5 * 4;
printf("CellID %ld vertex pts %ld %ld %ld %ld %ld %ld %ld %ld STARTINDEX %ld\n", inputCellId, i0, i1, i2, i3, i4, i5, i6, i7, startIndex);
printf("CellID %ld x %ld y %ld z %ld vertex pts %ld %ld %ld %ld %ld %ld %ld %ld STARTINDEX %ld\n", inputCellId, x, y, z, i0, i1, i2, i3, i4, i5, i6, i7, startIndex);
if (indexType == 0) {
this->TetrahedraIndices.Set(startIndex + 0, i0);
this->TetrahedraIndices.Set(startIndex + 1, i1);

@ -22,8 +22,11 @@ set(unit_tests
UnitTestCellAverage.cxx
UnitTestClipping.cxx
UnitTestExternalFaces.cxx
UnitTestFieldHistogram.cxx
UnitTestFieldStatistics.cxx
UnitTestIsosurfaceUniformGrid.cxx
UnitTestPointElevation.cxx
UnitTestTetrahedralizeUniformGrid.cxx
UnitTestWorkletMapField.cxx
UnitTestWorkletMapFieldExecArg.cxx
UnitTestWorkletMapTopologyExplicit.cxx

@ -26,8 +26,6 @@
#include <vtkm/cont/testing/Testing.h>
#include <vector>
namespace {
vtkm::cont::DataSet MakeTetrahedralizeTestDataSet(vtkm::Id3 dims)
@ -73,11 +71,13 @@ void TestTetrahedralizeUniformGrid()
vtkm::Id numberOfCells = dims[0] * dims[1] * dims[2];
vtkm::Id numberOfVertices = (dims[0] + 1) * (dims[1] + 1) * (dims[2] + 1);
// Create the output dataset which will get a CellSetExplicit
// Create the output dataset explicit cell set with same coordinate system
vtkm::cont::DataSet outDataSet;
vtkm::cont::CellSetExplicit<> cellSet(numberOfVertices, "cells", 3);
outDataSet.AddCellSet(cellSet);
outDataSet.AddCoordinateSystem(inDataSet.GetCoordinateSystem(0));
// Convert uniform hexahedra to tetrahedra
vtkm::worklet::TetrahedralizeFilterUniformGrid<DeviceAdapter>
tetrahedralizeFilter(dims, inDataSet, outDataSet);
tetrahedralizeFilter.Run();