20 #ifndef vtk_m_worklet_cellmetrics_CellDiagonalRatioMetric_h
21 #define vtk_m_worklet_cellmetrics_CellDiagonalRatioMetric_h
42 #define UNUSED(expr) (void)(expr);
53 template <
typename OutType,
typename VecType>
56 const vtkm::Id numDiagonals = diagonals.GetNumberOfComponents();
62 FloatType currLen, minLen = d0Len, maxLen = d0Len;
63 for (
int i = 1; i < numDiagonals; i++)
72 if (minLen <= OutType(0.0))
73 return vtkm::Infinity<OutType>();
76 OutType diagonalRatio = (OutType)
vtkm::Sqrt(minLen / maxLen);
81 template <
typename OutType,
typename Po
intCoordVecType,
typename CellShapeType>
83 const PointCoordVecType& pts,
98 template <
typename OutType,
typename Po
intCoordVecType>
100 const PointCoordVecType& pts,
101 vtkm::CellShapeTagQuad,
113 using Diagonal =
typename PointCoordVecType::ComponentType;
114 const Diagonal QuadDiagonals[2] = { pts[2] - pts[0], pts[3] - pts[1] };
116 return vtkm::worklet::cellmetrics::ComputeDiagonalRatio<OutType>(
117 vtkm::make_VecC(QuadDiagonals, numDiagonals));
127 template <
typename OutType,
typename Po
intCoordVecType>
129 const PointCoordVecType& pts,
130 vtkm::CellShapeTagHexahedron,
142 using Diagonal =
typename PointCoordVecType::ComponentType;
143 const Diagonal HexDiagonals[4] = {
144 pts[6] - pts[0], pts[7] - pts[1], pts[4] - pts[2], pts[5] - pts[3]
147 return vtkm::worklet::cellmetrics::ComputeDiagonalRatio<OutType>(
148 vtkm::make_VecC(HexDiagonals, numDiagonals));
153 #endif // vtk_m_worklet_cellmetrics_CellDiagonalRatioMetric_h