Remove pixel and voxel cell types
These cell types are inherited from VTK, but they are basically the same as quad and hexahedron, respectively. The only useful difference is that pixel and voxel are supposed to be axis aligned, but you cannot determine that by the cell shape alone (at least not just from the cell set). A big issue with these is that their indexing is different that of quad and hex. The development team had a long discussion about the benefits of the alternate indexing, but after consulting with Berk Geveci and Will Schroder from the VTK team, that indexing is not really taken advantage of at the cell level. Thus, it is really just a nuisance in VTK-m.
This commit is contained in:
parent
ed6ff1e931
commit
947178e7e4
@ -43,10 +43,10 @@ enum CellShapeIdEnum
|
||||
CELL_SHAPE_TRIANGLE = 5,
|
||||
//CELL_SHAPE_TRIANGLE_STRIP = 6,
|
||||
CELL_SHAPE_POLYGON = 7,
|
||||
CELL_SHAPE_PIXEL = 8,
|
||||
//CELL_SHAPE_PIXEL = 8,
|
||||
CELL_SHAPE_QUAD = 9,
|
||||
CELL_SHAPE_TETRA = 10,
|
||||
CELL_SHAPE_VOXEL = 11,
|
||||
//CELL_SHAPE_VOXEL = 11,
|
||||
CELL_SHAPE_HEXAHEDRON = 12,
|
||||
CELL_SHAPE_WEDGE = 13,
|
||||
CELL_SHAPE_PYRAMID = 14,
|
||||
@ -121,10 +121,10 @@ VTKM_DEFINE_CELL_TAG(Line, CELL_SHAPE_LINE);
|
||||
VTKM_DEFINE_CELL_TAG(Triangle, CELL_SHAPE_TRIANGLE);
|
||||
//VTKM_DEFINE_CELL_TAG(TriangleStrip, CELL_SHAPE_TRIANGLE_STRIP);
|
||||
VTKM_DEFINE_CELL_TAG(Polygon, CELL_SHAPE_POLYGON);
|
||||
VTKM_DEFINE_CELL_TAG(Pixel, CELL_SHAPE_PIXEL);
|
||||
//VTKM_DEFINE_CELL_TAG(Pixel, CELL_SHAPE_PIXEL);
|
||||
VTKM_DEFINE_CELL_TAG(Quad, CELL_SHAPE_QUAD);
|
||||
VTKM_DEFINE_CELL_TAG(Tetra, CELL_SHAPE_TETRA);
|
||||
VTKM_DEFINE_CELL_TAG(Voxel, CELL_SHAPE_VOXEL);
|
||||
//VTKM_DEFINE_CELL_TAG(Voxel, CELL_SHAPE_VOXEL);
|
||||
VTKM_DEFINE_CELL_TAG(Hexahedron, CELL_SHAPE_HEXAHEDRON);
|
||||
VTKM_DEFINE_CELL_TAG(Wedge, CELL_SHAPE_WEDGE);
|
||||
VTKM_DEFINE_CELL_TAG(Pyramid, CELL_SHAPE_PYRAMID);
|
||||
@ -189,10 +189,8 @@ struct CellShapeTagGeneric {
|
||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_LINE, call); \
|
||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TRIANGLE, call); \
|
||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_POLYGON, call); \
|
||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_PIXEL, call); \
|
||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_QUAD, call); \
|
||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TETRA, call); \
|
||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_VOXEL, call); \
|
||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_HEXAHEDRON, call); \
|
||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_WEDGE, call); \
|
||||
vtkmGenericCellShapeMacroCase(CELL_SHAPE_PYRAMID, call)
|
||||
|
@ -112,10 +112,10 @@ VTKM_DEFINE_CELL_TRAITS(Line, 1, 2);
|
||||
VTKM_DEFINE_CELL_TRAITS(Triangle, 2, 3);
|
||||
//VTKM_DEFINE_CELL_TRAITS_VARIABLE(TriangleStrip, 2);
|
||||
VTKM_DEFINE_CELL_TRAITS_VARIABLE(Polygon, 2);
|
||||
VTKM_DEFINE_CELL_TRAITS(Pixel, 2, 4);
|
||||
//VTKM_DEFINE_CELL_TRAITS(Pixel, 2, 4);
|
||||
VTKM_DEFINE_CELL_TRAITS(Quad, 2, 4);
|
||||
VTKM_DEFINE_CELL_TRAITS(Tetra, 3, 4);
|
||||
VTKM_DEFINE_CELL_TRAITS(Voxel, 3, 8);
|
||||
//VTKM_DEFINE_CELL_TRAITS(Voxel, 3, 8);
|
||||
VTKM_DEFINE_CELL_TRAITS(Hexahedron, 3, 8);
|
||||
VTKM_DEFINE_CELL_TRAITS(Wedge, 3, 6);
|
||||
VTKM_DEFINE_CELL_TRAITS(Pyramid, 3, 5);
|
||||
|
@ -96,7 +96,7 @@ TwoDimRegularTest()
|
||||
VTKM_TEST_ASSERT(cellSet.GetNumberOfPointsInCell(cellIndex) == 4,
|
||||
"Incorrect number of cell indices");
|
||||
vtkm::IdComponent shape = cellSet.GetCellShape();
|
||||
VTKM_TEST_ASSERT(shape == vtkm::CELL_SHAPE_PIXEL,
|
||||
VTKM_TEST_ASSERT(shape == vtkm::CELL_SHAPE_QUAD,
|
||||
"Incorrect element type.");
|
||||
}
|
||||
|
||||
@ -118,7 +118,7 @@ TwoDimRegularTest()
|
||||
vtkm::TopologyElementTagPoint());
|
||||
|
||||
|
||||
vtkm::Id cells[2][4] = {{0,1,3,4}, {1,2,4,5}};
|
||||
vtkm::Id cells[2][4] = {{0,1,4,3}, {1,2,5,4}};
|
||||
for (vtkm::Id cellIndex = 0; cellIndex < 2; cellIndex++)
|
||||
{
|
||||
vtkm::Vec<vtkm::Id,4> pointIds = pointToCell.GetIndices(cellIndex);
|
||||
@ -213,7 +213,7 @@ ThreeDimRegularTest()
|
||||
VTKM_TEST_ASSERT(cellSet.GetNumberOfPointsInCell(cellIndex) == 8,
|
||||
"Incorrect number of cell indices");
|
||||
vtkm::IdComponent shape = cellSet.GetCellShape();
|
||||
VTKM_TEST_ASSERT(shape == vtkm::CELL_SHAPE_VOXEL,
|
||||
VTKM_TEST_ASSERT(shape == vtkm::CELL_SHAPE_HEXAHEDRON,
|
||||
"Incorrect element type.");
|
||||
}
|
||||
|
||||
@ -226,7 +226,7 @@ ThreeDimRegularTest()
|
||||
vtkm::cont::DeviceAdapterTagSerial(),
|
||||
vtkm::TopologyElementTagPoint(),
|
||||
vtkm::TopologyElementTagCell());
|
||||
vtkm::Id expectedPointIds[8] = {0,1,3,4,6,7,9,10};
|
||||
vtkm::Id expectedPointIds[8] = {0,1,4,3,6,7,10,9};
|
||||
vtkm::Vec<vtkm::Id,8> retrievedPointIds = pointToCell.GetIndices(0);
|
||||
for (vtkm::IdComponent localPointIndex = 0;
|
||||
localPointIndex < 8;
|
||||
|
@ -206,22 +206,6 @@ void JacobianFor3DCell(const WorldCoordType &wCoords,
|
||||
VTKM_DERIVATIVE_WEIGHTS_HEXAHEDRON(pc, rc, VTKM_ACCUM_JACOBIAN_3D);
|
||||
}
|
||||
|
||||
template<typename WorldCoordType,
|
||||
typename ParametricCoordType,
|
||||
typename JacobianType>
|
||||
VTKM_EXEC_EXPORT
|
||||
void JacobianFor3DCell(const WorldCoordType &wCoords,
|
||||
const vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::Matrix<JacobianType,3,3> &jacobian,
|
||||
vtkm::CellShapeTagVoxel)
|
||||
{
|
||||
vtkm::Vec<JacobianType,3> pc(pcoords);
|
||||
vtkm::Vec<JacobianType,3> rc = vtkm::Vec<JacobianType,3>(1) - pc;
|
||||
|
||||
jacobian = vtkm::Matrix<JacobianType,3,3>(0);
|
||||
VTKM_DERIVATIVE_WEIGHTS_VOXEL(pc, rc, VTKM_ACCUM_JACOBIAN_3D);
|
||||
}
|
||||
|
||||
template<typename WorldCoordType,
|
||||
typename ParametricCoordType,
|
||||
typename JacobianType>
|
||||
@ -302,24 +286,6 @@ void JacobianFor2DCell(const WorldCoordType &wCoords,
|
||||
VTKM_DERIVATIVE_WEIGHTS_QUAD(pc, rc, VTKM_ACCUM_JACOBIAN_2D);
|
||||
}
|
||||
|
||||
template<typename WorldCoordType,
|
||||
typename ParametricCoordType,
|
||||
typename JacobianType>
|
||||
VTKM_EXEC_EXPORT
|
||||
void JacobianFor2DCell(const WorldCoordType &wCoords,
|
||||
const vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
const vtkm::exec::internal::Space2D<JacobianType> &space,
|
||||
vtkm::Matrix<JacobianType,2,2> &jacobian,
|
||||
vtkm::CellShapeTagPixel)
|
||||
{
|
||||
vtkm::Vec<JacobianType,2> pc(pcoords[0], pcoords[1]);
|
||||
vtkm::Vec<JacobianType,2> rc = vtkm::Vec<JacobianType,2>(1) - pc;
|
||||
|
||||
vtkm::Vec<JacobianType,2> wcoords2d;
|
||||
jacobian = vtkm::Matrix<JacobianType,2,2>(0);
|
||||
VTKM_DERIVATIVE_WEIGHTS_PIXEL(pc, rc, VTKM_ACCUM_JACOBIAN_2D);
|
||||
}
|
||||
|
||||
#if 0
|
||||
// This code doesn't work, so I'm bailing on it. Instead, I'm just grabbing a
|
||||
// triangle and finding the derivative of that. If you can do better, please
|
||||
@ -396,26 +362,6 @@ ParametricDerivative(const FieldVecType &field,
|
||||
return parametricDerivative;
|
||||
}
|
||||
|
||||
template<typename FieldVecType,
|
||||
typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
vtkm::Vec<typename FieldVecType::ComponentType,3>
|
||||
ParametricDerivative(const FieldVecType &field,
|
||||
const vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::CellShapeTagVoxel)
|
||||
{
|
||||
typedef typename FieldVecType::ComponentType FieldType;
|
||||
typedef vtkm::Vec<FieldType,3> GradientType;
|
||||
|
||||
GradientType pc(pcoords);
|
||||
GradientType rc = GradientType(1) - pc;
|
||||
|
||||
GradientType parametricDerivative(0);
|
||||
VTKM_DERIVATIVE_WEIGHTS_VOXEL(pc, rc, VTKM_ACCUM_PARAMETRIC_DERIVATIVE_3D);
|
||||
|
||||
return parametricDerivative;
|
||||
}
|
||||
|
||||
template<typename FieldVecType,
|
||||
typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
@ -496,26 +442,6 @@ ParametricDerivative(const FieldVecType &field,
|
||||
return parametricDerivative;
|
||||
}
|
||||
|
||||
template<typename FieldVecType,
|
||||
typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
vtkm::Vec<typename FieldVecType::ComponentType,2>
|
||||
ParametricDerivative(const FieldVecType &field,
|
||||
const vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::CellShapeTagPixel)
|
||||
{
|
||||
typedef typename FieldVecType::ComponentType FieldType;
|
||||
typedef vtkm::Vec<FieldType,2> GradientType;
|
||||
|
||||
GradientType pc(pcoords[0], pcoords[1]);
|
||||
GradientType rc = GradientType(1) - pc;
|
||||
|
||||
GradientType parametricDerivative(0);
|
||||
VTKM_DERIVATIVE_WEIGHTS_PIXEL(pc, rc, VTKM_ACCUM_PARAMETRIC_DERIVATIVE_2D);
|
||||
|
||||
return parametricDerivative;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// This code doesn't work, so I'm bailing on it. Instead, I'm just grabbing a
|
||||
// triangle and finding the derivative of that. If you can do better, please
|
||||
@ -953,25 +879,6 @@ CellDerivative(const FieldVecType &field,
|
||||
worklet);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template<typename FieldVecType,
|
||||
typename WorldCoordType,
|
||||
typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
vtkm::Vec<typename FieldVecType::ComponentType,3>
|
||||
CellDerivative(const FieldVecType &field,
|
||||
const WorldCoordType &wCoords,
|
||||
const vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::CellShapeTagPixel,
|
||||
const vtkm::exec::FunctorBase &worklet)
|
||||
{
|
||||
VTKM_ASSERT_EXEC(field.GetNumberOfComponents() == 4, worklet);
|
||||
VTKM_ASSERT_EXEC(wCoords.GetNumberOfComponents() == 4, worklet);
|
||||
|
||||
return detail::CellDerivativeFor2DCell(
|
||||
field, wCoords, pcoords, vtkm::CellShapeTagPixel());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template<typename FieldVecType,
|
||||
typename WorldCoordType,
|
||||
@ -1059,25 +966,6 @@ CellDerivative(const FieldVecType &field,
|
||||
return vtkm::SolveLinearSystem(A, b, valid);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template<typename FieldVecType,
|
||||
typename WorldCoordType,
|
||||
typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
vtkm::Vec<typename FieldVecType::ComponentType,3>
|
||||
CellDerivative(const FieldVecType &field,
|
||||
const WorldCoordType &wCoords,
|
||||
const vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::CellShapeTagVoxel,
|
||||
const vtkm::exec::FunctorBase &worklet)
|
||||
{
|
||||
VTKM_ASSERT_EXEC(field.GetNumberOfComponents() == 8, worklet);
|
||||
VTKM_ASSERT_EXEC(wCoords.GetNumberOfComponents() == 8, worklet);
|
||||
|
||||
return detail::CellDerivativeFor3DCell(
|
||||
field, wCoords, pcoords, vtkm::CellShapeTagVoxel());
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template<typename FieldVecType,
|
||||
typename WorldCoordType,
|
||||
|
@ -311,26 +311,6 @@ CellInterpolate(const FieldVecType &field,
|
||||
worklet);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template<typename FieldVecType,
|
||||
typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
typename FieldVecType::ComponentType
|
||||
CellInterpolate(const FieldVecType &field,
|
||||
const vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::CellShapeTagPixel,
|
||||
const vtkm::exec::FunctorBase &worklet)
|
||||
{
|
||||
VTKM_ASSERT_EXEC(field.GetNumberOfComponents() == 4, worklet);
|
||||
|
||||
typedef typename FieldVecType::ComponentType T;
|
||||
|
||||
T bottomInterp = vtkm::Lerp(field[0], field[1], pcoords[0]);
|
||||
T topInterp = vtkm::Lerp(field[2], field[3], pcoords[0]);
|
||||
|
||||
return vtkm::Lerp(bottomInterp, topInterp, pcoords[1]);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template<typename FieldVecType,
|
||||
typename ParametricCoordType>
|
||||
@ -369,31 +349,6 @@ CellInterpolate(const FieldVecType &field,
|
||||
+ (field[3] * pcoords[2]));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template<typename FieldVecType,
|
||||
typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
typename FieldVecType::ComponentType
|
||||
CellInterpolate(const FieldVecType &field,
|
||||
const vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::CellShapeTagVoxel,
|
||||
const vtkm::exec::FunctorBase &worklet)
|
||||
{
|
||||
VTKM_ASSERT_EXEC(field.GetNumberOfComponents() == 8, worklet);
|
||||
|
||||
typedef typename FieldVecType::ComponentType T;
|
||||
|
||||
T bottomFrontInterp = vtkm::Lerp(field[0], field[1], pcoords[0]);
|
||||
T bottomBackInterp = vtkm::Lerp(field[2], field[3], pcoords[0]);
|
||||
T topFrontInterp = vtkm::Lerp(field[4], field[5], pcoords[0]);
|
||||
T topBackInterp = vtkm::Lerp(field[6], field[7], pcoords[0]);
|
||||
|
||||
T bottomInterp = vtkm::Lerp(bottomFrontInterp, bottomBackInterp, pcoords[1]);
|
||||
T topInterp = vtkm::Lerp(topFrontInterp, topBackInterp, pcoords[1]);
|
||||
|
||||
return vtkm::Lerp(bottomInterp, topInterp, pcoords[2]);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
template<typename FieldVecType,
|
||||
typename ParametricCoordType>
|
||||
|
@ -114,19 +114,6 @@ void ParametricCoordinatesCenter(vtkm::IdComponent numPoints,
|
||||
}
|
||||
}
|
||||
|
||||
template<typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
void ParametricCoordinatesCenter(vtkm::IdComponent numPoints,
|
||||
vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::CellShapeTagPixel,
|
||||
const vtkm::exec::FunctorBase &worklet)
|
||||
{
|
||||
VTKM_ASSERT_EXEC(numPoints == 4, worklet);
|
||||
pcoords[0] = 0.5;
|
||||
pcoords[1] = 0.5;
|
||||
pcoords[2] = 0;
|
||||
}
|
||||
|
||||
template<typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
void ParametricCoordinatesCenter(vtkm::IdComponent numPoints,
|
||||
@ -153,19 +140,6 @@ void ParametricCoordinatesCenter(vtkm::IdComponent numPoints,
|
||||
pcoords[2] = 0.25;
|
||||
}
|
||||
|
||||
template<typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
void ParametricCoordinatesCenter(vtkm::IdComponent numPoints,
|
||||
vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::CellShapeTagVoxel,
|
||||
const vtkm::exec::FunctorBase &worklet)
|
||||
{
|
||||
VTKM_ASSERT_EXEC(numPoints == 8, worklet);
|
||||
pcoords[0] = 0.5;
|
||||
pcoords[1] = 0.5;
|
||||
pcoords[2] = 0.5;
|
||||
}
|
||||
|
||||
template<typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
void ParametricCoordinatesCenter(vtkm::IdComponent numPoints,
|
||||
@ -357,28 +331,6 @@ void ParametricCoordinatesPoint(vtkm::IdComponent numPoints,
|
||||
pcoords[2] = 0;
|
||||
}
|
||||
|
||||
template<typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
void ParametricCoordinatesPoint(vtkm::IdComponent numPoints,
|
||||
vtkm::IdComponent pointIndex,
|
||||
vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::CellShapeTagPixel,
|
||||
const vtkm::exec::FunctorBase &worklet)
|
||||
{
|
||||
VTKM_ASSERT_EXEC(numPoints == 4, worklet);
|
||||
|
||||
switch (pointIndex)
|
||||
{
|
||||
case 0: pcoords[0] = 0; pcoords[1] = 0; break;
|
||||
case 1: pcoords[0] = 1; pcoords[1] = 0; break;
|
||||
case 2: pcoords[0] = 0; pcoords[1] = 1; break;
|
||||
case 3: pcoords[0] = 1; pcoords[1] = 1; break;
|
||||
default:
|
||||
worklet.RaiseError("Bad point index.");
|
||||
}
|
||||
pcoords[2] = 0;
|
||||
}
|
||||
|
||||
template<typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
void ParametricCoordinatesPoint(vtkm::IdComponent numPoints,
|
||||
@ -422,31 +374,6 @@ void ParametricCoordinatesPoint(vtkm::IdComponent numPoints,
|
||||
}
|
||||
}
|
||||
|
||||
template<typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
void ParametricCoordinatesPoint(vtkm::IdComponent numPoints,
|
||||
vtkm::IdComponent pointIndex,
|
||||
vtkm::Vec<ParametricCoordType,3> &pcoords,
|
||||
vtkm::CellShapeTagVoxel,
|
||||
const vtkm::exec::FunctorBase &worklet)
|
||||
{
|
||||
VTKM_ASSERT_EXEC(numPoints == 8, worklet);
|
||||
|
||||
switch (pointIndex)
|
||||
{
|
||||
case 0: pcoords[0] = 0; pcoords[1] = 0; pcoords[2] = 0; break;
|
||||
case 1: pcoords[0] = 1; pcoords[1] = 0; pcoords[2] = 0; break;
|
||||
case 2: pcoords[0] = 0; pcoords[1] = 1; pcoords[2] = 0; break;
|
||||
case 3: pcoords[0] = 1; pcoords[1] = 1; pcoords[2] = 0; break;
|
||||
case 4: pcoords[0] = 0; pcoords[1] = 0; pcoords[2] = 1; break;
|
||||
case 5: pcoords[0] = 1; pcoords[1] = 0; pcoords[2] = 1; break;
|
||||
case 6: pcoords[0] = 0; pcoords[1] = 1; pcoords[2] = 1; break;
|
||||
case 7: pcoords[0] = 1; pcoords[1] = 1; pcoords[2] = 1; break;
|
||||
default:
|
||||
worklet.RaiseError("Bad point index.");
|
||||
}
|
||||
}
|
||||
|
||||
template<typename ParametricCoordType>
|
||||
VTKM_EXEC_EXPORT
|
||||
void ParametricCoordinatesPoint(vtkm::IdComponent numPoints,
|
||||
@ -937,36 +864,6 @@ WorldCoordinatesToParametricCoordinates(
|
||||
worklet);
|
||||
}
|
||||
|
||||
template<typename WorldCoordVector>
|
||||
VTKM_EXEC_EXPORT
|
||||
typename WorldCoordVector::ComponentType
|
||||
WorldCoordinatesToParametricCoordinates(
|
||||
const WorldCoordVector &pointWCoords,
|
||||
const typename WorldCoordVector::ComponentType &wcoords,
|
||||
vtkm::CellShapeTagPixel,
|
||||
const vtkm::exec::FunctorBase &worklet)
|
||||
{
|
||||
VTKM_ASSERT_EXEC(pointWCoords.GetNumberOfComponents() == 4, worklet);
|
||||
|
||||
typedef typename WorldCoordVector::ComponentType::ComponentType T;
|
||||
typedef vtkm::Vec<T,2> Vector2;
|
||||
typedef vtkm::Vec<T,3> Vector3;
|
||||
|
||||
// We have an underdetermined system in 3D, so create a 2D space in the
|
||||
// plane that the polygon sits.
|
||||
vtkm::exec::internal::Space2D<T> space(
|
||||
pointWCoords[0], pointWCoords[1], pointWCoords[3]);
|
||||
|
||||
Vector2 pcoords =
|
||||
vtkm::exec::NewtonsMethod(
|
||||
detail::JacobianFunctorQuad<WorldCoordVector,vtkm::CellShapeTagPixel>(&pointWCoords, &space),
|
||||
detail::CoordinatesFunctorQuad<WorldCoordVector,vtkm::CellShapeTagPixel>(&pointWCoords, &space, &worklet),
|
||||
space.ConvertCoordToSpace(wcoords),
|
||||
Vector2(0.5f, 0.5f));
|
||||
|
||||
return Vector3(pcoords[0], pcoords[1], 0);
|
||||
}
|
||||
|
||||
template<typename WorldCoordVector>
|
||||
VTKM_EXEC_EXPORT
|
||||
typename WorldCoordVector::ComponentType
|
||||
@ -1053,21 +950,6 @@ WorldCoordinatesToParametricCoordinates(
|
||||
return pcoords;
|
||||
}
|
||||
|
||||
template<typename WorldCoordVector>
|
||||
VTKM_EXEC_EXPORT
|
||||
typename WorldCoordVector::ComponentType
|
||||
WorldCoordinatesToParametricCoordinates(
|
||||
const WorldCoordVector &pointWCoords,
|
||||
const typename WorldCoordVector::ComponentType &wcoords,
|
||||
vtkm::CellShapeTagVoxel,
|
||||
const vtkm::exec::FunctorBase &worklet)
|
||||
{
|
||||
VTKM_ASSERT_EXEC(pointWCoords.GetNumberOfComponents() == 8, worklet);
|
||||
|
||||
return detail::WorldCoordinatesToParametricCoordinates3D(
|
||||
pointWCoords, wcoords, vtkm::CellShapeTagVoxel(), worklet);
|
||||
}
|
||||
|
||||
|
||||
template<typename WorldCoordVector>
|
||||
VTKM_EXEC_EXPORT
|
||||
|
@ -84,7 +84,7 @@ public:
|
||||
VTKM_EXEC_CONT_EXPORT
|
||||
vtkm::IdComponent GetNumberOfPointsInCell() const {return NUM_POINTS_IN_CELL;}
|
||||
VTKM_EXEC_CONT_EXPORT
|
||||
vtkm::IdComponent GetCellShape() const {return CELL_SHAPE_LINE;}
|
||||
vtkm::IdComponent GetCellShape() const {return vtkm::CELL_SHAPE_LINE;}
|
||||
|
||||
typedef vtkm::CellShapeTagLine CellShapeTag;
|
||||
|
||||
@ -184,9 +184,9 @@ public:
|
||||
VTKM_EXEC_CONT_EXPORT
|
||||
vtkm::IdComponent GetNumberOfPointsInCell() const {return NUM_POINTS_IN_CELL;}
|
||||
VTKM_EXEC_CONT_EXPORT
|
||||
vtkm::IdComponent GetCellShape() const { return CELL_SHAPE_PIXEL; }
|
||||
vtkm::IdComponent GetCellShape() const { return vtkm::CELL_SHAPE_QUAD; }
|
||||
|
||||
typedef vtkm::CellShapeTagPixel CellShapeTag;
|
||||
typedef vtkm::CellShapeTagQuad CellShapeTag;
|
||||
|
||||
VTKM_EXEC_CONT_EXPORT
|
||||
vtkm::Vec<vtkm::Id,NUM_POINTS_IN_CELL> GetPointsOfCell(vtkm::Id index) const
|
||||
@ -197,8 +197,8 @@ public:
|
||||
vtkm::Vec<vtkm::Id,NUM_POINTS_IN_CELL> pointIds;
|
||||
pointIds[0] = j*this->PointDimensions[0] + i;
|
||||
pointIds[1] = pointIds[0] + 1;
|
||||
pointIds[2] = pointIds[0] + this->PointDimensions[0];
|
||||
pointIds[3] = pointIds[2] + 1;
|
||||
pointIds[2] = pointIds[1] + this->PointDimensions[0];
|
||||
pointIds[3] = pointIds[2] - 1;
|
||||
return pointIds;
|
||||
}
|
||||
|
||||
@ -322,9 +322,9 @@ public:
|
||||
VTKM_EXEC_CONT_EXPORT
|
||||
vtkm::IdComponent GetNumberOfPointsInCell() const {return NUM_POINTS_IN_CELL;}
|
||||
VTKM_EXEC_CONT_EXPORT
|
||||
vtkm::IdComponent GetCellShape() const { return CELL_SHAPE_VOXEL; }
|
||||
vtkm::IdComponent GetCellShape() const { return vtkm::CELL_SHAPE_HEXAHEDRON; }
|
||||
|
||||
typedef vtkm::CellShapeTagVoxel CellShapeTag;
|
||||
typedef vtkm::CellShapeTagHexahedron CellShapeTag;
|
||||
|
||||
VTKM_EXEC_CONT_EXPORT
|
||||
vtkm::Vec<vtkm::Id,NUM_POINTS_IN_CELL> GetPointsOfCell(vtkm::Id index) const
|
||||
@ -340,12 +340,12 @@ public:
|
||||
vtkm::Vec<vtkm::Id,NUM_POINTS_IN_CELL> pointIds;
|
||||
pointIds[0] = (k * this->PointDimensions[1] + j) * this->PointDimensions[0] + i;
|
||||
pointIds[1] = pointIds[0] + 1;
|
||||
pointIds[2] = pointIds[0] + this->PointDimensions[0];
|
||||
pointIds[3] = pointIds[2] + 1;
|
||||
pointIds[2] = pointIds[1] + this->PointDimensions[0];
|
||||
pointIds[3] = pointIds[2] - 1;
|
||||
pointIds[4] = pointIds[0] + this->PointDimensions[0]*this->PointDimensions[1];
|
||||
pointIds[5] = pointIds[4] + 1;
|
||||
pointIds[6] = pointIds[4] + this->PointDimensions[0];
|
||||
pointIds[7] = pointIds[6] + 1;
|
||||
pointIds[6] = pointIds[5] + this->PointDimensions[0];
|
||||
pointIds[7] = pointIds[6] - 1;
|
||||
|
||||
return pointIds;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user