Block-Structured AMR Software Framework
AMReX_EB_utils.H
Go to the documentation of this file.
1 #ifndef AMREX_EB_UTILS_H_
2 #define AMREX_EB_UTILS_H_
3 #include <AMReX_Config.H>
4 
5 #include <AMReX.H>
6 #include <AMReX_MultiFab.H>
7 #include <AMReX_EB2.H>
9 
10 namespace amrex {
24  template <typename G>
25  void FillImpFunc (MultiFab& mf, G const& gshop, Geometry const& geom)
26  {
28 
29  Box bounding_box = geom.Domain();
30  bounding_box.surroundingNodes();
32  for (int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
33  if (!extend_domain_face || geom.isPeriodic(idim)) {
34  bounding_box.grow(mf.nGrowVect()[idim]);
35  }
36  }
37 
38 #ifdef AMREX_USE_OMP
39 #pragma omp parallel if (Gpu::notInLaunchRegion())
40 #endif
41  for(MFIter mfi(mf); mfi.isValid(); ++ mfi) {
42  gshop.fillFab(mf[mfi], geom, RunOn::Gpu, bounding_box);
43  }
44  }
45 
59  void FillSignedDistance (MultiFab& mf, EB2::Level const& ls_lev,
60  EBFArrayBoxFactory const& eb_fac, int refratio,
61  bool fluid_has_positive_sign=true);
62 
73  void FillSignedDistance (MultiFab& mf, bool fluid_has_positive_sign=true);
74 }
75 
76 #endif
#define AMREX_ALWAYS_ASSERT(EX)
Definition: AMReX_BLassert.H:50
AMREX_GPU_HOST_DEVICE BoxND & surroundingNodes() noexcept
Convert to NODE type in all directions.
Definition: AMReX_Box.H:946
AMREX_GPU_HOST_DEVICE BoxND & grow(int i) noexcept
Definition: AMReX_Box.H:627
IntVect nGrowVect() const noexcept
Definition: AMReX_FabArrayBase.H:79
bool is_nodal() const noexcept
This tests on whether the FabArray is fully nodal.
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
const Box & Domain() const noexcept
Returns our rectangular domain.
Definition: AMReX_Geometry.H:210
bool isPeriodic(int dir) const noexcept
Is the domain periodic in the specified direction?
Definition: AMReX_Geometry.H:331
Definition: AMReX_MFIter.H:57
bool isValid() const noexcept
Is the iterator valid i.e. is it associated with a FAB?
Definition: AMReX_MFIter.H:141
A collection (stored as an array) of FArrayBox objects.
Definition: AMReX_MultiFab.H:38
bool ExtendDomainFace()
Definition: AMReX_EB2.cpp:42
AMREX_EXPORT bool extend_domain_face
Definition: AMReX_EB2.cpp:24
Definition: AMReX_Amr.cpp:49
void FillImpFunc(MultiFab &mf, G const &gshop, Geometry const &geom)
Fill MultiFab with implicit function.
Definition: AMReX_EB_utils.H:25
void FillSignedDistance(MultiFab &mf, bool fluid_has_positive_sign)
Fill MultiFab with signed distance.
Definition: AMReX_EB_utils.cpp:11