1 #ifndef AMREX_EBCELLFLAG_H_
2 #define AMREX_EBCELLFLAG_H_
3 #include <AMReX_Config.H>
67 return (
flag == (a_input.flag));
73 return (
flag != (a_input.flag));
107 return flag & (1 << n);
113 return flag & (1 << n);
121 return !(
flag & (1 << n));
127 return !(
flag & (1 << n));
181 #if (AMREX_SPACEDIM == 3)
258 static constexpr std::array<std::array<std::array<int,3>,3>,3>
pos_ngbr
271 #if AMREX_SPACEDIM == 3
298 Arena* ar =
nullptr);
#define AMREX_ASSERT(EX)
Definition: AMReX_BLassert.H:38
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
#define AMREX_D_TERM(a, b, c)
Definition: AMReX_SPACE.H:129
A virtual base class for objects that manage their own dynamic memory allocation.
Definition: AMReX_Arena.H:100
A FortranArrayBox(FAB)-like object.
Definition: AMReX_BaseFab.H:183
Definition: AMReX_EBCellFlag.H:287
int getNumRegularCells(const Box &bx) const noexcept
Returns the number of regular cells in the given Box.
Definition: AMReX_EBCellFlag.cpp:147
~EBCellFlagFab() override=default
void setType(FabType t) noexcept
Definition: AMReX_EBCellFlag.H:340
void resetType(int ng)
Reset FabType.
Definition: AMReX_EBCellFlag.cpp:132
FabType m_type
Definition: AMReX_EBCellFlag.H:351
std::map< Box, NumCells > m_typemap
Definition: AMReX_EBCellFlag.H:352
EBCellFlagFab(EBCellFlagFab &&rhs)=default
int getNumCutCells(const Box &bx) const noexcept
Returns the number of cut cells in the given Box.
Definition: AMReX_EBCellFlag.cpp:188
int getNumCoveredCells(const Box &bx) const noexcept
Returns the number of covered cells in the given Box.
Definition: AMReX_EBCellFlag.cpp:226
FabType getType() const noexcept
Returns FabType of the whole EBCellFlagFab.
Definition: AMReX_EBCellFlag.H:313
EBCellFlagFab & operator=(const EBCellFlagFab &)=delete
EBCellFlagFab(const EBCellFlagFab &)=delete
Definition: AMReX_EBCellFlag.H:17
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void setConnected(const IntVect &iv) noexcept
Definition: AMReX_EBCellFlag.H:155
constexpr EBCellFlag & operator=(const EBCellFlag &rhs) noexcept=default
static constexpr int w_numvofs
Definition: AMReX_EBCellFlag.H:255
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void setConnected() noexcept
Definition: AMReX_EBCellFlag.H:150
static constexpr uint32_t zero_lower_mask
Definition: AMReX_EBCellFlag.H:228
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void setConnected(int i, int j, int k) noexcept
Definition: AMReX_EBCellFlag.H:163
static constexpr int pos_numvofs
Definition: AMReX_EBCellFlag.H:256
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE uint32_t getValue() const noexcept
Definition: AMReX_EBCellFlag.H:210
static constexpr uint32_t one_type_mask
masks lowest 2 bits (i.e., bit number 0-1)
Definition: AMReX_EBCellFlag.H:231
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void setDisconnected() noexcept
Definition: AMReX_EBCellFlag.H:131
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void setRegular() noexcept
Definition: AMReX_EBCellFlag.H:38
static constexpr uint32_t covered_value
zero out all neighbors
Definition: AMReX_EBCellFlag.H:277
static constexpr uint32_t one_numvofs_mask
masks for bit number 2-4
Definition: AMReX_EBCellFlag.H:235
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator==(const EBCellFlag &a_input) const noexcept
Definition: AMReX_EBCellFlag.H:65
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool operator!=(const EBCellFlag &a_input) const noexcept
Definition: AMReX_EBCellFlag.H:71
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isConnected(int i, int j, int k) const noexcept
Definition: AMReX_EBCellFlag.H:111
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE EBCellFlag TheDefaultCell()
Definition: AMReX_EBCellFlag.H:216
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isSingleValued() const noexcept
Definition: AMReX_EBCellFlag.H:88
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void setCovered() noexcept
Definition: AMReX_EBCellFlag.H:45
static constexpr uint32_t zero_numvofs_mask
Definition: AMReX_EBCellFlag.H:236
static constexpr int w_type
Definition: AMReX_EBCellFlag.H:254
constexpr EBCellFlag() noexcept=default
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isMultiValued() const noexcept
Definition: AMReX_EBCellFlag.H:93
static constexpr uint32_t single_vof_bits
this represent single vof (regular is considered as single vof too)
Definition: AMReX_EBCellFlag.H:246
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void setMultiValued(int n) noexcept
Definition: AMReX_EBCellFlag.H:57
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int getNumVoFs() const noexcept
Definition: AMReX_EBCellFlag.H:77
static constexpr uint32_t multi_valued_bits
Definition: AMReX_EBCellFlag.H:242
static constexpr uint32_t default_value
regular connected with all neighbors
Definition: AMReX_EBCellFlag.H:274
static constexpr uint32_t regular_bits
Definition: AMReX_EBCellFlag.H:240
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isConnected(const IntVect &iv) const noexcept
Definition: AMReX_EBCellFlag.H:103
static constexpr int w_lower_mask
Definition: AMReX_EBCellFlag.H:253
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void setDisconnected(const IntVect &iv) noexcept
Definition: AMReX_EBCellFlag.H:136
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isDisconnected(int i, int j, int k) const noexcept
Definition: AMReX_EBCellFlag.H:125
uint32_t flag
Definition: AMReX_EBCellFlag.H:279
static constexpr uint32_t one_lower_mask
masks for lowest 5 bits (i.e., bit number 0-4)
Definition: AMReX_EBCellFlag.H:227
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void setDisconnected(int i, int j, int k) noexcept
Definition: AMReX_EBCellFlag.H:144
AMREX_GPU_HOST_DEVICE static constexpr AMREX_FORCE_INLINE EBCellFlag TheCoveredCell()
Definition: AMReX_EBCellFlag.H:222
static constexpr uint32_t zero_type_mask
Definition: AMReX_EBCellFlag.H:232
static constexpr uint32_t single_valued_bits
Definition: AMReX_EBCellFlag.H:241
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void setSingleValued() noexcept
Definition: AMReX_EBCellFlag.H:50
static constexpr uint32_t covered_bits
Definition: AMReX_EBCellFlag.H:243
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isDisconnected(const IntVect &iv) const noexcept
Definition: AMReX_EBCellFlag.H:117
AMREX_GPU_HOST_DEVICE EBCellFlag & operator+=(const EBCellFlag &)
Definition: AMReX_EBCellFlag.H:32
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isRegular() const noexcept
Definition: AMReX_EBCellFlag.H:83
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE int numNeighbors() const noexcept
Definition: AMReX_EBCellFlag.H:169
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool isCovered() const noexcept
Definition: AMReX_EBCellFlag.H:98
integer, dimension(-1:1,-1:1,-1:1), parameter, public pos_ngbr
Definition: AMReX_ebcellflag_mod.F90:16
Definition: AMReX_Amr.cpp:49
MakeType
Definition: AMReX_MakeType.H:7
FabType
Definition: AMReX_FabFactory.H:18
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition: AMReX.cpp:225
std::ostream & operator<<(std::ostream &os, AmrMesh const &amr_mesh)
Definition: AMReX_AmrMesh.cpp:1236
void * alloc(std::size_t sz) const noexcept
Definition: AMReX_DataAllocator.H:16
Definition: AMReX_EBCellFlag.H:342
FabType type
Definition: AMReX_EBCellFlag.H:347
int nmulti
Definition: AMReX_EBCellFlag.H:345
int nsingle
Definition: AMReX_EBCellFlag.H:344
int ncovered
Definition: AMReX_EBCellFlag.H:346
int nregular
Definition: AMReX_EBCellFlag.H:343
Definition: AMReX_TypeTraits.H:266