36 Real small_volfrac = 1.e-14;
38 pp.queryAdd(
"small_volfrac", small_volfrac);
39 const Real small_value = 1.e-15;
41 const IntVect vdim(IntVect::TheDimensionVector(a_idim));
43 const BoxArray& my_grids = amrex::convert(a_grids, vdim);
45 m_cellflags =
new FabArray<EBCellFlagFab>(my_grids, a_dmap, 1, a_ngrow[0], MFInfo(),
46 DefaultFabFactory<EBCellFlagFab>());
50 for (MFIter mfi(*
m_cellflags,
false); mfi.isValid(); ++mfi) {
51 auto& fab = (*m_cellflags)[mfi];
52 fab.setType(FabType::singlevalued);
55 m_volfrac =
new MultiFab(my_grids, a_dmap, 1, a_ngrow[1], MFInfo(), FArrayBoxFactory());
56 m_volcent =
new MultiFab(my_grids, a_dmap, AMREX_SPACEDIM, a_ngrow[2], MFInfo(), FArrayBoxFactory());
58 for (
int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
59 m_areafrac[idim] =
new MultiFab(a_grids, a_dmap, 1, a_ngrow[1]+1, MFInfo(), FArrayBoxFactory());
60 m_facecent[idim] =
new MultiFab(a_grids, a_dmap, AMREX_SPACEDIM-1, a_ngrow[2], MFInfo(), FArrayBoxFactory());
63 m_bndryarea =
new MultiFab(my_grids, a_dmap, 1, a_ngrow[2], MFInfo(), FArrayBoxFactory());
64 m_bndrycent =
new MultiFab(my_grids, a_dmap, AMREX_SPACEDIM, a_ngrow[2], MFInfo(), FArrayBoxFactory());
65 m_bndrynorm =
new MultiFab(my_grids, a_dmap, AMREX_SPACEDIM, a_ngrow[2], MFInfo(), FArrayBoxFactory());
71 for (
int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
80 const auto& FlagFab = a_factory->getMultiEBCellFlagFab();
82 for (MFIter mfi(*
m_cellflags,
false); mfi.isValid(); ++mfi) {
84 const Box& bx = mfi.validbox();
85 const Box& bx_grown = mfi.growntilebox();
86 const Box tbx = mfi.nodaltilebox(a_idim);
87 const Box domain = surroundingNodes(a_geom.Domain(), a_idim);
89 GpuArray<Real, AMREX_SPACEDIM> dx = a_geom.CellSizeArray();
90 bool l_periodic = a_geom.isPeriodic(a_idim);
92 Array4<EBCellFlag>
const& aux_flag =
m_cellflags->array(mfi);
93 Array4<Real>
const& aux_vfrac =
m_volfrac->array(mfi);
94 Array4<Real>
const& aux_afrac_x =
m_areafrac[0]->array(mfi);
95 Array4<Real>
const& aux_afrac_y =
m_areafrac[1]->array(mfi);
96 Array4<Real>
const& aux_afrac_z =
m_areafrac[2]->array(mfi);
98 if (FlagFab[mfi].getType(bx) == FabType::covered ) {
100 ParallelFor(tbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
102 aux_flag(i,j,k).setCovered();
103 aux_flag(i,j,k).setDisconnected();
104 if (i==bx.bigEnd(0)) {
105 aux_flag(i+1,j,k).setCovered();
107 if (j==bx.bigEnd(1)) {
108 aux_flag(i,j+1,k).setCovered();
110 if (k==bx.bigEnd(2)) {
111 aux_flag(i,j,k+1).setCovered();
115 }
else if (FlagFab[mfi].getType(bx) == FabType::regular ) {
117 ParallelFor(tbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
119 aux_flag(i,j,k).setRegular();
120 aux_flag(i,j,k).setDisconnected();
121 aux_vfrac(i,j,k) = 1.0;
122 aux_afrac_x(i,j,k) = 1.0;
123 aux_afrac_y(i,j,k) = 1.0;
124 aux_afrac_z(i,j,k) = 1.0;
125 if (i==bx.bigEnd(0)) {
126 aux_flag(i+1,j,k).setRegular();
127 aux_vfrac(i+1,j,k) = 1.0;
128 aux_afrac_x(i+1,j,k) = 1.0;
130 if (j==bx.bigEnd(1)) {
131 aux_flag(i,j+1,k).setRegular();
132 aux_vfrac(i,j+1,k) = 1.0;
133 aux_afrac_y(i,j+1,k) = 1.0;
135 if (k==bx.bigEnd(2)) {
136 aux_flag(i,j,k+1).setRegular();
137 aux_vfrac(i,j,k+1) = 1.0;
138 aux_afrac_z(i,j,k+1) = 1.0;
142 }
else if (FlagFab[mfi].getType(bx) == FabType::singlevalued ) {
147 Array4<EBCellFlag const>
const& flag = FlagFab.const_array(mfi);
148 Array4<Real const>
const& afrac = (a_factory->getAreaFrac()[a_idim])->const_array(mfi);
149 Array4<Real const>
const& bnorm = a_factory->getBndryNormal()[mfi].const_array();
150 Array4<Real const>
const& bcent = a_factory->getBndryCent()[mfi].const_array();
153 Array4<Real>
const& aux_vcent =
m_volcent->array(mfi);
154 Array4<Real>
const& aux_fcent_x =
m_facecent[0]->array(mfi);
155 Array4<Real>
const& aux_fcent_y =
m_facecent[1]->array(mfi);
156 Array4<Real>
const& aux_fcent_z =
m_facecent[2]->array(mfi);
157 Array4<Real>
const& aux_barea =
m_bndryarea->array(mfi);
158 Array4<Real>
const& aux_bcent =
m_bndrycent->array(mfi);
159 Array4<Real>
const& aux_bnorm =
m_bndrynorm->array(mfi);
162 Box dom_grown = domain;
163 for (
int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
164 if (a_geom.isPeriodic(idim)) {
165 dom_grown.grow(idim, a_ngrow[0]);
169 const IntVect dom_grown_lo = dom_grown.smallEnd();
170 const IntVect dom_grown_hi = dom_grown.bigEnd();
172 BoxList diffList = boxDiff(bx_grown, bx);
173 for (
const Box& b : diffList) {
174 ParallelFor(b, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
176 if ( i < dom_grown_lo[0] || i > dom_grown_hi[0] ||
177 j < dom_grown_lo[1] || j > dom_grown_hi[1] ||
178 k < dom_grown_lo[2] || k > dom_grown_hi[2] ) {
179 aux_flag(i,j,k).setCovered();
180 aux_flag(i,j,k).setDisconnected();
185 #ifndef AMREX_USE_GPU
189 ParallelFor(bx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
192 aux_flag(i,j,k).setCovered();
193 aux_flag(i,j,k).setDisconnected();
195 if (i==bx.bigEnd(0)) {
196 aux_flag(i+1,j,k).setCovered();
198 if (j==bx.bigEnd(1)) {
199 aux_flag(i,j+1,k).setCovered();
201 if (k==bx.bigEnd(2)) {
202 aux_flag(i,j,k+1).setCovered();
206 IntVect iv_hi(i,j,k);
207 IntVect iv_lo(iv_hi - vdim);
209 bool lo_isCovered = flag(iv_lo).isCovered();
210 bool hi_isCovered = flag(iv_hi).isCovered();
211 bool lo_isRegular = flag(iv_lo).isRegular();
212 bool hi_isRegular = flag(iv_hi).isRegular();
213 bool lo_isSingleValued = flag(iv_lo).isSingleValued();
214 bool hi_isSingleValued = flag(iv_hi).isSingleValued();
216 const bool at_lo_boundary = (!l_periodic && iv_hi[a_idim]==domain.smallEnd(a_idim));
217 const bool at_hi_boundary = (!l_periodic && iv_hi[a_idim]==domain.bigEnd(a_idim));
221 if (at_lo_boundary) {
224 lo_isRegular =
false;
225 lo_isSingleValued =
false;
226 }
else if (hi_isRegular) {
227 lo_isCovered =
false;
229 lo_isSingleValued =
false;
230 }
else if (hi_isSingleValued) {
231 if (almostEqual(afrac(i,j,k),0.0)) {
233 lo_isRegular =
false;
234 lo_isSingleValued =
false;
235 }
else if (almostEqual(afrac(i,j,k),1.0)) {
236 lo_isCovered =
false;
238 lo_isSingleValued =
false;
240 lo_isCovered =
false;
241 lo_isRegular =
false;
242 lo_isSingleValued =
true;
250 if (at_hi_boundary) {
253 hi_isRegular =
false;
254 hi_isSingleValued =
false;
255 }
else if (lo_isRegular) {
256 hi_isCovered =
false;
258 hi_isSingleValued =
false;
259 }
else if (lo_isSingleValued) {
260 if (almostEqual(afrac(i,j,k),0.0)) {
262 hi_isRegular =
false;
263 hi_isSingleValued =
false;
264 }
else if (almostEqual(afrac(i,j,k),1.0)) {
265 hi_isCovered =
false;
267 hi_isSingleValued =
false;
269 hi_isCovered =
false;
270 hi_isRegular =
false;
271 hi_isSingleValued =
true;
277 if ( lo_isCovered && hi_isCovered) {
281 }
else if ( lo_isRegular && hi_isRegular) {
283 aux_flag(i,j,k).setRegular();
284 aux_flag(i,j,k).setConnected();
286 aux_vfrac(i,j,k) = 1.0;
288 aux_afrac_x(i,j,k) = 1.0;
289 aux_afrac_y(i,j,k) = 1.0;
290 aux_afrac_z(i,j,k) = 1.0;
292 if (i==bx.bigEnd(0)) {
293 aux_afrac_x(i+1,j,k) = 1.0;
295 if (j==bx.bigEnd(1)) {
296 aux_afrac_y(i,j+1,k) = 1.0;
298 if (k==bx.bigEnd(2)) {
299 aux_afrac_z(i,j,k+1) = 1.0;
304 #ifndef AMREX_USE_GPU
305 if (verbose) { Print() <<
"\ncell: " << amrex::IntVect(i,j,k) <<
"\n"; }
307 Array<Real,AMREX_SPACEDIM> lo_arr = {-0.5,-0.5,-0.5};
308 Array<Real,AMREX_SPACEDIM> hi_arr = { 0.5, 0.5, 0.5};
317 RealVect lo_point (bcent(iv_lo,0), bcent(iv_lo,1), bcent(iv_lo,2));
318 RealVect lo_normal(bnorm(iv_lo,0), bnorm(iv_lo,1), bnorm(iv_lo,2));
320 if (at_lo_boundary) {
321 lo_point[a_idim] += 1.0;
324 if (lo_isSingleValued ) {
325 Real bnorm_x = bnorm(iv_lo,0) * dx[0];
326 Real bnorm_y = bnorm(iv_lo,1) * dx[1];
327 Real bnorm_z = bnorm(iv_lo,2) * dx[2];
329 Real norm = sqrt( bnorm_x*bnorm_x + bnorm_y*bnorm_y + bnorm_z*bnorm_z);
331 RealVect bnorm_isoparam ( bnorm_x / norm, bnorm_y / norm, bnorm_z / norm);
333 lo_normal = bnorm_isoparam;
337 lo_arr[a_idim] = 0.0;
338 hi_arr[a_idim] = 0.5;
339 RealBox lo_rbx(lo_arr.data(), hi_arr.data());
341 eb_cut_cell_ lo_eb_cc(flag(iv_lo), lo_rbx, lo_point, lo_normal);
345 AMREX_ASSERT( !lo_isCovered || lo_eb_cc.isCovered() );
346 AMREX_ASSERT( !lo_isRegular || lo_eb_cc.isRegular() );
352 RealVect hi_point (bcent(iv_hi,0), bcent(iv_hi,1), bcent(iv_hi,2));
353 RealVect hi_normal(bnorm(iv_hi,0), bnorm(iv_hi,1), bnorm(iv_hi,2));
355 if (at_hi_boundary) {
356 hi_point[a_idim] += -1.0;
359 if (hi_isSingleValued ) {
360 Real bnorm_x = bnorm(iv_hi,0) * dx[0];
361 Real bnorm_y = bnorm(iv_hi,1) * dx[1];
362 Real bnorm_z = bnorm(iv_hi,2) * dx[2];
364 Real norm = sqrt( bnorm_x*bnorm_x + bnorm_y*bnorm_y + bnorm_z*bnorm_z);
366 RealVect bnorm_isoparam ( bnorm_x / norm, bnorm_y / norm, bnorm_z / norm);
368 hi_normal = bnorm_isoparam;
372 lo_arr[a_idim] = -0.5;
373 hi_arr[a_idim] = 0.0;
374 RealBox hi_rbx(lo_arr.data(), hi_arr.data());
376 eb_cut_cell_ hi_eb_cc(flag(iv_hi), hi_rbx, hi_point, hi_normal);
380 AMREX_ASSERT( !hi_isCovered || hi_eb_cc.isCovered() );
381 AMREX_ASSERT( !hi_isRegular || hi_eb_cc.isRegular() );
384 #if defined(AMREX_DEBUG) || defined(AMREX_TESTING) || 1
394 eb_cut_cell_ hi_hi_eb_cc(flag(iv_hi), lo_rbx, hi_point, hi_normal);
398 #ifndef AMREX_USE_GPU
399 if ( !(!hi_isRegular || hi_hi_eb_cc.isRegular()) ||
400 !(!hi_isCovered || hi_hi_eb_cc.isCovered()) ) {
401 Print() <<
"flag(iv_hi) and hi_hi_eb_cc flags do not agree\n"
402 <<
"\n isRegular() " << hi_isRegular <<
" " << hi_hi_eb_cc.isRegular()
403 <<
"\n isCovered() " << hi_isCovered <<
" " << hi_hi_eb_cc.isCovered()
409 AMREX_ALWAYS_ASSERT( !hi_isRegular || hi_hi_eb_cc.isRegular() );
410 AMREX_ALWAYS_ASSERT( !hi_isCovered || hi_hi_eb_cc.isCovered() );
417 if ( hi_isSingleValued ) {
419 Real const adx = (a_idim == 0)
420 ? (hi_eb_cc.areaLo(0) - hi_hi_eb_cc.areaHi(0)) * dx[1] * dx[2]
421 : (hi_eb_cc.areaLo(0) + hi_hi_eb_cc.areaLo(0)) * dx[1] * dx[2]
422 - (hi_eb_cc.areaHi(0) + hi_hi_eb_cc.areaHi(0)) * dx[1] * dx[2];
424 Real const ady = (a_idim == 1)
425 ? (hi_eb_cc.areaLo(1) - hi_hi_eb_cc.areaHi(1)) * dx[0] * dx[2]
426 : (hi_eb_cc.areaLo(1) + hi_hi_eb_cc.areaLo(1)) * dx[0] * dx[2]
427 - (hi_eb_cc.areaHi(1) + hi_hi_eb_cc.areaHi(1)) * dx[0] * dx[2];
429 Real const adz = (a_idim == 2)
430 ? (hi_eb_cc.areaLo(2) - hi_hi_eb_cc.areaHi(2)) * dx[0] * dx[1]
431 : (hi_eb_cc.areaLo(2) + hi_hi_eb_cc.areaLo(2)) * dx[0] * dx[1]
432 - (hi_eb_cc.areaHi(2) + hi_hi_eb_cc.areaHi(2)) * dx[0] * dx[1];
434 Real const apnorm = std::sqrt(adx*adx + ady*ady + adz*adz);
437 Real const apnorminv = 1. / apnorm;
438 RealVect
const normal(adx*apnorminv, ady*apnorminv, adz*apnorminv);
439 Real const dot_normals = normal.dotProduct(hi_normal);
441 #ifndef AMREX_USE_GPU
442 if ( !amrex::almostEqual(dot_normals, 1.0) ) {
443 Print() <<
"\nFail: check-1 dot_normals " << dot_normals
449 }
else if (verbose) {
450 Print() <<
"Pass: dot_normals = 1.0\n";
454 AMREX_ALWAYS_ASSERT( amrex::almostEqual(dot_normals, 1.0) );
459 #ifndef AMREX_USE_GPU
460 Real const abs_err = std::abs( hi_eb_cc.areaHi(a_idim) - hi_hi_eb_cc.areaLo(a_idim) );
462 if ( abs_err >= machine_tol ) {
463 Print() <<
"\nFail: check-2 area abs_err: " << abs_err
464 <<
"\n hi_eb_cc.areaHi " << hi_eb_cc.areaHi(a_idim)
465 <<
"\n hi_hi_eb_cc.areaLo " << hi_hi_eb_cc.areaLo(a_idim)
467 }
else if (verbose) {
468 Print() <<
"Pass: hi_eb_cc.areaHi = hi_hi_eb_cc.areaLo"
469 <<
" abs_err: " << abs_err <<
"\n";
471 AMREX_ALWAYS_ASSERT( abs_err < machine_tol );
476 {
Real const abs_err = amrex::max(std::abs(lo_eb_cc.areaHi(a_idim) - afrac(iv_hi)),
477 std::abs(hi_eb_cc.areaLo(a_idim) - afrac(iv_hi)));
478 Real compare_tol = 5.0e-6;
479 #ifndef AMREX_USE_GPU
480 if ( abs_err >= compare_tol ) {
482 Print() <<
"\nFail: check-3 area abs_err " << abs_err
483 <<
"\n hi_eb_cc.areaLo(" << a_idim <<
") = " << hi_eb_cc.areaLo(a_idim)
484 <<
"\n lo_eb_cc.areaHi(" << a_idim <<
") = " << lo_eb_cc.areaHi(a_idim)
485 <<
"\n afrac" << iv_hi <<
" = " << afrac(iv_hi)
487 }
else if (verbose) {
488 Print() <<
"Pass: hi_eb_cc.areaLo = afrac = " << afrac(iv_hi)
489 <<
" abs_err: " << abs_err <<
"\n";
492 AMREX_ALWAYS_ASSERT( abs_err < compare_tol );
497 {
Real const vol = hi_eb_cc.volume() + hi_hi_eb_cc.volume();
498 Real const abs_err = amrex::Math::abs(vfrac(iv_hi) - vol);
499 Real compare_tol = 5.0e-6;
500 #ifndef AMREX_USE_GPU
501 if ( abs_err >= compare_tol ) {
504 amrex::Print() <<
"\nFail: check-4 volume abs_err: " << abs_err
505 <<
"\n point: " << hi_point
506 <<
"\n normal: " << hi_normal
507 <<
"\n hi_eb_cc.volume() " << hi_eb_cc.volume()
508 <<
"\n hi_hi_eb_cc.volume() " << hi_hi_eb_cc.volume()
509 <<
"\n vfrac: " << vfrac(iv_hi)
511 }
else if (verbose) {
512 Print() <<
"Pass: hi_eb_cc + hi_hi_eb_cc = vfrac = " << vfrac(iv_hi)
513 <<
" abs_err: " << abs_err <<
"\n";
516 AMREX_ALWAYS_ASSERT( abs_err < compare_tol );
526 if (lo_eb_cc.isCovered() && hi_eb_cc.isCovered()) {
530 }
else if (lo_eb_cc.isRegular() && hi_eb_cc.isRegular()) {
532 aux_flag(i,j,k).setRegular();
533 aux_flag(i,j,k).setConnected();
535 aux_vfrac(i,j,k) = 1.0;
537 aux_afrac_x(i,j,k) = 1.0;
538 aux_afrac_y(i,j,k) = 1.0;
539 aux_afrac_z(i,j,k) = 1.0;
541 aux_fcent_x(i,j,k,0) = 0.0; aux_fcent_x(i,j,k,1) = 0.0;
542 aux_fcent_y(i,j,k,0) = 0.0; aux_fcent_y(i,j,k,1) = 0.0;
543 aux_fcent_z(i,j,k,0) = 0.0; aux_fcent_z(i,j,k,1) = 0.0;
545 if (i==bx.bigEnd(0)) {
546 aux_afrac_x(i+1,j,k) = 1.0;
547 aux_fcent_x(i+1,j,k,0) = 0.0; aux_fcent_x(i+1,j,k,1) = 0.0;
549 if (j==bx.bigEnd(1)) {
550 aux_afrac_y(i,j+1,k) = 1.0;
551 aux_fcent_y(i,j+1,k,0) = 0.0; aux_fcent_y(i,j+1,k,1) = 0.0;
553 if (k==bx.bigEnd(2)) {
554 aux_afrac_z(i,j,k+1) = 1.0;
555 aux_fcent_z(i,j,k+1,0) = 0.0; aux_fcent_z(i,j,k+1,1) = 0.0;
558 }
else if ( (lo_eb_cc.isRegular() && hi_eb_cc.isCovered())
559 || (lo_eb_cc.isCovered() && hi_eb_cc.isRegular()) ) {
562 #ifndef AMREX_USE_GPU
563 Print()<<
"eb_aux_ / Check: Regular and Covered cut cells are facing each other." << std::endl;
570 aux_flag(i,j,k).setSingleValued();
574 Real lo_vol {lo_eb_cc.volume()}; AMREX_ASSERT(lo_vol >= 0.0 && lo_vol <= 0.5);
575 Real hi_vol {hi_eb_cc.volume()}; AMREX_ASSERT(hi_vol >= 0.0 && hi_vol <= 0.5);
577 aux_vfrac(i,j,k) = lo_vol + hi_vol;
589 RealVect lo_vcent {lo_eb_cc.centVol()};
590 RealVect hi_vcent {hi_eb_cc.centVol()};
592 lo_vcent[a_idim] = lo_vcent[a_idim] - 0.5;
593 hi_vcent[a_idim] = hi_vcent[a_idim] + 0.5;
595 aux_vcent(i,j,k,0) = ( lo_vol * lo_vcent[0] + hi_vol * hi_vcent[0] ) / aux_vfrac(i,j,k);
596 aux_vcent(i,j,k,1) = ( lo_vol * lo_vcent[1] + hi_vol * hi_vcent[1] ) / aux_vfrac(i,j,k);
597 aux_vcent(i,j,k,2) = ( lo_vol * lo_vcent[2] + hi_vol * hi_vcent[2] ) / aux_vfrac(i,j,k);
601 Real lo_areaLo_x {lo_eb_cc.areaLo(0)};
602 Real lo_areaLo_y {lo_eb_cc.areaLo(1)};
603 Real lo_areaLo_z {lo_eb_cc.areaLo(2)};
605 Real hi_areaLo_x {hi_eb_cc.areaLo(0)};
606 Real hi_areaLo_y {hi_eb_cc.areaLo(1)};
607 Real hi_areaLo_z {hi_eb_cc.areaLo(2)};
609 aux_afrac_x(i,j,k) = (a_idim == 0) ? lo_areaLo_x : lo_areaLo_x + hi_areaLo_x;
610 aux_afrac_y(i,j,k) = (a_idim == 1) ? lo_areaLo_y : lo_areaLo_y + hi_areaLo_y;
611 aux_afrac_z(i,j,k) = (a_idim == 2) ? lo_areaLo_z : lo_areaLo_z + hi_areaLo_z;
613 if (i==bx.bigEnd(0)) {
614 Real lo_areaHi_x {lo_eb_cc.areaHi(0)};
615 Real hi_areaHi_x {hi_eb_cc.areaHi(0)};
616 aux_afrac_x(i+1,j,k) = (a_idim == 0) ? hi_areaHi_x : lo_areaHi_x + hi_areaHi_x;
618 if (j==bx.bigEnd(1)) {
619 Real lo_areaHi_y {lo_eb_cc.areaHi(1)};
620 Real hi_areaHi_y {hi_eb_cc.areaHi(1)};
621 aux_afrac_y(i,j+1,k) = (a_idim == 1) ? hi_areaHi_y : lo_areaHi_y + hi_areaHi_y;
623 if (k==bx.bigEnd(2)) {
624 Real lo_areaHi_z {lo_eb_cc.areaHi(2)};
625 Real hi_areaHi_z {hi_eb_cc.areaHi(2)};
626 aux_afrac_z(i,j,k+1) = (a_idim == 2) ? hi_areaHi_z : lo_areaHi_z + hi_areaHi_z;
639 RealVect lo_centLo_x {lo_eb_cc.centLo(0)};
640 RealVect lo_centLo_y {lo_eb_cc.centLo(1)};
641 RealVect lo_centLo_z {lo_eb_cc.centLo(2)};
643 RealVect hi_centLo_x {hi_eb_cc.centLo(0)};
644 RealVect hi_centLo_y {hi_eb_cc.centLo(1)};
645 RealVect hi_centLo_z {hi_eb_cc.centLo(2)};
648 aux_fcent_x(i,j,k,0) = lo_centLo_x[1];
649 aux_fcent_x(i,j,k,1) = lo_centLo_x[2];
650 aux_fcent_y(i,j,k,0) = (aux_afrac_y(i,j,k) > 0.0)
651 ? ( lo_areaLo_y * (lo_centLo_y[0] - 0.5)
652 + hi_areaLo_y * (hi_centLo_y[0] + 0.5) ) / aux_afrac_y(i,j,k)
654 aux_fcent_y(i,j,k,1) = (aux_afrac_y(i,j,k) > 0.0)
655 ? ( lo_areaLo_y * lo_centLo_y[2]
656 + hi_areaLo_y * hi_centLo_y[2] ) / aux_afrac_y(i,j,k)
658 aux_fcent_z(i,j,k,0) = (aux_afrac_z(i,j,k) > 0.0)
659 ? ( lo_areaLo_z * (lo_centLo_z[0] - 0.5)
660 + hi_areaLo_z * (hi_centLo_z[0] + 0.5) ) / aux_afrac_z(i,j,k)
662 aux_fcent_z(i,j,k,1) = (aux_afrac_z(i,j,k) > 0.0)
663 ? ( lo_areaLo_z * lo_centLo_z[1]
664 + hi_areaLo_z * hi_centLo_z[1] ) / aux_afrac_z(i,j,k)
666 }
else if (a_idim == 1) {
667 aux_fcent_x(i,j,k,0) = (aux_afrac_x(i,j,k) > 0.0)
668 ? ( lo_areaLo_x * (lo_centLo_x[1] - 0.5)
669 + hi_areaLo_x * (hi_centLo_x[1] + 0.5) ) / aux_afrac_x(i,j,k)
671 aux_fcent_x(i,j,k,1) = (aux_afrac_x(i,j,k) > 0.0)
672 ? ( lo_areaLo_x * lo_centLo_x[2]
673 + hi_areaLo_x * hi_centLo_x[2] ) / aux_afrac_x(i,j,k)
675 aux_fcent_y(i,j,k,0) = lo_centLo_y[0];
676 aux_fcent_y(i,j,k,1) = lo_centLo_y[2];
677 aux_fcent_z(i,j,k,0) = (aux_afrac_z(i,j,k) > 0.0)
678 ? ( lo_areaLo_z * lo_centLo_z[0]
679 + hi_areaLo_z * hi_centLo_z[0] ) / aux_afrac_z(i,j,k)
681 aux_fcent_z(i,j,k,1) = (aux_afrac_z(i,j,k) > 0.0)
682 ? ( lo_areaLo_z * (lo_centLo_z[1] - 0.5)
683 + hi_areaLo_z * (hi_centLo_z[1] + 0.5) ) / aux_afrac_z(i,j,k)
685 }
else if (a_idim == 2) {
686 aux_fcent_x(i,j,k,0) = (aux_afrac_x(i,j,k) > 0.0)
687 ? ( lo_areaLo_x * lo_centLo_x[1]
688 + hi_areaLo_x * hi_centLo_x[1] ) / aux_afrac_x(i,j,k)
690 aux_fcent_x(i,j,k,1) = (aux_afrac_x(i,j,k) > 0.0)
691 ? ( lo_areaLo_x * (lo_centLo_x[2] - 0.5)
692 + hi_areaLo_x * (hi_centLo_x[2] + 0.5) ) / aux_afrac_x(i,j,k)
694 aux_fcent_y(i,j,k,0) = (aux_afrac_y(i,j,k) > 0.0)
695 ? ( lo_areaLo_y * lo_centLo_y[0]
696 + hi_areaLo_y * hi_centLo_y[0] ) / aux_afrac_y(i,j,k)
698 aux_fcent_y(i,j,k,1) = (aux_afrac_y(i,j,k) > 0.0)
699 ? ( lo_areaLo_y * (lo_centLo_y[2] - 0.5)
700 + hi_areaLo_y * (hi_centLo_y[2] + 0.5) ) / aux_afrac_y(i,j,k)
702 aux_fcent_z(i,j,k,0) = lo_centLo_z[0];
703 aux_fcent_z(i,j,k,1) = lo_centLo_z[1];
706 if (i==bx.bigEnd(0)) {
707 Real lo_areaHi_x {lo_eb_cc.areaHi(0)};
708 Real hi_areaHi_x {hi_eb_cc.areaHi(0)};
709 RealVect lo_centHi_x {lo_eb_cc.centHi(0)};
710 RealVect hi_centHi_x {hi_eb_cc.centHi(0)};
712 aux_fcent_x(i+1,j,k,0) = hi_centHi_x[1];
713 aux_fcent_x(i+1,j,k,1) = hi_centHi_x[2];
714 }
else if (a_idim == 1) {
715 aux_fcent_x(i+1,j,k,0) = (aux_afrac_x(i+1,j,k) > 0.0)
716 ? ( lo_areaHi_x * (lo_centHi_x[1] - 0.5)
717 + hi_areaHi_x * (hi_centHi_x[1] + 0.5) ) / aux_afrac_x(i+1,j,k)
719 aux_fcent_x(i+1,j,k,1) = (aux_afrac_x(i+1,j,k) > 0.0)
720 ? ( lo_areaHi_x * lo_centHi_x[2]
721 + hi_areaHi_x * hi_centHi_x[2] ) / aux_afrac_x(i+1,j,k)
723 }
else if (a_idim == 2) {
724 aux_fcent_x(i+1,j,k,0) = (aux_afrac_x(i+1,j,k) > 0.0)
725 ? ( lo_areaHi_x * lo_centHi_x[1]
726 + hi_areaHi_x * hi_centHi_x[1] ) / aux_afrac_x(i+1,j,k)
728 aux_fcent_x(i+1,j,k,1) = (aux_afrac_x(i+1,j,k) > 0.0)
729 ? ( lo_areaHi_x * (lo_centHi_x[2] - 0.5)
730 + hi_areaHi_x * (hi_centHi_x[2] + 0.5) ) / aux_afrac_x(i+1,j,k)
734 if (j==bx.bigEnd(1)) {
735 Real lo_areaHi_y {lo_eb_cc.areaHi(1)};
736 Real hi_areaHi_y {hi_eb_cc.areaHi(1)};
737 RealVect lo_centHi_y {lo_eb_cc.centHi(1)};
738 RealVect hi_centHi_y {hi_eb_cc.centHi(1)};
740 aux_fcent_y(i,j+1,k,0) = (aux_afrac_y(i,j+1,k) > 0.0)
741 ? ( lo_areaHi_y * (lo_centHi_y[0] - 0.5)
742 + hi_areaHi_y * (hi_centHi_y[0] + 0.5) ) / aux_afrac_y(i,j+1,k)
744 aux_fcent_y(i,j+1,k,1) = (aux_afrac_y(i,j+1,k) > 0.0)
745 ? ( lo_areaHi_y * lo_centHi_y[2]
746 + hi_areaHi_y * hi_centHi_y[2] ) / aux_afrac_y(i,j+1,k)
748 }
else if (a_idim == 1) {
749 aux_fcent_y(i,j+1,k,0) = lo_centHi_y[0];
750 aux_fcent_y(i,j+1,k,1) = lo_centHi_y[2];
751 }
else if (a_idim == 2) {
752 aux_fcent_y(i,j+1,k,0) = (aux_afrac_y(i,j+1,k) > 0.0)
753 ? ( lo_areaHi_y * lo_centHi_y[0]
754 + hi_areaHi_y * hi_centHi_y[0] ) / aux_afrac_y(i,j+1,k)
756 aux_fcent_y(i,j+1,k,1) = (aux_afrac_y(i,j+1,k) > 0.0)
757 ? ( lo_areaHi_y * (lo_centHi_y[2] - 0.5)
758 + hi_areaHi_y * (hi_centHi_y[2] + 0.5) ) / aux_afrac_y(i,j+1,k)
762 if (k==bx.bigEnd(2)) {
763 Real lo_areaHi_z {lo_eb_cc.areaHi(2)};
764 Real hi_areaHi_z {hi_eb_cc.areaHi(2)};
765 RealVect lo_centHi_z {lo_eb_cc.centHi(2)};
766 RealVect hi_centHi_z {hi_eb_cc.centHi(2)};
768 aux_fcent_z(i,j,k+1,0) = (aux_afrac_z(i,j,k+1) > 0.0)
769 ? ( lo_areaHi_z * (lo_centHi_z[0] - 0.5)
770 + hi_areaHi_z * (hi_centHi_z[0] + 0.5) ) / aux_afrac_z(i,j,k+1)
772 aux_fcent_z(i,j,k+1,1) = (aux_afrac_z(i,j,k+1) > 0.0)
773 ? ( lo_areaHi_z * lo_centHi_z[1]
774 + hi_areaHi_z * hi_centHi_z[1] ) / aux_afrac_z(i,j,k+1)
776 }
else if (a_idim == 1) {
777 aux_fcent_z(i,j,k+1,0) = (aux_afrac_z(i,j,k+1) > 0.0)
778 ? ( lo_areaHi_z * lo_centHi_z[0]
779 + hi_areaHi_z * hi_centHi_z[0] ) / aux_afrac_z(i,j,k+1)
781 aux_fcent_z(i,j,k+1,1) = (aux_afrac_z(i,j,k+1) > 0.0)
782 ? ( lo_areaHi_z * (lo_centHi_z[1] - 0.5)
783 + hi_areaHi_z * (hi_centHi_z[1] + 0.5) ) / aux_afrac_z(i,j,k+1)
785 }
else if (a_idim == 2) {
786 aux_fcent_z(i,j,k+1,0) = lo_centHi_z[0];
787 aux_fcent_z(i,j,k+1,1) = lo_centHi_z[1];
793 Real lo_areaBoun {lo_eb_cc.areaBoun()};
794 Real hi_areaBoun {hi_eb_cc.areaBoun()};
796 aux_barea(i,j,k) = lo_areaBoun + hi_areaBoun;
800 RealVect lo_centBoun {lo_eb_cc.centBoun()};
801 RealVect hi_centBoun {hi_eb_cc.centBoun()};
804 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);
805 aux_bcent(i,j,k,1) = ( lo_areaBoun * lo_centBoun[1] + hi_areaBoun * hi_centBoun[1] ) / aux_barea(i,j,k);
806 aux_bcent(i,j,k,2) = ( lo_areaBoun * lo_centBoun[2] + hi_areaBoun * hi_centBoun[2] ) / aux_barea(i,j,k);
807 }
else if (a_idim == 1) {
808 aux_bcent(i,j,k,0) = ( lo_areaBoun * lo_centBoun[0] + hi_areaBoun * hi_centBoun[0] ) / aux_barea(i,j,k);
809 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);
810 aux_bcent(i,j,k,2) = ( lo_areaBoun * lo_centBoun[2] + hi_areaBoun * hi_centBoun[2] ) / aux_barea(i,j,k);
811 }
else if (a_idim == 2) {
812 aux_bcent(i,j,k,0) = ( lo_areaBoun * lo_centBoun[0] + hi_areaBoun * hi_centBoun[0] ) / aux_barea(i,j,k);
813 aux_bcent(i,j,k,1) = ( lo_areaBoun * lo_centBoun[1] + hi_areaBoun * hi_centBoun[1] ) / aux_barea(i,j,k);
814 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);
819 RealVect eb_normal = ( lo_areaBoun * lo_normal + hi_areaBoun * hi_normal )/ aux_barea(i,j,k);
821 aux_bnorm(i,j,k,0) = eb_normal[0];
822 aux_bnorm(i,j,k,1) = eb_normal[1];
823 aux_bnorm(i,j,k,2) = eb_normal[2];
831 ParallelFor(bx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
833 if (aux_vfrac(i,j,k) < small_volfrac)
835 aux_vfrac(i,j,k) = 0.0;
844 m_volfrac->FillBoundary(a_geom.periodicity());
846 for (MFIter mfi(*
m_cellflags,
false); mfi.isValid(); ++mfi) {
848 const Box& bx = mfi.validbox();
849 const Box& bx_grown = mfi.growntilebox();
850 const Box domain = surroundingNodes(a_geom.Domain(), a_idim);
851 const int dom_lo_i = domain.smallEnd(0);
852 const int dom_hi_i = domain.bigEnd(0);
853 const int dom_lo_j = domain.smallEnd(1);
854 const int dom_hi_j = domain.bigEnd(1);
855 const int dom_lo_k = domain.smallEnd(2);
856 const int dom_hi_k = domain.bigEnd(2);
858 Array4<EBCellFlag>
const& aux_flag =
m_cellflags->array(mfi);
859 Array4<Real>
const& aux_vfrac =
m_volfrac->array(mfi);
860 Array4<Real>
const& aux_afrac_x =
m_areafrac[0]->array(mfi);
861 Array4<Real>
const& aux_afrac_y =
m_areafrac[1]->array(mfi);
862 Array4<Real>
const& aux_afrac_z =
m_areafrac[2]->array(mfi);
864 Array4<Real>
const& aux_vcent =
m_volcent->array(mfi);
865 Array4<Real>
const& aux_fcent_x =
m_facecent[0]->array(mfi);
866 Array4<Real>
const& aux_fcent_y =
m_facecent[1]->array(mfi);
867 Array4<Real>
const& aux_fcent_z =
m_facecent[2]->array(mfi);
868 Array4<Real>
const& aux_barea =
m_bndryarea->array(mfi);
869 Array4<Real>
const& aux_bcent =
m_bndrycent->array(mfi);
870 Array4<Real>
const& aux_bnorm =
m_bndrynorm->array(mfi);
872 if (FlagFab[mfi].getType(bx) == FabType::singlevalued ) {
875 Box my_xbx(bx); my_xbx.growHi(0,1);
876 ParallelFor(my_xbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
878 if (aux_vfrac(i,j,k) < small_volfrac || aux_vfrac(i-1,j,k) < small_volfrac) {
880 if ((i == dom_lo_i && aux_vfrac(i,j,k) < small_volfrac) ||
881 (i == dom_hi_i+1 && aux_vfrac(i-1,j,k) < small_volfrac) ||
882 (i != dom_lo_i && i != dom_hi_i+1)) {
883 aux_afrac_x(i,j,k) = 0.0;
888 Box my_ybx(bx); my_ybx.growHi(1,1);
889 ParallelFor(my_ybx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
891 if (aux_vfrac(i,j,k) < small_volfrac || aux_vfrac(i,j-1,k) < small_volfrac) {
893 if ((j == dom_lo_j && aux_vfrac(i,j,k) < small_volfrac) ||
894 (j == dom_hi_j+1 && aux_vfrac(i,j-1,k) < small_volfrac) ||
895 (j != dom_lo_j && j != dom_hi_j+1)) {
896 aux_afrac_y(i,j,k) = 0.0;
901 Box my_zbx(bx); my_zbx.growHi(2,1);
902 ParallelFor(my_zbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
904 if (aux_vfrac(i,j,k) < small_volfrac || aux_vfrac(i,j,k-1) < small_volfrac) {
906 if ((k == dom_lo_k && aux_vfrac(i,j,k) < small_volfrac) ||
907 (k == dom_hi_k+1 && aux_vfrac(i,j,k-1) < small_volfrac) ||
908 (k != dom_lo_k && k != dom_hi_k+1)) {
909 aux_afrac_z(i,j,k) = 0.0;
914 ParallelFor(bx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
916 if (aux_vfrac(i,j,k) < small_volfrac)
918 aux_vcent(i,j,k,0) = 0.0;
919 aux_vcent(i,j,k,1) = 0.0;
920 aux_vcent(i,j,k,2) = 0.0;
922 aux_fcent_x(i ,j ,k ,0) = 0.0;
923 aux_fcent_x(i ,j ,k ,1) = 0.0;
924 aux_fcent_x(i+1,j ,k ,0) = 0.0;
925 aux_fcent_x(i+1,j ,k ,1) = 0.0;
927 aux_fcent_y(i ,j ,k ,0) = 0.0;
928 aux_fcent_y(i ,j ,k ,1) = 0.0;
929 aux_fcent_y(i ,j+1,k ,0) = 0.0;
930 aux_fcent_y(i ,j+1,k ,1) = 0.0;
932 aux_fcent_z(i ,j ,k ,0) = 0.0;
933 aux_fcent_z(i ,j ,k ,1) = 0.0;
934 aux_fcent_z(i ,j ,k+1,0) = 0.0;
935 aux_fcent_z(i ,j ,k+1,1) = 0.0;
937 aux_barea(i,j,k) = 0.0;
939 aux_bcent(i,j,k,0) = 0.0;
940 aux_bcent(i,j,k,1) = 0.0;
941 aux_bcent(i,j,k,2) = 0.0;
943 aux_bnorm(i,j,k,0) = 0.0;
944 aux_bnorm(i,j,k,1) = 0.0;
945 aux_bnorm(i,j,k,2) = 0.0;
947 aux_flag(i,j,k).setCovered();
950 if (std::abs(aux_vcent(i,j,k,0)) < small_value) aux_vcent(i,j,k,0) = 0.0;
951 if (std::abs(aux_vcent(i,j,k,1)) < small_value) aux_vcent(i,j,k,1) = 0.0;
952 if (std::abs(aux_vcent(i,j,k,2)) < small_value) aux_vcent(i,j,k,2) = 0.0;
953 if (std::abs(aux_bcent(i,j,k,0)) < small_value) aux_bcent(i,j,k,0) = 0.0;
954 if (std::abs(aux_bcent(i,j,k,1)) < small_value) aux_bcent(i,j,k,1) = 0.0;
955 if (std::abs(aux_bcent(i,j,k,2)) < small_value) aux_bcent(i,j,k,2) = 0.0;
964 Box upper_slab = makeSlab(bx_grown, a_idim, bx.bigEnd(a_idim)+1);
965 Box bx_grown_1 = bx; bx_grown_1.grow(a_idim,1);
966 BoxList slab_diffList = boxDiff(upper_slab, bx_grown_1);
968 for (
const Box& b : slab_diffList) {
969 ParallelFor(b, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
971 IntVect iv(AMREX_D_DECL(i,j,k));
972 IntVect iv_nearest = iv;
973 for (
int d=0; d<AMREX_SPACEDIM; ++d) {
974 iv_nearest[d] = Clamp(iv[d], bx_grown_1.smallEnd(d), bx_grown_1.bigEnd(d));
976 aux_afrac_x(iv) = aux_afrac_x(iv_nearest);
989 m_volcent->FillBoundary(a_geom.periodicity());
990 for (
int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
991 m_areafrac[idim]->FillBoundary(a_geom.periodicity());
992 m_facecent[idim]->FillBoundary(a_geom.periodicity());
999 for (MFIter mfi(*
m_cellflags,
false); mfi.isValid(); ++mfi) {
1001 const Box& bx = mfi.validbox();
1002 const Box domain = surroundingNodes(a_geom.Domain(), a_idim);
1004 if (FlagFab[mfi].getType(bx) == FabType::singlevalued ) {
1006 Array4<EBCellFlag>
const& aux_flag =
m_cellflags->array(mfi);
1007 Array4<Real>
const& aux_afrac_x =
m_areafrac[0]->array(mfi);
1008 Array4<Real>
const& aux_afrac_y =
m_areafrac[1]->array(mfi);
1009 Array4<Real>
const& aux_afrac_z =
m_areafrac[2]->array(mfi);
1011 ParallelFor(bx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1013 EB2::build_cellflag_from_ap (i, j, k, aux_flag, aux_afrac_x, aux_afrac_y, aux_afrac_z);
1018 bool l_periodic_x = a_geom.isPeriodic(0);
1019 bool l_periodic_y = a_geom.isPeriodic(1);
1020 bool l_periodic_z = a_geom.isPeriodic(2);
1022 if (!l_periodic_x) {
1023 const Box dom_grown = grow(grow(domain,1,1),2,1);
1024 const Box bx_grown = grow(grow( bx,1,1),2,1);
1025 const Box bx_face_x_lo = bx_grown & makeSlab(dom_grown,0,domain.smallEnd(0));
1026 const Box bx_face_x_hi = bx_grown & makeSlab(dom_grown,0,domain.bigEnd(0));
1028 ParallelFor(bx_face_x_lo, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1030 for(
int kk(-1); kk<=1; kk++) {
1031 for(
int jj(-1); jj<=1; jj++) {
1032 aux_flag(i,j,k).setDisconnected(-1,jj,kk);
1035 ParallelFor(bx_face_x_hi, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1037 for(
int kk(-1); kk<=1; kk++) {
1038 for(
int jj(-1); jj<=1; jj++) {
1039 aux_flag(i,j,k).setDisconnected( 1,jj,kk);
1044 if (!l_periodic_y) {
1045 const Box dom_grown = grow(grow(domain,0,1),2,1);
1046 const Box bx_grown = grow(grow( bx,0,1),2,1);
1047 const Box bx_face_y_lo = bx_grown & makeSlab(dom_grown,1,domain.smallEnd(1));
1048 const Box bx_face_y_hi = bx_grown & makeSlab(dom_grown,1,domain.bigEnd(1));
1050 ParallelFor(bx_face_y_lo, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1052 for(
int kk(-1); kk<=1; kk++) {
1053 for(
int ii(-1); ii<=1; ii++) {
1054 aux_flag(i,j,k).setDisconnected(ii,-1,kk);
1057 ParallelFor(bx_face_y_hi, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1059 for(
int kk(-1); kk<=1; kk++) {
1060 for(
int ii(-1); ii<=1; ii++) {
1061 aux_flag(i,j,k).setDisconnected(ii, 1,kk);
1066 if (!l_periodic_z) {
1067 const Box dom_grown = grow(grow(domain,0,1),1,1);
1068 const Box bx_grown = grow(grow( bx,0,1),1,1);
1069 const Box bx_face_z_lo = bx_grown & makeSlab(dom_grown,2,domain.smallEnd(2));
1070 const Box bx_face_z_hi = bx_grown & makeSlab(dom_grown,2,domain.bigEnd(2));
1072 ParallelFor(bx_face_z_lo, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1074 for(
int jj(-1); jj<=1; jj++) {
1075 for(
int ii(-1); ii<=1; ii++) {
1076 aux_flag(i,j,k).setDisconnected(ii,jj,-1);
1079 ParallelFor(bx_face_z_hi, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1081 for(
int jj(-1); jj<=1; jj++) {
1082 for(
int ii(-1); ii<=1; ii++) {
1083 aux_flag(i,j,k).setDisconnected(ii,jj, 1);
1095 for (MFIter mfi(*
m_cellflags,
false); mfi.isValid(); ++mfi) {
1097 const Box& bx = mfi.validbox();
1098 const Box gbx = amrex::grow(bx,
m_cellflags->nGrow()-1);
1100 Array4<EBCellFlag>
const& aux_flag =
m_cellflags->array(mfi);
1101 Array4<Real>
const& aux_vfrac =
m_volfrac->array(mfi);
1103 ParallelFor(gbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1105 for(
int kk(-1); kk<=1; kk++) {
1106 for(
int jj(-1); jj<=1; jj++) {
1107 for(
int ii(-1); ii<=1; ii++)
1109 if (aux_vfrac(i+ii,j+jj,k+kk) == 0.0) {
1110 aux_flag(i,j,k).setDisconnected(ii,jj,kk);
1115 ParallelFor(gbx, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
1117 if (aux_vfrac(i,j,k)==0.0) {
1118 aux_flag(i,j,k).setCovered();
1133 amrex::VisMF::Write(*
m_areafrac[0],
"UAREAX");
1134 amrex::VisMF::Write(*
m_areafrac[1],
"UAREAY");
1135 amrex::VisMF::Write(*
m_areafrac[2],
"UAREAZ");
1136 }
else if (a_idim == 1) {
1138 amrex::VisMF::Write(*
m_areafrac[0],
"VAREAX");
1139 amrex::VisMF::Write(*
m_areafrac[1],
"VAREAY");
1140 amrex::VisMF::Write(*
m_areafrac[2],
"VAREAZ");
1143 amrex::VisMF::Write(*
m_areafrac[0],
"WAREAX");
1144 amrex::VisMF::Write(*
m_areafrac[1],
"WAREAY");
1145 amrex::VisMF::Write(*
m_areafrac[2],
"WAREAZ");
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: ERF_MicrophysicsUtils.H:233
amrex::Real Real
Definition: ERF_ShocInterface.H:19
amrex::FabArray< amrex::EBCellFlagFab > * m_cellflags
Definition: ERF_EBAux.H:44
amrex::MultiFab * m_bndrynorm
Definition: ERF_EBAux.H:49
amrex::MultiFab * m_bndryarea
Definition: ERF_EBAux.H:47
amrex::MultiFab * m_volfrac
Definition: ERF_EBAux.H:45
amrex::MultiFab * m_bndrycent
Definition: ERF_EBAux.H:48
amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > m_facecent
Definition: ERF_EBAux.H:52
amrex::MultiFab * m_volcent
Definition: ERF_EBAux.H:46
amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > m_areafrac
Definition: ERF_EBAux.H:51
Definition: ERF_EBCutCell.H:46
real(c_double), parameter epsilon
Definition: ERF_module_model_constants.F90:12