20 #ifndef vtk_m_worklet_cellmetrics_CellAspectGammaMetric_h
21 #define vtk_m_worklet_cellmetrics_CellAspectGammaMetric_h
41 #define UNUSED(expr) (void)(expr);
52 template <
typename OutType,
typename Po
intCoordVecType,
typename CellShapeType>
54 const PointCoordVecType& pts,
66 template <
typename OutType,
typename Po
intCoordVecType>
68 const PointCoordVecType& pts,
69 vtkm::CellShapeTagTetra,
78 using Scalar = OutType;
79 using CollectionOfPoints = PointCoordVecType;
80 using Vector =
typename PointCoordVecType::ComponentType;
82 const Scalar volume = GetTetraVolume<Scalar, Vector, CollectionOfPoints>(pts);
83 const Scalar vAbs = vtkm::Abs(volume);
85 if (vAbs <= Scalar(0.0))
87 return vtkm::Infinity<Scalar>();
89 const Scalar six = Scalar(6.0);
90 const Scalar l0 = GetTetraL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
91 const Scalar l1 = GetTetraL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
92 const Scalar l2 = GetTetraL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
93 const Scalar l3 = GetTetraL3Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
94 const Scalar l4 = GetTetraL4Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
95 const Scalar l5 = GetTetraL5Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
97 const Scalar R =
vtkm::Sqrt((vtkm::Pow(l0, 2) + vtkm::Pow(l1, 2) + vtkm::Pow(l2, 2) +
98 vtkm::Pow(l3, 2) + vtkm::Pow(l4, 2) + vtkm::Pow(l5, 2)) /
101 const Scalar rootTwo(
vtkm::Sqrt(Scalar(2.0)));
102 const Scalar twelve(12.0);
103 const Scalar q = (vtkm::Pow(R, 3) * rootTwo) / (twelve * vAbs);
111 #endif // vtk_m_worklet_cellmetrics_CellAspectGammaMetric_h