20 #ifndef vtk_m_worklet_cellmetrics_TypeOfCellHexahedral
21 #define vtk_m_worklet_cellmetrics_TypeOfCellHexahedral
44 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
47 const Vector L0(pts[1] - pts[0]);
57 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
60 const Vector L1(pts[2] - pts[1]);
70 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
73 const Vector L2(pts[3] - pts[2]);
83 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
86 const Vector L3(pts[3] - pts[0]);
96 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
99 const Vector L4(pts[4] - pts[0]);
109 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
112 const Vector L5(pts[5] - pts[1]);
122 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
125 const Vector L6(pts[6] - pts[2]);
135 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
138 const Vector L7(pts[7] - pts[3]);
148 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
151 const Vector L8(pts[5] - pts[4]);
161 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
164 const Vector L9(pts[6] - pts[5]);
174 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
177 const Vector L10(pts[7] - pts[6]);
186 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
189 const Vector L11(pts[7] - pts[4]);
198 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
201 const Scalar l0 =
static_cast<Scalar
>(
211 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
214 const Scalar l1 =
static_cast<Scalar
>(
224 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
227 const Scalar l2 =
static_cast<Scalar
>(
237 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
240 const Scalar l3 =
static_cast<Scalar
>(
250 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
253 const Scalar l4 =
static_cast<Scalar
>(
263 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
266 const Scalar l5 =
static_cast<Scalar
>(
276 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
279 const Scalar l6 =
static_cast<Scalar
>(
289 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
292 const Scalar l7 =
static_cast<Scalar
>(
302 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
305 const Scalar l8 =
static_cast<Scalar
>(
315 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
318 const Scalar l9 =
static_cast<Scalar
>(
328 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
331 const Scalar l10 =
static_cast<Scalar
>(
341 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
344 const Scalar l11 =
static_cast<Scalar
>(
354 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
357 const Scalar l0 = GetHexL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
358 const Scalar l1 = GetHexL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
359 const Scalar l2 = GetHexL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
360 const Scalar l3 = GetHexL3Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
361 const Scalar l4 = GetHexL4Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
362 const Scalar l5 = GetHexL5Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
363 const Scalar l6 = GetHexL6Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
364 const Scalar l7 = GetHexL7Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
365 const Scalar l8 = GetHexL8Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
366 const Scalar l9 = GetHexL9Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
367 const Scalar l10 = GetHexL10Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
368 const Scalar l11 = GetHexL11Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
370 const Scalar lmax = vtkm::Max(
382 vtkm::Max(l6, vtkm::Max(l7, vtkm::Max(l8, vtkm::Max(l9, vtkm::Max(l10, l11)))))))))));
393 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
396 const Scalar l0 = GetHexL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
397 const Scalar l1 = GetHexL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
398 const Scalar l2 = GetHexL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
399 const Scalar l3 = GetHexL3Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
400 const Scalar l4 = GetHexL4Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
401 const Scalar l5 = GetHexL5Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
402 const Scalar l6 = GetHexL6Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
403 const Scalar l7 = GetHexL7Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
404 const Scalar l8 = GetHexL8Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
405 const Scalar l9 = GetHexL9Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
406 const Scalar l10 = GetHexL10Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
407 const Scalar l11 = GetHexL11Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
409 const Scalar lmin = vtkm::Min(
421 vtkm::Min(l6, vtkm::Min(l7, vtkm::Min(l8, vtkm::Min(l9, vtkm::Min(l10, l11)))))))))));
432 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
435 const Vector D0((pts[6] - pts[0]));
445 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
448 const Vector D1(pts[7] - pts[1]);
458 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
461 const Vector D2(pts[4] - pts[2]);
471 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
474 const Vector D3(pts[5] - pts[3]);
484 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
487 const Scalar d0 =
static_cast<Scalar
>(
498 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
501 const Scalar d1 =
static_cast<Scalar
>(
512 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
515 const Scalar d2 =
static_cast<Scalar
>(
526 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
529 const Scalar d3 =
static_cast<Scalar
>(
540 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
543 const Scalar d0 = GetHexD0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
544 const Scalar d1 = GetHexD1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
545 const Scalar d2 = GetHexD2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
546 const Scalar d3 = GetHexD3Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
548 const Scalar dmin = vtkm::Min(d0, vtkm::Min(d1, vtkm::Min(d2, d3)));
559 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
562 const Scalar d0 = GetHexD0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
563 const Scalar d1 = GetHexD1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
564 const Scalar d2 = GetHexD2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
565 const Scalar d3 = GetHexD3Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
567 const Scalar dmax = vtkm::Max(d0, vtkm::Max(d1, vtkm::Max(d2, d3)));
578 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
581 const Vector X1((pts[1] - pts[0]) + (pts[2] - pts[3]) + (pts[5] - pts[4]) + (pts[6] - pts[7]));
591 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
594 const Vector X2((pts[3] - pts[0]) + (pts[2] - pts[1]) + (pts[7] - pts[4]) + (pts[6] - pts[5]));
604 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
607 const Vector X3((pts[4] - pts[0]) + (pts[5] - pts[1]) + (pts[6] - pts[2]) + (pts[7] - pts[3]));
618 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
621 const Scalar neg1(-1.0);
624 const Vector v0 = GetHexL0<Scalar, Vector, CollectionOfPoints>(pts);
625 const Vector v1 = GetHexL3<Scalar, Vector, CollectionOfPoints>(pts);
626 const Vector v2 = GetHexL4<Scalar, Vector, CollectionOfPoints>(pts);
632 const Vector v0 = GetHexL1<Scalar, Vector, CollectionOfPoints>(pts);
633 const Vector v1 = neg1 * GetHexL0<Scalar, Vector, CollectionOfPoints>(pts);
634 const Vector v2 = GetHexL5<Scalar, Vector, CollectionOfPoints>(pts);
640 const Vector v0 = GetHexL2<Scalar, Vector, CollectionOfPoints>(pts);
641 const Vector v1 = neg1 * GetHexL1<Scalar, Vector, CollectionOfPoints>(pts);
642 const Vector v2 = GetHexL6<Scalar, Vector, CollectionOfPoints>(pts);
648 const Vector v0 = neg1 * GetHexL3<Scalar, Vector, CollectionOfPoints>(pts);
649 const Vector v1 = neg1 * GetHexL2<Scalar, Vector, CollectionOfPoints>(pts);
650 const Vector v2 = GetHexL7<Scalar, Vector, CollectionOfPoints>(pts);
656 const Vector v0 = GetHexL11<Scalar, Vector, CollectionOfPoints>(pts);
657 const Vector v1 = GetHexL8<Scalar, Vector, CollectionOfPoints>(pts);
658 const Vector v2 = neg1 * GetHexL4<Scalar, Vector, CollectionOfPoints>(pts);
664 const Vector v0 = neg1 * GetHexL8<Scalar, Vector, CollectionOfPoints>(pts);
665 const Vector v1 = GetHexL9<Scalar, Vector, CollectionOfPoints>(pts);
666 const Vector v2 = neg1 * GetHexL5<Scalar, Vector, CollectionOfPoints>(pts);
672 const Vector v0 = neg1 * GetHexL9<Scalar, Vector, CollectionOfPoints>(pts);
673 const Vector v1 = GetHexL10<Scalar, Vector, CollectionOfPoints>(pts);
674 const Vector v2 = neg1 * GetHexL6<Scalar, Vector, CollectionOfPoints>(pts);
680 const Vector v0 = neg1 * GetHexL10<Scalar, Vector, CollectionOfPoints>(pts);
681 const Vector v1 = neg1 * GetHexL11<Scalar, Vector, CollectionOfPoints>(pts);
682 const Vector v2 = neg1 * GetHexL7<Scalar, Vector, CollectionOfPoints>(pts);
688 const Vector v0 = GetHexX1<Scalar, Vector, CollectionOfPoints>(pts);
689 const Vector v1 = GetHexX2<Scalar, Vector, CollectionOfPoints>(pts);
690 const Vector v2 = GetHexX3<Scalar, Vector, CollectionOfPoints>(pts);
703 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
711 const Scalar AiNormSquared = magSquared0 + magSquared1 + magSquared2;
713 return AiNormSquared;
723 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
731 const Scalar AiAdjNormSquared = magSquared0 + magSquared1 + magSquared2;
733 return AiAdjNormSquared;
743 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
747 const Scalar alpha_i =
static_cast<Scalar
>(vtkm::Dot(Ai[0],
vtkm::Cross(Ai[1], Ai[2])));
759 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
777 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
781 const Scalar hatAlpha_i =
static_cast<Scalar
>(vtkm::Dot(Ai[0],
vtkm::Cross(Ai[1], Ai[2])));