4 #include <AMReX_Config.H>
31 Mask () noexcept = default;
46 explicit
Mask (std::istream& is);
56 ~Mask () noexcept override = default;
71 friend std::istream& operator>> (std::istream&,
Mask&);
83 friend std::ostream& operator<< (std::ostream&, const
Mask&);
89 void writeOn (std::ostream&) const;
92 #if defined(AMREX_USE_GPU)
93 template <RunOn run_on>
95 template <RunOn run_on=RunOn::Host>
104 #if defined(AMREX_USE_GPU)
105 template <RunOn run_on>
107 template <RunOn run_on=RunOn::Host>
119 #if defined(AMREX_USE_GPU)
120 template <RunOn run_on>
122 template <RunOn run_on=RunOn::Host>
127 int numcomp = 1) noexcept;
137 #if defined(AMREX_USE_GPU)
138 template <RunOn run_on>
140 template <RunOn run_on=RunOn::Host>
146 int numcomp = 1) noexcept;
158 #if defined(AMREX_USE_GPU)
159 template <RunOn run_on>
161 template <RunOn run_on=RunOn::Host>
168 int numcomp = 1) noexcept;
171 #if defined(AMREX_USE_GPU)
172 template <RunOn run_on>
174 template <RunOn run_on=RunOn::Host>
183 #if defined(AMREX_USE_GPU)
184 template <RunOn run_on>
186 template <RunOn run_on=RunOn::Host>
198 #if defined(AMREX_USE_GPU)
199 template <RunOn run_on>
201 template <RunOn run_on=RunOn::Host>
206 int numcomp = 1) noexcept;
216 #if defined(AMREX_USE_GPU)
217 template <RunOn run_on>
219 template <RunOn run_on=RunOn::Host>
225 int numcomp = 1) noexcept;
237 #if defined(AMREX_USE_GPU)
238 template <RunOn run_on>
240 template <RunOn run_on=RunOn::Host>
247 int numcomp = 1) noexcept;
250 template <
RunOn run_on>
257 template <RunOn run_on>
262 int numcomp) noexcept
264 return this->And<run_on>(src,
domain,
domain,srccomp,destcomp,numcomp);
267 template <RunOn run_on>
273 int numcomp) noexcept
275 return this->And<run_on>(src,subbox,subbox,srccomp,destcomp,numcomp);
278 template <RunOn run_on>
285 int numcomp) noexcept
287 auto const& d = this->
array();
291 const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
294 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;
299 template <RunOn run_on>
306 template <RunOn run_on>
311 int numcomp) noexcept
313 return this->Or<run_on>(src,
domain,
domain,srccomp,destcomp,numcomp);
316 template <RunOn run_on>
322 int numcomp) noexcept
324 return this->Or<run_on>(src,subbox,subbox,srccomp,destcomp,numcomp);
327 template <RunOn run_on>
334 int numcomp) noexcept
336 auto const& d = this->
array();
340 const Dim3 offset{slo.x-dlo.x,slo.y-dlo.y,slo.z-dlo.z};
343 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_HOST_DEVICE_PARALLEL_FOR_4D_FLAG(where_to_run, box, nc, i, j, k, n, block)
Definition: AMReX_GpuLaunch.nolint.H:89
Array4< int const > offset
Definition: AMReX_HypreMLABecLap.cpp:1089
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
AMREX_FORCE_INLINE Array4< T const > const_array() const noexcept
Definition: AMReX_BaseFab.H:415
AMREX_FORCE_INLINE Array4< int const > array() const noexcept
Definition: AMReX_BaseFab.H:379
Box domain
My index space.
Definition: AMReX_BaseFab.H:1650
int nvar
Number components.
Definition: AMReX_BaseFab.H:1651
Definition: AMReX_Mask.H:28
Mask & Or(const Mask &src) noexcept
in-place Or
Definition: AMReX_Mask.H:301
Mask & And(const Mask &src) noexcept
in-place And
Definition: AMReX_Mask.H:252
Mask(Array4< int const > const &a, IndexType t) noexcept
Definition: AMReX_Mask.H:54
Mask & operator&=(const Mask &src) noexcept
in-place And operator
Definition: AMReX_Mask.H:97
~Mask() noexcept override=default
Mask(Array4< int > const &a, IndexType t) noexcept
Definition: AMReX_Mask.H:50
void writeOn(std::ostream &) const
output to stream, FAB-style
Definition: AMReX_Mask.cpp:78
Mask(Array4< int const > const &a) noexcept
Definition: AMReX_Mask.H:52
void readFrom(std::istream &)
initialize from stream, FAB-style
Definition: AMReX_Mask.cpp:88
Mask & operator|=(const Mask &src) noexcept
in-place Or operator
Definition: AMReX_Mask.H:176
Definition: AMReX_Amr.cpp:49
MakeType
Definition: AMReX_MakeType.H:7
RunOn
Definition: AMReX_GpuControl.H:69
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE Dim3 lbound(Array4< T > const &a) noexcept
Definition: AMReX_Array4.H:308
Definition: AMReX_Array4.H:61
void * alloc(std::size_t sz) const noexcept
Definition: AMReX_DataAllocator.H:16
Definition: AMReX_Dim3.H:12