20 #ifndef vtk_m_worklet_cellmetrics_TypeOfCellTetrahedral
21 #define vtk_m_worklet_cellmetrics_TypeOfCellTetrahedral
32 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
35 const Vector L0(pts[1] - pts[0]);
45 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
48 const Vector L1(pts[2] - pts[1]);
58 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
61 const Vector L2(pts[0] - pts[2]);
71 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
74 const Vector L3(pts[3] - pts[0]);
84 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
87 const Vector L4(pts[3] - pts[1]);
97 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
100 const Vector L5(pts[3] - pts[2]);
110 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
113 const Scalar l0 =
static_cast<Scalar
>(
124 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
127 const Scalar l1 =
static_cast<Scalar
>(
138 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
141 const Scalar l2 =
static_cast<Scalar
>(
152 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
155 const Scalar l3 =
static_cast<Scalar
>(
166 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
169 const Scalar l4 =
static_cast<Scalar
>(
180 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
183 const Scalar l5 =
static_cast<Scalar
>(
194 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
197 const Scalar l0 = GetTetraL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
198 const Scalar l1 = GetTetraL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
199 const Scalar l2 = GetTetraL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
200 const Scalar l3 = GetTetraL3Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
201 const Scalar l4 = GetTetraL4Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
202 const Scalar l5 = GetTetraL5Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
203 const Scalar lmax = vtkm::Max(l0, vtkm::Max(l1, vtkm::Max(l2, vtkm::Max(l3, vtkm::Max(l4, l5)))));
213 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
216 const Scalar l0 = GetTetraL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
217 const Scalar l1 = GetTetraL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
218 const Scalar l2 = GetTetraL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
219 const Scalar l3 = GetTetraL3Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
220 const Scalar l4 = GetTetraL4Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
221 const Scalar l5 = GetTetraL5Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
222 const Scalar lmin = vtkm::Min(l0, vtkm::Min(l1, vtkm::Min(l2, vtkm::Min(l3, vtkm::Min(l4, l5)))));
232 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
235 const Vector L0 = GetTetraL0<Scalar, Vector, CollectionOfPoints>(pts);
236 const Vector L1 = GetTetraL1<Scalar, Vector, CollectionOfPoints>(pts);
237 const Vector L2 = GetTetraL2<Scalar, Vector, CollectionOfPoints>(pts);
238 const Vector L3 = GetTetraL3<Scalar, Vector, CollectionOfPoints>(pts);
239 const Vector L4 = GetTetraL4<Scalar, Vector, CollectionOfPoints>(pts);
245 const Scalar hhalf(0.5);
247 const Scalar area = hhalf * (a + b + c + d);
257 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
260 const Vector L0 = GetTetraL0<Scalar, Vector, CollectionOfPoints>(pts);
261 const Vector L2 = GetTetraL2<Scalar, Vector, CollectionOfPoints>(pts);
262 const Vector L3 = GetTetraL3<Scalar, Vector, CollectionOfPoints>(pts);
263 const Scalar six(6.0);
265 return static_cast<Scalar
>(vtkm::Dot(
vtkm::Cross(L2, L0), L3)) / six;
274 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
277 const Scalar three(3.0);
278 const Scalar volume = GetTetraVolume<Scalar, Vector, CollectionOfPoints>(pts);
279 const Scalar area = GetTetraArea<Scalar, Vector, CollectionOfPoints>(pts);
281 return (three * volume) / area;
291 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
294 const Vector L0 = GetTetraL0<Scalar, Vector, CollectionOfPoints>(pts);
295 const Vector L1 = GetTetraL1<Scalar, Vector, CollectionOfPoints>(pts);
296 const Vector L2 = GetTetraL2<Scalar, Vector, CollectionOfPoints>(pts);
297 const Vector L3 = GetTetraL3<Scalar, Vector, CollectionOfPoints>(pts);
298 const Vector L4 = GetTetraL4<Scalar, Vector, CollectionOfPoints>(pts);
308 const Vector D(A + B + C);
311 const Scalar twelve(12.0);
312 const Scalar volume = GetTetraVolume<Scalar, Vector, CollectionOfPoints>(pts);
314 const Scalar circumradius = d / (twelve * volume);