4#include <AMReX_Config.H>
37 Mask () noexcept = default;
61 explicit
Mask (std::istream& is);
75 ~Mask () noexcept override = default;
94 friend std::istream& operator>> (std::istream& is,
Mask& m);
109 friend std::ostream& operator<< (std::ostream& os, const
Mask& m);
116 void writeOn (std::ostream& os) const;
120 Mask& operator&= (const
Mask& src) noexcept {
return And<run_on>(src); }
127 template <RunOn run_on AMREX_DEFAULT_RUNON>
138 template <RunOn run_on AMREX_DEFAULT_RUNON>
142 int numcomp = 1) noexcept;
157 int numcomp = 1) noexcept;
174 int numcomp = 1) noexcept;
178 Mask& operator|= (const
Mask& src) noexcept {
return Or<run_on>(src); }
185 template <RunOn run_on AMREX_DEFAULT_RUNON>
196 template <RunOn run_on AMREX_DEFAULT_RUNON>
200 int numcomp = 1) noexcept;
215 int numcomp = 1) noexcept;
232 int numcomp = 1) noexcept;
235template <
RunOn run_on>
242template <RunOn run_on>
247 int numcomp)
noexcept
249 return this->And<run_on>(src,
domain,
domain,srccomp,destcomp,numcomp);
252template <RunOn run_on>
258 int numcomp)
noexcept
260 return this->And<run_on>(src,subbox,subbox,srccomp,destcomp,numcomp);
263template <RunOn run_on>
270 int numcomp)
noexcept
272 auto const& d = this->
array();
273 auto const& s = src.const_array();
276 const Dim3 offset{slo.
x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
279 d(i,j,k,n+destcomp) = d(i,j,k,n+destcomp) ? s(i+
offset.x,j+
offset.y,k+
offset.z,n+srccomp) : 0;
284template <RunOn run_on>
291template <RunOn run_on>
296 int numcomp)
noexcept
298 return this->Or<run_on>(src,
domain,
domain,srccomp,destcomp,numcomp);
301template <RunOn run_on>
307 int numcomp)
noexcept
309 return this->Or<run_on>(src,subbox,subbox,srccomp,destcomp,numcomp);
312template <RunOn run_on>
319 int numcomp)
noexcept
321 auto const& d = this->
array();
322 auto const& s = src.const_array();
325 const Dim3 offset{slo.
x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
328 d(i,j,k,n+destcomp) = d(i,j,k,n+destcomp) ? 1: s(i+
offset.x,j+
offset.y,k+
offset.z,n+srccomp);
#define AMREX_DEFAULT_RUNON
Definition AMReX_GpuControl.H:73
#define AMREX_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(where_to_run, box, nc, i, j, k, n, block)
Definition AMReX_GpuLaunch.nolint.H:73
Array4< int const > offset
Definition AMReX_HypreMLABecLap.cpp:1139
A virtual base class for objects that manage their own dynamic memory allocation.
Definition AMReX_Arena.H:127
A FortranArrayBox(FAB)-like object.
Definition AMReX_BaseFab.H:190
Array4< int const > array() const noexcept
Definition AMReX_BaseFab.H:382
Box domain
My index space.
Definition AMReX_BaseFab.H:1165
int nvar
Number components.
Definition AMReX_BaseFab.H:1166
Definition AMReX_Mask.H:33
Mask & Or(const Mask &src) noexcept
In-place logical OR over every component.
Definition AMReX_Mask.H:286
Mask & And(const Mask &src) noexcept
In-place logical AND over every component.
Definition AMReX_Mask.H:237
Mask(Array4< int const > const &a, IndexType t) noexcept
Wrap a const Array4 a with IndexType t.
Definition AMReX_Mask.H:73
void readFrom(std::istream &is)
Initialize from stream, FAB-style.
Definition AMReX_Mask.cpp:89
void writeOn(std::ostream &os) const
Output to stream in FAB binary format.
Definition AMReX_Mask.cpp:78
~Mask() noexcept override=default
Mask(Array4< int > const &a, IndexType t) noexcept
Wrap an existing Array4 a with IndexType t.
Definition AMReX_Mask.H:67
Mask(Array4< int const > const &a) noexcept
Wrap a const Array4 a without taking ownership.
Definition AMReX_Mask.H:70
Mask() noexcept=default
Construct an empty mask with no allocation.
__host__ __device__ Dim3 lbound(Array4< T > const &a) noexcept
Return the inclusive lower bounds of an Array4 in Dim3 form.
Definition AMReX_Array4.H:1317
Definition AMReX_Amr.cpp:49
MakeType
Definition AMReX_MakeType.H:7
RunOn
Definition AMReX_GpuControl.H:69
A multidimensional array accessor.
Definition AMReX_Array4.H:283
void * alloc(std::size_t sz) const noexcept
Definition AMReX_DataAllocator.H:16
Definition AMReX_Dim3.H:12
int x
Definition AMReX_Dim3.H:12