1 #ifndef AMREX_MULTICUTFAB_H_
2 #define AMREX_MULTICUTFAB_H_
3 #include <AMReX_Config.H>
24 bool shared=
false,
Arena* ar =
nullptr)
28 :
FArrayBox(rhs, make_type, scomp, ncomp) {}
40 return copyFromMem<run_on, BUF>(
box(), 0,
nComp(), src);
43 template <RunOn run_on,
typename BUF = CutFab::value_type>
49 if (
dptr !=
nullptr) {
50 return FArrayBox::copyFromMem<run_on, BUF>(dstbox, dstcomp, numcomp, src);
52 return sizeof(BUF)*
static_cast<std::size_t
>(dstbox.
numPts()*numcomp);
56 template <RunOn run_on>
64 if (
dptr !=
nullptr) {
65 FArrayBox::copy<run_on>(src,srcbox,srccomp,destbox,destcomp,numcomp);
70 template <RunOn run_on>
73 if (
dptr !=
nullptr) {
74 FArrayBox::copy<run_on>(src, bx, scomp, dcomp, ncomp);
115 return m_data.const_arrays();
119 return m_data.const_arrays();
123 bool ok (
const MFIter& mfi)
const noexcept;
126 bool ok (
int global_box_index)
const noexcept;
A virtual base class for objects that manage their own dynamic memory allocation.
Definition: AMReX_Arena.H:100
Real value_type
Definition: AMReX_BaseFab.H:188
Real * dptr
The data pointer.
Definition: AMReX_BaseFab.H:1649
const Box & box() const noexcept
Returns the domain (box) where the array is defined.
Definition: AMReX_BaseFab.H:291
int nComp() const noexcept
Returns the number of components.
Definition: AMReX_BaseFab.H:277
A collection of Boxes stored in an Array.
Definition: AMReX_BoxArray.H:549
AMREX_GPU_HOST_DEVICE Long numPts() const noexcept
Returns the number of points contained in the BoxND.
Definition: AMReX_Box.H:346
Definition: AMReX_MultiCutFab.H:13
CutFab & copy(const CutFab &src, const Box &bx, SrcComp scomp, DestComp dcomp, NumComps ncomp)
Definition: AMReX_MultiCutFab.H:71
CutFab(Arena *ar)
Definition: AMReX_MultiCutFab.H:18
~CutFab() noexcept override=default
CutFab(const Box &b, int n, Arena *ar)
Definition: AMReX_MultiCutFab.H:20
CutFab(CutFab const &rhs, MakeType make_type, int scomp, int ncomp)
Definition: AMReX_MultiCutFab.H:27
CutFab & copy(const CutFab &src, const Box &srcbox, int srccomp, const Box &destbox, int destcomp, int numcomp)
Definition: AMReX_MultiCutFab.H:57
CutFab(const Box &b, int ncomps, bool alloc=true, bool shared=false, Arena *ar=nullptr)
Definition: AMReX_MultiCutFab.H:23
std::size_t copyFromMem(const Box &dstbox, int dstcomp, int numcomp, const void *src)
Definition: AMReX_MultiCutFab.H:44
std::size_t copyFromMem(const void *src)
Definition: AMReX_MultiCutFab.H:39
Calculates the distribution of FABs to MPI processes.
Definition: AMReX_DistributionMapping.H:41
A Fortran Array of REALs.
Definition: AMReX_FArrayBox.H:229
An Array of FortranArrayBox(FAB)-like Objects.
Definition: AMReX_FabArray.H:344
Definition: AMReX_MFIter.H:57
Definition: AMReX_MultiCutFab.H:81
const FabArray< CutFab > & data() const noexcept
Definition: AMReX_MultiCutFab.H:131
MultiCutFab(const MultiCutFab &rhs)=delete
FabArray< CutFab > & data() noexcept
Definition: AMReX_MultiCutFab.H:130
void ParallelCopy(const MultiCutFab &src, int scomp, int dcomp, int ncomp, int sng, int dng, const Periodicity &period=Periodicity::NonPeriodic())
Definition: AMReX_MultiCutFab.cpp:149
void setVal(Real val)
Definition: AMReX_MultiCutFab.cpp:130
Array4< Real > array(const MFIter &mfi) noexcept
Definition: AMReX_MultiCutFab.cpp:111
const CutFab & operator[](const MFIter &mfi) const noexcept
Definition: AMReX_MultiCutFab.cpp:69
const DistributionMapping & DistributionMap() const noexcept
Definition: AMReX_MultiCutFab.H:134
int nComp() const noexcept
Definition: AMReX_MultiCutFab.H:135
const BoxArray & boxArray() const noexcept
Definition: AMReX_MultiCutFab.H:133
Array4< Real const > const_array(const MFIter &mfi) const noexcept
Definition: AMReX_MultiCutFab.cpp:97
MultiCutFab(MultiCutFab &&rhs) noexcept=default
MultiArray4< Real > arrays() noexcept
Definition: AMReX_MultiCutFab.H:110
MultiCutFab & operator=(const MultiCutFab &rhs)=delete
FabArray< CutFab > m_data
Definition: AMReX_MultiCutFab.H:145
void define(const BoxArray &ba, const DistributionMapping &dm, int ncomp, int ngrow, const FabArray< EBCellFlagFab > &cellflags)
Definition: AMReX_MultiCutFab.cpp:61
MultiFab ToMultiFab(Real regular_value, Real covered_value) const
Definition: AMReX_MultiCutFab.cpp:155
MultiArray4< Real const > const_arrays() const noexcept
Definition: AMReX_MultiCutFab.H:118
const FabArray< EBCellFlagFab > * m_cellflags
Definition: AMReX_MultiCutFab.H:146
MultiArray4< Real const > arrays() const noexcept
Definition: AMReX_MultiCutFab.H:114
bool ok(const MFIter &mfi) const noexcept
Is it OK to call operator[] with this MFIter?
Definition: AMReX_MultiCutFab.cpp:118
int nGrow() const noexcept
Definition: AMReX_MultiCutFab.H:136
A collection (stored as an array) of FArrayBox objects.
Definition: AMReX_MultiFab.H:38
This provides length of period for periodic domains. 0 means it is not periodic in that direction....
Definition: AMReX_Periodicity.H:17
static const Periodicity & NonPeriodic() noexcept
Definition: AMReX_Periodicity.cpp:52
Definition: AMReX_Amr.cpp:49
MakeType
Definition: AMReX_MakeType.H:7
RunOn
Definition: AMReX_GpuControl.H:69
Definition: AMReX_Array4.H:61
void * alloc(std::size_t sz) const noexcept
Definition: AMReX_DataAllocator.H:16
Definition: AMReX_BaseFab.H:72
Definition: AMReX_FabArray.H:152
Definition: AMReX_BaseFab.H:78
Definition: AMReX_BaseFab.H:66