57 typedef struct Line<2> base_cell_topology_type;
58 enum :
int { dimension = 1,
64 static constexpr double coords[2][3]{ {-1.0, 0.0, 0.0}, { 1.0, 0.0, 0.0} };
67 template<
typename Po
intViewType>
68 KOKKOS_INLINE_FUNCTION
71 const double threshold) {
72 const double minus_one = -1.0 - threshold, plus_one = 1.0 + threshold;
73 return (minus_one <= point(0) && point(0) <= plus_one);
82 typedef struct Line<2> base_cell_topology_type;
83 enum :
int { dimension = 1,
89 static constexpr double coords[3][3]{ {-1.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 0.0, 0.0} };
91 template<
typename Po
intViewType>
92 KOKKOS_INLINE_FUNCTION
95 const double threshold) {
96 return base_cell_topology_type::checkPointInclusion(point, threshold);
110 typedef struct Triangle<3> base_cell_topology_type;
111 enum :
int { dimension = 2,
117 static constexpr double coords[3][3]{ { 0.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0} };
119 template<
typename Po
intViewType>
120 KOKKOS_INLINE_FUNCTION
123 const double threshold) {
124 const double distance = max( max( -point(0), -point(1) ), point(0) + point(1) - 1.0 );
125 return distance < threshold;
134 typedef struct Triangle<3> base_cell_topology_type;
135 enum :
int { dimension = 2,
141 static constexpr double coords[4][3]{ { 0.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 1.0/3.0, 1.0/3.0, 0.0} };
143 template<
typename Po
intViewType>
144 KOKKOS_INLINE_FUNCTION
147 const double threshold) {
148 return base_cell_topology_type::checkPointInclusion(point, threshold);
157 typedef struct Triangle<3> base_cell_topology_type;
158 enum :
int { dimension = 2,
164 static constexpr double coords[6][3]{ { 0.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0},
165 { 0.5, 0.0, 0.0}, { 0.5, 0.5, 0.0}, { 0.0, 0.5, 0.0} };
167 template<
typename Po
intViewType>
168 KOKKOS_INLINE_FUNCTION
171 const double threshold) {
172 return base_cell_topology_type::checkPointInclusion(point, threshold);
187 enum :
int { dimension = 2,
193 static constexpr double coords[4][3]{ {-1.0,-1.0, 0.0}, { 1.0,-1.0, 0.0}, { 1.0, 1.0, 0.0}, {-1.0, 1.0, 0.0} };
195 template<
typename Po
intViewType>
196 KOKKOS_INLINE_FUNCTION
199 const double threshold) {
200 const double minus_one = -1.0 - threshold, plus_one = 1.0 + threshold;
201 return ((minus_one <= point(0) && point(0) <= plus_one) &&
202 (minus_one <= point(1) && point(1) <= plus_one));
212 enum :
int { dimension = 2,
218 static constexpr double coords[8][3]{ {-1.0,-1.0, 0.0}, { 1.0,-1.0, 0.0}, { 1.0, 1.0, 0.0}, {-1.0, 1.0, 0.0},
219 { 0.0,-1.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0} };
221 template<
typename Po
intViewType>
222 KOKKOS_INLINE_FUNCTION
225 const double threshold) {
226 return base_cell_topology_type::checkPointInclusion(point, threshold);
236 enum :
int { dimension = 2,
242 static constexpr double coords[9][3]{ {-1.0,-1.0, 0.0}, { 1.0,-1.0, 0.0}, { 1.0, 1.0, 0.0}, {-1.0, 1.0, 0.0},
243 { 0.0,-1.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0}, { 0.0, 0.0, 0.0} };
245 template<
typename Po
intViewType>
246 KOKKOS_INLINE_FUNCTION
249 const double threshold) {
250 return base_cell_topology_type::checkPointInclusion(point, threshold);
264 typedef struct Tetrahedron<4> base_cell_topology_type;
265 enum :
int { dimension = 3,
271 static constexpr double coords[4][3]{ { 0.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0} };
273 template<
typename Po
intViewType>
274 KOKKOS_INLINE_FUNCTION
277 const double threshold) {
278 const double distance = max( max(-point(0),-point(1)),
279 max(-point(2), point(0) + point(1) + point(2) - 1) );
281 return distance < threshold;
290 typedef struct Tetrahedron<4> base_cell_topology_type;
291 enum :
int { dimension = 3,
297 static constexpr double coords[8][3]{ { 0.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0},
298 { 1/3, 0.0, 1/3}, { 1/3, 1/3, 1/3}, { 1/3, 1/3, 0.0}, { 0.0, 1/3, 1/3} };
300 template<
typename Po
intViewType>
301 KOKKOS_INLINE_FUNCTION
304 const double threshold) {
305 return base_cell_topology_type::checkPointInclusion(point, threshold);
314 typedef struct Tetrahedron<4> base_cell_topology_type;
315 enum :
int { dimension = 3,
321 static constexpr double coords[10][3]{ { 0.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0},
322 { 0.5, 0.0, 0.0}, { 0.5, 0.5, 0.0}, { 0.0, 0.5, 0.0}, { 0.0, 0.0, 0.5}, { 0.5, 0.0, 0.5}, { 0.0, 0.5, 0.5} };
324 template<
typename Po
intViewType>
325 KOKKOS_INLINE_FUNCTION
328 const double threshold) {
329 return base_cell_topology_type::checkPointInclusion(point, threshold);
338 typedef struct Tetrahedron<4> base_cell_topology_type;
339 enum :
int { dimension = 3,
345 static constexpr double coords[11][3]{ { 0.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, { 0.0, 0.0, 1.0},
346 { 0.5, 0.0, 0.0}, { 0.5, 0.5, 0.0}, { 0.0, 0.5, 0.0}, { 0.0, 0.0, 0.5}, { 0.5, 0.0, 0.5}, { 0.0, 0.5, 0.5} };
348 template<
typename Po
intViewType>
349 KOKKOS_INLINE_FUNCTION
352 const double threshold) {
353 return base_cell_topology_type::checkPointInclusion(point, threshold);
367 typedef struct Hexahedron<8> base_cell_topology_type;
368 enum :
int { dimension = 3,
374 static constexpr double coords[8][3]{ {-1.0,-1.0,-1.0}, { 1.0,-1.0,-1.0}, { 1.0, 1.0,-1.0}, {-1.0, 1.0,-1.0},
375 {-1.0,-1.0, 1.0}, { 1.0,-1.0, 1.0}, { 1.0, 1.0, 1.0}, {-1.0, 1.0, 1.0} };
377 template<
typename Po
intViewType>
378 KOKKOS_INLINE_FUNCTION
381 const double threshold) {
382 const double minus_one = -1.0 - threshold, plus_one = 1.0 + threshold;
383 return ((minus_one <= point(0) && point(0) <= plus_one) &&
384 (minus_one <= point(1) && point(1) <= plus_one) &&
385 (minus_one <= point(2) && point(2) <= plus_one));
394 typedef struct Hexahedron<8> base_cell_topology_type;
395 enum :
int { dimension = 3,
401 static constexpr double coords[20][3]{ {-1.0,-1.0,-1.0}, { 1.0,-1.0,-1.0}, { 1.0, 1.0,-1.0}, {-1.0, 1.0,-1.0},
402 {-1.0,-1.0, 1.0}, { 1.0,-1.0, 1.0}, { 1.0, 1.0, 1.0}, {-1.0, 1.0, 1.0},
403 { 0.0,-1.0,-1.0}, { 1.0, 0.0,-1.0}, { 0.0, 1.0,-1.0}, {-1.0, 0.0,-1.0},
404 {-1.0,-1.0, 0.0}, { 1.0,-1.0, 0.0}, { 1.0, 1.0, 0.0}, {-1.0, 1.0, 0.0},
405 { 0.0,-1.0, 1.0}, { 1.0, 0.0, 1.0}, { 0.0, 1.0, 1.0}, {-1.0, 0.0, 1.0} };
407 template<
typename Po
intViewType>
408 KOKKOS_INLINE_FUNCTION
411 const double threshold) {
412 return base_cell_topology_type::checkPointInclusion(point, threshold);
422 typedef struct Hexahedron<8> base_cell_topology_type;
423 enum :
int { dimension = 3,
429 static constexpr double coords[27][3]{ {-1.0,-1.0,-1.0}, { 1.0,-1.0,-1.0}, { 1.0, 1.0,-1.0}, {-1.0, 1.0,-1.0},
430 {-1.0,-1.0, 1.0}, { 1.0,-1.0, 1.0}, { 1.0, 1.0, 1.0}, {-1.0, 1.0, 1.0},
431 { 0.0,-1.0,-1.0}, { 1.0, 0.0,-1.0}, { 0.0, 1.0,-1.0}, {-1.0, 0.0,-1.0},
432 {-1.0,-1.0, 0.0}, { 1.0,-1.0, 0.0}, { 1.0, 1.0, 0.0}, {-1.0, 1.0, 0.0},
433 { 0.0,-1.0, 1.0}, { 1.0, 0.0, 1.0}, { 0.0, 1.0, 1.0}, {-1.0, 0.0, 1.0},
435 { 0.0, 0.0,-1.0}, { 0.0, 0.0, 1.0}, {-1.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, {0.0,-1.0, 0.0}, {0.0, 1.0, 0.0} };
437 template<
typename Po
intViewType>
438 KOKKOS_INLINE_FUNCTION
441 const double threshold) {
442 return base_cell_topology_type::checkPointInclusion(point, threshold);
456 typedef struct Pyramid<5> base_cell_topology_type;
457 enum :
int { dimension = 3,
463 static constexpr double coords[5][3]{ {-1.0,-1.0, 0.0}, { 1.0,-1.0, 0.0}, { 1.0, 1.0, 0.0}, {-1.0, 1.0, 0.0}, { 0.0, 0.0, 1.0} };
465 template<
typename Po
intViewType>
466 KOKKOS_INLINE_FUNCTION
469 const double threshold) {
470 const double minus_one = -1.0 - threshold, plus_one = 1.0 + threshold, minus_zero = -threshold;
471 const double left = minus_one + point(2);
472 const double right = plus_one - point(2);
473 return ((left <= point(0) && point(0) <= right) &&
474 (left <= point(1) && point(1) <= right) &&
475 (minus_zero <= point(2) && point(2) <= plus_one));
484 typedef struct Pyramid<5> base_cell_topology_type;
485 enum :
int { dimension = 3,
491 static constexpr double coords[13][3]{ {-1.0,-1.0, 0.0}, { 1.0,-1.0, 0.0}, { 1.0, 1.0, 0.0}, {-1.0, 1.0, 0.0}, { 0.0, 0.0, 1.0},
492 { 0.0,-1.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0},
493 {-0.5,-0.5, 0.5}, { 0.5,-0.5, 0.5}, { 0.5, 0.5, 0.5}, {-0.5, 0.5, 0.5} };
495 template<
typename Po
intViewType>
496 KOKKOS_INLINE_FUNCTION
499 const double threshold) {
500 return base_cell_topology_type::checkPointInclusion(point, threshold);
509 typedef struct Pyramid<5> base_cell_topology_type;
510 enum :
int { dimension = 3,
516 static constexpr double coords[14][3]{ {-1.0,-1.0, 0.0}, { 1.0,-1.0, 0.0}, { 1.0, 1.0, 0.0}, {-1.0, 1.0, 0.0}, { 0.0, 0.0, 1.0},
517 { 0.0,-1.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0}, {-1.0, 0.0, 0.0},
518 {-0.5,-0.5, 0.5}, { 0.5,-0.5, 0.5}, { 0.5, 0.5, 0.5}, {-0.5, 0.5, 0.5}, { 0.0, 0.0, 0.0} };
520 template<
typename Po
intViewType>
521 KOKKOS_INLINE_FUNCTION
524 const double threshold) {
525 return base_cell_topology_type::checkPointInclusion(point, threshold);
539 typedef struct Wedge<6> base_cell_topology_type;
540 enum :
int { dimension = 3,
546 static constexpr double coords[6][3]{ { 0.0, 0.0,-1.0}, { 1.0, 0.0,-1.0}, { 0.0, 1.0,-1.0}, { 0.0, 0.0, 1.0}, { 1.0, 0.0, 1.0}, { 0.0, 1.0, 1.0} };
548 template<
typename Po
intViewType>
549 KOKKOS_INLINE_FUNCTION
552 const double threshold) {
553 const double minus_one = -1.0 - threshold, plus_one = 1.0 + threshold;
554 const double distance = max( max( -point(0), -point(1) ), point(0) + point(1) - 1 );
555 return (distance < threshold && (minus_one <= point(2) && point(2) <= plus_one));
564 typedef struct Wedge<6> base_cell_topology_type;
565 enum :
int { dimension = 3,
571 static constexpr double coords[15][3]{ { 0.0, 0.0,-1.0}, { 1.0, 0.0,-1.0}, { 0.0, 1.0,-1.0}, { 0.0, 0.0, 1.0}, { 1.0, 0.0, 1.0}, { 0.0, 1.0, 1.0},
572 { 0.5, 0.0,-1.0}, { 0.5, 0.5,-1.0}, { 0.0, 0.5,-1.0}, { 0.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0},
573 { 0.5, 0.0, 1.0}, { 0.5, 0.5, 1.0}, { 0.0, 0.5, 1.0} };
575 template<
typename Po
intViewType>
576 KOKKOS_INLINE_FUNCTION
579 const double threshold) {
580 return base_cell_topology_type::checkPointInclusion(point, threshold);
589 typedef struct Wedge<6> base_cell_topology_type;
590 enum :
int { dimension = 3,
596 static constexpr double coords[18][3]{ { 0.0, 0.0,-1.0}, { 1.0, 0.0,-1.0}, { 0.0, 1.0,-1.0}, { 0.0, 0.0, 1.0}, { 1.0, 0.0, 1.0}, { 0.0, 1.0, 1.0},
597 { 0.5, 0.0,-1.0}, { 0.5, 0.5,-1.0}, { 0.0, 0.5,-1.0}, { 0.0, 0.0, 0.0}, { 1.0, 0.0, 0.0}, { 0.0, 1.0, 0.0},
598 { 0.5, 0.0, 1.0}, { 0.5, 0.5, 1.0}, { 0.0, 0.5, 1.0},
599 { 0.5, 0.0, 0.0}, { 0.5, 0.5, 0.0}, { 0.0, 0.5, 0.0} };
602 template<
typename Po
intViewType>
603 KOKKOS_INLINE_FUNCTION
606 const double threshold) {
607 return base_cell_topology_type::checkPointInclusion(point, threshold);