5 #ifndef ERF_EB_CUT_CELL_H_
6 #define ERF_EB_CUT_CELL_H_
8 #include <AMReX_REAL.H>
9 #include <AMReX_Array.H>
10 #include <AMReX_RealBox.H>
11 #include <AMReX_RealVect.H>
12 #include <AMReX_Algorithm.H>
13 #include <AMReX_EBCellFlag.H>
14 #include <AMReX_GpuPrint.H>
29 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
32 amrex::RealVect
const& a_plane_normal,
33 amrex::RealVect
const& a_edge_point0,
34 amrex::RealVect
const& a_edge_point1,
35 amrex::RealVect& a_intersection_point,
38 amrex::RealVect
const edge(a_edge_point1 - a_edge_point0);
39 amrex::Real const edge_length = edge.vectorLength();
43 amrex::RealVect edge_normal = edge / edge_length;
45 amrex::Real np_dot_ne = a_plane_normal.dotProduct(edge_normal);
51 a_intersection_dist = a_plane_normal.dotProduct(a_plane_point)
52 - a_plane_normal.dotProduct(a_edge_point0);
53 a_intersection_dist /= np_dot_ne;
55 a_intersection_point = a_edge_point0 + a_intersection_dist*edge_normal;
57 if (
zero <= a_intersection_dist && a_intersection_dist <= edge_length) {
return 1;}
82 amrex::RealBox
const& a_rbox,
83 amrex::RealVect
const& a_point,
84 amrex::RealVect
const& a_normal );
87 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
91 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
95 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
99 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
105 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
124 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
133 amrex::RealVect v0(
lo[0],
lo[1],
lo[2]);
149 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
151 AMREX_ASSERT( idir >=0 && idir < AMREX_SPACEDIM );
162 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
164 AMREX_ASSERT( idir >= 0 && idir < AMREX_SPACEDIM );
172 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
181 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
182 amrex::RealVect
centLo (
int const idir )
const noexcept {
183 AMREX_ASSERT( idir >=0 && idir < AMREX_SPACEDIM );
189 if (amrex::almostEqual(area_R,
zero) || amrex::almostEqual(area_R,
m_rbox_area[idir]) ){
192 amrex::RealVect cent_O = cent;
193 amrex::RealVect cent_R =
m_lo_faces[idir]->get_centroid();
205 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
206 amrex::RealVect
centHi (
int const idir )
const noexcept {
207 AMREX_ASSERT( idir >=0 && idir < AMREX_SPACEDIM );
213 if (amrex::almostEqual(area_R,
zero) || amrex::almostEqual(area_R,
m_rbox_area[idir]) ){
216 amrex::RealVect cent_O = cent;
217 amrex::RealVect cent_R =
m_hi_faces[idir]->get_centroid();
226 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
229 if (
m_flag.isSingleValued()) {
236 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
239 if (
m_flag.isSingleValued()) {
246 [[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
249 if (
m_flag.isSingleValued()) {
269 vcent[0] =
myhalf * ( - xm * xm * axm + xp * xp * axp + bcent[0] * bcent[0] *
m_eb_normal[0] * barea ) / vol;
270 vcent[1] =
myhalf * ( - ym * ym * aym + yp * yp * ayp + bcent[1] * bcent[1] *
m_eb_normal[1] * barea ) / vol;
271 vcent[2] =
myhalf * ( - zm * zm * azm + zp * zp * azp + bcent[2] * bcent[2] *
m_eb_normal[2] * barea ) / vol;
280 void debug (
int const a_face = -1 );
321 AMREX_GPU_HOST_DEVICE
325 AMREX_GPU_HOST_DEVICE
329 AMREX_GPU_HOST_DEVICE
333 amrex::RealBox
const& a_rbox,
334 amrex::RealVect
const& a_point,
335 amrex::RealVect
const& a_normal )
337 , m_eb_point(a_point)
338 , m_eb_normal(a_normal)
340 , m_F1(a_point, a_normal)
341 , m_F2(a_point, a_normal)
342 , m_F3(a_point, a_normal)
343 , m_F4(a_point, a_normal)
344 , m_F5(a_point, a_normal)
345 , m_F6(a_point, a_normal)
346 , m_cellface_cent({amrex::RealVect(
zero), amrex::RealVect(
zero), amrex::RealVect(
zero),
347 amrex::RealVect(
zero), amrex::RealVect(
zero), amrex::RealVect(
zero)})
349 using namespace amrex;
351 m_rbox_area[0] = m_rbox.length(1)*m_rbox.length(2);
352 m_rbox_area[1] = m_rbox.length(0)*m_rbox.length(2);
353 m_rbox_area[2] = m_rbox.length(0)*m_rbox.length(1);
355 amrex::RealVect v0(m_rbox.lo(0), m_rbox.lo(1), m_rbox.lo(2));
356 amrex::RealVect v1(m_rbox.hi(0), m_rbox.lo(1), m_rbox.lo(2));
357 amrex::RealVect v2(m_rbox.lo(0), m_rbox.hi(1), m_rbox.lo(2));
358 amrex::RealVect v3(m_rbox.lo(0), m_rbox.lo(1), m_rbox.hi(2));
359 amrex::RealVect v4(m_rbox.hi(0), m_rbox.lo(1), m_rbox.hi(2));
360 amrex::RealVect v5(m_rbox.hi(0), m_rbox.hi(1), m_rbox.lo(2));
361 amrex::RealVect v6(m_rbox.lo(0), m_rbox.hi(1), m_rbox.hi(2));
362 amrex::RealVect v7(m_rbox.hi(0), m_rbox.hi(1), m_rbox.hi(2));
366 m_cellface_cent[0] =
fourth * ( v0 + v2 + v5 + v1 );
367 m_cellface_cent[1] =
fourth * ( v1 + v5 + v7 + v4 );
368 m_cellface_cent[2] =
fourth * ( v3 + v4 + v7 + v6 );
369 m_cellface_cent[3] =
fourth * ( v0 + v3 + v6 + v2 );
370 m_cellface_cent[4] =
fourth * ( v0 + v1 + v4 + v3 );
371 m_cellface_cent[5] =
fourth * ( v2 + v5 + v7 + v6 );
375 m_cell_cent[0] =
myhalf * ( m_rbox.lo(0) + m_rbox.hi(0) );
376 m_cell_cent[1] =
myhalf * ( m_rbox.lo(1) + m_rbox.hi(1) );
377 m_cell_cent[2] =
myhalf * ( m_rbox.lo(2) + m_rbox.hi(2) );
381 m_dx[0] = m_rbox.hi(0) - m_rbox.lo(0);
382 m_dx[1] = m_rbox.hi(1) - m_rbox.lo(1);
383 m_dx[2] = m_rbox.hi(2) - m_rbox.lo(2);
385 if (a_flag.isCovered() ) {
389 }
else if (a_flag.isRegular() ) {
395 amrex::RealVect c =
myhalf*(v0 + v7);
396 amrex::RealVect e = v7 - c;
398 amrex::Real r = e[0]*amrex::Math::abs(a_normal[0]) +
399 e[1]*amrex::Math::abs(a_normal[1]) +
400 e[2]*amrex::Math::abs(a_normal[2]);
402 amrex::Real s = amrex::Math::abs(c.dotProduct(a_normal)
403 - a_point.dotProduct(a_normal));
406 if ((a_normal.dotProduct(v0) - a_normal.dotProduct(a_point)) >
zero)
407 { set_covered(); }
else { set_regular(); }
408 }
else { m_flag.setSingleValued(); }
411 if ( m_flag.isSingleValued() ) {
413 m_invert = ((m_eb_normal.dotProduct(v0) - m_eb_normal.dotProduct(m_eb_point)) >
zero) ?
zero :
one;
415 calc_edge_intersections();
428 if ( !m_flag.isSingleValued() ) {
429 set_covered_regular_cell_vertices();
440 AMREX_GPU_HOST_DEVICE
464 AMREX_GPU_HOST_DEVICE
466 void set(
const amrex::RealVect& eb_point,
467 const amrex::RealVect& eb_normal,
468 const amrex::RealVect& v_start,
469 const amrex::RealVect& v_end)
475 amrex::RealVect v_intersect{v_start};
476 amrex::Real dist_intersect = std::numeric_limits<amrex::Real>::quiet_NaN();
478 eb_point, eb_normal, v_start, v_end, v_intersect, dist_intersect
495 AMREX_GPU_HOST_DEVICE
501 using namespace amrex;
517 const bool print_F1 = print_initial &&
false;
518 const bool print_F2 = print_initial &&
false;
519 const bool print_F3 = print_initial &&
false;
520 const bool print_F4 = print_initial &&
false;
521 const bool print_F5 = print_initial &&
false;
522 const bool print_F6 = print_initial &&
false;
523 const bool print_F7 = print_initial &&
false;
526 m_F1.
add_vertex(v0);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Initial: add v0 -> F1");
527 m_F4.
add_vertex(v0);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Initial: add v0 -> F4");
528 m_F5.
add_vertex(v0);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Initial: add v0 -> F5");
535 amrex::Array<bool,8> vertex_intersected{};
543 amrex::Array<path_data,3> p1, p2, p3;
577 for (
int i = 0; i < 8; ++i) vertex_intersected[i] =
false;
579 if (p1[0].intersected) {
580 if (p1[0].intersected_start) {
581 m_F1.
add_vertex(v0);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add v0 -> F1");
582 m_F4.
add_vertex(v0);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add v0 -> F4");
583 m_F5.
add_vertex(v0);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add v0 -> F5");
584 m_F7.
add_vertex(v0);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add v0 -> F7");
585 if (!vertex_intersected[0]) {
586 vertex_intersected[0] =
true;
589 }
else if (p1[0].intersected_end) {
590 m_F1.
add_vertex(v1);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add v1 -> F1");
591 m_F2.
add_vertex(v1);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add v1 -> F2");
592 m_F5.
add_vertex(v1);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add v1 -> F5");
593 m_F7.
add_vertex(v1);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add v1 -> F7");
594 if (!vertex_intersected[1]) {
595 vertex_intersected[1] =
true;
599 m_F1.
add_vertex(p1[0].vIP);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add vIP -> F1");
600 m_F5.
add_vertex(p1[0].vIP);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add vIP -> F5");
601 m_F7.
add_vertex(p1[0].vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v0--v1: add vIP -> F7");
608 m_F1.
add_vertex(v1);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: after v0--v1, cuts-mod-2==0: add v1 -> F1");
609 m_F2.
add_vertex(v1);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: after v0--v1, cuts-mod-2==0: add v1 -> F2");
610 m_F5.
add_vertex(v1);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: after v0--v1, cuts-mod-2==0: add v1 -> F5");
613 if (p1[1].intersected) {
614 if (p1[1].intersected_start) {
615 m_F1.
add_vertex(v1);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add v1 -> F1");
616 m_F2.
add_vertex(v1);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add v1 -> F2");
617 m_F5.
add_vertex(v1);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add v1 -> F5");
618 m_F7.
add_vertex(v1);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add v1 -> F7");
619 if (!vertex_intersected[1]) {
620 vertex_intersected[1] =
true;
623 }
else if (p1[1].intersected_end) {
624 m_F2.
add_vertex(v4);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add v4 -> F2");
625 m_F3.
add_vertex(v4);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add v4 -> F3");
626 m_F5.
add_vertex(v4);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add v4 -> F5");
627 m_F7.
add_vertex(v4);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add v4 -> F7");
628 if (!vertex_intersected[4]) {
629 vertex_intersected[4] =
true;
633 m_F2.
add_vertex(p1[1].vIP);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add vIP -> F2");
634 m_F5.
add_vertex(p1[1].vIP);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add vIP -> F5");
635 m_F7.
add_vertex(p1[1].vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v1--v4: add vIP -> F7");
642 m_F2.
add_vertex(v4);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: after v1--v4, cuts-mod-2==0: add v4 -> F2");
643 m_F3.
add_vertex(v4);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: after v1--v4, cuts-mod-2==0: add v4 -> F3");
644 m_F5.
add_vertex(v4);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: after v1--v4, cuts-mod-2==0: add v4 -> F5");
647 if (p1[2].intersected) {
648 if (p1[2].intersected_start) {
649 m_F2.
add_vertex(v4);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add v4 -> F2");
650 m_F3.
add_vertex(v4);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add v4 -> F3");
651 m_F5.
add_vertex(v4);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add v4 -> F5");
652 m_F7.
add_vertex(v4);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add v4 -> F7");
653 if (!vertex_intersected[4]) {
654 vertex_intersected[4] =
true;
657 }
else if (p1[2].intersected_end) {
658 m_F2.
add_vertex(v7);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add v7 -> F2");
659 m_F3.
add_vertex(v7);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add v7 -> F3");
660 m_F6.
add_vertex(v7);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add v7 -> F6");
661 m_F7.
add_vertex(v7);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add v7 -> F7");
662 if (!vertex_intersected[7]) {
663 vertex_intersected[7] =
true;
667 m_F2.
add_vertex(p1[2].vIP);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add vIP -> F2");
668 m_F3.
add_vertex(p1[2].vIP);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add vIP -> F3");
669 m_F7.
add_vertex(p1[2].vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: v4--v7: add vIP -> F7");
675 if (cuts == 2 && add_v7) {
677 m_F2.
add_vertex(v7);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: after v4--v7, cuts == 2 && add_v7: add v7 -> F2");
678 m_F3.
add_vertex(v7);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: after v4--v7, cuts == 2 && add_v7: add v7 -> F3");
679 m_F6.
add_vertex(v7);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 1: after v4--v7, cuts == 2 && add_v7: add v7 -> F6");
688 m_F1.
add_vertex(v1);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add v1 -> F1");
689 m_F2.
add_vertex(v1);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add v1 -> F2");
690 m_F5.
add_vertex(v1);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add v1 -> F5");
691 m_F7.
add_vertex(v1);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add v1 -> F7");
693 m_F1.
add_vertex(v5);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add v5 -> F1");
694 m_F2.
add_vertex(v5);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add v5 -> F2");
695 m_F6.
add_vertex(v5);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add v5 -> F6");
696 m_F7.
add_vertex(v5);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add v5 -> F7");
698 m_F1.
add_vertex(p4.
vIP);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add vIP -> F1");
699 m_F2.
add_vertex(p4.
vIP);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add vIP -> F2");
700 m_F7.
add_vertex(p4.
vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 4: v1--v5: add vIP -> F7");
706 for (
int i = 0; i < 8; ++i) vertex_intersected[i] =
false;
708 if (p2[0].intersected) {
709 if (p2[0].intersected_start) {
710 m_F1.
add_vertex(v0);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add v0 -> F1");
711 m_F4.
add_vertex(v0);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add v0 -> F4");
712 m_F5.
add_vertex(v0);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add v0 -> F5");
713 m_F7.
add_vertex(v0);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add v0 -> F7");
714 if (!vertex_intersected[0]) {
715 vertex_intersected[0] =
true;
718 }
else if (p2[0].intersected_end) {
719 m_F1.
add_vertex(v2);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add v2 -> F1");
720 m_F4.
add_vertex(v2);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add v2 -> F4");
721 m_F6.
add_vertex(v2);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add v2 -> F6");
722 m_F7.
add_vertex(v2);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add v2 -> F7");
723 if (!vertex_intersected[2]) {
724 vertex_intersected[2] =
true;
728 m_F1.
add_vertex(p2[0].vIP);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add vIP -> F1");
729 m_F4.
add_vertex(p2[0].vIP);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add vIP -> F4");
730 m_F7.
add_vertex(p2[0].vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v0--v2: add vIP -> F7");
737 m_F1.
add_vertex(v2);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: after v0--v2, cuts-mod-2==0: add v2 -> F1");
738 m_F4.
add_vertex(v2);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: after v0--v2, cuts-mod-2==0: add v2 -> F4");
739 m_F6.
add_vertex(v2);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: after v0--v2, cuts-mod-2==0: add v2 -> F6");
742 if (p2[1].intersected) {
743 if (p2[1].intersected_start) {
744 m_F1.
add_vertex(v2);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add v2 -> F1");
745 m_F4.
add_vertex(v2);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add v2 -> F4");
746 m_F6.
add_vertex(v2);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add v2 -> F6");
747 m_F7.
add_vertex(v2);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add v2 -> F7");
748 if (!vertex_intersected[2]) {
749 vertex_intersected[2] =
true;
752 }
else if (p2[1].intersected_end) {
753 m_F1.
add_vertex(v5);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add v5 -> F1");
754 m_F2.
add_vertex(v5);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add v5 -> F2");
755 m_F6.
add_vertex(v5);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add v5 -> F6");
756 m_F7.
add_vertex(v5);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add v5 -> F7");
757 if (!vertex_intersected[5]) {
758 vertex_intersected[5] =
true;
762 m_F1.
add_vertex(p2[1].vIP);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add vIP -> F1");
763 m_F6.
add_vertex(p2[1].vIP);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add vIP -> F6");
764 m_F7.
add_vertex(p2[1].vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v2--v5: add vIP -> F7");
770 m_F1.
add_vertex(v5);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: after v2--v5, cuts-mod-2==0: add v5 -> F1");
771 m_F2.
add_vertex(v5);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: after v2--v5, cuts-mod-2==0: add v5 -> F2");
772 m_F6.
add_vertex(v5);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: after v2--v5, cuts-mod-2==0: add v5 -> F6");
775 if (p2[2].intersected) {
776 if (p2[2].intersected_start) {
777 m_F1.
add_vertex(v5);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add v5 -> F1");
778 m_F2.
add_vertex(v5);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add v5 -> F2");
779 m_F6.
add_vertex(v5);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add v5 -> F6");
780 m_F7.
add_vertex(v5);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add v5 -> F7");
781 if (!vertex_intersected[5]) {
782 vertex_intersected[5] =
true;
785 }
else if (p2[2].intersected_end) {
786 m_F2.
add_vertex(v7);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add v7 -> F2");
787 m_F3.
add_vertex(v7);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add v7 -> F3");
788 m_F6.
add_vertex(v7);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add v7 -> F6");
789 m_F7.
add_vertex(v7);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add v7 -> F7");
790 if (!vertex_intersected[7]) {
791 vertex_intersected[7] =
true;
795 m_F2.
add_vertex(p2[2].vIP);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add vIP -> F2");
796 m_F6.
add_vertex(p2[2].vIP);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add vIP -> F6");
797 m_F7.
add_vertex(p2[2].vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: v5--v7: add vIP -> F7");
802 if (cuts == 2 && add_v7) {
804 m_F2.
add_vertex(v7);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: after v5--v7, cuts == 2 && add_v7: add v7 -> F2");
805 m_F3.
add_vertex(v7);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: after v5--v7, cuts == 2 && add_v7: add v7 -> F3");
806 m_F6.
add_vertex(v7);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 2: after v5--v7, cuts == 2 && add_v7: add v7 -> F6");
816 m_F1.
add_vertex(v2);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add v2 -> F1");
817 m_F4.
add_vertex(v2);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add v2 -> F4");
818 m_F6.
add_vertex(v2);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add v2 -> F6");
819 m_F7.
add_vertex(v2);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add v2 -> F7");
821 m_F3.
add_vertex(v6);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add v6 -> F3");
822 m_F4.
add_vertex(v6);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add v6 -> F4");
823 m_F6.
add_vertex(v6);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add v6 -> F6");
824 m_F7.
add_vertex(v6);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add v6 -> F7");
826 m_F4.
add_vertex(p5.
vIP);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add vIP -> F4");
827 m_F6.
add_vertex(p5.
vIP);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add vIP -> F6");
828 m_F7.
add_vertex(p5.
vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 5: v2--v6: add vIP -> F7");
835 for (
int i = 0; i < 8; ++i) vertex_intersected[i] =
false;
837 if (p3[0].intersected) {
838 if (p3[0].intersected_start) {
839 m_F1.
add_vertex(v0);
if(print_F1) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add v0 -> F1");
840 m_F4.
add_vertex(v0);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add v0 -> F4");
841 m_F5.
add_vertex(v0);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add v0 -> F5");
842 m_F7.
add_vertex(v0);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add v0 -> F7");
843 if (!vertex_intersected[0]) {
844 vertex_intersected[0] =
true;
847 }
else if (p3[0].intersected_end) {
848 m_F3.
add_vertex(v3);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add v3 -> F3");
849 m_F4.
add_vertex(v3);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add v3 -> F4");
850 m_F5.
add_vertex(v3);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add v3 -> F5");
851 m_F7.
add_vertex(v3);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add v3 -> F7");
852 if (!vertex_intersected[3]) {
853 vertex_intersected[3] =
true;
857 m_F4.
add_vertex(p3[0].vIP);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add vIP -> F4");
858 m_F5.
add_vertex(p3[0].vIP);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add vIP -> F5");
859 m_F7.
add_vertex(p3[0].vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v0--v3: add vIP -> F7");
866 m_F3.
add_vertex(v3);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: after v0--v3, cuts-mod-2 == 0: add v3 -> F3");
867 m_F4.
add_vertex(v3);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: after v0--v3, cuts-mod-2 == 0: add v3 -> F4");
868 m_F5.
add_vertex(v3);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: after v0--v3, cuts-mod-2 == 0: add v3 -> F5");
871 if (p3[1].intersected) {
872 if (p3[1].intersected_start) {
873 m_F3.
add_vertex(v3);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add v3 -> F3");
874 m_F4.
add_vertex(v3);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add v3 -> F4");
875 m_F5.
add_vertex(v3);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add v3 -> F5");
876 m_F7.
add_vertex(v3);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add v3 -> F7");
877 if (!vertex_intersected[3]) {
878 vertex_intersected[3] =
true;
881 }
else if (p3[1].intersected_end) {
882 m_F3.
add_vertex(v6);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add v6 -> F3");
883 m_F4.
add_vertex(v6);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add v6 -> F4");
884 m_F6.
add_vertex(v6);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add v6 -> F6");
885 m_F7.
add_vertex(v6);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add v6 -> F7");
886 if (!vertex_intersected[6]) {
887 vertex_intersected[6] =
true;
891 m_F3.
add_vertex(p3[1].vIP);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add vIP -> F3");
892 m_F4.
add_vertex(p3[1].vIP);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add vIP -> F4");
893 m_F7.
add_vertex(p3[1].vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v3--v6: add vIP -> F7");
900 m_F3.
add_vertex(v6);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: after v3--v6, cuts-mod-2 == 0: add v6 -> F3");
901 m_F4.
add_vertex(v6);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: after v3--v6, cuts-mod-2 == 0: add v6 -> F4");
902 m_F6.
add_vertex(v6);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: after v3--v6, cuts-mod-2 == 0: add v6 -> F6");
905 if (p3[2].intersected) {
906 if (p3[2].intersected_start) {
907 m_F3.
add_vertex(v6);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add v6 -> F3");
908 m_F4.
add_vertex(v6);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add v6 -> F4");
909 m_F6.
add_vertex(v6);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add v6 -> F6");
910 m_F7.
add_vertex(v6);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add v6 -> F7");
911 if (!vertex_intersected[6]) {
912 vertex_intersected[6] =
true;
915 }
else if (p3[2].intersected_end) {
916 m_F2.
add_vertex(v7);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add v7 -> F2");
917 m_F3.
add_vertex(v7);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add v7 -> F3");
918 m_F6.
add_vertex(v7);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add v7 -> F6");
919 m_F7.
add_vertex(v7);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add v7 -> F7");
920 if (!vertex_intersected[7]) {
921 vertex_intersected[7] =
true;
925 m_F3.
add_vertex(p3[2].vIP);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add vIP -> F3");
926 m_F6.
add_vertex(p3[2].vIP);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add vIP -> F6");
927 m_F7.
add_vertex(p3[2].vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: v6--v7: add vIP -> F7");
932 if (cuts == 2 && add_v7) {
934 m_F2.
add_vertex(v7);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: after v6--v7, cuts == 2 && add_v7: add v7 -> F2");
935 m_F3.
add_vertex(v7);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: after v6--v7, cuts == 2 && add_v7: add v7 -> F3");
936 m_F6.
add_vertex(v7);
if(print_F6) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 3: after v6--v7, cuts == 2 && add_v7: add v7 -> F6");
946 m_F3.
add_vertex(v3);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add v3 -> F3");
947 m_F4.
add_vertex(v3);
if(print_F4) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add v3 -> F4");
948 m_F5.
add_vertex(v3);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add v3 -> F5");
949 m_F7.
add_vertex(v3);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add v3 -> F7");
951 m_F2.
add_vertex(v4);
if(print_F2) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add v4 -> F2");
952 m_F3.
add_vertex(v4);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add v4 -> F3\n");
953 m_F5.
add_vertex(v4);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add v4 -> F5");
954 m_F7.
add_vertex(v4);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add v4 -> F7");
956 m_F3.
add_vertex(p6.
vIP);
if(print_F3) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add vIP -> F3");
957 m_F5.
add_vertex(p6.
vIP);
if(print_F5) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add vIP -> F5");
958 m_F7.
add_vertex(p6.
vIP);
if(print_F7) AMREX_DEVICE_PRINTF(
"%s \n",
"Path 6: v3--v4: add vIP -> F7");
962 if (print_F1 || print_F2 || print_F3 || print_F4 || print_F5 || print_F6 || print_F7) {
963 AMREX_DEVICE_PRINTF(
"%s \n",
" ");
968 AMREX_GPU_HOST_DEVICE
974 using namespace amrex;
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int intersect_plane_edge(amrex::RealVect const &a_plane_point, amrex::RealVect const &a_plane_normal, amrex::RealVect const &a_edge_point0, amrex::RealVect const &a_edge_point1, amrex::RealVect &a_intersection_point, amrex::Real &a_intersection_dist)
Intersect a plane with a line segment.
Definition: ERF_EBCutCell.H:31
Defines polygon geometry utilities for EB cut-cell reconstruction.
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
Dimensionless numeric literals and pure mathematical constants.
constexpr amrex::Real three
Definition: ERF_NumericalConstants.H:32
constexpr amrex::Real real_eps
Definition: ERF_NumericalConstants.H:27
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:30
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:35
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:29
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:34
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Reconstructs geometric moments for one EB cut cell.
Definition: ERF_EBCutCell.H:69
AMREX_GPU_HOST_DEVICE void calc_edge_intersections()
Compute all edge-plane intersections and populate polygon vertices.
Definition: ERF_EBCutCell.H:499
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real volume() const
Return the physical volume of the reconstructed cell.
Definition: ERF_EBCutCell.H:125
polygon_ m_F6
Definition: ERF_EBCutCell.H:301
amrex::Array< polygon_ const *const, 3 > m_lo_faces
Definition: ERF_EBCutCell.H:311
amrex::RealVect m_rbox_area
Definition: ERF_EBCutCell.H:290
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isRegular() const noexcept
Return true if the reconstructed cell is regular.
Definition: ERF_EBCutCell.H:92
amrex::RealVect m_cell_cent
Definition: ERF_EBCutCell.H:305
amrex::RealVect m_dx
Definition: ERF_EBCutCell.H:306
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real areaLo(int const idir) const noexcept
Return the low-side face area in one coordinate direction.
Definition: ERF_EBCutCell.H:150
amrex::RealVect const m_eb_point
Definition: ERF_EBCutCell.H:285
amrex::Real m_invert
Definition: ERF_EBCutCell.H:288
amrex::RealBox const m_rbox
Definition: ERF_EBCutCell.H:284
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real areaHi(int const idir) const noexcept
Return the high-side face area in one coordinate direction.
Definition: ERF_EBCutCell.H:163
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect centBoun() const noexcept
Return the EB boundary centroid.
Definition: ERF_EBCutCell.H:227
AMREX_GPU_HOST_DEVICE void set_covered_regular_cell_vertices()
Populate polygon vertices for cells that are fully covered or regular.
Definition: ERF_EBCutCell.H:972
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void set_regular()
Mark the reconstructed cell as regular and fill regular face areas.
Definition: ERF_EBCutCell.H:106
polygon_ m_F1
Definition: ERF_EBCutCell.H:296
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real areaBoun() const noexcept
Return the EB boundary area inside the cell.
Definition: ERF_EBCutCell.H:173
polygon_ m_F3
Definition: ERF_EBCutCell.H:298
amrex::EBCellFlag m_flag
Definition: ERF_EBCutCell.H:292
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect centHi(int const idir) const noexcept
Return the high-side face centroid in one coordinate direction.
Definition: ERF_EBCutCell.H:206
polygon_ m_F5
Definition: ERF_EBCutCell.H:300
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect centVol() const noexcept
Return the volume centroid of the reconstructed cell.
Definition: ERF_EBCutCell.H:247
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void set_covered()
Mark the reconstructed cell as covered.
Definition: ERF_EBCutCell.H:100
polygon_ m_F7
Definition: ERF_EBCutCell.H:309
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect normBoun() const noexcept
Return the EB boundary normal.
Definition: ERF_EBCutCell.H:237
amrex::Array< int const, 3 > m_hi_faces_id
Definition: ERF_EBCutCell.H:315
AMREX_GPU_HOST_DEVICE eb_cut_cell_(amrex::EBCellFlag const &a_flag, amrex::RealBox const &a_rbox, amrex::RealVect const &a_point, amrex::RealVect const &a_normal)
Construct cut-cell geometry from a cell flag, box, EB point, and EB normal.
Definition: ERF_EBCutCell.H:332
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isSingleValued() const noexcept
Return true if the reconstructed cell is single-valued.
Definition: ERF_EBCutCell.H:96
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isCovered() const noexcept
Return true if the reconstructed cell is covered.
Definition: ERF_EBCutCell.H:88
void debug(int const a_face=-1)
Print cut-cell diagnostics on CPU builds.
Definition: ERF_EBCutCell.cpp:13
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect centLo(int const idir) const noexcept
Return the low-side face centroid in one coordinate direction.
Definition: ERF_EBCutCell.H:182
static constexpr int m_max_faces
Definition: ERF_EBCutCell.H:303
amrex::RealVect const m_eb_normal
Definition: ERF_EBCutCell.H:286
amrex::Array< int const, 3 > m_lo_faces_id
Definition: ERF_EBCutCell.H:314
polygon_ m_F2
Definition: ERF_EBCutCell.H:297
amrex::Array< polygon_ const *const, 3 > m_hi_faces
Definition: ERF_EBCutCell.H:312
polygon_ m_F4
Definition: ERF_EBCutCell.H:299
amrex::Array< amrex::RealVect, m_max_faces > m_cellface_cent
Definition: ERF_EBCutCell.H:304
Polygon helper used to accumulate cut-cell face geometry.
Definition: ERF_EBPolygon.H:20
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::RealVect get_centroid() const noexcept
Return the polygon centroid from its sub-triangulation.
Definition: ERF_EBPolygon.H:206
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int ok() const noexcept
Return whether the polygon has been defined with a valid area state.
Definition: ERF_EBPolygon.H:183
AMREX_GPU_HOST_DEVICE void add_vertex(amrex::RealVect const &a_v)
Add a unique vertex to the polygon.
Definition: ERF_EBPolygon.H:64
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real distance(amrex::RealVect const &a_point) const noexcept
Return the perpendicular distance from this polygon to a point.
Definition: ERF_EBPolygon.H:198
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real area() const noexcept
Return the polygon area.
Definition: ERF_EBPolygon.H:188
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void set_area(amrex::Real const &a_area)
Set the polygon area directly.
Definition: ERF_EBPolygon.H:88
Definition: ERF_ConsoleIO.cpp:15
real(c_double), parameter epsilon
Definition: ERF_module_model_constants.F90:12
Intersection metadata for one ordered edge path in the cut-cell box.
Definition: ERF_EBCutCell.H:438
amrex::RealVect vIP
Coordinates of the intersection point.
Definition: ERF_EBCutCell.H:451
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE path_data()=default
Construct empty path data.
amrex::Real distIP
Distance from the start vertex to the intersection point.
Definition: ERF_EBCutCell.H:453
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void set(const amrex::RealVect &eb_point, const amrex::RealVect &eb_normal, const amrex::RealVect &v_start, const amrex::RealVect &v_end)
Compute and store the intersection data for one edge.
Definition: ERF_EBCutCell.H:466
amrex::Real edge_length
Physical length of the edge.
Definition: ERF_EBCutCell.H:455
bool intersected_end
Whether the intersection lies on the end vertex.
Definition: ERF_EBCutCell.H:449
bool intersected
Whether the edge intersects the EB plane.
Definition: ERF_EBCutCell.H:445
bool intersected_start
Whether the intersection lies on the start vertex.
Definition: ERF_EBCutCell.H:447