28 const IntVect vdim(IntVect::TheDimensionVector(a_idim));
30 const BoxArray& grids = amrex::convert(a_grids, vdim);
32 m_cellflags =
new FabArray<EBCellFlagFab>(grids, a_dmap, 1, a_ngrow[0], MFInfo(),
33 DefaultFabFactory<EBCellFlagFab>());
37 for (MFIter mfi(*
m_cellflags,
false); mfi.isValid(); ++mfi) {
38 auto& fab = (*m_cellflags)[mfi];
39 fab.setType(FabType::singlevalued);
42 m_volfrac =
new MultiFab(grids, a_dmap, 1, a_ngrow[1], MFInfo(), FArrayBoxFactory());
45 for (
int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
46 const BoxArray& faceba = amrex::convert(a_grids, IntVect::TheDimensionVector(idim));
55 const auto& FlagFab = a_factory->getMultiEBCellFlagFab();
57 for (MFIter mfi(*
m_cellflags,
false); mfi.isValid(); ++mfi) {
59 const Box& bx = mfi.validbox();
61 if (FlagFab[mfi].getType(bx) == FabType::singlevalued ) {
63 GpuArray<Real, AMREX_SPACEDIM> dx = a_geom.CellSizeArray();
65 Array4<EBCellFlag const>
const& flag = FlagFab.const_array(mfi);
72 Array4<Real const>
const& bnorm = a_factory->getBndryNormal()[mfi].const_array();
73 Array4<Real const>
const& bcent = a_factory->getBndryCent()[mfi].const_array();
76 Array4<EBCellFlag>
const& aux_flag =
m_cellflags->array(mfi);
77 Array4<Real>
const& aux_vfrac =
m_volfrac->array(mfi);
78 Array4<Real>
const& aux_vcent =
m_volcent->array(mfi);
80 Array4<Real>
const& aux_afrac_x =
m_areafrac[0]->array(mfi);
81 Array4<Real>
const& aux_afrac_y =
m_areafrac[1]->array(mfi);
82 Array4<Real>
const& aux_afrac_z =
m_areafrac[2]->array(mfi);
84 Array4<Real>
const& aux_fcent_x =
m_facecent[0]->array(mfi);
85 Array4<Real>
const& aux_fcent_y =
m_facecent[1]->array(mfi);
86 Array4<Real>
const& aux_fcent_z =
m_facecent[2]->array(mfi);
88 Array4<Real>
const& aux_barea =
m_bndryarea->array(mfi);
89 Array4<Real>
const& aux_bcent =
m_bndrycent->array(mfi);
90 Array4<Real>
const& aux_bnorm =
m_bndrynorm->array(mfi);
92 bool is_per = a_geom.isPeriodic(a_idim);
98 dx, bx, bnorm, bcent, flag,
99 aux_flag, aux_vfrac, aux_vcent,
100 aux_afrac_x, aux_afrac_y, aux_afrac_z,
101 aux_fcent_x, aux_fcent_y, aux_fcent_z,
102 aux_barea, aux_bcent, aux_bnorm,
103 vdim, idim=a_idim, is_per ]
104 AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
109 aux_flag(i,j,k).setCovered();
110 aux_flag(i,j,k).setDisconnected();
112 aux_vfrac(i,j,k) = 0.0;
113 aux_vcent(i,j,k,0) = 0.0;
114 aux_vcent(i,j,k,1) = 0.0;
115 aux_vcent(i,j,k,2) = 0.0;
117 aux_afrac_x(i,j,k) = 0.0;
118 aux_afrac_y(i,j,k) = 0.0;
119 aux_afrac_z(i,j,k) = 0.0;
121 aux_fcent_x(i,j,k,0) = 0.0; aux_fcent_x(i,j,k,1) = 0.0;
122 aux_fcent_y(i,j,k,0) = 0.0; aux_fcent_y(i,j,k,1) = 0.0;
123 aux_fcent_z(i,j,k,0) = 0.0; aux_fcent_z(i,j,k,1) = 0.0;
125 if (i==bx.bigEnd(0)) {
126 aux_afrac_x(i+1,j,k) = 0.0;
127 aux_fcent_x(i+1,j,k,0) = 0.0; aux_fcent_x(i+1,j,k,1) = 0.0;
129 if (j==bx.bigEnd(1)) {
130 aux_afrac_y(i,j+1,k) = 0.0;
131 aux_fcent_y(i,j+1,k,0) = 0.0; aux_fcent_y(i,j+1,k,1) = 0.0;
133 if (k==bx.bigEnd(2)) {
134 aux_afrac_z(i,j,k+1) = 0.0;
135 aux_fcent_z(i,j,k+1,0) = 0.0; aux_fcent_z(i,j,k+1,1) = 0.0;
138 aux_barea(i,j,k) = 0.0;
140 aux_bcent(i,j,k,0) = 0.0;
141 aux_bcent(i,j,k,1) = 0.0;
142 aux_bcent(i,j,k,2) = 0.0;
144 aux_bnorm(i,j,k,0) = 0.0;
145 aux_bnorm(i,j,k,1) = 0.0;
146 aux_bnorm(i,j,k,2) = 0.0;
149 IntVect iv_hi(i,j,k);
150 IntVect iv_lo(iv_hi - vdim);
151 if (!is_per && iv_hi[idim]==bx.bigEnd(idim)){
154 if (!is_per && iv_hi[idim]==bx.smallEnd(idim)){
160 if ( flag(iv_lo).isCovered() && flag(iv_hi).isCovered()) {
164 }
else if ( flag(iv_lo).isRegular() && flag(iv_hi).isRegular()) {
166 aux_flag(i,j,k).setRegular();
167 aux_flag(i,j,k).setConnected(vdim);
169 aux_vfrac(i,j,k) = 1.0;
171 aux_afrac_x(i,j,k) = 1.0;
172 aux_afrac_y(i,j,k) = 1.0;
173 aux_afrac_z(i,j,k) = 1.0;
175 aux_fcent_x(i,j,k,0) = 0.0; aux_fcent_x(i,j,k,1) = 0.0;
176 aux_fcent_y(i,j,k,0) = 0.0; aux_fcent_y(i,j,k,1) = 0.0;
177 aux_fcent_z(i,j,k,0) = 0.0; aux_fcent_z(i,j,k,1) = 0.0;
179 if (i==bx.bigEnd(0)) {
180 aux_afrac_x(i+1,j,k) = 1.0;
181 aux_fcent_x(i+1,j,k,0) = 0.0; aux_fcent_x(i+1,j,k,1) = 0.0;
183 if (j==bx.bigEnd(1)) {
184 aux_afrac_y(i,j+1,k) = 1.0;
185 aux_fcent_y(i,j+1,k,0) = 0.0; aux_fcent_y(i,j+1,k,1) = 0.0;
187 if (k==bx.bigEnd(2)) {
188 aux_afrac_z(i,j,k+1) = 1.0;
189 aux_fcent_z(i,j,k+1,0) = 0.0; aux_fcent_z(i,j,k+1,1) = 0.0;
194 #ifndef AMREX_USE_GPU
195 if (verbose) { Print() <<
"\ncell: " << amrex::IntVect(i,j,k) <<
"\n"; }
197 Array<Real,AMREX_SPACEDIM> lo_arr = {-0.5,-0.5,-0.5};
198 Array<Real,AMREX_SPACEDIM> hi_arr = { 0.5, 0.5, 0.5};
207 RealVect lo_point (bcent(iv_lo,0), bcent(iv_lo,1), bcent(iv_lo,2));
208 RealVect lo_normal(bnorm(iv_lo,0), bnorm(iv_lo,1), bnorm(iv_lo,2));
210 if (!is_per && iv_hi[idim]==bx.smallEnd(idim)){
211 lo_point[idim] += 1.0;
214 if (flag(iv_lo).isSingleValued() ) {
216 Real bnorm_x = bnorm(iv_lo,0) * dx[0];
217 Real bnorm_y = bnorm(iv_lo,1) * dx[1];
218 Real bnorm_z = bnorm(iv_lo,2) * dx[2];
220 Real norm = sqrt( bnorm_x*bnorm_x + bnorm_y*bnorm_y + bnorm_z*bnorm_z);
222 RealVect bnorm_isoparam ( bnorm_x / norm, bnorm_y / norm, bnorm_z / norm);
226 lo_normal = bnorm_isoparam;
233 RealBox lo_rbx(lo_arr.data(), hi_arr.data());
235 eb_cut_cell_ lo_eb_cc(flag(iv_lo), lo_rbx, lo_point, lo_normal);
239 AMREX_ASSERT( !flag(iv_lo).isCovered() || lo_eb_cc.isCovered() );
240 AMREX_ASSERT( !flag(iv_lo).isRegular() || lo_eb_cc.isRegular() );
246 RealVect hi_point (bcent(iv_hi,0), bcent(iv_hi,1), bcent(iv_hi,2));
247 RealVect hi_normal(bnorm(iv_hi,0), bnorm(iv_hi,1), bnorm(iv_hi,2));
249 if (!is_per && iv_hi[idim]==bx.bigEnd(idim)){
250 lo_point[idim] += -1.0;
253 if (flag(iv_hi).isSingleValued() ) {
255 Real bnorm_x = bnorm(iv_hi,0) * dx[0];
256 Real bnorm_y = bnorm(iv_hi,1) * dx[1];
257 Real bnorm_z = bnorm(iv_hi,2) * dx[2];
259 Real norm = sqrt( bnorm_x*bnorm_x + bnorm_y*bnorm_y + bnorm_z*bnorm_z);
261 RealVect bnorm_isoparam ( bnorm_x / norm, bnorm_y / norm, bnorm_z / norm);
265 hi_normal = bnorm_isoparam;
272 RealBox hi_rbx(lo_arr.data(), hi_arr.data());
274 eb_cut_cell_ hi_eb_cc(flag(iv_hi), hi_rbx, hi_point, hi_normal);
278 AMREX_ASSERT( !flag(iv_hi).isCovered() || hi_eb_cc.isCovered() );
279 AMREX_ASSERT( !flag(iv_hi).isRegular() || hi_eb_cc.isRegular() );
282 #if defined(AMREX_DEBUG) || defined(AMREX_TESTING) || 1
292 eb_cut_cell_ hi_hi_eb_cc(flag(iv_hi), lo_rbx, hi_point, hi_normal);
296 #ifndef AMREX_USE_GPU
297 if ( !(!flag(iv_hi).isRegular() || hi_hi_eb_cc.isRegular()) ||
298 !(!flag(iv_hi).isCovered() || hi_hi_eb_cc.isCovered()) ) {
299 Print() <<
"flag(iv_hi) and hi_hi_eb_cc flags do not agree\n"
300 <<
"\n isRegular() " << flag(iv_hi).isRegular() <<
" " << hi_hi_eb_cc.isRegular()
301 <<
"\n isCovered() " << flag(iv_hi).isCovered() <<
" " << hi_hi_eb_cc.isCovered()
307 AMREX_ALWAYS_ASSERT( !flag(iv_hi).isRegular() || hi_hi_eb_cc.isRegular() );
308 AMREX_ALWAYS_ASSERT( !flag(iv_hi).isCovered() || hi_hi_eb_cc.isCovered() );
315 if ( flag(iv_hi).isSingleValued() ) {
317 Real
const adx = (idim == 0)
318 ? (hi_eb_cc.areaLo(0) - hi_hi_eb_cc.areaHi(0)) * dx[1] * dx[2]
319 : (hi_eb_cc.areaLo(0) + hi_hi_eb_cc.areaLo(0)) * dx[1] * dx[2]
320 - (hi_eb_cc.areaHi(0) + hi_hi_eb_cc.areaHi(0)) * dx[1] * dx[2];
322 Real
const ady = (idim == 1)
323 ? (hi_eb_cc.areaLo(1) - hi_hi_eb_cc.areaHi(1)) * dx[0] * dx[2]
324 : (hi_eb_cc.areaLo(1) + hi_hi_eb_cc.areaLo(1)) * dx[0] * dx[2]
325 - (hi_eb_cc.areaHi(1) + hi_hi_eb_cc.areaHi(1)) * dx[0] * dx[2];
327 Real
const adz = (idim == 2)
328 ? (hi_eb_cc.areaLo(2) - hi_hi_eb_cc.areaHi(2)) * dx[0] * dx[1]
329 : (hi_eb_cc.areaLo(2) + hi_hi_eb_cc.areaLo(2)) * dx[0] * dx[1]
330 - (hi_eb_cc.areaHi(2) + hi_hi_eb_cc.areaHi(2)) * dx[0] * dx[1];
332 Real
const apnorm = std::sqrt(adx*adx + ady*ady + adz*adz);
335 Real
const apnorminv = 1. / apnorm;
336 RealVect
const normal(adx*apnorminv, ady*apnorminv, adz*apnorminv);
337 Real
const dot_normals = normal.dotProduct(hi_normal);
339 #ifndef AMREX_USE_GPU
340 if ( !amrex::almostEqual(dot_normals, 1.0) ) {
341 Print() <<
"\nFail: check-1 dot_normals " << dot_normals
347 }
else if (verbose) {
348 Print() <<
"Pass: dot_normals = 1.0\n";
352 AMREX_ALWAYS_ASSERT( amrex::almostEqual(dot_normals, 1.0) );
357 #ifndef AMREX_USE_GPU
358 Real
const abs_err = std::abs( hi_eb_cc.areaHi(idim) - hi_hi_eb_cc.areaLo(idim) );
359 Real machine_tol = 10.0*std::numeric_limits<amrex::Real>::epsilon();
360 if ( abs_err >= machine_tol ) {
361 Print() <<
"\nFail: check-2 area abs_err: " << abs_err
362 <<
"\n hi_eb_cc.areaHi " << hi_eb_cc.areaHi(idim)
363 <<
"\n hi_hi_eb_cc.areaLo " << hi_hi_eb_cc.areaLo(idim)
365 }
else if (verbose) {
366 Print() <<
"Pass: hi_eb_cc.areaHi = hi_hi_eb_cc.areaLo"
367 <<
" abs_err: " << abs_err <<
"\n";
369 AMREX_ALWAYS_ASSERT( abs_err < machine_tol );
374 { Real
const abs_err = amrex::max(std::abs(lo_eb_cc.areaHi(idim) - afrac(iv_hi)),
375 std::abs(hi_eb_cc.areaLo(idim) - afrac(iv_hi)));
376 Real compare_tol = 5.0e-6;
377 #ifndef AMREX_USE_GPU
378 if ( abs_err >= compare_tol ) {
380 Print() <<
"\nFail: check-3 area abs_err " << abs_err
381 <<
"\n hi_eb_cc.areaLo(" << idim <<
") = " << hi_eb_cc.areaLo(idim)
382 <<
"\n lo_eb_cc.areaHi(" << idim <<
") = " << lo_eb_cc.areaHi(idim)
383 <<
"\n afrac" << iv_hi <<
" = " << afrac(iv_hi)
385 }
else if (verbose) {
386 Print() <<
"Pass: hi_eb_cc.areaLo = afrac = " << afrac(iv_hi)
387 <<
" abs_err: " << abs_err <<
"\n";
390 AMREX_ALWAYS_ASSERT( abs_err < compare_tol );
395 { Real
const vol = hi_eb_cc.volume() + hi_hi_eb_cc.volume();
396 Real
const abs_err = amrex::Math::abs(vfrac(iv_hi) - vol);
397 Real compare_tol = 5.0e-6;
398 #ifndef AMREX_USE_GPU
399 if ( abs_err >= compare_tol ) {
402 amrex::Print() <<
"\nFail: check-4 volume abs_err: " << abs_err
403 <<
"\n point: " << hi_point
404 <<
"\n normal: " << hi_normal
405 <<
"\n hi_eb_cc.volume() " << hi_eb_cc.volume()
406 <<
"\n hi_hi_eb_cc.volume() " << hi_hi_eb_cc.volume()
407 <<
"\n vfrac: " << vfrac(iv_hi)
409 }
else if (verbose) {
410 Print() <<
"Pass: hi_eb_cc + hi_hi_eb_cc = vfrac = " << vfrac(iv_hi)
411 <<
" abs_err: " << abs_err <<
"\n";
414 AMREX_ALWAYS_ASSERT( abs_err < compare_tol );
424 if (lo_eb_cc.isCovered() && hi_eb_cc.isCovered()) {
428 }
else if (lo_eb_cc.isRegular() && hi_eb_cc.isRegular()) {
430 aux_flag(i,j,k).setRegular();
431 aux_flag(i,j,k).setConnected(vdim);
433 aux_vfrac(i,j,k) = 1.0;
435 aux_afrac_x(i,j,k) = 1.0;
436 aux_afrac_y(i,j,k) = 1.0;
437 aux_afrac_z(i,j,k) = 1.0;
439 aux_fcent_x(i,j,k,0) = 0.0; aux_fcent_x(i,j,k,1) = 0.0;
440 aux_fcent_y(i,j,k,0) = 0.0; aux_fcent_y(i,j,k,1) = 0.0;
441 aux_fcent_z(i,j,k,0) = 0.0; aux_fcent_z(i,j,k,1) = 0.0;
443 if (i==bx.bigEnd(0)) {
444 aux_afrac_x(i+1,j,k) = 1.0;
445 aux_fcent_x(i+1,j,k,0) = 0.0; aux_fcent_x(i+1,j,k,1) = 0.0;
447 if (j==bx.bigEnd(1)) {
448 aux_afrac_y(i,j+1,k) = 1.0;
449 aux_fcent_y(i,j+1,k,0) = 0.0; aux_fcent_y(i,j+1,k,1) = 0.0;
451 if (k==bx.bigEnd(2)) {
452 aux_afrac_z(i,j,k+1) = 1.0;
453 aux_fcent_z(i,j,k+1,0) = 0.0; aux_fcent_z(i,j,k+1,1) = 0.0;
456 }
else if ( (lo_eb_cc.isRegular() && hi_eb_cc.isCovered())
457 || (lo_eb_cc.isCovered() && hi_eb_cc.isRegular()) ) {
460 #ifndef AMREX_USE_GPU
461 Print()<<
"eb_aux_ / Check: Regular and Covered cut cells are facing each other." << std::endl;
466 aux_flag(i,j,k).setSingleValued();
467 aux_flag(i,j,k).setConnected(vdim);
469 Real lo_vol {lo_eb_cc.volume()};
470 Real hi_vol {hi_eb_cc.volume()};
472 aux_vfrac(i,j,k) = lo_vol + hi_vol;
482 RealVect lo_vcent {lo_eb_cc.centVol()};
483 RealVect hi_vcent {hi_eb_cc.centVol()};
485 lo_vcent[idim] = lo_vcent[idim] - 0.5;
486 hi_vcent[idim] = hi_vcent[idim] + 0.5;
488 aux_vcent(i,j,k,0) = ( lo_vol * lo_vcent[0] + hi_vol * hi_vcent[0] ) / aux_vfrac(i,j,k);
489 aux_vcent(i,j,k,1) = ( lo_vol * lo_vcent[1] + hi_vol * hi_vcent[1] ) / aux_vfrac(i,j,k);
490 aux_vcent(i,j,k,2) = ( lo_vol * lo_vcent[2] + hi_vol * hi_vcent[2] ) / aux_vfrac(i,j,k);
492 Real lo_areaLo_x {lo_eb_cc.areaLo(0)};
493 Real lo_areaLo_y {lo_eb_cc.areaLo(1)};
494 Real lo_areaLo_z {lo_eb_cc.areaLo(2)};
496 Real hi_areaLo_x {hi_eb_cc.areaLo(0)};
497 Real hi_areaLo_y {hi_eb_cc.areaLo(1)};
498 Real hi_areaLo_z {hi_eb_cc.areaLo(2)};
500 aux_afrac_x(i,j,k) = (idim == 0) ? lo_areaLo_x : lo_areaLo_x + hi_areaLo_x;
501 aux_afrac_y(i,j,k) = (idim == 1) ? lo_areaLo_y : lo_areaLo_y + hi_areaLo_y;
502 aux_afrac_z(i,j,k) = (idim == 2) ? lo_areaLo_z : lo_areaLo_z + hi_areaLo_z;
512 RealVect lo_centLo_x {lo_eb_cc.centLo(0)};
513 RealVect lo_centLo_y {lo_eb_cc.centLo(1)};
514 RealVect lo_centLo_z {lo_eb_cc.centLo(2)};
516 RealVect hi_centLo_x {hi_eb_cc.centLo(0)};
517 RealVect hi_centLo_y {hi_eb_cc.centLo(1)};
518 RealVect hi_centLo_z {hi_eb_cc.centLo(2)};
521 aux_fcent_x(i,j,k,0) = lo_centLo_x[1];
522 aux_fcent_x(i,j,k,1) = lo_centLo_x[2];
523 aux_fcent_y(i,j,k,0) = (aux_afrac_y(i,j,k) > 0.0)
524 ? ( lo_areaLo_y * (lo_centLo_y[0] - 0.5)
525 + hi_areaLo_y * (hi_centLo_y[0] + 0.5) ) / aux_afrac_y(i,j,k)
527 aux_fcent_y(i,j,k,1) = (aux_afrac_y(i,j,k) > 0.0)
528 ? ( lo_areaLo_y * lo_centLo_y[2]
529 + hi_areaLo_y * hi_centLo_y[2] ) / aux_afrac_y(i,j,k)
531 aux_fcent_z(i,j,k,0) = (aux_afrac_z(i,j,k) > 0.0)
532 ? ( lo_areaLo_z * (lo_centLo_z[0] - 0.5)
533 + hi_areaLo_z * (hi_centLo_z[0] + 0.5) ) / aux_afrac_z(i,j,k)
535 aux_fcent_z(i,j,k,1) = (aux_afrac_z(i,j,k) > 0.0)
536 ? ( lo_areaLo_z * lo_centLo_z[1]
537 + hi_areaLo_z * hi_centLo_z[1] ) / aux_afrac_z(i,j,k)
539 }
else if (idim == 1) {
540 aux_fcent_x(i,j,k,0) = (aux_afrac_x(i,j,k) > 0.0)
541 ? ( lo_areaLo_x * (lo_centLo_x[1] - 0.5)
542 + hi_areaLo_x * (hi_centLo_x[1] + 0.5) ) / aux_afrac_x(i,j,k)
544 aux_fcent_x(i,j,k,1) = (aux_afrac_x(i,j,k) > 0.0)
545 ? ( lo_areaLo_x * lo_centLo_x[2]
546 + hi_areaLo_x * hi_centLo_x[2] ) / aux_afrac_x(i,j,k)
548 aux_fcent_y(i,j,k,0) = lo_centLo_y[0];
549 aux_fcent_y(i,j,k,1) = lo_centLo_y[2];
550 aux_fcent_z(i,j,k,0) = (aux_afrac_z(i,j,k) > 0.0)
551 ? ( lo_areaLo_z * lo_centLo_z[0]
552 + hi_areaLo_z * hi_centLo_z[0] ) / aux_afrac_z(i,j,k)
554 aux_fcent_z(i,j,k,1) = (aux_afrac_z(i,j,k) > 0.0)
555 ? ( lo_areaLo_z * (lo_centLo_z[1] - 0.5)
556 + hi_areaLo_z * (hi_centLo_z[1] + 0.5) ) / aux_afrac_z(i,j,k)
558 }
else if (idim == 2) {
559 aux_fcent_x(i,j,k,0) = (aux_afrac_x(i,j,k) > 0.0)
560 ? ( lo_areaLo_x * lo_centLo_x[1]
561 + hi_areaLo_x * hi_centLo_x[1] ) / aux_afrac_x(i,j,k)
563 aux_fcent_x(i,j,k,1) = (aux_afrac_x(i,j,k) > 0.0)
564 ? ( lo_areaLo_x * (lo_centLo_x[2] - 0.5)
565 + hi_areaLo_x * (hi_centLo_x[2] + 0.5) ) / aux_afrac_x(i,j,k)
567 aux_fcent_y(i,j,k,0) = (aux_afrac_y(i,j,k) > 0.0)
568 ? ( lo_areaLo_y * lo_centLo_y[0]
569 + hi_areaLo_y * hi_centLo_y[0] ) / aux_afrac_y(i,j,k)
571 aux_fcent_y(i,j,k,1) = (aux_afrac_y(i,j,k) > 0.0)
572 ? ( lo_areaLo_y * (lo_centLo_y[2] - 0.5)
573 + hi_areaLo_y * (hi_centLo_y[2] + 0.5) ) / aux_afrac_y(i,j,k)
575 aux_fcent_z(i,j,k,0) = lo_centLo_z[0];
576 aux_fcent_z(i,j,k,1) = lo_centLo_z[1];
581 Real lo_areaBoun {lo_eb_cc.areaBoun()};
582 Real hi_areaBoun {hi_eb_cc.areaBoun()};
584 aux_barea(i,j,k) = lo_areaBoun + hi_areaBoun;
586 RealVect lo_centBoun {lo_eb_cc.centBoun()};
587 RealVect hi_centBoun {hi_eb_cc.centBoun()};
590 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);
591 aux_bcent(i,j,k,1) = ( lo_areaBoun * lo_centBoun[1] + hi_areaBoun * hi_centBoun[1] ) / aux_barea(i,j,k);
592 aux_bcent(i,j,k,2) = ( lo_areaBoun * lo_centBoun[2] + hi_areaBoun * hi_centBoun[2] ) / aux_barea(i,j,k);
593 }
else if (idim == 1) {
594 aux_bcent(i,j,k,0) = ( lo_areaBoun * lo_centBoun[0] + hi_areaBoun * hi_centBoun[0] ) / aux_barea(i,j,k);
595 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);
596 aux_bcent(i,j,k,2) = ( lo_areaBoun * lo_centBoun[2] + hi_areaBoun * hi_centBoun[2] ) / aux_barea(i,j,k);
597 }
else if (idim == 2) {
598 aux_bcent(i,j,k,0) = ( lo_areaBoun * lo_centBoun[0] + hi_areaBoun * hi_centBoun[0] ) / aux_barea(i,j,k);
599 aux_bcent(i,j,k,1) = ( lo_areaBoun * lo_centBoun[1] + hi_areaBoun * hi_centBoun[1] ) / aux_barea(i,j,k);
600 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);
603 RealVect eb_normal = ( lo_areaBoun * lo_normal + hi_areaBoun * hi_normal )/ aux_barea(i,j,k);
605 aux_bnorm(i,j,k,0) = eb_normal[0];
606 aux_bnorm(i,j,k,1) = eb_normal[1];
607 aux_bnorm(i,j,k,2) = eb_normal[2];
amrex::MultiCutFab * m_bndrycent
Definition: ERF_EBAux.H:48
amrex::MultiCutFab * m_bndryarea
Definition: ERF_EBAux.H:47
amrex::FabArray< amrex::EBCellFlagFab > * m_cellflags
Definition: ERF_EBAux.H:42
amrex::MultiFab * m_volfrac
Definition: ERF_EBAux.H:44
amrex::MultiCutFab * m_bndrynorm
Definition: ERF_EBAux.H:49
amrex::Array< amrex::MultiCutFab *, AMREX_SPACEDIM > m_areafrac
Definition: ERF_EBAux.H:51
amrex::MultiCutFab * m_volcent
Definition: ERF_EBAux.H:46
amrex::Array< amrex::MultiCutFab *, AMREX_SPACEDIM > m_facecent
Definition: ERF_EBAux.H:52
Definition: ERF_EBCutCell.H:14