Skip to content

Commit

Permalink
Added EB data for staggered grids (eb_aux_). (#2123)
Browse files Browse the repository at this point in the history
* Call build_level for EB2::Build.

* (1) Properly treat iv_hi and iv_lo at the boundaries to avoid empty cell. (2) In the EB normal, area fractions are multiplied by cell areas.

* Add declaration of dx.

* Map bcent and bnorm to isoparametric space.

* Added eb_::WriteEBSurface for plotting anisotropic EB grids.

* Added ERF_EBToPVD files.

* Modified z_arr for WitchOfAgnesi to prevent unexpected irregular ghost cells.

* Add files to CMake.

* Removed whitespaces.

* Changed spells.

* Commented out unused max_coarsening_level.

* Call a_geom.isPeriodic(a_idim) outside of ParallelFor.

* Removed unused parameters from lambda capture.

* Commented unused parameters.

* Map bcent and bnorm only if flag.isSingleValues.

* Added getVolFrac() to eb_aux_.

* Set cellflags type to singlevalued to enable MultiCutFab.

* Area fraction added to eb_aux.

* Changed function name get_u_const_factory to be consistent with cell-centered factory.

* convert face BoxArray to the DimensionVector.

* Cleaned up the values at the grown box.

* WIP: eb_aux_ face centroid.

* Removed whitespaces.

* Added preprocessor directive to Print().

* Removed Print().

* Removed whitespace.

* set_covered_regular_cell_vertices.

* get_centroid based on sub-triangulation.

* Fixed face centroid using the new get_centroid.

* Added areaBoun to compute the area of EB.

* Use lvalue for face centroids in eb_aux_.

* Added boundary centroids to eb_aux_.

* Added boundary normal.

* Removed whitespaces.

* Commented unused variable.
  • Loading branch information
skang67 authored Feb 15, 2025
1 parent 7302ad2 commit f2bf14d
Show file tree
Hide file tree
Showing 3 changed files with 206 additions and 55 deletions.
142 changes: 98 additions & 44 deletions Source/EB/ERF_EBAux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ define( int const& a_idim,
m_facecent[idim] = new MultiCutFab(faceba, a_dmap, AMREX_SPACEDIM-1, a_ngrow[2], *m_cellflags);
}

m_bndryarea = new MultiCutFab(grids, a_dmap, 1, a_ngrow[2], *m_cellflags);
m_bndrycent = new MultiCutFab(grids, a_dmap, AMREX_SPACEDIM, a_ngrow[2], *m_cellflags);
m_bndrynorm = new MultiCutFab(grids, a_dmap, AMREX_SPACEDIM, a_ngrow[2], *m_cellflags);

#if 0
m_centroid = new MultiCutFab(a_ba, a_dm, AMREX_SPACEDIM, m_ngrow[1], *m_cellflags);
m_bndrycent = new MultiCutFab(a_ba, a_dm, AMREX_SPACEDIM, m_grow[2], *m_cellflags);

m_bndryarea = new MultiCutFab(a_ba, a_dm, 1, m_grow[2], *m_cellflags);
m_bndrynorm = new MultiCutFab(a_ba, a_dm, AMREX_SPACEDIM, m_grow[2], *m_cellflags);
#endif

const auto& FlagFab = a_factory->getMultiEBCellFlagFab(); // EBFArrayBoxFactory, EBDataCollection
Expand Down Expand Up @@ -88,6 +88,10 @@ define( int const& a_idim,
Array4<Real> const& aux_fcent_y = m_facecent[1]->array(mfi);
Array4<Real> const& aux_fcent_z = m_facecent[2]->array(mfi);

Array4<Real> const& aux_barea = m_bndryarea->array(mfi);
Array4<Real> const& aux_bcent = m_bndrycent->array(mfi);
Array4<Real> const& aux_bnorm = m_bndrynorm->array(mfi);

bool is_per = a_geom.isPeriodic(a_idim);

ParallelFor(bx, [
Expand All @@ -98,8 +102,8 @@ define( int const& a_idim,
aux_flag, aux_vfrac,
aux_afrac_x, aux_afrac_y, aux_afrac_z,
aux_fcent_x, aux_fcent_y, aux_fcent_z,
aux_barea, aux_bcent, aux_bnorm,
vdim, idim=a_idim, is_per ]
// aux_flag, aux_vfrac, vdim, idim=a_idim, is_per, &outfiles ]
AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{

Expand Down Expand Up @@ -131,6 +135,16 @@ define( int const& a_idim,
aux_fcent_z(i,j,k+1,0) = 0.0; aux_fcent_z(i,j,k+1,1) = 0.0;
}

aux_barea(i,j,k) = 0.0;

aux_bcent(i,j,k,0) = 0.0;
aux_bcent(i,j,k,1) = 0.0;
aux_bcent(i,j,k,2) = 0.0;

aux_bnorm(i,j,k,0) = 0.0;
aux_bnorm(i,j,k,1) = 0.0;
aux_bnorm(i,j,k,2) = 0.0;

// Index for low and hi cells
IntVect iv_hi(i,j,k);
IntVect iv_lo(iv_hi - vdim);
Expand Down Expand Up @@ -460,9 +474,17 @@ define( int const& a_idim,

aux_vfrac(i,j,k) = lo_eb_cc.volume() + hi_eb_cc.volume();

aux_afrac_x(i,j,k) = (idim == 0) ? lo_eb_cc.areaLo(0) : lo_eb_cc.areaLo(0) + hi_eb_cc.areaLo(0);
aux_afrac_y(i,j,k) = (idim == 1) ? lo_eb_cc.areaLo(1) : lo_eb_cc.areaLo(1) + hi_eb_cc.areaLo(1);
aux_afrac_z(i,j,k) = (idim == 2) ? lo_eb_cc.areaLo(2) : lo_eb_cc.areaLo(2) + hi_eb_cc.areaLo(2);
Real lo_areaLo_x {lo_eb_cc.areaLo(0)};
Real lo_areaLo_y {lo_eb_cc.areaLo(1)};
Real lo_areaLo_z {lo_eb_cc.areaLo(2)};

Real hi_areaLo_x {hi_eb_cc.areaLo(0)};
Real hi_areaLo_y {hi_eb_cc.areaLo(1)};
Real hi_areaLo_z {hi_eb_cc.areaLo(2)};

aux_afrac_x(i,j,k) = (idim == 0) ? lo_areaLo_x : lo_areaLo_x + hi_areaLo_x;
aux_afrac_y(i,j,k) = (idim == 1) ? lo_areaLo_y : lo_areaLo_y + hi_areaLo_y;
aux_afrac_z(i,j,k) = (idim == 2) ? lo_areaLo_z : lo_areaLo_z + hi_areaLo_z;

/* fcentLo returns the coordinates based on m_rbx.
The coordinates in the idim direction are in [0.0,0.5] for the low cell and in [-0.5,0.0] for the hi cell.
Expand All @@ -472,71 +494,103 @@ define( int const& a_idim,
z' = z - 0.5 (low cell), z + 0.5 (hi cell) if idim = 2
*/

RealVect lo_centLo_x {lo_eb_cc.centLo(0)};
RealVect lo_centLo_y {lo_eb_cc.centLo(1)};
RealVect lo_centLo_z {lo_eb_cc.centLo(2)};

RealVect hi_centLo_x {hi_eb_cc.centLo(0)};
RealVect hi_centLo_y {hi_eb_cc.centLo(1)};
RealVect hi_centLo_z {hi_eb_cc.centLo(2)};

if (idim == 0) {
aux_fcent_x(i,j,k,0) = lo_eb_cc.fcentLo(0)[1]; // y
aux_fcent_x(i,j,k,1) = lo_eb_cc.fcentLo(0)[2]; // z
aux_fcent_x(i,j,k,0) = lo_centLo_x[1]; // y
aux_fcent_x(i,j,k,1) = lo_centLo_x[2]; // z
aux_fcent_y(i,j,k,0) = (aux_afrac_y(i,j,k) > 0.0) // x (mapped)
? ( lo_eb_cc.areaLo(1) * (lo_eb_cc.fcentLo(1)[0] - 0.5)
+ hi_eb_cc.areaLo(1) * (hi_eb_cc.fcentLo(1)[0] + 0.5) ) / aux_afrac_y(i,j,k)
? ( lo_areaLo_y * (lo_centLo_y[0] - 0.5)
+ hi_areaLo_y * (hi_centLo_y[0] + 0.5) ) / aux_afrac_y(i,j,k)
: 0.0;
aux_fcent_y(i,j,k,1) = (aux_afrac_y(i,j,k) > 0.0) // z
? ( lo_eb_cc.areaLo(1) * lo_eb_cc.fcentLo(1)[2]
+ hi_eb_cc.areaLo(1) * hi_eb_cc.fcentLo(1)[2] ) / aux_afrac_y(i,j,k)
? ( lo_areaLo_y * lo_centLo_y[2]
+ hi_areaLo_y * hi_centLo_y[2] ) / aux_afrac_y(i,j,k)
: 0.0;
aux_fcent_z(i,j,k,0) = (aux_afrac_z(i,j,k) > 0.0) // x (mapped)
? ( lo_eb_cc.areaLo(2) * (lo_eb_cc.fcentLo(2)[0] - 0.5)
+ hi_eb_cc.areaLo(2) * (hi_eb_cc.fcentLo(2)[0] + 0.5) ) / aux_afrac_z(i,j,k)
? ( lo_areaLo_z * (lo_centLo_z[0] - 0.5)
+ hi_areaLo_z * (hi_centLo_z[0] + 0.5) ) / aux_afrac_z(i,j,k)
: 0.0;
aux_fcent_z(i,j,k,1) = (aux_afrac_z(i,j,k) > 0.0) // y
? ( lo_eb_cc.areaLo(2) * lo_eb_cc.fcentLo(2)[1]
+ hi_eb_cc.areaLo(2) * hi_eb_cc.fcentLo(2)[1] ) / aux_afrac_z(i,j,k)
? ( lo_areaLo_z * lo_centLo_z[1]
+ hi_areaLo_z * hi_centLo_z[1] ) / aux_afrac_z(i,j,k)
: 0.0;
}

if (idim == 1) {
} else if (idim == 1) {
aux_fcent_x(i,j,k,0) = (aux_afrac_x(i,j,k) > 0.0) // y (mapped)
? ( lo_eb_cc.areaLo(0) * (lo_eb_cc.fcentLo(0)[1] - 0.5)
+ hi_eb_cc.areaLo(0) * (hi_eb_cc.fcentLo(0)[1] + 0.5) ) / aux_afrac_x(i,j,k)
? ( lo_areaLo_x * (lo_centLo_x[1] - 0.5)
+ hi_areaLo_x * (hi_centLo_x[1] + 0.5) ) / aux_afrac_x(i,j,k)
: 0.0;
aux_fcent_x(i,j,k,1) = (aux_afrac_x(i,j,k) > 0.0) // z
? ( lo_eb_cc.areaLo(0) * lo_eb_cc.fcentLo(0)[2]
+ hi_eb_cc.areaLo(0) * hi_eb_cc.fcentLo(0)[2] ) / aux_afrac_x(i,j,k)
? ( lo_areaLo_x * lo_centLo_x[2]
+ hi_areaLo_x * hi_centLo_x[2] ) / aux_afrac_x(i,j,k)
: 0.0;
aux_fcent_y(i,j,k,0) = lo_eb_cc.fcentLo(1)[0]; // x
aux_fcent_y(i,j,k,1) = lo_eb_cc.fcentLo(1)[2]; // z
aux_fcent_y(i,j,k,0) = lo_centLo_y[0]; // x
aux_fcent_y(i,j,k,1) = lo_centLo_y[2]; // z
aux_fcent_z(i,j,k,0) = (aux_afrac_z(i,j,k) > 0.0) // x
? ( lo_eb_cc.areaLo(2) * lo_eb_cc.fcentLo(2)[0]
+ hi_eb_cc.areaLo(2) * hi_eb_cc.fcentLo(2)[0] ) / aux_afrac_z(i,j,k)
? ( lo_areaLo_z * lo_centLo_z[0]
+ hi_areaLo_z * hi_centLo_z[0] ) / aux_afrac_z(i,j,k)
: 0.0;
aux_fcent_z(i,j,k,1) = (aux_afrac_z(i,j,k) > 0.0) // y (mapped)
? ( lo_eb_cc.areaLo(2) * (lo_eb_cc.fcentLo(2)[1] - 0.5)
+ hi_eb_cc.areaLo(2) * (hi_eb_cc.fcentLo(2)[1] + 0.5) ) / aux_afrac_z(i,j,k)
? ( lo_areaLo_z * (lo_centLo_z[1] - 0.5)
+ hi_areaLo_z * (hi_centLo_z[1] + 0.5) ) / aux_afrac_z(i,j,k)
: 0.0;
}

if (idim == 2) {
} else if (idim == 2) {
aux_fcent_x(i,j,k,0) = (aux_afrac_x(i,j,k) > 0.0) // y
? ( lo_eb_cc.areaLo(0) * lo_eb_cc.fcentLo(0)[1]
+ hi_eb_cc.areaLo(0) * hi_eb_cc.fcentLo(0)[1] ) / aux_afrac_x(i,j,k)
? ( lo_areaLo_x * lo_centLo_x[1]
+ hi_areaLo_x * hi_centLo_x[1] ) / aux_afrac_x(i,j,k)
: 0.0;
aux_fcent_x(i,j,k,1) = (aux_afrac_x(i,j,k) > 0.0) // z (mapped)
? ( lo_eb_cc.areaLo(0) * (lo_eb_cc.fcentLo(0)[2] - 0.5)
+ hi_eb_cc.areaLo(0) * (hi_eb_cc.fcentLo(0)[2] + 0.5) ) / aux_afrac_x(i,j,k)
? ( lo_areaLo_x * (lo_centLo_x[2] - 0.5)
+ hi_areaLo_x * (hi_centLo_x[2] + 0.5) ) / aux_afrac_x(i,j,k)
: 0.0;
aux_fcent_y(i,j,k,0) = (aux_afrac_y(i,j,k) > 0.0) // x
? ( lo_eb_cc.areaLo(1) * lo_eb_cc.fcentLo(1)[0]
+ hi_eb_cc.areaLo(1) * hi_eb_cc.fcentLo(1)[0] ) / aux_afrac_y(i,j,k)
? ( lo_areaLo_y * lo_centLo_y[0]
+ hi_areaLo_y * hi_centLo_y[0] ) / aux_afrac_y(i,j,k)
: 0.0;
aux_fcent_y(i,j,k,1) = (aux_afrac_y(i,j,k) > 0.0) // z (mapped)
? ( lo_eb_cc.areaLo(1) * (lo_eb_cc.fcentLo(1)[2] - 0.5)
+ hi_eb_cc.areaLo(1) * (hi_eb_cc.fcentLo(1)[2] + 0.5) ) / aux_afrac_y(i,j,k)
? ( lo_areaLo_y * (lo_centLo_y[2] - 0.5)
+ hi_areaLo_y * (hi_centLo_y[2] + 0.5) ) / aux_afrac_y(i,j,k)
: 0.0;
aux_fcent_z(i,j,k,0) = lo_eb_cc.fcentLo(2)[0]; // x
aux_fcent_z(i,j,k,1) = lo_eb_cc.fcentLo(2)[1]; // y
aux_fcent_z(i,j,k,0) = lo_centLo_z[0]; // x
aux_fcent_z(i,j,k,1) = lo_centLo_z[1]; // y
}

// Need to fill the nodes the big ends?

Real lo_areaBoun {lo_eb_cc.areaBoun()};
Real hi_areaBoun {hi_eb_cc.areaBoun()};

aux_barea(i,j,k) = lo_areaBoun + hi_areaBoun;

RealVect lo_centBoun {lo_eb_cc.centBoun()};
RealVect hi_centBoun {hi_eb_cc.centBoun()};

if (idim == 0) {
aux_bcent(i,j,k,0) = ( lo_areaBoun * (lo_centBoun[0]-0.5) + hi_areaBoun * (hi_centBoun[0]+0.5) ) / aux_barea(i,j,k); // x (mapped)
aux_bcent(i,j,k,1) = ( lo_areaBoun * lo_centBoun[1] + hi_areaBoun * hi_centBoun[1] ) / aux_barea(i,j,k); // y
aux_bcent(i,j,k,2) = ( lo_areaBoun * lo_centBoun[2] + hi_areaBoun * hi_centBoun[2] ) / aux_barea(i,j,k); // z
} else if (idim == 1) {
aux_bcent(i,j,k,0) = ( lo_areaBoun * lo_centBoun[0] + hi_areaBoun * hi_centBoun[0] ) / aux_barea(i,j,k); // x
aux_bcent(i,j,k,1) = ( lo_areaBoun * (lo_centBoun[1]-0.5) + hi_areaBoun * (hi_centBoun[1]+0.5) ) / aux_barea(i,j,k); // y (mapped)
aux_bcent(i,j,k,2) = ( lo_areaBoun * lo_centBoun[2] + hi_areaBoun * hi_centBoun[2] ) / aux_barea(i,j,k); // z
} else if (idim == 2) {
aux_bcent(i,j,k,0) = ( lo_areaBoun * lo_centBoun[0] + hi_areaBoun * hi_centBoun[0] ) / aux_barea(i,j,k); // x
aux_bcent(i,j,k,1) = ( lo_areaBoun * lo_centBoun[1] + hi_areaBoun * hi_centBoun[1] ) / aux_barea(i,j,k); // y
aux_bcent(i,j,k,2) = ( lo_areaBoun * (lo_centBoun[2]-0.5) + hi_areaBoun * (hi_centBoun[2]+0.5) ) / aux_barea(i,j,k); // z (mapped)
}

RealVect eb_normal = ( lo_areaBoun * lo_normal + hi_areaBoun * hi_normal )/ aux_barea(i,j,k);

aux_bnorm(i,j,k,0) = eb_normal[0];
aux_bnorm(i,j,k,1) = eb_normal[1];
aux_bnorm(i,j,k,2) = eb_normal[2];

}

} // flag(iv_lo) and flag(iv_hi)
Expand Down
92 changes: 84 additions & 8 deletions Source/EB/ERF_EBCutCell.H
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <AMReX_Array.H>
#include <AMReX_RealBox.H>
#include <AMReX_RealVect.H>
#include <AMReX_Algorithm.H>
#include <AMReX_EBCellFlag.H>

#include "ERF_EBPolygon.H"
Expand Down Expand Up @@ -92,17 +93,66 @@ class eb_cut_cell_ {
}

[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
amrex::Array<amrex::Real,AMREX_SPACEDIM> fcentLo ( int const a_idim ) const noexcept {
amrex::Real areaBoun () const noexcept {
return m_F7.area();
}

[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
amrex::RealVect centLo ( int const a_idim ) const noexcept {
AMREX_ASSERT( a_idim >=0 && a_idim < AMREX_SPACEDIM );
amrex::RealVect cent = m_lo_faces[a_idim]->get_centroid();
return {AMREX_D_DECL(cent[0],cent[1],cent[2])};
amrex::RealVect cent(0.,0.,0.);
amrex::RealVect cent_O = m_cellface_cent[ m_lo_faces_id[a_idim] ];
if (m_flag.isCovered() || m_flag.isRegular() ) {
cent = cent_O;
} else {
amrex::Real const area_R = m_lo_faces[a_idim]->area();
if (amrex::almostEqual(area_R,0.0) || amrex::almostEqual(area_R, m_rbox_area[a_idim]) ){
// Default cent
} else {
amrex::RealVect cent_R = m_lo_faces[a_idim]->get_centroid();
amrex::Real const area_C = m_rbox_area[a_idim] - area_R;
cent = m_invert * cent_R + (1.-m_invert) * ((1.+area_R/area_C)*cent_O - area_R/area_C*cent_R);
}
}
return cent;
}

[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
amrex::RealArray fcentHi ( int const a_idim ) const noexcept {
amrex::RealVect centHi ( int const a_idim ) const noexcept {
AMREX_ASSERT( a_idim >=0 && a_idim < AMREX_SPACEDIM );
amrex::RealVect cent = m_hi_faces[a_idim]->get_centroid();
return {AMREX_D_DECL(cent[0],cent[1],cent[2])};
amrex::RealVect cent(0.,0.,0.);
amrex::RealVect cent_O = m_cellface_cent[ m_hi_faces_id[a_idim] ];
if (m_flag.isCovered() || m_flag.isRegular() ) {
cent = cent_O;
} else {
amrex::Real const area_R = m_hi_faces[a_idim]->area();
if (amrex::almostEqual(area_R,0.0) || amrex::almostEqual(area_R, m_rbox_area[a_idim]) ){
// Default cent
} else {
amrex::RealVect cent_R = m_hi_faces[a_idim]->get_centroid();
amrex::Real const area_C = m_rbox_area[a_idim] - area_R;
cent = m_invert * cent_R + (1.-m_invert) * ((1.+area_R/area_C)*cent_O - area_R/area_C*cent_R);
}
}
return cent;
}

[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
amrex::RealVect centBoun () const noexcept {
amrex::RealVect cent{0.,0.,0.};
if (m_flag.isSingleValued()){
cent = m_F7.get_centroid();
}
return cent;
}

[[nodiscard]] AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
amrex::RealVect normBoun () const noexcept {
amrex::RealVect normal{0.,0.,0.};
if (m_flag.isSingleValued()){
normal = m_eb_normal;
}
return normal;
}

void debug ( int const a_face = -1 );
Expand All @@ -128,12 +178,18 @@ class eb_cut_cell_ {
polygon_ m_F5;
polygon_ m_F6;

static int constexpr m_max_faces = 6;
amrex::Array<amrex::RealVect,m_max_faces> m_cellface_cent; // Centroids of cell faces

// cut face
polygon_ m_F7;

amrex::Array<polygon_ const* const,3> m_lo_faces {&m_F4, &m_F5, &m_F1};
amrex::Array<polygon_ const* const,3> m_hi_faces {&m_F2, &m_F6, &m_F3};

amrex::Array<int const,3> m_lo_faces_id {3,4,0};
amrex::Array<int const,3> m_hi_faces_id {1,5,2};

AMREX_GPU_HOST_DEVICE
void calc_edge_intersections ( int const a_dry_run = 0 );

Expand All @@ -159,6 +215,8 @@ eb_cut_cell_ ( amrex::EBCellFlag const& a_flag,
, m_F4(a_point, a_normal)
, m_F5(a_point, a_normal)
, m_F6(a_point, a_normal)
, m_cellface_cent({amrex::RealVect(0.), amrex::RealVect(0.), amrex::RealVect(0.),
amrex::RealVect(0.), amrex::RealVect(0.), amrex::RealVect(0.)})
{
using namespace amrex;

Expand All @@ -167,17 +225,30 @@ eb_cut_cell_ ( amrex::EBCellFlag const& a_flag,
m_rbox_area[2] = m_rbox.length(0)*m_rbox.length(1);

RealVect v0(a_rbox.lo(0), a_rbox.lo(1), a_rbox.lo(2));
RealVect v1(a_rbox.hi(0), a_rbox.lo(1), a_rbox.lo(2));
RealVect v2(a_rbox.lo(0), a_rbox.hi(1), a_rbox.lo(2));
RealVect v3(a_rbox.lo(0), a_rbox.lo(1), a_rbox.hi(2));
RealVect v4(a_rbox.hi(0), a_rbox.lo(1), a_rbox.hi(2));
RealVect v5(a_rbox.hi(0), a_rbox.hi(1), a_rbox.lo(2));
RealVect v6(a_rbox.lo(0), a_rbox.hi(1), a_rbox.hi(2));
RealVect v7(a_rbox.hi(0), a_rbox.hi(1), a_rbox.hi(2));

// Centoids of cell faces

m_cellface_cent[0] = 0.25 * ( v0 + v2 + v5 + v1 ); // F1
m_cellface_cent[1] = 0.25 * ( v1 + v5 + v7 + v4 ); // F2
m_cellface_cent[2] = 0.25 * ( v3 + v4 + v7 + v6 ); // F3
m_cellface_cent[3] = 0.25 * ( v0 + v3 + v6 + v2 ); // F4
m_cellface_cent[4] = 0.25 * ( v0 + v1 + v4 + v3 ); // F5
m_cellface_cent[5] = 0.25 * ( v2 + v5 + v7 + v6 ); // F6

if (a_flag.isCovered() ) {

set_covered();
set_covered_regular_cell_vertices();

} else if (a_flag.isRegular() ) {

set_regular();
set_covered_regular_cell_vertices();

} else { // Check that the box and plane intersect.

Expand Down Expand Up @@ -213,6 +284,11 @@ eb_cut_cell_ ( amrex::EBCellFlag const& a_flag,
m_F6.define();
m_F7.define();

// For covered and regular cut cells, add vertices to utilize e.g., get_centroid.
if ( !m_flag.isSingleValued() ) {
set_covered_regular_cell_vertices();
}

}

AMREX_GPU_HOST_DEVICE
Expand Down
Loading

0 comments on commit f2bf14d

Please sign in to comment.