ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
eb_aux_ Class Reference

#include <ERF_EBAux.H>

Collaboration diagram for eb_aux_:

Public Member Functions

 eb_aux_ ()
 
 ~eb_aux_ ()
 
void define (int const &a_idim, amrex::Geometry const &a_geom, amrex::BoxArray const &a_grids, amrex::DistributionMapping const &a_dmap, amrex::Vector< int > const &a_ngrow, amrex::EBFArrayBoxFactory const *a_factory)
 
void set_verbose ()
 
const amrex::FabArray< amrex::EBCellFlagFab > & getMultiEBCellFlagFab () const
 
const amrex::MultiFab & getVolFrac () const
 
const amrex::MultiFab & getCentroid () const
 
const amrex::MultiFab & getBndryArea () const
 
const amrex::MultiFab & getBndryCent () const
 
const amrex::MultiFab & getBndryNorm () const
 
amrex::Array< const amrex::MultiFab *, AMREX_SPACEDIM > getAreaFrac () const
 
amrex::Array< const amrex::MultiFab *, AMREX_SPACEDIM > getFaceCent () const
 

Private Attributes

int m_verbose
 
amrex::FabArray< amrex::EBCellFlagFab > * m_cellflags = nullptr
 
amrex::MultiFab * m_volfrac = nullptr
 
amrex::MultiFab * m_volcent = nullptr
 
amrex::MultiFab * m_bndryarea = nullptr
 
amrex::MultiFab * m_bndrycent = nullptr
 
amrex::MultiFab * m_bndrynorm = nullptr
 
amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > m_areafrac {{AMREX_D_DECL(nullptr, nullptr, nullptr)}}
 
amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > m_facecent {{AMREX_D_DECL(nullptr, nullptr, nullptr)}}
 

Constructor & Destructor Documentation

◆ eb_aux_()

eb_aux_::eb_aux_ ( )
15  : m_verbose(0)
16 // ,m_defined(0)
17 {}
int m_verbose
Definition: ERF_EBAux.H:39

◆ ~eb_aux_()

eb_aux_::~eb_aux_ ( )
10 {
11 }

Member Function Documentation

◆ define()

void eb_aux_::define ( int const &  a_idim,
amrex::Geometry const &  a_geom,
amrex::BoxArray const &  a_grids,
amrex::DistributionMapping const &  a_dmap,
amrex::Vector< int > const &  a_ngrow,
amrex::EBFArrayBoxFactory const *  a_factory 
)
27 {
28  // Box dbox(a_geom.Domain());
29 
30  // small_volfrac
31  Real small_volfrac = 1.e-14;
32  ParmParse pp("eb2");
33  pp.queryAdd("small_volfrac", small_volfrac);
34  const Real small_value = 1.e-15;
35 
36  const IntVect vdim(IntVect::TheDimensionVector(a_idim));
37 
38  const BoxArray& grids = amrex::convert(a_grids, vdim);
39 
40  m_cellflags = new FabArray<EBCellFlagFab>(grids, a_dmap, 1, a_ngrow[0], MFInfo(),
41  DefaultFabFactory<EBCellFlagFab>());
42 
43  // Set m_cellflags type to singlevalued
44  m_cellflags->setVal(EBCellFlag::TheDefaultCell());
45  for (MFIter mfi(*m_cellflags, false); mfi.isValid(); ++mfi) {
46  auto& fab = (*m_cellflags)[mfi];
47  fab.setType(FabType::singlevalued);
48  }
49 
50  m_volfrac = new MultiFab(grids, a_dmap, 1, a_ngrow[1], MFInfo(), FArrayBoxFactory());
51  m_volcent = new MultiFab(grids, a_dmap, AMREX_SPACEDIM, a_ngrow[2], MFInfo(), FArrayBoxFactory());
52 
53  for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
54  const BoxArray& faceba = amrex::convert(a_grids, IntVect::TheDimensionVector(idim));
55  m_areafrac[idim] = new MultiFab(faceba, a_dmap, 1, a_ngrow[1], MFInfo(), FArrayBoxFactory());
56  m_facecent[idim] = new MultiFab(faceba, a_dmap, AMREX_SPACEDIM-1, a_ngrow[2], MFInfo(), FArrayBoxFactory());
57  }
58 
59  m_bndryarea = new MultiFab(grids, a_dmap, 1, a_ngrow[2], MFInfo(), FArrayBoxFactory());
60  m_bndrycent = new MultiFab(grids, a_dmap, AMREX_SPACEDIM, a_ngrow[2], MFInfo(), FArrayBoxFactory());
61  m_bndrynorm = new MultiFab(grids, a_dmap, AMREX_SPACEDIM, a_ngrow[2], MFInfo(), FArrayBoxFactory());
62 
63  // Initialize with zeros
64  m_volfrac->setVal(0.0);
65  m_volcent->setVal(0.0);
66  for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
67  m_areafrac[idim]->setVal(0.0);
68  m_facecent[idim]->setVal(0.0);
69  }
70  m_bndryarea->setVal(0.0);
71  m_bndrycent->setVal(0.0);
72  m_bndrynorm->setVal(0.0);
73 
74  const auto& FlagFab = a_factory->getMultiEBCellFlagFab(); // EBFArrayBoxFactory, EBDataCollection
75 
76  for (MFIter mfi(*m_cellflags, false); mfi.isValid(); ++mfi) {
77 
78  const Box& bx = mfi.validbox();
79  const Box& bx_grown = mfi.growntilebox();
80  const Box domain = surroundingNodes(a_geom.Domain(), a_idim);
81 
82  if (FlagFab[mfi].getType(bx) == FabType::singlevalued ) {
83 
84  GpuArray<Real, AMREX_SPACEDIM> dx = a_geom.CellSizeArray();
85 
86  Array4<EBCellFlag const> const& flag = FlagFab.const_array(mfi);
87 
88  // Array4<Real const> const& vfrac = (a_factory->getVolFrac()).const_array(mfi);
89  // Array4<Real const> const& ccent = (a_factory->getCentroid()).const_array(mfi);
90  // Array4<Real const> const& afrac = (a_factory->getAreaFrac()[a_idim])->const_array(mfi);
91 
92  // EB normal and face centroid
93  Array4<Real const> const& bnorm = a_factory->getBndryNormal()[mfi].const_array();
94  Array4<Real const> const& bcent = a_factory->getBndryCent()[mfi].const_array();
95 
96  // aux quantities
97  Array4<EBCellFlag> const& aux_flag = m_cellflags->array(mfi);
98  Array4<Real> const& aux_vfrac = m_volfrac->array(mfi);
99  Array4<Real> const& aux_vcent = m_volcent->array(mfi);
100 
101  Array4<Real> const& aux_afrac_x = m_areafrac[0]->array(mfi);
102  Array4<Real> const& aux_afrac_y = m_areafrac[1]->array(mfi);
103  Array4<Real> const& aux_afrac_z = m_areafrac[2]->array(mfi);
104 
105  Array4<Real> const& aux_fcent_x = m_facecent[0]->array(mfi);
106  Array4<Real> const& aux_fcent_y = m_facecent[1]->array(mfi);
107  Array4<Real> const& aux_fcent_z = m_facecent[2]->array(mfi);
108 
109  Array4<Real> const& aux_barea = m_bndryarea->array(mfi);
110  Array4<Real> const& aux_bcent = m_bndrycent->array(mfi);
111  Array4<Real> const& aux_bnorm = m_bndrynorm->array(mfi);
112 
113  bool l_periodic = a_geom.isPeriodic(a_idim);
114 
115  // Initialization
116  // This is an ad-hoc; ideally, eb_aux should be defined in bx_grown.
117 
118  // Extended domain in the direction of periodicity
119  Box dom_grown = domain;
120  for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
121  if (a_geom.isPeriodic(idim)) {
122  dom_grown.grow(idim, a_ngrow[0]);
123  }
124  }
125 
126  const IntVect dom_grown_lo = dom_grown.smallEnd();
127  const IntVect dom_grown_hi = dom_grown.bigEnd();
128 
129  BoxList diffList = boxDiff(bx_grown, bx);
130  for (const Box& b : diffList) {
131  ParallelFor(b, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
132  {
133  if ( i < dom_grown_lo[0] || i > dom_grown_hi[0] ||
134  j < dom_grown_lo[1] || j > dom_grown_hi[1] ||
135  k < dom_grown_lo[2] || k > dom_grown_hi[2] ) {
136  aux_flag(i,j,k).setCovered();
137  aux_flag(i,j,k).setDisconnected();
138  }
139  });
140  }
141 
142  ParallelFor(bx, [
143 #ifndef AMREX_USE_GPU
144  verbose=m_verbose,
145 #endif
146  dx, bx, domain, bnorm, bcent, flag,
147  aux_flag, aux_vfrac, aux_vcent,
148  aux_afrac_x, aux_afrac_y, aux_afrac_z,
149  aux_fcent_x, aux_fcent_y, aux_fcent_z,
150  aux_barea, aux_bcent, aux_bnorm,
151  vdim, idim=a_idim, l_periodic,
152  small_volfrac, small_value ]
153  AMREX_GPU_DEVICE (int i, int j, int k) noexcept
154  {
155 
156  // defaults to covered and disconnected.
157 
158  aux_flag(i,j,k).setCovered();
159  aux_flag(i,j,k).setDisconnected();
160 
161  aux_vfrac(i,j,k) = 0.0;
162  aux_vcent(i,j,k,0) = 0.0;
163  aux_vcent(i,j,k,1) = 0.0;
164  aux_vcent(i,j,k,2) = 0.0;
165 
166  aux_afrac_x(i,j,k) = 0.0;
167  aux_afrac_y(i,j,k) = 0.0;
168  aux_afrac_z(i,j,k) = 0.0;
169 
170  aux_fcent_x(i,j,k,0) = 0.0; aux_fcent_x(i,j,k,1) = 0.0;
171  aux_fcent_y(i,j,k,0) = 0.0; aux_fcent_y(i,j,k,1) = 0.0;
172  aux_fcent_z(i,j,k,0) = 0.0; aux_fcent_z(i,j,k,1) = 0.0;
173 
174  if (i==bx.bigEnd(0)) {
175  aux_afrac_x(i+1,j,k) = 0.0;
176  aux_fcent_x(i+1,j,k,0) = 0.0;
177  aux_fcent_x(i+1,j,k,1) = 0.0;
178  }
179  if (j==bx.bigEnd(1)) {
180  aux_afrac_y(i,j+1,k) = 0.0;
181  aux_fcent_y(i,j+1,k,0) = 0.0;
182  aux_fcent_y(i,j+1,k,1) = 0.0;
183  }
184  if (k==bx.bigEnd(2)) {
185  aux_afrac_z(i,j,k+1) = 0.0;
186  aux_fcent_z(i,j,k+1,0) = 0.0;
187  aux_fcent_z(i,j,k+1,1) = 0.0;
188  }
189 
190  aux_barea(i,j,k) = 0.0;
191 
192  aux_bcent(i,j,k,0) = 0.0;
193  aux_bcent(i,j,k,1) = 0.0;
194  aux_bcent(i,j,k,2) = 0.0;
195 
196  aux_bnorm(i,j,k,0) = 0.0;
197  aux_bnorm(i,j,k,1) = 0.0;
198  aux_bnorm(i,j,k,2) = 0.0;
199 
200  // Index for low and hi cells
201  IntVect iv_hi(i,j,k);
202  IntVect iv_lo(iv_hi - vdim);
203  if (!l_periodic && iv_hi[idim]==domain.bigEnd(idim)){
204  iv_hi = iv_lo; // At the upper boundary, hi cell takes the values of the low cell.
205  }
206  if (!l_periodic && iv_hi[idim]==domain.smallEnd(idim)){
207  iv_lo = iv_hi; // At the lower boundary, low cell takes the values of the high cell.
208  }
209 
210  if ( flag(iv_lo).isCovered() && flag(iv_hi).isCovered()) {
211 
212  // defaults to covered and disconnected.
213 
214  } else if ( flag(iv_lo).isRegular() && flag(iv_hi).isRegular()) {
215 
216  aux_flag(i,j,k).setRegular();
217  aux_flag(i,j,k).setConnected();
218 
219  aux_vfrac(i,j,k) = 1.0;
220 
221  aux_afrac_x(i,j,k) = 1.0;
222  aux_afrac_y(i,j,k) = 1.0;
223  aux_afrac_z(i,j,k) = 1.0;
224 
225  aux_fcent_x(i,j,k,0) = 0.0; aux_fcent_x(i,j,k,1) = 0.0;
226  aux_fcent_y(i,j,k,0) = 0.0; aux_fcent_y(i,j,k,1) = 0.0;
227  aux_fcent_z(i,j,k,0) = 0.0; aux_fcent_z(i,j,k,1) = 0.0;
228 
229  if (i==bx.bigEnd(0)) {
230  aux_afrac_x(i+1,j,k) = 1.0;
231  aux_fcent_x(i+1,j,k,0) = 0.0;
232  aux_fcent_x(i+1,j,k,1) = 0.0;
233  }
234  if (j==bx.bigEnd(1)) {
235  aux_afrac_y(i,j+1,k) = 1.0;
236  aux_fcent_y(i,j+1,k,0) = 0.0;
237  aux_fcent_y(i,j+1,k,1) = 0.0;
238  }
239  if (k==bx.bigEnd(2)) {
240  aux_afrac_z(i,j,k+1) = 1.0;
241  aux_fcent_z(i,j,k+1,0) = 0.0;
242  aux_fcent_z(i,j,k+1,1) = 0.0;
243  }
244 
245  } else {
246 
247 #ifndef AMREX_USE_GPU
248  if (verbose) { Print() << "\ncell: " << amrex::IntVect(i,j,k) << "\n"; }
249 #endif
250  Array<Real,AMREX_SPACEDIM> lo_arr = {-0.5,-0.5,-0.5};
251  Array<Real,AMREX_SPACEDIM> hi_arr = { 0.5, 0.5, 0.5};
252 
253  //-----------------------
254  // Low EB cut cell
255  //-----------------------
256 
257  // Map bcent and bnorm to the isoparametric space for anisotropic grids.
258  // (This step is needed because bcent in AMReX is isotropically normalized.)
259 
260  RealVect lo_point (bcent(iv_lo,0), bcent(iv_lo,1), bcent(iv_lo,2));
261  RealVect lo_normal(bnorm(iv_lo,0), bnorm(iv_lo,1), bnorm(iv_lo,2));
262 
263  if (!l_periodic && iv_hi[idim]==domain.smallEnd(idim)){
264  lo_point[idim] += 1.0; // Move the boundary centroid upward in the idim direction.
265  }
266 
267  if (flag(iv_lo).isSingleValued() ) {
268 
269  Real bnorm_x = bnorm(iv_lo,0) * dx[0];
270  Real bnorm_y = bnorm(iv_lo,1) * dx[1];
271  Real bnorm_z = bnorm(iv_lo,2) * dx[2];
272 
273  Real norm = sqrt( bnorm_x*bnorm_x + bnorm_y*bnorm_y + bnorm_z*bnorm_z);
274 
275  RealVect bnorm_isoparam ( bnorm_x / norm, bnorm_y / norm, bnorm_z / norm);
276 
277  // plane point and normal
278  // lo_point = bcent_isoparam;
279  lo_normal = bnorm_isoparam;
280 
281  }
282 
283  // High side of low cell
284  lo_arr[idim] = 0.0;
285  hi_arr[idim] = 0.5;
286  RealBox lo_rbx(lo_arr.data(), hi_arr.data());
287 
288  eb_cut_cell_ lo_eb_cc(flag(iv_lo), lo_rbx, lo_point, lo_normal);
289 
290  // cell iv_lo covered (regular) imples lo_eb_cc is covered (regular)
291  // The inverse is not always true.
292  AMREX_ASSERT( !flag(iv_lo).isCovered() || lo_eb_cc.isCovered() );
293  AMREX_ASSERT( !flag(iv_lo).isRegular() || lo_eb_cc.isRegular() );
294 
295  //-----------------------
296  // High EB cut cell
297  //-----------------------
298 
299  RealVect hi_point (bcent(iv_hi,0), bcent(iv_hi,1), bcent(iv_hi,2));
300  RealVect hi_normal(bnorm(iv_hi,0), bnorm(iv_hi,1), bnorm(iv_hi,2));
301 
302  if (!l_periodic && iv_hi[idim]==domain.bigEnd(idim)){
303  lo_point[idim] += -1.0; // Move the boundary centroid downward in the idim direction.
304  }
305 
306  if (flag(iv_hi).isSingleValued() ) {
307 
308  Real bnorm_x = bnorm(iv_hi,0) * dx[0];
309  Real bnorm_y = bnorm(iv_hi,1) * dx[1];
310  Real bnorm_z = bnorm(iv_hi,2) * dx[2];
311 
312  Real norm = sqrt( bnorm_x*bnorm_x + bnorm_y*bnorm_y + bnorm_z*bnorm_z);
313 
314  RealVect bnorm_isoparam ( bnorm_x / norm, bnorm_y / norm, bnorm_z / norm);
315 
316  // plane point and normal
317  // hi_point = bcent_isoparam;
318  hi_normal = bnorm_isoparam;
319 
320  }
321 
322  // Low side of high cell
323  lo_arr[idim] = -0.5;
324  hi_arr[idim] = 0.0;
325  RealBox hi_rbx(lo_arr.data(), hi_arr.data());
326 
327  eb_cut_cell_ hi_eb_cc(flag(iv_hi), hi_rbx, hi_point, hi_normal);
328 
329  // cell iv_hi covered (regular) imples hi_eb_cc is covered (regular)
330  // The inverse is not always true.
331  AMREX_ASSERT( !flag(iv_hi).isCovered() || hi_eb_cc.isCovered() );
332  AMREX_ASSERT( !flag(iv_hi).isRegular() || hi_eb_cc.isRegular() );
333 
334 #if 0
335 #if defined(AMREX_DEBUG) || defined(AMREX_TESTING) || 1
336 
337  { /***************************** SANITY CHECK ***********************\
338  * Perform some basic sanity checks to verify that what we computed *
339  * for cell (i,j,k) compares to what we know to be true. *
340  \******************************************************************/
341 
342  // Compute the cut-cell for the high side of the high cell. This is
343  // only needed for sanity checks.
344 
345  eb_cut_cell_ hi_hi_eb_cc(flag(iv_hi), lo_rbx, hi_point, hi_normal);
346 
347  // cell iv_hi covered (regular) imples hi_hi_eb_cc is covered (regular)
348  // The inverse is not always true.
349 #ifndef AMREX_USE_GPU
350  if ( !(!flag(iv_hi).isRegular() || hi_hi_eb_cc.isRegular()) ||
351  !(!flag(iv_hi).isCovered() || hi_hi_eb_cc.isCovered()) ) {
352  Print() << "flag(iv_hi) and hi_hi_eb_cc flags do not agree\n"
353  << "\n isRegular() " << flag(iv_hi).isRegular() << " " << hi_hi_eb_cc.isRegular()
354  << "\n isCovered() " << flag(iv_hi).isCovered() << " " << hi_hi_eb_cc.isCovered()
355  << "\n";
356  }
357 #endif
358  // If cell iv_hi is regular or covered, then hi_hi_eb_cc must also
359  // be regular or covered. The inverse is not true.
360  AMREX_ALWAYS_ASSERT( !flag(iv_hi).isRegular() || hi_hi_eb_cc.isRegular() );
361  AMREX_ALWAYS_ASSERT( !flag(iv_hi).isCovered() || hi_hi_eb_cc.isCovered() );
362 
363  // The area and volume fractions that are computed for the scalar grid
364  // are slightly different than those we compute from the geometric
365  // reconstruction using the EB point and normal. However, we expect
366  // that the area fractions computed here will give back the same
367  // normal we used to compute them.
368  if ( flag(iv_hi).isSingleValued() ) {
369 
370  Real const adx = (idim == 0)
371  ? (hi_eb_cc.areaLo(0) - hi_hi_eb_cc.areaHi(0)) * dx[1] * dx[2]
372  : (hi_eb_cc.areaLo(0) + hi_hi_eb_cc.areaLo(0)) * dx[1] * dx[2]
373  - (hi_eb_cc.areaHi(0) + hi_hi_eb_cc.areaHi(0)) * dx[1] * dx[2];
374 
375  Real const ady = (idim == 1)
376  ? (hi_eb_cc.areaLo(1) - hi_hi_eb_cc.areaHi(1)) * dx[0] * dx[2]
377  : (hi_eb_cc.areaLo(1) + hi_hi_eb_cc.areaLo(1)) * dx[0] * dx[2]
378  - (hi_eb_cc.areaHi(1) + hi_hi_eb_cc.areaHi(1)) * dx[0] * dx[2];
379 
380  Real const adz = (idim == 2)
381  ? (hi_eb_cc.areaLo(2) - hi_hi_eb_cc.areaHi(2)) * dx[0] * dx[1]
382  : (hi_eb_cc.areaLo(2) + hi_hi_eb_cc.areaLo(2)) * dx[0] * dx[1]
383  - (hi_eb_cc.areaHi(2) + hi_hi_eb_cc.areaHi(2)) * dx[0] * dx[1];
384 
385  Real const apnorm = std::sqrt(adx*adx + ady*ady + adz*adz);
386 
387  // EB normal
388  Real const apnorminv = 1. / apnorm;
389  RealVect const normal(adx*apnorminv, ady*apnorminv, adz*apnorminv);
390  Real const dot_normals = normal.dotProduct(hi_normal);
391 
392 #ifndef AMREX_USE_GPU
393  if ( !amrex::almostEqual(dot_normals, 1.0) ) {
394  Print() << "\nFail: check-1 dot_normals " << dot_normals
395  << '\n';
396 
397  hi_eb_cc.debug();
398  hi_hi_eb_cc.debug();
399 
400  } else if (verbose) {
401  Print() << "Pass: dot_normals = 1.0\n";
402 
403  }
404 #endif
405  AMREX_ALWAYS_ASSERT( amrex::almostEqual(dot_normals, 1.0) );
406  }
407 
408  // The idim area of hi_eb_cc.areaHi() should equal hi_hi_eb_cc.areaLo()
409  {
410 #ifndef AMREX_USE_GPU
411  Real const abs_err = std::abs( hi_eb_cc.areaHi(idim) - hi_hi_eb_cc.areaLo(idim) );
412  Real machine_tol = 10.0*std::numeric_limits<amrex::Real>::epsilon();
413  if ( abs_err >= machine_tol ) {
414  Print() << "\nFail: check-2 area abs_err: " << abs_err
415  << "\n hi_eb_cc.areaHi " << hi_eb_cc.areaHi(idim)
416  << "\n hi_hi_eb_cc.areaLo " << hi_hi_eb_cc.areaLo(idim)
417  << '\n';
418  } else if (verbose) {
419  Print() << "Pass: hi_eb_cc.areaHi = hi_hi_eb_cc.areaLo"
420  << " abs_err: " << abs_err << "\n";
421  }
422  AMREX_ALWAYS_ASSERT( abs_err < machine_tol );
423 #endif
424  }
425 
426  // The low-side area of hi_eb_cc should equal idim afrac.
427  { Real const abs_err = amrex::max(std::abs(lo_eb_cc.areaHi(idim) - afrac(iv_hi)),
428  std::abs(hi_eb_cc.areaLo(idim) - afrac(iv_hi)));
429  Real compare_tol = 5.0e-6;
430 #ifndef AMREX_USE_GPU
431  if ( abs_err >= compare_tol ) {
432  //hi_eb_cc.debug();
433  Print() << "\nFail: check-3 area abs_err " << abs_err
434  << "\n hi_eb_cc.areaLo(" << idim << ") = " << hi_eb_cc.areaLo(idim)
435  << "\n lo_eb_cc.areaHi(" << idim << ") = " << lo_eb_cc.areaHi(idim)
436  << "\n afrac" << iv_hi << " = " << afrac(iv_hi)
437  << '\n';
438  } else if (verbose) {
439  Print() << "Pass: hi_eb_cc.areaLo = afrac = " << afrac(iv_hi)
440  << " abs_err: " << abs_err << "\n";
441  }
442 #endif
443  AMREX_ALWAYS_ASSERT( abs_err < compare_tol );
444  }
445 
446  // The combined volumes of hi_eb_cc.areaHi() and hi_hi_eb_cc should
447  // equal vfrac(iv_hi).
448  { Real const vol = hi_eb_cc.volume() + hi_hi_eb_cc.volume();
449  Real const abs_err = amrex::Math::abs(vfrac(iv_hi) - vol);
450  Real compare_tol = 5.0e-6;
451 #ifndef AMREX_USE_GPU
452  if ( abs_err >= compare_tol ) {
453  hi_eb_cc.debug();
454  hi_hi_eb_cc.debug();
455  amrex::Print() << "\nFail: check-4 volume abs_err: " << abs_err
456  << "\n point: " << hi_point
457  << "\n normal: " << hi_normal
458  << "\n hi_eb_cc.volume() " << hi_eb_cc.volume()
459  << "\n hi_hi_eb_cc.volume() " << hi_hi_eb_cc.volume()
460  << "\n vfrac: " << vfrac(iv_hi)
461  << '\n';
462  } else if (verbose) {
463  Print() << "Pass: hi_eb_cc + hi_hi_eb_cc = vfrac = " << vfrac(iv_hi)
464  << " abs_err: " << abs_err << "\n";
465  }
466 #endif
467  AMREX_ALWAYS_ASSERT( abs_err < compare_tol );
468  }
469  } //
470 #endif
471 #endif // 0
472 
473  //-----------------------
474  // Fill out aux_ arrays
475  //-----------------------
476 
477  if (lo_eb_cc.isCovered() && hi_eb_cc.isCovered()) {
478 
479  // defaults to covered and disconnected.
480 
481  } else if (lo_eb_cc.isRegular() && hi_eb_cc.isRegular()) {
482 
483  aux_flag(i,j,k).setRegular();
484  aux_flag(i,j,k).setConnected();
485 
486  aux_vfrac(i,j,k) = 1.0;
487 
488  aux_afrac_x(i,j,k) = 1.0;
489  aux_afrac_y(i,j,k) = 1.0;
490  aux_afrac_z(i,j,k) = 1.0;
491 
492  aux_fcent_x(i,j,k,0) = 0.0; aux_fcent_x(i,j,k,1) = 0.0;
493  aux_fcent_y(i,j,k,0) = 0.0; aux_fcent_y(i,j,k,1) = 0.0;
494  aux_fcent_z(i,j,k,0) = 0.0; aux_fcent_z(i,j,k,1) = 0.0;
495 
496  if (i==bx.bigEnd(0)) {
497  aux_afrac_x(i+1,j,k) = 1.0;
498  aux_fcent_x(i+1,j,k,0) = 0.0; aux_fcent_x(i+1,j,k,1) = 0.0;
499  }
500  if (j==bx.bigEnd(1)) {
501  aux_afrac_y(i,j+1,k) = 1.0;
502  aux_fcent_y(i,j+1,k,0) = 0.0; aux_fcent_y(i,j+1,k,1) = 0.0;
503  }
504  if (k==bx.bigEnd(2)) {
505  aux_afrac_z(i,j,k+1) = 1.0;
506  aux_fcent_z(i,j,k+1,0) = 0.0; aux_fcent_z(i,j,k+1,1) = 0.0;
507  }
508 
509  } else if ( (lo_eb_cc.isRegular() && hi_eb_cc.isCovered())
510  || (lo_eb_cc.isCovered() && hi_eb_cc.isRegular()) ) {
511 
512  // This is a problematic situation.
513 #ifndef AMREX_USE_GPU
514  Print()<< "eb_aux_ / Check: Regular and Covered cut cells are facing each other." << std::endl;
515 #endif
516 
517  } else {
518 
519  // 0. Cell Flag
520 
521  aux_flag(i,j,k).setSingleValued();
522 
523  // 1. Volume Fraction
524 
525  Real lo_vol {lo_eb_cc.volume()};
526  Real hi_vol {hi_eb_cc.volume()};
527 
528  aux_vfrac(i,j,k) = lo_vol + hi_vol;
529 
530  // 2. Volume Centroid
531 
532  /* centVol() returns the coordinates based on m_rbx.
533  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.
534  Therefore, they need to be mapped to the eb_aux space, by shifting:
535  x' = x - 0.5 (low cell), x + 0.5 (hi cell) if idim = 0
536  y' = y - 0.5 (low cell), y + 0.5 (hi cell) if idim = 1
537  z' = z - 0.5 (low cell), z + 0.5 (hi cell) if idim = 2
538  */
539 
540  RealVect lo_vcent {lo_eb_cc.centVol()};
541  RealVect hi_vcent {hi_eb_cc.centVol()};
542 
543  lo_vcent[idim] = lo_vcent[idim] - 0.5;
544  hi_vcent[idim] = hi_vcent[idim] + 0.5;
545 
546  aux_vcent(i,j,k,0) = ( lo_vol * lo_vcent[0] + hi_vol * hi_vcent[0] ) / aux_vfrac(i,j,k);
547  aux_vcent(i,j,k,1) = ( lo_vol * lo_vcent[1] + hi_vol * hi_vcent[1] ) / aux_vfrac(i,j,k);
548  aux_vcent(i,j,k,2) = ( lo_vol * lo_vcent[2] + hi_vol * hi_vcent[2] ) / aux_vfrac(i,j,k);
549 
550  // 3. Area Fraction
551 
552  Real lo_areaLo_x {lo_eb_cc.areaLo(0)};
553  Real lo_areaLo_y {lo_eb_cc.areaLo(1)};
554  Real lo_areaLo_z {lo_eb_cc.areaLo(2)};
555 
556  Real hi_areaLo_x {hi_eb_cc.areaLo(0)};
557  Real hi_areaLo_y {hi_eb_cc.areaLo(1)};
558  Real hi_areaLo_z {hi_eb_cc.areaLo(2)};
559 
560  aux_afrac_x(i,j,k) = (idim == 0) ? lo_areaLo_x : lo_areaLo_x + hi_areaLo_x;
561  aux_afrac_y(i,j,k) = (idim == 1) ? lo_areaLo_y : lo_areaLo_y + hi_areaLo_y;
562  aux_afrac_z(i,j,k) = (idim == 2) ? lo_areaLo_z : lo_areaLo_z + hi_areaLo_z;
563 
564  if (i==bx.bigEnd(0)) {
565  Real lo_areaHi_x {lo_eb_cc.areaHi(0)};
566  Real hi_areaHi_x {hi_eb_cc.areaHi(0)};
567  aux_afrac_x(i+1,j,k) = (idim == 0) ? hi_areaHi_x : lo_areaHi_x + hi_areaHi_x;
568  }
569  if (j==bx.bigEnd(1)) {
570  Real lo_areaHi_y {lo_eb_cc.areaHi(1)};
571  Real hi_areaHi_y {hi_eb_cc.areaHi(1)};
572  aux_afrac_y(i,j+1,k) = (idim == 1) ? hi_areaHi_y : lo_areaHi_y + hi_areaHi_y;
573  }
574  if (k==bx.bigEnd(2)) {
575  Real lo_areaHi_z {lo_eb_cc.areaHi(2)};
576  Real hi_areaHi_z {hi_eb_cc.areaHi(2)};
577  aux_afrac_z(i,j,k+1) = (idim == 2) ? hi_areaHi_z : lo_areaHi_z + hi_areaHi_z;
578  }
579 
580  // 4. Face Centroid
581 
582  /* fcentLo returns the coordinates based on m_rbx.
583  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.
584  Therefore, they need to be mapped to the eb_aux space, by shifting:
585  x' = x - 0.5 (low cell), x + 0.5 (hi cell) if idim = 0
586  y' = y - 0.5 (low cell), y + 0.5 (hi cell) if idim = 1
587  z' = z - 0.5 (low cell), z + 0.5 (hi cell) if idim = 2
588  */
589 
590  RealVect lo_centLo_x {lo_eb_cc.centLo(0)};
591  RealVect lo_centLo_y {lo_eb_cc.centLo(1)};
592  RealVect lo_centLo_z {lo_eb_cc.centLo(2)};
593 
594  RealVect hi_centLo_x {hi_eb_cc.centLo(0)};
595  RealVect hi_centLo_y {hi_eb_cc.centLo(1)};
596  RealVect hi_centLo_z {hi_eb_cc.centLo(2)};
597 
598  if (idim == 0) {
599  aux_fcent_x(i,j,k,0) = lo_centLo_x[1]; // y
600  aux_fcent_x(i,j,k,1) = lo_centLo_x[2]; // z
601  aux_fcent_y(i,j,k,0) = (aux_afrac_y(i,j,k) > 0.0) // x (mapped)
602  ? ( lo_areaLo_y * (lo_centLo_y[0] - 0.5)
603  + hi_areaLo_y * (hi_centLo_y[0] + 0.5) ) / aux_afrac_y(i,j,k)
604  : 0.0;
605  aux_fcent_y(i,j,k,1) = (aux_afrac_y(i,j,k) > 0.0) // z
606  ? ( lo_areaLo_y * lo_centLo_y[2]
607  + hi_areaLo_y * hi_centLo_y[2] ) / aux_afrac_y(i,j,k)
608  : 0.0;
609  aux_fcent_z(i,j,k,0) = (aux_afrac_z(i,j,k) > 0.0) // x (mapped)
610  ? ( lo_areaLo_z * (lo_centLo_z[0] - 0.5)
611  + hi_areaLo_z * (hi_centLo_z[0] + 0.5) ) / aux_afrac_z(i,j,k)
612  : 0.0;
613  aux_fcent_z(i,j,k,1) = (aux_afrac_z(i,j,k) > 0.0) // y
614  ? ( lo_areaLo_z * lo_centLo_z[1]
615  + hi_areaLo_z * hi_centLo_z[1] ) / aux_afrac_z(i,j,k)
616  : 0.0;
617  } else if (idim == 1) {
618  aux_fcent_x(i,j,k,0) = (aux_afrac_x(i,j,k) > 0.0) // y (mapped)
619  ? ( lo_areaLo_x * (lo_centLo_x[1] - 0.5)
620  + hi_areaLo_x * (hi_centLo_x[1] + 0.5) ) / aux_afrac_x(i,j,k)
621  : 0.0;
622  aux_fcent_x(i,j,k,1) = (aux_afrac_x(i,j,k) > 0.0) // z
623  ? ( lo_areaLo_x * lo_centLo_x[2]
624  + hi_areaLo_x * hi_centLo_x[2] ) / aux_afrac_x(i,j,k)
625  : 0.0;
626  aux_fcent_y(i,j,k,0) = lo_centLo_y[0]; // x
627  aux_fcent_y(i,j,k,1) = lo_centLo_y[2]; // z
628  aux_fcent_z(i,j,k,0) = (aux_afrac_z(i,j,k) > 0.0) // x
629  ? ( lo_areaLo_z * lo_centLo_z[0]
630  + hi_areaLo_z * hi_centLo_z[0] ) / aux_afrac_z(i,j,k)
631  : 0.0;
632  aux_fcent_z(i,j,k,1) = (aux_afrac_z(i,j,k) > 0.0) // y (mapped)
633  ? ( lo_areaLo_z * (lo_centLo_z[1] - 0.5)
634  + hi_areaLo_z * (hi_centLo_z[1] + 0.5) ) / aux_afrac_z(i,j,k)
635  : 0.0;
636  } else if (idim == 2) {
637  aux_fcent_x(i,j,k,0) = (aux_afrac_x(i,j,k) > 0.0) // y
638  ? ( lo_areaLo_x * lo_centLo_x[1]
639  + hi_areaLo_x * hi_centLo_x[1] ) / aux_afrac_x(i,j,k)
640  : 0.0;
641  aux_fcent_x(i,j,k,1) = (aux_afrac_x(i,j,k) > 0.0) // z (mapped)
642  ? ( lo_areaLo_x * (lo_centLo_x[2] - 0.5)
643  + hi_areaLo_x * (hi_centLo_x[2] + 0.5) ) / aux_afrac_x(i,j,k)
644  : 0.0;
645  aux_fcent_y(i,j,k,0) = (aux_afrac_y(i,j,k) > 0.0) // x
646  ? ( lo_areaLo_y * lo_centLo_y[0]
647  + hi_areaLo_y * hi_centLo_y[0] ) / aux_afrac_y(i,j,k)
648  : 0.0;
649  aux_fcent_y(i,j,k,1) = (aux_afrac_y(i,j,k) > 0.0) // z (mapped)
650  ? ( lo_areaLo_y * (lo_centLo_y[2] - 0.5)
651  + hi_areaLo_y * (hi_centLo_y[2] + 0.5) ) / aux_afrac_y(i,j,k)
652  : 0.0;
653  aux_fcent_z(i,j,k,0) = lo_centLo_z[0]; // x
654  aux_fcent_z(i,j,k,1) = lo_centLo_z[1]; // y
655  }
656 
657  if (i==bx.bigEnd(0)) {
658  Real lo_areaHi_x {lo_eb_cc.areaHi(0)};
659  Real hi_areaHi_x {hi_eb_cc.areaHi(0)};
660  RealVect lo_centHi_x {lo_eb_cc.centHi(0)};
661  RealVect hi_centHi_x {hi_eb_cc.centHi(0)};
662  if (idim == 0) {
663  aux_fcent_x(i+1,j,k,0) = hi_centHi_x[1]; // y
664  aux_fcent_x(i+1,j,k,1) = hi_centHi_x[2]; // z
665  } else if (idim == 1) {
666  aux_fcent_x(i+1,j,k,0) = (aux_afrac_x(i+1,j,k) > 0.0) // y (mapped)
667  ? ( lo_areaHi_x * (lo_centHi_x[1] - 0.5)
668  + hi_areaHi_x * (hi_centHi_x[1] + 0.5) ) / aux_afrac_x(i+1,j,k)
669  : 0.0;
670  aux_fcent_x(i+1,j,k,1) = (aux_afrac_x(i+1,j,k) > 0.0) // z
671  ? ( lo_areaHi_x * lo_centHi_x[2]
672  + hi_areaHi_x * hi_centHi_x[2] ) / aux_afrac_x(i+1,j,k)
673  : 0.0;
674  } else if (idim == 2) {
675  aux_fcent_x(i+1,j,k,0) = (aux_afrac_x(i+1,j,k) > 0.0) // y
676  ? ( lo_areaHi_x * lo_centHi_x[1]
677  + hi_areaHi_x * hi_centHi_x[1] ) / aux_afrac_x(i+1,j,k)
678  : 0.0;
679  aux_fcent_x(i+1,j,k,1) = (aux_afrac_x(i+1,j,k) > 0.0) // z (mapped)
680  ? ( lo_areaHi_x * (lo_centHi_x[2] - 0.5)
681  + hi_areaHi_x * (hi_centHi_x[2] + 0.5) ) / aux_afrac_x(i+1,j,k)
682  : 0.0;
683  }
684  }
685  if (j==bx.bigEnd(1)) {
686  Real lo_areaHi_y {lo_eb_cc.areaHi(1)};
687  Real hi_areaHi_y {hi_eb_cc.areaHi(1)};
688  RealVect lo_centHi_y {lo_eb_cc.centHi(1)};
689  RealVect hi_centHi_y {hi_eb_cc.centHi(1)};
690  if (idim == 0) {
691  aux_fcent_y(i,j+1,k,0) = (aux_afrac_y(i,j+1,k) > 0.0) // x (mapped)
692  ? ( lo_areaHi_y * (lo_centHi_y[0] - 0.5)
693  + hi_areaHi_y * (hi_centHi_y[0] + 0.5) ) / aux_afrac_y(i,j+1,k)
694  : 0.0;
695  aux_fcent_y(i,j+1,k,1) = (aux_afrac_y(i,j+1,k) > 0.0) // z
696  ? ( lo_areaHi_y * lo_centHi_y[2]
697  + hi_areaHi_y * hi_centHi_y[2] ) / aux_afrac_y(i,j+1,k)
698  : 0.0;
699  } else if (idim == 1) {
700  aux_fcent_y(i,j+1,k,0) = lo_centHi_y[0]; // x
701  aux_fcent_y(i,j+1,k,1) = lo_centHi_y[2]; // z
702  } else if (idim == 2) {
703  aux_fcent_y(i,j+1,k,0) = (aux_afrac_y(i,j+1,k) > 0.0) // x
704  ? ( lo_areaHi_y * lo_centHi_y[0]
705  + hi_areaHi_y * hi_centHi_y[0] ) / aux_afrac_y(i,j+1,k)
706  : 0.0;
707  aux_fcent_y(i,j+1,k,1) = (aux_afrac_y(i,j+1,k) > 0.0) // z (mapped)
708  ? ( lo_areaHi_y * (lo_centHi_y[2] - 0.5)
709  + hi_areaHi_y * (hi_centHi_y[2] + 0.5) ) / aux_afrac_y(i,j+1,k)
710  : 0.0;
711  }
712  }
713  if (k==bx.bigEnd(2)) {
714  Real lo_areaHi_z {lo_eb_cc.areaHi(2)};
715  Real hi_areaHi_z {hi_eb_cc.areaHi(2)};
716  RealVect lo_centHi_z {lo_eb_cc.centHi(2)};
717  RealVect hi_centHi_z {hi_eb_cc.centHi(2)};
718  if (idim == 0) {
719  aux_fcent_z(i,j,k+1,0) = (aux_afrac_z(i,j,k+1) > 0.0) // x (mapped)
720  ? ( lo_areaHi_z * (lo_centHi_z[0] - 0.5)
721  + hi_areaHi_z * (hi_centHi_z[0] + 0.5) ) / aux_afrac_z(i,j,k+1)
722  : 0.0;
723  aux_fcent_z(i,j,k+1,1) = (aux_afrac_z(i,j,k+1) > 0.0) // y
724  ? ( lo_areaHi_z * lo_centHi_z[1]
725  + hi_areaHi_z * hi_centHi_z[1] ) / aux_afrac_z(i,j,k+1)
726  : 0.0;
727  } else if (idim == 1) {
728  aux_fcent_z(i,j,k+1,0) = (aux_afrac_z(i,j,k+1) > 0.0) // x
729  ? ( lo_areaHi_z * lo_centHi_z[0]
730  + hi_areaHi_z * hi_centHi_z[0] ) / aux_afrac_z(i,j,k+1)
731  : 0.0;
732  aux_fcent_z(i,j,k+1,1) = (aux_afrac_z(i,j,k+1) > 0.0) // y (mapped)
733  ? ( lo_areaHi_z * (lo_centHi_z[1] - 0.5)
734  + hi_areaHi_z * (hi_centHi_z[1] + 0.5) ) / aux_afrac_z(i,j,k+1)
735  : 0.0;
736  } else if (idim == 2) {
737  aux_fcent_z(i,j,k+1,0) = lo_centHi_z[0]; // x
738  aux_fcent_z(i,j,k+1,1) = lo_centHi_z[1]; // y
739  }
740  }
741 
742  // 5. Boundary Area
743 
744  Real lo_areaBoun {lo_eb_cc.areaBoun()};
745  Real hi_areaBoun {hi_eb_cc.areaBoun()};
746 
747  aux_barea(i,j,k) = lo_areaBoun + hi_areaBoun;
748 
749  // 6. Boundary Centroid
750 
751  RealVect lo_centBoun {lo_eb_cc.centBoun()};
752  RealVect hi_centBoun {hi_eb_cc.centBoun()};
753 
754  if (idim == 0) {
755  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)
756  aux_bcent(i,j,k,1) = ( lo_areaBoun * lo_centBoun[1] + hi_areaBoun * hi_centBoun[1] ) / aux_barea(i,j,k); // y
757  aux_bcent(i,j,k,2) = ( lo_areaBoun * lo_centBoun[2] + hi_areaBoun * hi_centBoun[2] ) / aux_barea(i,j,k); // z
758  } else if (idim == 1) {
759  aux_bcent(i,j,k,0) = ( lo_areaBoun * lo_centBoun[0] + hi_areaBoun * hi_centBoun[0] ) / aux_barea(i,j,k); // x
760  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)
761  aux_bcent(i,j,k,2) = ( lo_areaBoun * lo_centBoun[2] + hi_areaBoun * hi_centBoun[2] ) / aux_barea(i,j,k); // z
762  } else if (idim == 2) {
763  aux_bcent(i,j,k,0) = ( lo_areaBoun * lo_centBoun[0] + hi_areaBoun * hi_centBoun[0] ) / aux_barea(i,j,k); // x
764  aux_bcent(i,j,k,1) = ( lo_areaBoun * lo_centBoun[1] + hi_areaBoun * hi_centBoun[1] ) / aux_barea(i,j,k); // y
765  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)
766  }
767 
768  // 7. Boundary Normal
769 
770  RealVect eb_normal = ( lo_areaBoun * lo_normal + hi_areaBoun * hi_normal )/ aux_barea(i,j,k);
771 
772  aux_bnorm(i,j,k,0) = eb_normal[0];
773  aux_bnorm(i,j,k,1) = eb_normal[1];
774  aux_bnorm(i,j,k,2) = eb_normal[2];
775 
776  // Small cell
777 
778  if (aux_vfrac(i,j,k) < small_volfrac) {
779  aux_vfrac(i,j,k) = 0.0;
780  aux_vcent(i,j,k,0) = 0.0;
781  aux_vcent(i,j,k,1) = 0.0;
782  aux_vcent(i,j,k,2) = 0.0;
783  aux_bcent(i,j,k,0) = 0.0;
784  aux_bcent(i,j,k,1) = 0.0;
785  aux_bcent(i,j,k,2) = 0.0;
786  aux_bnorm(i,j,k,0) = 0.0;
787  aux_bnorm(i,j,k,1) = 0.0;
788  aux_bnorm(i,j,k,2) = 0.0;
789  aux_barea(i,j,k) = 0.0;
790  aux_flag(i,j,k).setCovered();
791  }
792 
793  if (aux_vcent(i,j,k,0) < small_value) aux_vcent(i,j,k,0) = 0.0;
794  if (aux_vcent(i,j,k,1) < small_value) aux_vcent(i,j,k,1) = 0.0;
795  if (aux_vcent(i,j,k,2) < small_value) aux_vcent(i,j,k,2) = 0.0;
796  if (aux_bcent(i,j,k,0) < small_value) aux_bcent(i,j,k,0) = 0.0;
797  if (aux_bcent(i,j,k,1) < small_value) aux_bcent(i,j,k,1) = 0.0;
798  if (aux_bcent(i,j,k,2) < small_value) aux_bcent(i,j,k,2) = 0.0;
799 
800  }
801 
802  } // flag(iv_lo) and flag(iv_hi)
803  });
804 
805  } // if (FlagFab[mfi].getType(bx) == FabType::singlevalued )
806 
807  } // MFIter
808 
809  // Fill Boundary
810 
811  m_volfrac->FillBoundary(a_geom.periodicity());
812  m_volcent->FillBoundary(a_geom.periodicity());
813  for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
814  m_areafrac[idim]->FillBoundary(a_geom.periodicity());
815  m_facecent[idim]->FillBoundary(a_geom.periodicity());
816  }
817  m_bndryarea->FillBoundary(a_geom.periodicity());
818  m_bndrycent->FillBoundary(a_geom.periodicity());
819  m_bndrynorm->FillBoundary(a_geom.periodicity());
820 
821  // Set Connectivities
822 
823  for (MFIter mfi(*m_cellflags, false); mfi.isValid(); ++mfi) {
824 
825  const Box& bx = mfi.validbox();
826 
827  if (FlagFab[mfi].getType(bx) == FabType::singlevalued ) {
828 
829  Array4<EBCellFlag> const& aux_flag = m_cellflags->array(mfi);
830  Array4<Real> const& aux_afrac_x = m_areafrac[0]->array(mfi);
831  Array4<Real> const& aux_afrac_y = m_areafrac[1]->array(mfi);
832  Array4<Real> const& aux_afrac_z = m_areafrac[2]->array(mfi);
833 
834  ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
835  {
836  EB2::build_cellflag_from_ap (i, j, k, aux_flag, aux_afrac_x, aux_afrac_y, aux_afrac_z);
837  });
838  } // if (FlagFab[mfi].getType(bx) == FabType::singlevalued )
839  } // MFIter
840 
841  // Fill Boundary
842 
843  m_cellflags->FillBoundary(a_geom.periodicity());
844 
845 
846 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real pp(amrex::Real y)
Definition: ERF_MicrophysicsUtils.H:230
amrex::FabArray< amrex::EBCellFlagFab > * m_cellflags
Definition: ERF_EBAux.H:43
amrex::MultiFab * m_bndrynorm
Definition: ERF_EBAux.H:48
amrex::MultiFab * m_bndryarea
Definition: ERF_EBAux.H:46
amrex::MultiFab * m_volfrac
Definition: ERF_EBAux.H:44
amrex::MultiFab * m_bndrycent
Definition: ERF_EBAux.H:47
amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > m_facecent
Definition: ERF_EBAux.H:51
amrex::MultiFab * m_volcent
Definition: ERF_EBAux.H:45
amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > m_areafrac
Definition: ERF_EBAux.H:50
Definition: ERF_EBCutCell.H:14
real(c_double), parameter epsilon
Definition: ERF_module_model_constants.F90:12

Referenced by eb_::make_all_factories().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAreaFrac()

Array< const MultiFab *, AMREX_SPACEDIM > eb_aux_::getAreaFrac ( ) const
892 {
893  AMREX_ASSERT(m_areafrac[0] != nullptr);
894  return {AMREX_D_DECL(m_areafrac[0], m_areafrac[1], m_areafrac[2])};
895 }

Referenced by redistribute_term().

Here is the caller graph for this function:

◆ getBndryArea()

const MultiFab & eb_aux_::getBndryArea ( ) const
871 {
872  AMREX_ASSERT(m_bndryarea != nullptr);
873  return *m_bndryarea;
874 }

◆ getBndryCent()

const MultiFab & eb_aux_::getBndryCent ( ) const
878 {
879  AMREX_ASSERT(m_bndrycent != nullptr);
880  return *m_bndrycent;
881 }

◆ getBndryNorm()

const MultiFab & eb_aux_::getBndryNorm ( ) const
885 {
886  AMREX_ASSERT(m_bndrynorm != nullptr);
887  return *m_bndrynorm;
888 }

◆ getCentroid()

const MultiFab & eb_aux_::getCentroid ( ) const
864 {
865  AMREX_ASSERT(m_volcent != nullptr);
866  return *m_volcent;
867 }

Referenced by redistribute_term().

Here is the caller graph for this function:

◆ getFaceCent()

Array< const MultiFab *, AMREX_SPACEDIM > eb_aux_::getFaceCent ( ) const
899 {
900  AMREX_ASSERT(m_facecent[0] != nullptr);
901  return {AMREX_D_DECL(m_facecent[0], m_facecent[1], m_facecent[2])};
902 }

Referenced by redistribute_term().

Here is the caller graph for this function:

◆ getMultiEBCellFlagFab()

const FabArray< EBCellFlagFab > & eb_aux_::getMultiEBCellFlagFab ( ) const
850 {
851  AMREX_ASSERT(m_cellflags != nullptr);
852  return *m_cellflags;
853 }

Referenced by redistribute_term().

Here is the caller graph for this function:

◆ getVolFrac()

const MultiFab & eb_aux_::getVolFrac ( ) const
857 {
858  AMREX_ASSERT(m_volfrac != nullptr);
859  return *m_volfrac;
860 }

Referenced by redistribute_term().

Here is the caller graph for this function:

◆ set_verbose()

void eb_aux_::set_verbose ( )
inline
25 { m_verbose = 1; }

Member Data Documentation

◆ m_areafrac

amrex::Array<amrex::MultiFab*,AMREX_SPACEDIM> eb_aux_::m_areafrac {{AMREX_D_DECL(nullptr, nullptr, nullptr)}}
private

Referenced by define(), and getAreaFrac().

◆ m_bndryarea

amrex::MultiFab* eb_aux_::m_bndryarea = nullptr
private

Referenced by define(), and getBndryArea().

◆ m_bndrycent

amrex::MultiFab* eb_aux_::m_bndrycent = nullptr
private

Referenced by define(), and getBndryCent().

◆ m_bndrynorm

amrex::MultiFab* eb_aux_::m_bndrynorm = nullptr
private

Referenced by define(), and getBndryNorm().

◆ m_cellflags

amrex::FabArray<amrex::EBCellFlagFab>* eb_aux_::m_cellflags = nullptr
private

Referenced by define(), and getMultiEBCellFlagFab().

◆ m_facecent

amrex::Array<amrex::MultiFab*,AMREX_SPACEDIM> eb_aux_::m_facecent {{AMREX_D_DECL(nullptr, nullptr, nullptr)}}
private

Referenced by define(), and getFaceCent().

◆ m_verbose

int eb_aux_::m_verbose
private

Referenced by define(), and set_verbose().

◆ m_volcent

amrex::MultiFab* eb_aux_::m_volcent = nullptr
private

Referenced by define(), and getCentroid().

◆ m_volfrac

amrex::MultiFab* eb_aux_::m_volfrac = nullptr
private

Referenced by define(), and getVolFrac().


The documentation for this class was generated from the following files: