Go to the documentation of this file.
20 #ifndef vtk_m_worklet_cellmetrics_TypeOfCellQuadrilateral
21 #define vtk_m_worklet_cellmetrics_TypeOfCellQuadrilateral
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[0] - pts[3]);
96 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
99 const Scalar l0 =
static_cast<Scalar
>(
110 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
113 const Scalar l1 =
static_cast<Scalar
>(
124 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
127 const Scalar l2 =
static_cast<Scalar
>(
138 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
141 const Scalar l3 =
static_cast<Scalar
>(
152 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
155 const Scalar l0 = GetQuadL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
156 const Scalar l1 = GetQuadL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
157 const Scalar l2 = GetQuadL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
158 const Scalar l3 = GetQuadL3Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
159 const Scalar lmax = vtkm::Max(l0, vtkm::Max(l1, vtkm::Max(l2, l3)));
169 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
172 const Scalar l0 = GetQuadL0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
173 const Scalar l1 = GetQuadL1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
174 const Scalar l2 = GetQuadL2Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
175 const Scalar l3 = GetQuadL3Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
176 const Scalar lmin = vtkm::Min(l0, vtkm::Min(l1, vtkm::Min(l2, l3)));
186 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
189 const Vector D0(pts[2] - pts[0]);
199 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
202 const Vector D1(pts[3] - pts[1]);
212 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
215 const Scalar d0 =
static_cast<Scalar
>(
226 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
229 const Scalar d1 =
static_cast<Scalar
>(
240 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
243 const Scalar d0 = GetQuadD0Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
244 const Scalar d1 = GetQuadD1Magnitude<Scalar, Vector, CollectionOfPoints>(pts);
246 const Scalar dmax = vtkm::Max(d0, d1);
256 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
259 const Vector X0((pts[1] - pts[0]) + (pts[2] - pts[3]));
269 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
272 const Vector X1((pts[2] - pts[1]) + (pts[3] - pts[0]));
282 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
285 const Vector A = GetQuadL3<Scalar, Vector, CollectionOfPoints>(pts);
286 const Vector B = GetQuadL0<Scalar, Vector, CollectionOfPoints>(pts);
297 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
300 const Vector A = GetQuadL0<Scalar, Vector, CollectionOfPoints>(pts);
301 const Vector B = GetQuadL1<Scalar, Vector, CollectionOfPoints>(pts);
312 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
315 const Vector A = GetQuadL1<Scalar, Vector, CollectionOfPoints>(pts);
316 const Vector B = GetQuadL2<Scalar, Vector, CollectionOfPoints>(pts);
327 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
330 const Vector A = GetQuadL2<Scalar, Vector, CollectionOfPoints>(pts);
331 const Vector B = GetQuadL3<Scalar, Vector, CollectionOfPoints>(pts);
342 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
345 const Vector A = GetQuadX0<Scalar, Vector, CollectionOfPoints>(pts);
346 const Vector B = GetQuadX1<Scalar, Vector, CollectionOfPoints>(pts);
357 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
360 return vtkm::Normal(GetQuadN0<Scalar, Vector, CollectionOfPoints>(pts));
369 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
372 return vtkm::Normal(GetQuadN1<Scalar, Vector, CollectionOfPoints>(pts));
381 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
384 return vtkm::Normal(GetQuadN2<Scalar, Vector, CollectionOfPoints>(pts));
393 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
396 return vtkm::Normal(GetQuadN3<Scalar, Vector, CollectionOfPoints>(pts));
405 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
408 return vtkm::Normal(GetQuadNc<Scalar, Vector, CollectionOfPoints>(pts));
417 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
420 const Vector normalizedCenterNormal =
421 GetQuadNcNormalized<Scalar, Vector, CollectionOfPoints>(pts);
422 const Vector N0 = GetQuadN0<Scalar, Vector, CollectionOfPoints>(pts);
423 return static_cast<Scalar
>(vtkm::Dot(normalizedCenterNormal, N0));
432 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
435 const Vector normalizedCenterNormal =
436 GetQuadNcNormalized<Scalar, Vector, CollectionOfPoints>(pts);
437 const Vector N1 = GetQuadN1<Scalar, Vector, CollectionOfPoints>(pts);
438 return static_cast<Scalar
>(vtkm::Dot(normalizedCenterNormal, N1));
447 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
450 const Vector normalizedCenterNormal =
451 GetQuadNcNormalized<Scalar, Vector, CollectionOfPoints>(pts);
452 const Vector N2 = GetQuadN2<Scalar, Vector, CollectionOfPoints>(pts);
453 return static_cast<Scalar
>(vtkm::Dot(normalizedCenterNormal, N2));
463 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
466 const Vector normalizedCenterNormal =
467 GetQuadNcNormalized<Scalar, Vector, CollectionOfPoints>(pts);
468 const Vector N3 = GetQuadN3<Scalar, Vector, CollectionOfPoints>(pts);
469 return static_cast<Scalar
>(vtkm::Dot(normalizedCenterNormal, N3));
479 template <
typename Scalar,
typename Vector,
typename CollectionOfPo
ints>
482 const Scalar quarter(0.25);
483 const Scalar a0 = GetQuadAlpha0<Scalar, Vector, CollectionOfPoints>(pts);
484 const Scalar a1 = GetQuadAlpha1<Scalar, Vector, CollectionOfPoints>(pts);
485 const Scalar a2 = GetQuadAlpha2<Scalar, Vector, CollectionOfPoints>(pts);
486 const Scalar a3 = GetQuadAlpha3<Scalar, Vector, CollectionOfPoints>(pts);
487 return quarter * (a0 + a1 + a2 + a3);
VTKM_EXEC Scalar GetQuadAlpha3(const CollectionOfPoints &pts)
Returns the alpha3 scalar, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:464
VTKM_EXEC Vector GetQuadL1(const CollectionOfPoints &pts)
Returns the L1 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:58
VTKM_EXEC Vector GetQuadN3(const CollectionOfPoints &pts)
Returns the N3 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:328
VTKM_EXEC Vector GetQuadL3(const CollectionOfPoints &pts)
Returns the L3 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:84
VTKM_EXEC_CONT vtkm::Float32 Sqrt(vtkm::Float32 x)
Compute the square root of x.
Definition: Math.h:958
VTKM_EXEC Vector GetQuadNc(const CollectionOfPoints &pts)
Returns the normal center vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:343
VTKM_EXEC Vector GetQuadN0Normalized(const CollectionOfPoints &pts)
Returns the normalized N0 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:358
VTKM_EXEC_CONT detail::FloatingPointReturnType< T >::Type MagnitudeSquared(const T &x)
Returns the square of the magnitude of a vector.
Definition: VectorAnalysis.h:64
VTKM_EXEC Scalar GetQuadLMin(const CollectionOfPoints &pts)
Returns the Min of the magnitude of each vector which makes up the sides of the Quad.
Definition: TypeOfCellQuadrilateral.h:170
#define VTKM_EXEC
Definition: ExportMacros.h:51
VTKM_EXEC Vector GetQuadNcNormalized(const CollectionOfPoints &pts)
Returns the normalized Nc vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:406
VTKM_EXEC Vector GetQuadN1Normalized(const CollectionOfPoints &pts)
Returns the normalized N1 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:370
VTKM_EXEC Scalar GetQuadD0Magnitude(const CollectionOfPoints &pts)
Returns the D0 vector's magnitude, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:213
VTKM_EXEC Vector GetQuadX1(const CollectionOfPoints &pts)
Returns the X1 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:270
VTKM_EXEC Vector GetQuadD1(const CollectionOfPoints &pts)
Returns the D1 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:200
VTKM_EXEC Scalar GetQuadL1Magnitude(const CollectionOfPoints &pts)
Returns the L1 vector's magnitude, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:111
VTKM_EXEC Scalar GetQuadL0Magnitude(const CollectionOfPoints &pts)
Returns the L0 vector's magnitude, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:97
VTKM_EXEC Scalar GetQuadArea(const CollectionOfPoints &pts)
Returns the area of the quad, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:480
VTKM_EXEC Scalar GetQuadL2Magnitude(const CollectionOfPoints &pts)
Returns the L2 vector's magnitude, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:125
VTKM_EXEC_CONT T Normal(const T &x)
Returns a normalized version of the given vector.
Definition: VectorAnalysis.h:157
VTKM_EXEC Vector GetQuadX0(const CollectionOfPoints &pts)
Returns the X0 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:257
VTKM_EXEC Scalar GetQuadAlpha1(const CollectionOfPoints &pts)
Returns the alpha1 scalar, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:433
VTKM_EXEC Scalar GetQuadLMax(const CollectionOfPoints &pts)
Returns the Max of the magnitude of each vector which makes up the sides of the Quad.
Definition: TypeOfCellQuadrilateral.h:153
VTKM_EXEC_CONT vtkm::Vec< typename detail::FloatingPointReturnType< T >::Type, 3 > Cross(const vtkm::Vec< T, 3 > &x, const vtkm::Vec< T, 3 > &y)
Find the cross product of two vectors.
Definition: VectorAnalysis.h:177
VTKM_EXEC Vector GetQuadN2(const CollectionOfPoints &pts)
Returns the N2 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:313
VTKM_EXEC Vector GetQuadN3Normalized(const CollectionOfPoints &pts)
Returns the normalized N3 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:394
VTKM_EXEC Vector GetQuadL0(const CollectionOfPoints &pts)
The Verdict manual defines a set of commonly used components of a quadrilateral (quad).
Definition: TypeOfCellQuadrilateral.h:45
VTKM_EXEC Vector GetQuadN0(const CollectionOfPoints &pts)
Returns the N0 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:283
VTKM_EXEC Scalar GetQuadAlpha2(const CollectionOfPoints &pts)
Returns the alpha2 scalar, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:448
VTKM_EXEC Vector GetQuadN1(const CollectionOfPoints &pts)
Returns the N1 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:298
VTKM_EXEC Vector GetQuadN2Normalized(const CollectionOfPoints &pts)
Returns the normalized N2 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:382
VTKM_EXEC Scalar GetQuadL3Magnitude(const CollectionOfPoints &pts)
Returns the L3 vector's magnitude, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:139
VTKM_EXEC Vector GetQuadD0(const CollectionOfPoints &pts)
Returns the D0 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:187
VTKM_EXEC Scalar GetQuadAlpha0(const CollectionOfPoints &pts)
Returns the alpha0 scalar, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:418
VTKM_EXEC Scalar GetQuadD1Magnitude(const CollectionOfPoints &pts)
Returns the D0 vector's magnitude, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:227
VTKM_EXEC Vector GetQuadL2(const CollectionOfPoints &pts)
Returns the L2 vector, as defined by the verdict manual.
Definition: TypeOfCellQuadrilateral.h:71
VTKM_EXEC Scalar GetQuadDMax(const CollectionOfPoints &pts)
Returns the Max of the magnitude of each vector which makes up the diagonals of the Quad.
Definition: TypeOfCellQuadrilateral.h:241