20 #ifndef vtk_m_worklet_cellmetrics_CellShearMetric_h
21 #define vtk_m_worklet_cellmetrics_CellShearMetric_h
45 #define UNUSED(expr) (void)(expr);
58 template <
typename OutType,
typename Po
intCoordVecType,
typename CellShapeType>
60 const PointCoordVecType& pts,
72 template <
typename OutType,
typename Po
intCoordVecType>
74 const PointCoordVecType& pts,
75 vtkm::CellShapeTagQuad,
83 using Scalar = OutType;
84 using CollectionOfPoints = PointCoordVecType;
85 using Vector =
typename PointCoordVecType::ComponentType;
87 const Scalar alpha0 = GetQuadAlpha0<Scalar, Vector, CollectionOfPoints>(pts);
88 const Scalar alpha1 = GetQuadAlpha1<Scalar, Vector, CollectionOfPoints>(pts);
89 const Scalar alpha2 = GetQuadAlpha2<Scalar, Vector, CollectionOfPoints>(pts);
90 const Scalar alpha3 = GetQuadAlpha3<Scalar, Vector, CollectionOfPoints>(pts);
92 const Scalar L0 = GetQuadL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
93 const Scalar L1 = GetQuadL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
94 const Scalar L2 = GetQuadL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
95 const Scalar L3 = GetQuadL3Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
97 const Scalar x0 = alpha0 / (L0 * L3);
98 const Scalar x1 = alpha1 / (L1 * L0);
99 const Scalar x2 = alpha2 / (L2 * L1);
100 const Scalar x3 = alpha3 / (L3 * L2);
102 const Scalar q = vtkm::Min(x0, vtkm::Min(x1, vtkm::Min(x2, x3)));
109 template <
typename OutType,
typename Po
intCoordVecType>
111 const PointCoordVecType& pts,
112 vtkm::CellShapeTagHexahedron,
118 return OutType(-1.0);
120 using Scalar = OutType;
121 using CollectionOfPoints = PointCoordVecType;
122 using Vector =
typename PointCoordVecType::ComponentType;
124 const Scalar a0 = GetHexAlphaiHat<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(0));
125 const Scalar a1 = GetHexAlphaiHat<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(1));
126 const Scalar a2 = GetHexAlphaiHat<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(2));
127 const Scalar a3 = GetHexAlphaiHat<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(3));
128 const Scalar a4 = GetHexAlphaiHat<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(4));
129 const Scalar a5 = GetHexAlphaiHat<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(5));
130 const Scalar a6 = GetHexAlphaiHat<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(6));
131 const Scalar a7 = GetHexAlphaiHat<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(7));
133 const Scalar q = vtkm::Min(
135 vtkm::Min(a1, vtkm::Min(a2, vtkm::Min(a3, vtkm::Min(a4, vtkm::Min(a5, vtkm::Min(a6, a7)))))));
145 #endif // vtk_m_worklet_cellmetrics_CellShearMetric_h