20 #ifndef vtk_m_worklet_CellWarpageMetric_h
21 #define vtk_m_worklet_CellWarpageMetric_h
37 template <
typename OutType,
typename Po
intCoordVecType,
typename CellShapeType>
47 template <
typename OutType,
typename Po
intCoordVecType>
49 const PointCoordVecType& pts,
50 vtkm::CellShapeTagQuad,
53 using Scalar = OutType;
54 using CollectionOfPoints = PointCoordVecType;
55 using Vector =
typename PointCoordVecType::ComponentType;
57 const Vector N0Mag = GetQuadN0Normalized<Scalar, Vector, CollectionOfPoints>(pts);
58 const Vector N1Mag = GetQuadN1Normalized<Scalar, Vector, CollectionOfPoints>(pts);
59 const Vector N2Mag = GetQuadN2Normalized<Scalar, Vector, CollectionOfPoints>(pts);
60 const Vector N3Mag = GetQuadN3Normalized<Scalar, Vector, CollectionOfPoints>(pts);
62 if (N0Mag < Scalar(0.0) || N1Mag < Scalar(0.0) || N2Mag < Scalar(0.0) || N3Mag < Scalar(0.0))
63 return vtkm::Infinity<Scalar>();
64 const Scalar n0dotn2 =
static_cast<Scalar
>(vtkm::Dot(N0Mag, N2Mag));
65 const Scalar n1dotn3 =
static_cast<Scalar
>(vtkm::Dot(N1Mag, N3Mag));
66 const Scalar min = vtkm::Min(n0dotn2, n1dotn3);
68 const Scalar minCubed = vtkm::Pow(min, 3);
75 #endif // vtk_m_worklet_CellWarpageMetric_h