Block-Structured AMR Software Framework
AMReX_MultiMask.H
Go to the documentation of this file.
1 #ifndef AMREX_MULTIMASK_H_
2 #define AMREX_MULTIMASK_H_
3 #include <AMReX_Config.H>
4 
5 #include <AMReX_Mask.H>
6 #include <AMReX_FabArray.H>
7 #include <AMReX_Geometry.H>
8 
9 #ifdef AMREX_USE_OMP
10 #include <omp.h>
11 #endif
12 
13 namespace amrex {
14 
15 class MultiMaskIter;
16 
17 class MultiMask
18 {
19 public:
20  MultiMask () { ; }
21  MultiMask (const BoxArray& ba, const DistributionMapping& dm, int ncomp);
22  MultiMask (const BoxArray& regba, const DistributionMapping& dm, const Geometry& geom,
23  Orientation face, int in_rad, int out_rad, int extent_rad, int ncomp, bool initval);
24 
25  ~MultiMask () = default;
26 
27  MultiMask (MultiMask&& rhs) noexcept = default;
28 
29  MultiMask (const MultiMask& rhs) = delete;
30  MultiMask& operator= (const MultiMask& rhs) = delete;
31  MultiMask& operator= (MultiMask&& rhs) = delete;
32 
33  void define (const BoxArray& ba, const DistributionMapping& dm, int ncomp);
34  void define (const BoxArray& regba, const DistributionMapping& dm, const Geometry& geom,
35  Orientation face, int in_rad, int out_rad, int extent_rad, int ncomp, bool initval);
36 
37  Mask& operator[] (const MFIter& mfi) noexcept { return m_fa[mfi]; }
38  const Mask& operator[] (const MFIter& mfi) const noexcept { return m_fa[mfi]; }
39 
40  Array4<int const> array (const MFIter& mfi) const noexcept { return m_fa.array(mfi); }
41  Array4<int > array (const MFIter& mfi) noexcept { return m_fa.array(mfi); }
42  Array4<int const> const_array (const MFIter& mfi) const noexcept {
43  return m_fa.const_array(mfi);
44  }
45 
46  MultiArray4<int const> arrays () const noexcept { return m_fa.const_arrays(); }
47  MultiArray4<int > arrays () noexcept { return m_fa.arrays(); }
48  MultiArray4<int const> const_arrays () const noexcept { return m_fa.const_arrays(); }
49 
50  int nComp () const noexcept { return m_fa.nComp(); }
51 
52  const BoxArray& boxArray () const noexcept { return m_fa.boxArray(); }
53 
54  const DistributionMapping& DistributionMap () const noexcept { return m_fa.DistributionMap(); }
55 
56  static void Copy (MultiMask& dst, const MultiMask& src);
57 
58  friend class MultiMaskIter;
59 
60 private:
61 
63 };
64 
66  : public MFIter
67 {
68 public:
69  explicit MultiMaskIter (const MultiMask& mm)
70  : MFIter(mm.m_fa) { }
71 };
72 
73 }
74 
75 #endif
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:550
Calculates the distribution of FABs to MPI processes.
Definition: AMReX_DistributionMapping.H:41
An Array of FortranArrayBox(FAB)-like Objects.
Definition: AMReX_FabArray.H:344
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
Definition: AMReX_MFIter.H:57
std::unique_ptr< FabArrayBase > m_fa
This must be the first member!
Definition: AMReX_MFIter.H:176
Definition: AMReX_Mask.H:28
Definition: AMReX_MultiMask.H:67
MultiMaskIter(const MultiMask &mm)
Definition: AMReX_MultiMask.H:69
Definition: AMReX_MultiMask.H:18
Array4< int const > array(const MFIter &mfi) const noexcept
Definition: AMReX_MultiMask.H:40
MultiMask(const MultiMask &rhs)=delete
MultiMask()
Definition: AMReX_MultiMask.H:20
FabArray< Mask > m_fa
Definition: AMReX_MultiMask.H:62
Array4< int const > const_array(const MFIter &mfi) const noexcept
Definition: AMReX_MultiMask.H:42
int nComp() const noexcept
Definition: AMReX_MultiMask.H:50
~MultiMask()=default
MultiArray4< int > arrays() noexcept
Definition: AMReX_MultiMask.H:47
const BoxArray & boxArray() const noexcept
Definition: AMReX_MultiMask.H:52
const DistributionMapping & DistributionMap() const noexcept
Definition: AMReX_MultiMask.H:54
MultiMask & operator=(const MultiMask &rhs)=delete
static void Copy(MultiMask &dst, const MultiMask &src)
Definition: AMReX_MultiMask.cpp:74
MultiMask(MultiMask &&rhs) noexcept=default
MultiArray4< int const > arrays() const noexcept
Definition: AMReX_MultiMask.H:46
MultiArray4< int const > const_arrays() const noexcept
Definition: AMReX_MultiMask.H:48
Mask & operator[](const MFIter &mfi) noexcept
Definition: AMReX_MultiMask.H:37
Array4< int > array(const MFIter &mfi) noexcept
Definition: AMReX_MultiMask.H:41
void define(const BoxArray &ba, const DistributionMapping &dm, int ncomp)
Definition: AMReX_MultiMask.cpp:18
Encapsulation of the Orientation of the Faces of a Box.
Definition: AMReX_Orientation.H:29
Definition: AMReX_Amr.cpp:49
Definition: AMReX_Array4.H:61
Definition: AMReX_FabArray.H:152