Commit ae835869 authored by Steven Walton's avatar Steven Walton

Removed Arbitrary

This removes the arbitrary cell type and should produce a clean build.
parent 289ba650
......@@ -47,6 +47,7 @@ enum CellShapeIdEnum
//CELL_SHAPE_VOXEL = 11,
CELL_SHAPE_HEXAHEDRON = lcl::ShapeId::HEXAHEDRON,
CELL_SHAPE_HEXAHEDRON2 = lcl::ShapeId::HEXAHEDRON2,
CELL_SHAPE_HEXAHEDRON9 = lcl::ShapeId::HEXAHEDRON9,
CELL_SHAPE_WEDGE = lcl::ShapeId::WEDGE,
CELL_SHAPE_PYRAMID = lcl::ShapeId::PYRAMID,
......@@ -141,6 +142,7 @@ VTKM_DEFINE_CELL_TAG(Tetra, CELL_SHAPE_TETRA);
//VTKM_DEFINE_CELL_TAG(Voxel, CELL_SHAPE_VOXEL);
VTKM_DEFINE_CELL_TAG(Hexahedron, CELL_SHAPE_HEXAHEDRON);
VTKM_DEFINE_CELL_TAG(Hexahedron2, CELL_SHAPE_HEXAHEDRON2);
VTKM_DEFINE_CELL_TAG(Hexahedron9, CELL_SHAPE_HEXAHEDRON9);
VTKM_DEFINE_CELL_TAG(Wedge, CELL_SHAPE_WEDGE);
VTKM_DEFINE_CELL_TAG(Pyramid, CELL_SHAPE_PYRAMID);
......@@ -240,6 +242,7 @@ inline lcl::Cell make_VtkcCellShapeTag(const vtkm::CellShapeTagGeneric& tag,
vtkmGenericCellShapeMacroCase(CELL_SHAPE_TETRA, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_HEXAHEDRON, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_HEXAHEDRON2, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_HEXAHEDRON9, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_WEDGE, call); \
vtkmGenericCellShapeMacroCase(CELL_SHAPE_PYRAMID, call)
......
......@@ -114,6 +114,7 @@ VTKM_DEFINE_CELL_TRAITS(Tetra, 3, 4);
//VTKM_DEFINE_CELL_TRAITS(Voxel, 3, 8);
VTKM_DEFINE_CELL_TRAITS(Hexahedron, 3, 8);
VTKM_DEFINE_CELL_TRAITS(Hexahedron2, 3, 8);
VTKM_DEFINE_CELL_TRAITS(Hexahedron9, 3, 9);
VTKM_DEFINE_CELL_TRAITS(Wedge, 3, 6);
VTKM_DEFINE_CELL_TRAITS(Pyramid, 3, 5);
......
......@@ -7,8 +7,8 @@
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//============================================================================
#ifndef lcl_Arbitrary_h
#define lcl_Arbitrary_h
#ifndef lcl_Hexahedron9_h
#define lcl_Hexahedron9_h
#include <lcl/ErrorCode.h>
#include <lcl/Shapes.h>
......@@ -18,20 +18,20 @@
namespace lcl
{
class Arbitrary : public Cell
class Hexahedron9 : public Cell
{
public:
constexpr LCL_EXEC Arbitrary() : Cell(ShapeId::HEXAHEDRON, 8) {}
constexpr LCL_EXEC explicit Arbitrary(const Cell& cell) : Cell(cell) {}
constexpr LCL_EXEC Hexahedron9() : Cell(ShapeId::HEXAHEDRON, 9) {}
constexpr LCL_EXEC explicit Hexahedron9(const Cell& cell) : Cell(cell) {}
};
LCL_EXEC inline lcl::ErrorCode validate(Arbitrary tag) noexcept
LCL_EXEC inline lcl::ErrorCode validate(Hexahedron9 tag) noexcept
{
if (tag.shape() != ShapeId::ARB && tag.shape() != ShapeId::VOXEL)
if (tag.shape() != ShapeId::HEXAHEDRON && tag.shape() != ShapeId::VOXEL)
{
return ErrorCode::WRONG_SHAPE_ID_FOR_TAG_TYPE;
}
if (tag.numberOfPoints() != 8)
if (tag.numberOfPoints() != 9)
{
return ErrorCode::INVALID_NUMBER_OF_POINTS;
}
......@@ -40,7 +40,7 @@ LCL_EXEC inline lcl::ErrorCode validate(Arbitrary tag) noexcept
}
template<typename CoordType>
LCL_EXEC inline lcl::ErrorCode parametricCenter(Arbitrary, CoordType&& pcoords) noexcept
LCL_EXEC inline lcl::ErrorCode parametricCenter(Hexahedron9, CoordType&& pcoords) noexcept
{
LCL_STATIC_ASSERT_PCOORDS_IS_FLOAT_TYPE(CoordType);
......@@ -52,7 +52,7 @@ LCL_EXEC inline lcl::ErrorCode parametricCenter(Arbitrary, CoordType&& pcoords)
template<typename CoordType>
LCL_EXEC inline lcl::ErrorCode parametricPoint(
Arbitrary, IdComponent pointId, CoordType&& pcoords) noexcept
Hexahedron9, IdComponent pointId, CoordType&& pcoords) noexcept
{
LCL_STATIC_ASSERT_PCOORDS_IS_FLOAT_TYPE(CoordType);
......@@ -98,6 +98,11 @@ LCL_EXEC inline lcl::ErrorCode parametricPoint(
component(pcoords, 1) = 1.0f;
component(pcoords, 2) = 1.0f;
break;
case 8:
component(pcoords, 0) = 0.5f;
component(pcoords, 1) = 0.5f;
component(pcoords, 2) = 0.5f;
break;
default:
return ErrorCode::INVALID_POINT_ID;
}
......@@ -106,14 +111,14 @@ LCL_EXEC inline lcl::ErrorCode parametricPoint(
}
template<typename CoordType>
LCL_EXEC inline ComponentType<CoordType> parametricDistance(Arbitrary, const CoordType& pcoords) noexcept
LCL_EXEC inline ComponentType<CoordType> parametricDistance(Hexahedron9, const CoordType& pcoords) noexcept
{
LCL_STATIC_ASSERT_PCOORDS_IS_FLOAT_TYPE(CoordType);
return internal::findParametricDistance(pcoords, 3);
}
template<typename CoordType>
LCL_EXEC inline bool cellInside(Arbitrary, const CoordType& pcoords) noexcept
LCL_EXEC inline bool cellInside(Hexahedron9, const CoordType& pcoords) noexcept
{
LCL_STATIC_ASSERT_PCOORDS_IS_FLOAT_TYPE(CoordType);
......@@ -127,7 +132,7 @@ LCL_EXEC inline bool cellInside(Arbitrary, const CoordType& pcoords) noexcept
template <typename Values, typename CoordType, typename Result>
LCL_EXEC inline lcl::ErrorCode interpolate(
Arbitrary,
Hexahedron9,
const Values& values,
const CoordType& pcoords,
Result&& result) noexcept
......@@ -163,7 +168,7 @@ namespace internal
{
template <typename Values, typename CoordType, typename Result>
LCL_EXEC inline void parametricDerivative(Arbitrary,
LCL_EXEC inline void parametricDerivative(Hexahedron9,
const Values& values,
IdComponent comp,
const CoordType& pcoords,
......@@ -213,7 +218,7 @@ LCL_EXEC inline void parametricDerivative(Arbitrary,
template <typename Points, typename Values, typename CoordType, typename Result>
LCL_EXEC inline lcl::ErrorCode derivative(
Arbitrary,
Hexahedron9,
const Points& points,
const Values& values,
const CoordType& pcoords,
......@@ -221,7 +226,7 @@ LCL_EXEC inline lcl::ErrorCode derivative(
Result&& dy,
Result&& dz) noexcept
{
return internal::derivative3D(Arbitrary{},
return internal::derivative3D(Hexahedron9{},
points,
values,
pcoords,
......@@ -232,25 +237,25 @@ LCL_EXEC inline lcl::ErrorCode derivative(
template <typename Points, typename PCoordType, typename WCoordType>
LCL_EXEC inline lcl::ErrorCode parametricToWorld(
Arbitrary,
Hexahedron9,
const Points& points,
const PCoordType& pcoords,
WCoordType&& wcoords) noexcept
{
return interpolate(Arbitrary{}, points, pcoords, std::forward<WCoordType>(wcoords));
return interpolate(Hexahedron9{}, points, pcoords, std::forward<WCoordType>(wcoords));
}
template <typename Points, typename WCoordType, typename PCoordType>
LCL_EXEC inline lcl::ErrorCode worldToParametric(
Arbitrary,
Hexahedron9,
const Points& points,
const WCoordType& wcoords,
PCoordType&& pcoords) noexcept
{
return internal::worldToParametric3D(
Arbitrary{}, points, wcoords, std::forward<PCoordType>(pcoords));
Hexahedron9{}, points, wcoords, std::forward<PCoordType>(pcoords));
}
} // lcl
#endif // lcl_Arbitrary_h
#endif // lcl_Hexahedron9_h
......@@ -34,6 +34,7 @@ enum ShapeId : IdShape
VOXEL = 11,
HEXAHEDRON = 12,
HEXAHEDRON2 = 15,
HEXAHEDRON9 = 16,
WEDGE = 13,
PYRAMID = 14,
......@@ -87,6 +88,7 @@ inline LCL_EXEC int dimension(IdShape shapeId)
case VOXEL:
case HEXAHEDRON:
case HEXAHEDRON2:
case HEXAHEDRON9:
case WEDGE:
case PYRAMID:
return 3;
......@@ -116,6 +118,7 @@ class Tetra;
class Voxel;
class Hexahedron;
class Hexahedron2;
class Hexahedron9;
class Wedge;
class Pyramid;
......@@ -140,6 +143,7 @@ class Pyramid;
lclGenericCellShapeMacroCase(lcl::ShapeId::VOXEL, lcl::Voxel, call); \
lclGenericCellShapeMacroCase(lcl::ShapeId::HEXAHEDRON, lcl::Hexahedron, call); \
lclGenericCellShapeMacroCase(lcl::ShapeId::HEXAHEDRON2, lcl::Hexahedron2, call); \
lclGenericCellShapeMacroCase(lcl::ShapeId::HEXAHEDRON9, lcl::Hexahedron9, call); \
lclGenericCellShapeMacroCase(lcl::ShapeId::WEDGE, lcl::Wedge, call); \
lclGenericCellShapeMacroCase(lcl::ShapeId::PYRAMID, lcl::Pyramid, call)
......
......@@ -60,12 +60,12 @@ template <typename Values, typename CoordType, typename Result>
LCL_EXEC inline void parametricDerivative( \
lcl::tag, const Values& values, IdComponent comp, const CoordType&, Result&& result) noexcept
FORWARD_DECLAR_PARAMETRIC_DERIVATIVE(Aribitrary);
FORWARD_DECLAR_PARAMETRIC_DERIVATIVE(Triangle);
FORWARD_DECLAR_PARAMETRIC_DERIVATIVE(Quad);
FORWARD_DECLAR_PARAMETRIC_DERIVATIVE(Tetra);
FORWARD_DECLAR_PARAMETRIC_DERIVATIVE(Hexahedron);
FORWARD_DECLAR_PARAMETRIC_DERIVATIVE(Hexahedron2);
FORWARD_DECLAR_PARAMETRIC_DERIVATIVE(Hexahedron9);
FORWARD_DECLAR_PARAMETRIC_DERIVATIVE(Wedge);
FORWARD_DECLAR_PARAMETRIC_DERIVATIVE(Pyramid);
......
......@@ -10,9 +10,9 @@
#ifndef lcl_lcl_h
#define lcl_lcl_h
#include <lcl/Arbitrary.h>
#include <lcl/Hexahedron.h>
#include <lcl/Hexahedron2.h>
#include <lcl/Hexahedron9.h>
#include <lcl/Line.h>
#include <lcl/Pixel.h>
#include <lcl/Polygon.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment