21 #ifndef vtk_m_worklet_cellmetrics_Jacobian_h
22 #define vtk_m_worklet_cellmetrics_Jacobian_h
45 #define UNUSED(expr) (void)(expr);
57 template <
typename OutType,
typename Po
intCoordVecType,
typename CellShapeType>
59 const PointCoordVecType& pts,
77 template <
typename OutType,
typename Po
intCoordVecType>
79 const PointCoordVecType& pts,
80 vtkm::CellShapeTagQuad,
89 using Scalar = OutType;
90 using CollectionOfPoints = PointCoordVecType;
91 using Vector =
typename PointCoordVecType::ComponentType;
93 const Scalar alpha0 = GetQuadAlpha0<Scalar, Vector, CollectionOfPoints>(pts);
94 const Scalar alpha1 = GetQuadAlpha1<Scalar, Vector, CollectionOfPoints>(pts);
95 const Scalar alpha2 = GetQuadAlpha2<Scalar, Vector, CollectionOfPoints>(pts);
96 const Scalar alpha3 = GetQuadAlpha3<Scalar, Vector, CollectionOfPoints>(pts);
98 const Scalar q = vtkm::Min(alpha0, vtkm::Min(alpha1, vtkm::Min(alpha2, alpha3)));
112 template <
typename OutType,
typename Po
intCoordVecType>
114 const PointCoordVecType& pts,
115 vtkm::CellShapeTagHexahedron,
124 using Scalar = OutType;
125 using CollectionOfPoints = PointCoordVecType;
126 using Vector =
typename PointCoordVecType::ComponentType;
128 const Scalar alpha0 = GetHexAlphai<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(0));
129 const Scalar alpha1 = GetHexAlphai<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(1));
130 const Scalar alpha2 = GetHexAlphai<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(2));
131 const Scalar alpha3 = GetHexAlphai<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(3));
132 const Scalar alpha4 = GetHexAlphai<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(4));
133 const Scalar alpha5 = GetHexAlphai<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(5));
134 const Scalar alpha6 = GetHexAlphai<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(6));
135 const Scalar alpha7 = GetHexAlphai<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(7));
136 const Scalar alpha8 = GetHexAlphai<Scalar, Vector, CollectionOfPoints>(pts,
vtkm::Id(8));
137 const Scalar alpha8Div64 = alpha8 / Scalar(64.0);
139 const Scalar q = vtkm::Min(
148 vtkm::Min(alpha5, vtkm::Min(alpha6, vtkm::Min(alpha7, alpha8Div64))))))));
159 template <
typename OutType,
typename Po
intCoordVecType>
161 const PointCoordVecType& pts,
162 vtkm::CellShapeTagTetra,
171 using Scalar = OutType;
172 using CollectionOfPoints = PointCoordVecType;
173 using Vector =
typename PointCoordVecType::ComponentType;
175 const Vector L0 = GetTetraL0<Scalar, Vector, CollectionOfPoints>(pts);
176 const Vector L2 = GetTetraL2<Scalar, Vector, CollectionOfPoints>(pts);
177 const Vector L3 = GetTetraL3<Scalar, Vector, CollectionOfPoints>(pts);
179 const Scalar q =
static_cast<Scalar
>((vtkm::Dot(
vtkm::Cross(L2, L0), L3)));
187 #endif // vtk_m_worklet_cellmetrics_Jacobian_h