Block-Structured AMR Software Framework
amrex::FabArray< FAB > Class Template Reference

An Array of FortranArrayBox(FAB)-like Objects. More...

#include <AMReX_FabArray.H>

Inheritance diagram for amrex::FabArray< FAB >:
amrex::FabArrayBase

Classes

struct  FABType
 
struct  ShMem
 for shared memory More...
 

Public Types

using value_type = typename std::conditional_t< IsBaseFab< FAB >::value, FAB, FABType >::value_type
 
using fab_type = FAB
 
- Public Types inherited from amrex::FabArrayBase
enum  CpOp { COPY = 0 , ADD = 1 }
 parallel copy or add More...
 
using CopyComTagsContainer = CopyComTag::CopyComTagsContainer
 
using MapOfCopyComTagContainers = CopyComTag::MapOfCopyComTagContainers
 
using FPinfoCache = std::multimap< BDKey, FabArrayBase::FPinfo * >
 
using FPinfoCacheIter = FPinfoCache::iterator
 
using CFinfoCache = std::multimap< BDKey, FabArrayBase::CFinfo * >
 
using CFinfoCacheIter = CFinfoCache::iterator
 
using TAMap = std::map< std::pair< IntVect, IntVect >, TileArray >
 
using TACache = std::map< BDKey, TAMap >
 
using FBCache = std::multimap< BDKey, FabArrayBase::FB * >
 
using FBCacheIter = FBCache::iterator
 
using CPCache = std::multimap< BDKey, FabArrayBase::CPC * >
 
using CPCacheIter = CPCache::iterator
 
using RB90Cache = std::multimap< BDKey, FabArrayBase::RB90 * >
 
using RB90CacheIter = RB90Cache::iterator
 
using RB180Cache = std::multimap< BDKey, FabArrayBase::RB180 * >
 
using RB180CacheIter = RB180Cache::iterator
 
using PolarBCache = std::multimap< BDKey, FabArrayBase::PolarB * >
 
using PolarBCacheIter = PolarBCache::iterator
 

Public Member Functions

 FabArray () noexcept
 Constructs an empty FabArray<FAB>. More...
 
 FabArray (Arena *a) noexcept
 Construct an empty FabArray<FAB> that has a default Arena. More...
 
 FabArray (const BoxArray &bxs, const DistributionMapping &dm, int nvar, int ngrow, const MFInfo &info=MFInfo(), const FabFactory< FAB > &factory=DefaultFabFactory< FAB >())
 Construct a FabArray<FAB> with a valid region defined by bxs and a region of definition defined by the grow factor ngrow and the number of components nvar. More...
 
 FabArray (const BoxArray &bxs, const DistributionMapping &dm, int nvar, const IntVect &ngrow, const MFInfo &info=MFInfo(), const FabFactory< FAB > &factory=DefaultFabFactory< FAB >())
 
 FabArray (const FabArray< FAB > &rhs, MakeType maketype, int scomp, int ncomp)
 
 ~FabArray ()
 The destructor – deletes all FABs in the array. More...
 
 FabArray (FabArray< FAB > &&rhs) noexcept
 
FabArray< FAB > & operator= (FabArray< FAB > &&rhs) noexcept
 
 FabArray (const FabArray< FAB > &rhs)=delete
 
FabArray< FAB > & operator= (const FabArray< FAB > &rhs)=delete
 
void define (const BoxArray &bxs, const DistributionMapping &dm, int nvar, int ngrow, const MFInfo &info=MFInfo(), const FabFactory< FAB > &factory=DefaultFabFactory< FAB >())
 Define this FabArray identically to that performed by the constructor having an analogous function signature. This is only valid if this FabArray was defined using the default constructor. More...
 
void define (const BoxArray &bxs, const DistributionMapping &dm, int nvar, const IntVect &ngrow, const MFInfo &info=MFInfo(), const FabFactory< FAB > &factory=DefaultFabFactory< FAB >())
 
const FabFactory< FAB > & Factory () const noexcept
 
Arenaarena () const noexcept
 
const Vector< std::string > & tags () const noexcept
 
bool hasEBFabFactory () const noexcept
 
value_typesingleChunkPtr () noexcept
 
value_type const * singleChunkPtr () const noexcept
 
std::size_t singleChunkSize () const noexcept
 
bool isAllRegular () const noexcept
 
bool ok () const
 Return true if the FabArray is well-defined. That is, the FabArray has a BoxArray and DistributionMapping, the FABs are allocated for each Box in the BoxArray and the sizes of the FABs and the number of components are consistent with the definition of the FabArray. More...
 
bool isDefined () const
 
const FAB & operator[] (const MFIter &mfi) const noexcept
 Return a constant reference to the FAB associated with mfi. More...
 
const FAB & get (const MFIter &mfi) const noexcept
 Return a constant reference to the FAB associated with mfi. More...
 
FAB & operator[] (const MFIter &mfi) noexcept
 Returns a reference to the FAB associated mfi. More...
 
FAB & get (const MFIter &mfi) noexcept
 Returns a reference to the FAB associated mfi. More...
 
const FAB & operator[] (int K) const noexcept
 Return a constant reference to the FAB associated with the Kth element. More...
 
const FAB & get (int K) const noexcept
 Return a constant reference to the FAB associated with the Kth element. More...
 
FAB & operator[] (int K) noexcept
 Return a reference to the FAB associated with the Kth element. More...
 
FAB & get (int K) noexcept
 Return a reference to the FAB associated with the Kth element. More...
 
FAB & atLocalIdx (int L) noexcept
 Return a reference to the FAB associated with local index L. More...
 
const FAB & atLocalIdx (int L) const noexcept
 
FAB * fabPtr (const MFIter &mfi) noexcept
 Return pointer to FAB. More...
 
FAB const * fabPtr (const MFIter &mfi) const noexcept
 
FAB * fabPtr (int K) noexcept
 
FAB const * fabPtr (int K) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void prefetchToHost (const MFIter &mfi) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void prefetchToDevice (const MFIter &mfi) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_type const > array (const MFIter &mfi) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_typearray (const MFIter &mfi) noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_type const > array (int K) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_typearray (int K) noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_type const > const_array (const MFIter &mfi) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_type const > const_array (int K) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_type const > array (const MFIter &mfi, int start_comp) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_typearray (const MFIter &mfi, int start_comp) noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_type const > array (int K, int start_comp) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_typearray (int K, int start_comp) noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_type const > const_array (const MFIter &mfi, int start_comp) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
Array4< typename FabArray< FAB >::value_type const > const_array (int K, int start_comp) const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
MultiArray4< typename FabArray< FAB >::value_typearrays () noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
MultiArray4< typename FabArray< FAB >::value_type const > arrays () const noexcept
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
MultiArray4< typename FabArray< FAB >::value_type const > const_arrays () const noexcept
 
void setFab (int boxno, std::unique_ptr< FAB > elem)
 Explicitly set the Kth FAB in the FabArray to point to elem. More...
 
template<class F = FAB, std::enable_if_t< std::is_move_constructible_v< F >, int > = 0>
void setFab (int boxno, FAB &&elem)
 Explicitly set the Kth FAB in the FabArray to point to elem. More...
 
void setFab (const MFIter &mfi, std::unique_ptr< FAB > elem)
 Explicitly set the FAB associated with mfi in the FabArray to point to elem. More...
 
template<class F = FAB, std::enable_if_t< std::is_move_constructible_v< F >, int > = 0>
void setFab (const MFIter &mfi, FAB &&elem)
 Explicitly set the FAB associated with mfi in the FabArray to point to elem. More...
 
AMREX_NODISCARD FAB * release (int K)
 Release ownership of the FAB. This function is not thread safe. More...
 
AMREX_NODISCARD FAB * release (const MFIter &mfi)
 Release ownership of the FAB. This function is not thread safe. More...
 
void clear ()
 Releases FAB memory in the FabArray. More...
 
template<typename SFAB , typename DFAB = FAB, std::enable_if_t< std::conjunction_v< IsBaseFab< DFAB >, IsBaseFab< SFAB >, std::is_convertible< typename SFAB::value_type, typename DFAB::value_type >>, int > = 0>
void LocalCopy (FabArray< SFAB > const &src, int scomp, int dcomp, int ncomp, IntVect const &nghost)
 Perform local copy of FabArray data. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void LocalAdd (FabArray< FAB > const &src, int scomp, int dcomp, int ncomp, IntVect const &nghost)
 Perform local addition of FabArray data. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setVal (value_type val)
 Set all components in the entire region of each FAB to val. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
FabArray< FAB > & operator= (value_type val)
 Set all components in the entire region of each FAB to val. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setVal (value_type val, int comp, int ncomp, int nghost=0)
 Set the value of num_comp components in the valid region of each FAB in the FabArray, starting at component comp to val. Also set the value of nghost boundary cells. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setVal (value_type val, int comp, int ncomp, const IntVect &nghost)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setVal (value_type val, const Box &region, int comp, int ncomp, int nghost=0)
 Set the value of num_comp components in the valid region of each FAB in the FabArray, starting at component comp, as well as nghost boundary cells, to val, provided they also intersect with the Box region. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setVal (value_type val, const Box &region, int comp, int ncomp, const IntVect &nghost)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setVal (value_type val, int nghost)
 Set all components in the valid region of each FAB in the FabArray to val, including nghost boundary cells. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setVal (value_type val, const IntVect &nghost)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setVal (value_type val, const Box &region, int nghost)
 Set all components in the valid region of each FAB in the FabArray to val, including nghost boundary cells, that also intersect the Box region. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setVal (value_type val, const Box &region, const IntVect &nghost)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void abs (int comp, int ncomp, int nghost=0)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void abs (int comp, int ncomp, const IntVect &nghost)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void plus (value_type val, int comp, int num_comp, int nghost=0)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void plus (value_type val, const Box &region, int comp, int num_comp, int nghost=0)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void mult (value_type val, int comp, int num_comp, int nghost=0)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void mult (value_type val, const Box &region, int comp, int num_comp, int nghost=0)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void invert (value_type numerator, int comp, int num_comp, int nghost=0)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void invert (value_type numerator, const Box &region, int comp, int num_comp, int nghost=0)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setBndry (value_type val)
 Set all values in the boundary region to val. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setBndry (value_type val, int strt_comp, int ncomp)
 Set ncomp values in the boundary region, starting at start_comp to val. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setDomainBndry (value_type val, const Geometry &geom)
 Set all values outside the Geometry domain to val. More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setDomainBndry (value_type val, int strt_comp, int ncomp, const Geometry &geom)
 Set ncomp values outside the Geometry domain to val, starting at start_comp. More...
 
template<typename F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
F::value_type sum (int comp, IntVect const &nghost, bool local=false) const
 Returns the sum of component "comp". More...
 
void ParallelAdd (const FabArray< FAB > &src, const Periodicity &period=Periodicity::NonPeriodic())
 This function copies data from src to this FabArray. Each FAB in fa is intersected with all FABs in this FabArray and a copy is performed on the region of intersection. The intersection is restricted to the valid regions. More...
 
void ParallelCopy (const FabArray< FAB > &src, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY)
 
void copy (const FabArray< FAB > &src, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY)
 
void ParallelAdd_nowait (const FabArray< FAB > &src, const Periodicity &period=Periodicity::NonPeriodic())
 
void ParallelCopy_nowait (const FabArray< FAB > &src, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY)
 
void ParallelAdd (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, const Periodicity &period=Periodicity::NonPeriodic())
 This function copies data from src to this FabArray. Each FAB in src is intersected with all FABs in this FabArray and a copy is performed on the region of intersection. The intersection is restricted to the num_comp components starting at src_comp in the FabArray src, with the destination components in this FabArray starting at dest_comp. More...
 
void ParallelCopy (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY)
 
void copy (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY)
 
void ParallelAdd_nowait (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, const Periodicity &period=Periodicity::NonPeriodic())
 
void ParallelCopy_nowait (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY)
 
void ParallelAdd (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, int src_nghost, int dst_nghost, const Periodicity &period=Periodicity::NonPeriodic())
 Similar to the above function, except that source and destination are grown by src_nghost and dst_nghost, respectively. More...
 
void ParallelAdd (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, const IntVect &src_nghost, const IntVect &dst_nghost, const Periodicity &period=Periodicity::NonPeriodic())
 
void ParallelCopy (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, int src_nghost, int dst_nghost, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY)
 
void ParallelCopy (const FabArray< FAB > &src, int scomp, int dcomp, int ncomp, const IntVect &snghost, const IntVect &dnghost, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY, const FabArrayBase::CPC *a_cpc=nullptr)
 
void ParallelAdd_nowait (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, int src_nghost, int dst_nghost, const Periodicity &period=Periodicity::NonPeriodic())
 
void ParallelAdd_nowait (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, const IntVect &src_nghost, const IntVect &dst_nghost, const Periodicity &period=Periodicity::NonPeriodic())
 
void ParallelCopy_nowait (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, int src_nghost, int dst_nghost, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY)
 
void ParallelCopy_nowait (const FabArray< FAB > &src, int scomp, int dcomp, int ncomp, const IntVect &snghost, const IntVect &dnghost, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY, const FabArrayBase::CPC *a_cpc=nullptr, bool to_ghost_cells_only=false)
 
void ParallelCopy_finish ()
 
void ParallelCopyToGhost (const FabArray< FAB > &src, int scomp, int dcomp, int ncomp, const IntVect &snghost, const IntVect &dnghost, const Periodicity &period=Periodicity::NonPeriodic())
 
void ParallelCopyToGhost_nowait (const FabArray< FAB > &src, int scomp, int dcomp, int ncomp, const IntVect &snghost, const IntVect &dnghost, const Periodicity &period=Periodicity::NonPeriodic())
 
void ParallelCopyToGhost_finish ()
 
void copy (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, int src_nghost, int dst_nghost, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY)
 
void copy (const FabArray< FAB > &src, int src_comp, int dest_comp, int num_comp, const IntVect &src_nghost, const IntVect &dst_nghost, const Periodicity &period=Periodicity::NonPeriodic(), CpOp op=FabArrayBase::COPY)
 
void Redistribute (const FabArray< FAB > &src, int scomp, int dcomp, int ncomp, const IntVect &nghost)
 Copy from src to this. this and src have the same BoxArray, but different DistributionMapping. More...
 
void copyTo (FAB &dest, int nghost=0) const
 Copy the values contained in the intersection of the valid + nghost region of this FabArray with the FAB dest into dest. Note that FAB dest is assumed to be identical on each process. More...
 
void copyTo (FAB &dest, int scomp, int dcomp, int ncomp, int nghost=0) const
 Copy the values contained in the intersection of the num_comp component valid + nghost region of this FabArray, starting at component src_comp, with the FAB dest into dest, starting at component dest_comp in dest. Note that FAB dest is assumed to be identical on each process. More...
 
void shift (const IntVect &v)
 Shift the boxarray by vector v. More...
 
bool defined (int K) const noexcept
 
bool defined (const MFIter &mfi) const noexcept
 
template<typename BUF = value_type>
void FillBoundary (bool cross=false)
 Copy on intersection within a FabArray. Data is copied from valid regions to intersecting regions of definition. The purpose is to fill in the boundary regions of each FAB in the FabArray. If cross=true, corner cells are not filled. If the length of periodic is provided, periodic boundaries are also filled. Note that FabArray itself does not contains any periodicity information. FillBoundary expects that its cell-centered version of its BoxArray is non-overlapping. More...
 
template<typename BUF = value_type>
void FillBoundary (const Periodicity &period, bool cross=false)
 
template<typename BUF = value_type>
void FillBoundary (const IntVect &nghost, const Periodicity &period, bool cross=false)
 
template<typename BUF = value_type>
void FillBoundary (int scomp, int ncomp, bool cross=false)
 Same as FillBoundary(), but only copies ncomp components starting at scomp. More...
 
template<typename BUF = value_type>
void FillBoundary (int scomp, int ncomp, const Periodicity &period, bool cross=false)
 
template<typename BUF = value_type>
void FillBoundary (int scomp, int ncomp, const IntVect &nghost, const Periodicity &period, bool cross=false)
 
template<typename BUF = value_type>
void FillBoundary_nowait (bool cross=false)
 
template<typename BUF = value_type>
void FillBoundary_nowait (const Periodicity &period, bool cross=false)
 
template<typename BUF = value_type>
void FillBoundary_nowait (const IntVect &nghost, const Periodicity &period, bool cross=false)
 
template<typename BUF = value_type>
void FillBoundary_nowait (int scomp, int ncomp, bool cross=false)
 
template<typename BUF = value_type>
void FillBoundary_nowait (int scomp, int ncomp, const Periodicity &period, bool cross=false)
 
template<typename BUF = value_type>
void FillBoundary_nowait (int scomp, int ncomp, const IntVect &nghost, const Periodicity &period, bool cross=false)
 
template<typename BUF = value_type, class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void FillBoundary_finish ()
 
void FillBoundary_test ()
 
void FillBoundaryAndSync (const Periodicity &period=Periodicity::NonPeriodic())
 Fill ghost cells and synchronize nodal data. Ghost regions are filled with data from the intersecting valid regions. The synchronization will override valid regions by the intersecting valid regions with a higher precedence. The smaller the global box index is, the higher precedence the box has. With periodic boundaries, for cells in the same box, those near the lower corner have higher precedence than those near the upper corner. More...
 
void FillBoundaryAndSync (int scomp, int ncomp, const IntVect &nghost, const Periodicity &period)
 Fill ghost cells and synchronize nodal data. Ghost regions are filled with data from the intersecting valid regions. The synchronization will override valid regions by the intersecting valid regions with a higher precedence. The smaller the global box index is, the higher precedence the box has. With periodic boundaries, for cells in the same box, those near the lower corner have higher precedence than those near the upper corner. More...
 
void FillBoundaryAndSync_nowait (const Periodicity &period=Periodicity::NonPeriodic())
 
void FillBoundaryAndSync_nowait (int scomp, int ncomp, const IntVect &nghost, const Periodicity &period)
 
void FillBoundaryAndSync_finish ()
 
void OverrideSync (const Periodicity &period=Periodicity::NonPeriodic())
 Synchronize nodal data. The synchronization will override valid regions by the intersecting valid regions with a higher precedence. The smaller the global box index is, the higher precedence the box has. With periodic boundaries, for cells in the same box, those near the lower corner have higher precedence than those near the upper corner. More...
 
void OverrideSync (int scomp, int ncomp, const Periodicity &period)
 Synchronize nodal data. The synchronization will override valid regions by the intersecting valid regions with a higher precedence. The smaller the global box index is, the higher precedence the box has. With periodic boundaries, for cells in the same box, those near the lower corner have higher precedence than those near the upper corner. More...
 
void OverrideSync_nowait (const Periodicity &period=Periodicity::NonPeriodic())
 
void OverrideSync_nowait (int scomp, int ncomp, const Periodicity &period)
 
void OverrideSync_finish ()
 
void SumBoundary (const Periodicity &period=Periodicity::NonPeriodic())
 Sum values in overlapped cells. The destination is limited to valid cells. More...
 
void SumBoundary (int scomp, int ncomp, const Periodicity &period=Periodicity::NonPeriodic())
 
void SumBoundary_nowait (const Periodicity &period=Periodicity::NonPeriodic())
 
void SumBoundary_nowait (int scomp, int ncomp, const Periodicity &period=Periodicity::NonPeriodic())
 
void SumBoundary (int scomp, int ncomp, IntVect const &nghost, const Periodicity &period=Periodicity::NonPeriodic())
 Sum values in overlapped cells. The destination is limited to valid + ngrow cells. More...
 
void SumBoundary_nowait (int scomp, int ncomp, IntVect const &nghost, const Periodicity &period=Periodicity::NonPeriodic())
 
void SumBoundary (int scomp, int ncomp, IntVect const &src_nghost, IntVect const &dst_nghost, const Periodicity &period=Periodicity::NonPeriodic())
 Sum values in overlapped cells. For computing the overlap, the dst is grown by dst_ngrow, while the src uses src_ngrow. More...
 
void SumBoundary_nowait (int scomp, int ncomp, IntVect const &src_nghost, IntVect const &dst_nghost, const Periodicity &period=Periodicity::NonPeriodic())
 
void SumBoundary_finish ()
 
void EnforcePeriodicity (const Periodicity &period)
 Fill ghost cells with values from their corresponding cells across periodic boundaries, regardless of whether the corresponding cells are valid. This differs from FillBoundary, which only fills from valid cells, and does not fill from ghost cells. The BoxArray is allowed to be overlapping. More...
 
void EnforcePeriodicity (int scomp, int ncomp, const Periodicity &period)
 
void EnforcePeriodicity (int scomp, int ncomp, const IntVect &nghost, const Periodicity &period)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void BuildMask (const Box &phys_domain, const Periodicity &period, value_type covered, value_type notcovered, value_type physbnd, value_type interior)
 
template<typename BUF = value_type, class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void FBEP_nowait (int scomp, int ncomp, const IntVect &nghost, const Periodicity &period, bool cross, bool enforce_periodicity_only=false, bool override_sync=false)
 
void FB_local_copy_cpu (const FB &TheFB, int scomp, int ncomp)
 
void PC_local_cpu (const CPC &thecpc, FabArray< FAB > const &src, int scomp, int dcomp, int ncomp, CpOp op)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void setVal (value_type val, const CommMetaData &thecmd, int scomp, int ncomp)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
LayoutData< intRecvLayoutMask (const CommMetaData &thecmd)
 
void FB_local_copy_gpu (const FB &TheFB, int scomp, int ncomp)
 
void PC_local_gpu (const CPC &thecpc, FabArray< FAB > const &src, int scomp, int dcomp, int ncomp, CpOp op)
 
void CMD_local_setVal_gpu (value_type x, const CommMetaData &thecmd, int scomp, int ncomp)
 
void CMD_remote_setVal_gpu (value_type x, const CommMetaData &thecmd, int scomp, int ncomp)
 
template<typename F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
F::value_type norminf (int comp, int ncomp, IntVect const &nghost, bool local=false, [[maybe_unused]] bool ignore_covered=false) const
 Return infinity norm. More...
 
template<typename IFAB , typename F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
F::value_type norminf (FabArray< IFAB > const &mask, int comp, int ncomp, IntVect const &nghost, bool local=false) const
 Return infinity norm in masked region. More...
 
template<typename BUF , class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void FBEP_nowait (int scomp, int ncomp, const IntVect &nghost, const Periodicity &period, bool cross, bool enforce_periodicity_only, bool override_sync)
 
template<typename BUF , class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void FillBoundary_finish ()
 
template<typename BUF >
void pack_send_buffer_gpu (FabArray< FAB > const &src, int scomp, int ncomp, Vector< char * > const &send_data, Vector< std::size_t > const &send_size, Vector< CopyComTagsContainer const * > const &send_cctc)
 
template<typename BUF >
void unpack_recv_buffer_gpu (FabArray< FAB > &dst, int dcomp, int ncomp, Vector< char * > const &recv_data, Vector< std::size_t > const &recv_size, Vector< CopyComTagsContainer const * > const &recv_cctc, CpOp op, bool is_thread_safe)
 
template<typename BUF >
void pack_send_buffer_cpu (FabArray< FAB > const &src, int scomp, int ncomp, Vector< char * > const &send_data, Vector< std::size_t > const &send_size, Vector< CopyComTagsContainer const * > const &send_cctc)
 
template<typename BUF >
void unpack_recv_buffer_cpu (FabArray< FAB > &dst, int dcomp, int ncomp, Vector< char * > const &recv_data, Vector< std::size_t > const &recv_size, Vector< CopyComTagsContainer const * > const &recv_cctc, CpOp op, bool is_thread_safe)
 
- Public Member Functions inherited from amrex::FabArrayBase
 FabArrayBase ()=default
 
 ~FabArrayBase ()=default
 
 FabArrayBase (const BoxArray &bxs, const DistributionMapping &dm, int nvar, int ngrow)
 
 FabArrayBase (const BoxArray &bxs, const DistributionMapping &dm, int nvar, const IntVect &ngrow)
 
 FabArrayBase (FabArrayBase &&rhs) noexcept=default
 
 FabArrayBase (const FabArrayBase &rhs)=default
 
FabArrayBaseoperator= (const FabArrayBase &rhs)=default
 
FabArrayBaseoperator= (FabArrayBase &&rhs)=default
 
void define (const BoxArray &bxs, const DistributionMapping &dm, int nvar, int ngrow)
 
void define (const BoxArray &bxs, const DistributionMapping &dm, int nvar, const IntVect &ngrow)
 
int nGrow (int direction=0) const noexcept
 Return the grow factor that defines the region of definition. More...
 
IntVect nGrowVect () const noexcept
 
int nComp () const noexcept
 Return number of variables (aka components) associated with each point. More...
 
IndexType ixType () const noexcept
 Return index type. More...
 
bool empty () const noexcept
 
const BoxArrayboxArray () const noexcept
 Return a constant reference to the BoxArray that defines the valid region associated with this FabArray. More...
 
Box box (int K) const noexcept
 Return the Kth Box in the BoxArray. That is, the valid region of the Kth grid. More...
 
Box fabbox (int K) const noexcept
 Return the Kth FABs Box in the FabArray. That is, the region the Kth fab is actually defined on. More...
 
int size () const noexcept
 Return the number of FABs in the FabArray. More...
 
int local_size () const noexcept
 Return the number of local FABs in the FabArray. More...
 
const Vector< int > & IndexArray () const noexcept
 Return constant reference to indices in the FabArray that we have access. More...
 
int localindex (int K) const noexcept
 Return local index in the vector of FABs. More...
 
const DistributionMappingDistributionMap () const noexcept
 Return constant reference to associated DistributionMapping. More...
 
bool is_nodal () const noexcept
 This tests on whether the FabArray is fully nodal. More...
 
bool is_nodal (int dir) const noexcept
 This tests on whether the FabArray is nodal in direction dir. More...
 
bool is_cell_centered () const noexcept
 This tests on whether the FabArray is cell-centered. More...
 
void setMultiGhost (bool a_multi_ghost)
 
IntVect nGrowFilled () const noexcept
 
void setNGrowFilled (IntVect const &ng) noexcept
 
bool isFusingCandidate () const noexcept
 Is this a good candidate for kernel fusing? More...
 
BDKey getBDKey () const noexcept
 
void updateBDKey ()
 
void flushFPinfo (bool no_assertion=false) const
 
void flushCFinfo (bool no_assertion=false) const
 
const TileArraygetTileArray (const IntVect &tilesize) const
 
void clear ()
 
const std::vector< bool > & OwnerShip () const noexcept
 Return owenership of fabs. The concept of ownership only applies when UPC++ team is used. In that case, each fab is shared by team workers, with one taking the ownership. More...
 
bool isOwner (int li) const noexcept
 
void buildTileArray (const IntVect &tilesize, TileArray &ta) const
 
void flushTileArray (const IntVect &tilesize=IntVect::TheZeroVector(), bool no_assertion=false) const
 
void define_fb_metadata (CommMetaData &cmd, const IntVect &nghost, bool cross, const Periodicity &period, bool multi_ghost) const
 
const FBgetFB (const IntVect &nghost, const Periodicity &period, bool cross=false, bool enforce_periodicity_only=false, bool override_sync=false) const
 
void flushFB (bool no_assertion=false) const
 This flushes its own FB. More...
 
const CPCgetCPC (const IntVect &dstng, const FabArrayBase &src, const IntVect &srcng, const Periodicity &period, bool to_ghost_cells_only=false) const
 
void flushCPC (bool no_assertion=false) const
 This flushes its own CPC. More...
 
const RB90getRB90 (const IntVect &nghost, const Box &domain) const
 
void flushRB90 (bool no_assertion=false) const
 This flushes its own RB90. More...
 
const RB180getRB180 (const IntVect &nghost, const Box &domain) const
 
void flushRB180 (bool no_assertion=false) const
 This flushes its own RB180. More...
 
const PolarBgetPolarB (const IntVect &nghost, const Box &domain) const
 
void flushPolarB (bool no_assertion=false) const
 This flushes its own PolarB. More...
 
ParForInfo const & getParForInfo (const IntVect &nghost, int nthreads) const
 
void flushParForInfo (bool no_assertion=false) const
 
void clearThisBD (bool no_assertion=false) const
 clear BD count and caches associated with this BD, if no other is using this BD. More...
 
void addThisBD ()
 add the current BD into BD count database More...
 

Static Public Member Functions

template<typename BUF = value_type>
static void pack_send_buffer_gpu (FabArray< FAB > const &src, int scomp, int ncomp, Vector< char * > const &send_data, Vector< std::size_t > const &send_size, Vector< const CopyComTagsContainer * > const &send_cctc)
 
template<typename BUF = value_type>
static void unpack_recv_buffer_gpu (FabArray< FAB > &dst, int dcomp, int ncomp, Vector< char * > const &recv_data, Vector< std::size_t > const &recv_size, Vector< const CopyComTagsContainer * > const &recv_cctc, CpOp op, bool is_thread_safe)
 
template<typename BUF = value_type>
static void pack_send_buffer_cpu (FabArray< FAB > const &src, int scomp, int ncomp, Vector< char * > const &send_data, Vector< std::size_t > const &send_size, Vector< const CopyComTagsContainer * > const &send_cctc)
 
template<typename BUF = value_type>
static void unpack_recv_buffer_cpu (FabArray< FAB > &dst, int dcomp, int ncomp, Vector< char * > const &recv_data, Vector< std::size_t > const &recv_size, Vector< const CopyComTagsContainer * > const &recv_cctc, CpOp op, bool is_thread_safe)
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
static void Saxpy (FabArray< FAB > &y, value_type a, FabArray< FAB > const &x, int xcomp, int ycomp, int ncomp, IntVect const &nghost)
 y += a*x More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
static void Xpay (FabArray< FAB > &y, value_type a, FabArray< FAB > const &x, int xcomp, int ycomp, int ncomp, IntVect const &nghost)
 y = x + a*y More...
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
static void LinComb (FabArray< FAB > &dst, value_type a, const FabArray< FAB > &x, int xcomp, value_type b, const FabArray< FAB > &y, int ycomp, int dstcomp, int numcomp, const IntVect &nghost)
 dst = a*x + b*y More...
 
- Static Public Member Functions inherited from amrex::FabArrayBase
static Long bytesOfMapOfCopyComTagContainers (const MapOfCopyComTagContainers &)
 
static void Initialize ()
 Initialize from ParmParse with "fabarray" prefix. More...
 
static void Finalize ()
 
static const FPinfoTheFPinfo (const FabArrayBase &srcfa, const FabArrayBase &dstfa, const IntVect &dstng, const BoxConverter &coarsener, const Geometry &fgeom, const Geometry &cgeom, const EB2::IndexSpace *)
 
static const CFinfoTheCFinfo (const FabArrayBase &finefa, const Geometry &finegm, const IntVect &ng, bool include_periodic, bool include_physbndry)
 
static void updateMemUsage (std::string const &tag, Long nbytes, Arena const *ar)
 
static void printMemUsage ()
 
static Long queryMemUsage (const std::string &tag=std::string("All"))
 
static Long queryMemUsageHWM (const std::string &tag=std::string("All"))
 
static void pushRegionTag (const char *t)
 
static void pushRegionTag (std::string t)
 
static void popRegionTag ()
 
static void flushTileArrayCache ()
 This flushes the entire cache. More...
 
static void flushFBCache ()
 This flushes the entire cache. More...
 
static void flushCPCache ()
 This flusheds the entire cache. More...
 
static void flushRB90Cache ()
 This flushes the entire cache. More...
 
static void flushRB180Cache ()
 This flushes the entire cache. More...
 
static void flushPolarBCache ()
 This flushes the entire cache. More...
 
static void flushParForCache ()
 
static bool getAllocSingleChunk ()
 

Public Attributes

std::unique_ptr< FBData< FAB > > fbd
 
std::unique_ptr< PCData< FAB > > pcd
 
std::unique_ptr< FabArray< FAB > > os_temp
 
- Public Attributes inherited from amrex::FabArrayBase
BoxArray boxarray
 
DistributionMapping distributionMap
 
Vector< intindexArray
 
std::vector< bool > ownership
 
IntVect n_grow
 
int n_comp
 
BDKey m_bdkey
 
IntVect n_filled
 
bool m_multi_ghost = false
 

Protected Member Functions

bool SharedMemory () const noexcept
 

Protected Attributes

std::unique_ptr< FabFactory< FAB > > m_factory
 
DataAllocator m_dallocator
 
std::unique_ptr< detail::SingleChunkArenam_single_chunk_arena
 
Long m_single_chunk_size = 0
 
bool define_function_called = false
 has define() been called? More...
 
std::vector< FAB * > m_fabs_v
 The data. More...
 
void * m_dp_arrays = nullptr
 
void * m_hp_arrays = nullptr
 
MultiArray4< value_typem_arrays
 
MultiArray4< value_type const > m_const_arrays
 
Vector< std::string > m_tags
 
ShMem shmem
 

Private Types

using Iterator = typename std::vector< FAB * >::iterator
 

Private Member Functions

void AllocFabs (const FabFactory< FAB > &factory, Arena *ar, const Vector< std::string > &tags, bool alloc_single_chunk)
 
void setFab_assert (int K, FAB const &fab) const
 
template<class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void build_arrays () const
 
void clear_arrays ()
 

Additional Inherited Members

- Static Public Attributes inherited from amrex::FabArrayBase
static AMREX_EXPORT IntVect mfiter_tile_size
 Default tilesize in MFIter. More...
 
static AMREX_EXPORT int MaxComp
 The maximum number of components to copy() at a time. More...
 
static AMREX_EXPORT IntVect comm_tile_size
 communication tile size More...
 
static FPinfoCache m_TheFillPatchCache
 
static CacheStats m_FPinfo_stats
 
static CFinfoCache m_TheCrseFineCache
 
static CacheStats m_CFinfo_stats
 
static std::map< std::string, meminfom_mem_usage
 
static AMREX_EXPORT std::vector< std::string > m_region_tag
 
static TACache m_TheTileArrayCache
 
static CacheStats m_TAC_stats
 
static FBCache m_TheFBCache
 
static CacheStats m_FBC_stats
 
static CPCache m_TheCPCache
 
static CacheStats m_CPC_stats
 
static RB90Cache m_TheRB90Cache
 
static RB180Cache m_TheRB180Cache
 
static PolarBCache m_ThePolarBCache
 
static std::multimap< BDKey, ParForInfo * > m_TheParForCache
 
static std::map< BDKey, intm_BD_count
 Keep track of how many FabArrays are built with the same BDKey. More...
 
static AMREX_EXPORT FabArrayStats m_FA_stats
 
static AMREX_EXPORT bool m_alloc_single_chunk
 

Detailed Description

template<class FAB>
class amrex::FabArray< FAB >

An Array of FortranArrayBox(FAB)-like Objects.

The FabArray<FAB> class implements a collection (stored as an array) of Fortran array box-like ( FAB ) objects. The parameterized type FAB is intended to be any class derived from BaseFab<T>. For example, FAB may be a BaseFab of integers, so we could write:

FabArray<BaseFab<int> > int_fabs;

Then int_fabs is a FabArray that can hold a collection of BaseFab<int> objects.

FabArray is not just a general container class for Fortran arrays. It is intended to hold "grid" data for use in finite difference calculations in which the data is defined on a union of (usually disjoint) rectangular regions embedded in a uniform index space. This region, called the valid region, is represented by a BoxArray. For the purposes of this discussion, the Kth Box in the BoxArray represents the interior region of the Kth grid.

Since the intent is to be used with finite difference calculations a FabArray also includes the notion of a boundary region for each grid. The boundary region is specified by the ngrow parameter which tells the FabArray to allocate each FAB to be ngrow cells larger in all directions than the underlying Box. The larger region covered by the union of all the FABs is called the region of definition. The underlying notion is that the valid region contains the grid interior data and the region of definition includes the interior region plus the boundary areas.

Operations are available to copy data from the valid regions into these boundary areas where the two overlap. The number of components, that is, the number of values that can be stored in each cell of a FAB, is either given as an argument to the constructor or is inherent in the definition of the underlying FAB. Each FAB in the FabArray will have the same number of components.

In summary, a FabArray is an array of FABs. The Kth element contains a FAB that holds the data for the Kth grid, a Box that defines the valid region of the Kth grid.

A typical use for a FabArray would be to hold the solution vector or right-hand-side when solving a linear system of equations on a union of rectangular grids. The copy operations would be used to copy data from the valid regions of neighboring grids into the boundary regions after each relaxation step of the iterative method. If a multigrid method is used, a FabArray could be used to hold the data at each level in the multigrid hierarchy.

This class is a concrete class not a polymorphic one.

This class does NOT provide a copy constructor or assignment operator.

Template Parameters
FABFortranArrayBox-like object. Typically a derived class of BaseFab. Not to be confused with FabArrayBase.

Member Typedef Documentation

◆ fab_type

template<class FAB >
using amrex::FabArray< FAB >::fab_type = FAB

◆ Iterator

template<class FAB >
using amrex::FabArray< FAB >::Iterator = typename std::vector<FAB*>::iterator
private

◆ value_type

template<class FAB >
using amrex::FabArray< FAB >::value_type = typename std::conditional_t<IsBaseFab<FAB>::value, FAB, FABType>::value_type

Constructor & Destructor Documentation

◆ FabArray() [1/7]

template<class FAB >
amrex::FabArray< FAB >::FabArray
noexcept

Constructs an empty FabArray<FAB>.

◆ FabArray() [2/7]

template<class FAB >
amrex::FabArray< FAB >::FabArray ( Arena a)
explicitnoexcept

Construct an empty FabArray<FAB> that has a default Arena.

If define is called later with a nullptr as MFInfo's arena, the default Arena a will be used. If the arena in MFInfo is not a nullptr, the MFInfo's arena will be used.

◆ FabArray() [3/7]

template<class FAB >
amrex::FabArray< FAB >::FabArray ( const BoxArray bxs,
const DistributionMapping dm,
int  nvar,
int  ngrow,
const MFInfo info = MFInfo(),
const FabFactory< FAB > &  factory = DefaultFabFactory<FAB>() 
)

Construct a FabArray<FAB> with a valid region defined by bxs and a region of definition defined by the grow factor ngrow and the number of components nvar.

◆ FabArray() [4/7]

template<class FAB >
amrex::FabArray< FAB >::FabArray ( const BoxArray bxs,
const DistributionMapping dm,
int  nvar,
const IntVect ngrow,
const MFInfo info = MFInfo(),
const FabFactory< FAB > &  factory = DefaultFabFactory<FAB>() 
)

◆ FabArray() [5/7]

template<class FAB >
amrex::FabArray< FAB >::FabArray ( const FabArray< FAB > &  rhs,
MakeType  maketype,
int  scomp,
int  ncomp 
)

◆ ~FabArray()

template<class FAB >
amrex::FabArray< FAB >::~FabArray

The destructor – deletes all FABs in the array.

◆ FabArray() [6/7]

template<class FAB >
amrex::FabArray< FAB >::FabArray ( FabArray< FAB > &&  rhs)
noexcept

◆ FabArray() [7/7]

template<class FAB >
amrex::FabArray< FAB >::FabArray ( const FabArray< FAB > &  rhs)
delete

Member Function Documentation

◆ abs() [1/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::abs ( int  comp,
int  ncomp,
const IntVect nghost 
)

◆ abs() [2/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::abs ( int  comp,
int  ncomp,
int  nghost = 0 
)

◆ AllocFabs()

template<class FAB >
void amrex::FabArray< FAB >::AllocFabs ( const FabFactory< FAB > &  factory,
Arena ar,
const Vector< std::string > &  tags,
bool  alloc_single_chunk 
)
private

◆ arena()

template<class FAB >
Arena* amrex::FabArray< FAB >::arena ( ) const
inlinenoexcept

◆ array() [1/8]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type const > amrex::FabArray< FAB >::array ( const MFIter mfi) const
noexcept

◆ array() [2/8]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type > amrex::FabArray< FAB >::array ( const MFIter mfi)
noexcept

◆ array() [3/8]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type const > amrex::FabArray< FAB >::array ( const MFIter mfi,
int  start_comp 
) const
noexcept

◆ array() [4/8]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type > amrex::FabArray< FAB >::array ( const MFIter mfi,
int  start_comp 
)
noexcept

◆ array() [5/8]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type const > amrex::FabArray< FAB >::array ( int  K) const
noexcept

◆ array() [6/8]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type > amrex::FabArray< FAB >::array ( int  K)
noexcept

◆ array() [7/8]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type const > amrex::FabArray< FAB >::array ( int  K,
int  start_comp 
) const
noexcept

◆ array() [8/8]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type > amrex::FabArray< FAB >::array ( int  K,
int  start_comp 
)
noexcept

◆ arrays() [1/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
MultiArray4< typename FabArray< FAB >::value_type const > amrex::FabArray< FAB >::arrays
noexcept

◆ arrays() [2/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
MultiArray4< typename FabArray< FAB >::value_type > amrex::FabArray< FAB >::arrays
noexcept

◆ atLocalIdx() [1/2]

template<class FAB >
const FAB& amrex::FabArray< FAB >::atLocalIdx ( int  L) const
inlinenoexcept

◆ atLocalIdx() [2/2]

template<class FAB >
FAB& amrex::FabArray< FAB >::atLocalIdx ( int  L)
inlinenoexcept

Return a reference to the FAB associated with local index L.

◆ build_arrays()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::build_arrays
private

◆ BuildMask()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::BuildMask ( const Box phys_domain,
const Periodicity period,
value_type  covered,
value_type  notcovered,
value_type  physbnd,
value_type  interior 
)

◆ clear()

template<class FAB >
void amrex::FabArray< FAB >::clear

Releases FAB memory in the FabArray.

< addThisBD is called in define

◆ clear_arrays()

template<class FAB >
void amrex::FabArray< FAB >::clear_arrays
private

◆ CMD_local_setVal_gpu()

template<class FAB >
void FabArray::CMD_local_setVal_gpu ( value_type  x,
const CommMetaData thecmd,
int  scomp,
int  ncomp 
)

◆ CMD_remote_setVal_gpu()

template<class FAB >
void FabArray::CMD_remote_setVal_gpu ( value_type  x,
const CommMetaData thecmd,
int  scomp,
int  ncomp 
)

◆ const_array() [1/4]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type const > amrex::FabArray< FAB >::const_array ( const MFIter mfi) const
noexcept

◆ const_array() [2/4]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type const > amrex::FabArray< FAB >::const_array ( const MFIter mfi,
int  start_comp 
) const
noexcept

◆ const_array() [3/4]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type const > amrex::FabArray< FAB >::const_array ( int  K) const
noexcept

◆ const_array() [4/4]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
Array4< typename FabArray< FAB >::value_type const > amrex::FabArray< FAB >::const_array ( int  K,
int  start_comp 
) const
noexcept

◆ const_arrays()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
MultiArray4< typename FabArray< FAB >::value_type const > amrex::FabArray< FAB >::const_arrays
noexcept

◆ copy() [1/4]

template<class FAB >
void amrex::FabArray< FAB >::copy ( const FabArray< FAB > &  src,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY 
)
inline

◆ copy() [2/4]

template<class FAB >
void amrex::FabArray< FAB >::copy ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
const IntVect src_nghost,
const IntVect dst_nghost,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY 
)
inline

◆ copy() [3/4]

template<class FAB >
void amrex::FabArray< FAB >::copy ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY 
)
inline

◆ copy() [4/4]

template<class FAB >
void amrex::FabArray< FAB >::copy ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
int  src_nghost,
int  dst_nghost,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY 
)
inline

◆ copyTo() [1/2]

template<class FAB >
void amrex::FabArray< FAB >::copyTo ( FAB &  dest,
int  nghost = 0 
) const

Copy the values contained in the intersection of the valid + nghost region of this FabArray with the FAB dest into dest. Note that FAB dest is assumed to be identical on each process.

◆ copyTo() [2/2]

template<class FAB >
void amrex::FabArray< FAB >::copyTo ( FAB &  dest,
int  scomp,
int  dcomp,
int  ncomp,
int  nghost = 0 
) const

Copy the values contained in the intersection of the num_comp component valid + nghost region of this FabArray, starting at component src_comp, with the FAB dest into dest, starting at component dest_comp in dest. Note that FAB dest is assumed to be identical on each process.

◆ define() [1/2]

template<class FAB >
void amrex::FabArray< FAB >::define ( const BoxArray bxs,
const DistributionMapping dm,
int  nvar,
const IntVect ngrow,
const MFInfo info = MFInfo(),
const FabFactory< FAB > &  factory = DefaultFabFactory<FAB>() 
)

◆ define() [2/2]

template<class FAB >
void amrex::FabArray< FAB >::define ( const BoxArray bxs,
const DistributionMapping dm,
int  nvar,
int  ngrow,
const MFInfo info = MFInfo(),
const FabFactory< FAB > &  factory = DefaultFabFactory<FAB>() 
)

Define this FabArray identically to that performed by the constructor having an analogous function signature. This is only valid if this FabArray was defined using the default constructor.

◆ defined() [1/2]

template<class FAB >
bool amrex::FabArray< FAB >::defined ( const MFIter mfi) const
noexcept

◆ defined() [2/2]

template<class FAB >
bool amrex::FabArray< FAB >::defined ( int  K) const
noexcept

◆ EnforcePeriodicity() [1/3]

template<class FAB >
void amrex::FabArray< FAB >::EnforcePeriodicity ( const Periodicity period)

Fill ghost cells with values from their corresponding cells across periodic boundaries, regardless of whether the corresponding cells are valid. This differs from FillBoundary, which only fills from valid cells, and does not fill from ghost cells. The BoxArray is allowed to be overlapping.

◆ EnforcePeriodicity() [2/3]

template<class FAB >
void amrex::FabArray< FAB >::EnforcePeriodicity ( int  scomp,
int  ncomp,
const IntVect nghost,
const Periodicity period 
)

◆ EnforcePeriodicity() [3/3]

template<class FAB >
void amrex::FabArray< FAB >::EnforcePeriodicity ( int  scomp,
int  ncomp,
const Periodicity period 
)

◆ fabPtr() [1/4]

template<class FAB >
FAB const * amrex::FabArray< FAB >::fabPtr ( const MFIter mfi) const
noexcept

◆ fabPtr() [2/4]

template<class FAB >
FAB * amrex::FabArray< FAB >::fabPtr ( const MFIter mfi)
noexcept

Return pointer to FAB.

◆ fabPtr() [3/4]

template<class FAB >
FAB const * amrex::FabArray< FAB >::fabPtr ( int  K) const
noexcept

◆ fabPtr() [4/4]

template<class FAB >
FAB * amrex::FabArray< FAB >::fabPtr ( int  K)
noexcept

◆ Factory()

template<class FAB >
const FabFactory<FAB>& amrex::FabArray< FAB >::Factory ( ) const
inlinenoexcept

◆ FB_local_copy_cpu()

template<class FAB >
void FabArray::FB_local_copy_cpu ( const FB TheFB,
int  scomp,
int  ncomp 
)

◆ FB_local_copy_gpu()

template<class FAB >
void FabArray::FB_local_copy_gpu ( const FB TheFB,
int  scomp,
int  ncomp 
)

◆ FBEP_nowait() [1/2]

template<class FAB >
template<typename BUF , class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::FBEP_nowait ( int  scomp,
int  ncomp,
const IntVect nghost,
const Periodicity period,
bool  cross,
bool  enforce_periodicity_only,
bool  override_sync 
)

◆ FBEP_nowait() [2/2]

template<class FAB >
template<typename BUF = value_type, class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void amrex::FabArray< FAB >::FBEP_nowait ( int  scomp,
int  ncomp,
const IntVect nghost,
const Periodicity period,
bool  cross,
bool  enforce_periodicity_only = false,
bool  override_sync = false 
)

◆ FillBoundary() [1/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary ( bool  cross = false)

Copy on intersection within a FabArray. Data is copied from valid regions to intersecting regions of definition. The purpose is to fill in the boundary regions of each FAB in the FabArray. If cross=true, corner cells are not filled. If the length of periodic is provided, periodic boundaries are also filled. Note that FabArray itself does not contains any periodicity information. FillBoundary expects that its cell-centered version of its BoxArray is non-overlapping.

◆ FillBoundary() [2/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary ( const IntVect nghost,
const Periodicity period,
bool  cross = false 
)

◆ FillBoundary() [3/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary ( const Periodicity period,
bool  cross = false 
)

◆ FillBoundary() [4/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary ( int  scomp,
int  ncomp,
bool  cross = false 
)

Same as FillBoundary(), but only copies ncomp components starting at scomp.

◆ FillBoundary() [5/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary ( int  scomp,
int  ncomp,
const IntVect nghost,
const Periodicity period,
bool  cross = false 
)

◆ FillBoundary() [6/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary ( int  scomp,
int  ncomp,
const Periodicity period,
bool  cross = false 
)

◆ FillBoundary_finish() [1/2]

template<class FAB >
template<typename BUF = value_type, class F = FAB, std::enable_if_t< IsBaseFab< F >::value, int > = 0>
void amrex::FabArray< FAB >::FillBoundary_finish ( )

◆ FillBoundary_finish() [2/2]

template<class FAB >
template<typename BUF , class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::FillBoundary_finish ( )

◆ FillBoundary_nowait() [1/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary_nowait ( bool  cross = false)

◆ FillBoundary_nowait() [2/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary_nowait ( const IntVect nghost,
const Periodicity period,
bool  cross = false 
)

◆ FillBoundary_nowait() [3/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary_nowait ( const Periodicity period,
bool  cross = false 
)

◆ FillBoundary_nowait() [4/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary_nowait ( int  scomp,
int  ncomp,
bool  cross = false 
)

◆ FillBoundary_nowait() [5/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary_nowait ( int  scomp,
int  ncomp,
const IntVect nghost,
const Periodicity period,
bool  cross = false 
)

◆ FillBoundary_nowait() [6/6]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::FillBoundary_nowait ( int  scomp,
int  ncomp,
const Periodicity period,
bool  cross = false 
)

◆ FillBoundary_test()

template<class FAB >
void FabArray::FillBoundary_test ( )

◆ FillBoundaryAndSync() [1/2]

template<class FAB >
void amrex::FabArray< FAB >::FillBoundaryAndSync ( const Periodicity period = Periodicity::NonPeriodic())

Fill ghost cells and synchronize nodal data. Ghost regions are filled with data from the intersecting valid regions. The synchronization will override valid regions by the intersecting valid regions with a higher precedence. The smaller the global box index is, the higher precedence the box has. With periodic boundaries, for cells in the same box, those near the lower corner have higher precedence than those near the upper corner.

Parameters
periodperiodic length if it's non-zero

◆ FillBoundaryAndSync() [2/2]

template<class FAB >
void amrex::FabArray< FAB >::FillBoundaryAndSync ( int  scomp,
int  ncomp,
const IntVect nghost,
const Periodicity period 
)

Fill ghost cells and synchronize nodal data. Ghost regions are filled with data from the intersecting valid regions. The synchronization will override valid regions by the intersecting valid regions with a higher precedence. The smaller the global box index is, the higher precedence the box has. With periodic boundaries, for cells in the same box, those near the lower corner have higher precedence than those near the upper corner.

Parameters
scompstarting component
ncompnumber of components
nghostnumber of ghost cells to fill
periodperiodic length if it's non-zero

◆ FillBoundaryAndSync_finish()

template<class FAB >
void amrex::FabArray< FAB >::FillBoundaryAndSync_finish

◆ FillBoundaryAndSync_nowait() [1/2]

template<class FAB >
void amrex::FabArray< FAB >::FillBoundaryAndSync_nowait ( const Periodicity period = Periodicity::NonPeriodic())

◆ FillBoundaryAndSync_nowait() [2/2]

template<class FAB >
void amrex::FabArray< FAB >::FillBoundaryAndSync_nowait ( int  scomp,
int  ncomp,
const IntVect nghost,
const Periodicity period 
)

◆ get() [1/4]

template<class FAB >
const FAB& amrex::FabArray< FAB >::get ( const MFIter mfi) const
inlinenoexcept

Return a constant reference to the FAB associated with mfi.

◆ get() [2/4]

template<class FAB >
FAB& amrex::FabArray< FAB >::get ( const MFIter mfi)
inlinenoexcept

Returns a reference to the FAB associated mfi.

◆ get() [3/4]

template<class FAB >
const FAB& amrex::FabArray< FAB >::get ( int  K) const
inlinenoexcept

Return a constant reference to the FAB associated with the Kth element.

◆ get() [4/4]

template<class FAB >
FAB& amrex::FabArray< FAB >::get ( int  K)
inlinenoexcept

Return a reference to the FAB associated with the Kth element.

◆ hasEBFabFactory()

template<class FAB >
bool amrex::FabArray< FAB >::hasEBFabFactory ( ) const
inlinenoexcept

◆ invert() [1/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::invert ( value_type  numerator,
const Box region,
int  comp,
int  num_comp,
int  nghost = 0 
)

◆ invert() [2/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::invert ( value_type  numerator,
int  comp,
int  num_comp,
int  nghost = 0 
)

◆ isAllRegular()

template<class FAB >
bool amrex::FabArray< FAB >::isAllRegular ( ) const
inlinenoexcept

◆ isDefined()

template<class FAB >
bool amrex::FabArray< FAB >::isDefined

Has define() been called on this rank?

Returns
true if define has been called on this FabArray. Note that all constructors except FabArray () and FabArray(Arena*a) call define, even if the MFInfo argument has alloc=false. One could also use FabArrayBase::empty() to find whether define is called or not, although they are not exactly the same.

◆ LinComb()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > FOO>
void amrex::FabArray< FAB >::LinComb ( FabArray< FAB > &  dst,
value_type  a,
const FabArray< FAB > &  x,
int  xcomp,
value_type  b,
const FabArray< FAB > &  y,
int  ycomp,
int  dstcomp,
int  numcomp,
const IntVect nghost 
)
static

dst = a*x + b*y

Parameters
dstdestination FabArray
ascalar a
xFabArray x
xcompstarting component of x
bscalar b
yFabArray y
ycompstarting component of y
dstcompstarting component of destination
numcompnumber of components
nghostnumber of ghost cells

◆ LocalAdd()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::LocalAdd ( FabArray< FAB > const &  src,
int  scomp,
int  dcomp,
int  ncomp,
IntVect const &  nghost 
)

Perform local addition of FabArray data.

The two FabArrays must have the same BoxArray and DistributionMapping.

Parameters
srcsource FabArray
scompstarting component of source
dcompstarting component of this FabArray
ncompnumber of components
nghostnumber of ghost cells

◆ LocalCopy()

template<class FAB >
template<typename SFAB , typename DFAB , std::enable_if_t< std::conjunction_v< IsBaseFab< DFAB >, IsBaseFab< SFAB >, std::is_convertible< typename SFAB::value_type, typename DFAB::value_type >>, int > >
void amrex::FabArray< FAB >::LocalCopy ( FabArray< SFAB > const &  src,
int  scomp,
int  dcomp,
int  ncomp,
IntVect const &  nghost 
)

Perform local copy of FabArray data.

The two FabArrays must have the same BoxArray and DistributionMapping, although they could have different data types. For example, this could be used to copy from FabArray<BaseFab<float>> to FabArray<BaseFab<double>>.

Parameters
srcsource FabArray
scompstarting component of source
dcompstarting component of this FabArray
ncompnumber of components
nghostnumber of ghost cells

◆ mult() [1/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::mult ( value_type  val,
const Box region,
int  comp,
int  num_comp,
int  nghost = 0 
)

◆ mult() [2/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::mult ( value_type  val,
int  comp,
int  num_comp,
int  nghost = 0 
)

◆ norminf() [1/2]

template<class FAB >
template<typename IFAB , typename F , std::enable_if_t< IsBaseFab< F >::value, int > FOO>
F::value_type amrex::FabArray< FAB >::norminf ( FabArray< IFAB > const &  mask,
int  comp,
int  ncomp,
IntVect const &  nghost,
bool  local = false 
) const

Return infinity norm in masked region.

Parameters
maskonly mask=true region is included
compstarting component
ncompnumber of components
nghostnumber of ghost cells
localIf true, MPI communication is skipped.

◆ norminf() [2/2]

template<class FAB >
template<typename F , std::enable_if_t< IsBaseFab< F >::value, int > FOO>
F::value_type amrex::FabArray< FAB >::norminf ( int  comp,
int  ncomp,
IntVect const &  nghost,
bool  local = false,
[[maybe_unused] ] bool  ignore_covered = false 
) const

Return infinity norm.

Parameters
compstarting component
ncompnumber of components
nghostnumber of ghost cells
localIf true, MPI communication is skipped.
ignore_coveredignore covered cells. Only relevant for cell-centered EB data.

◆ ok()

template<class FAB >
bool amrex::FabArray< FAB >::ok

Return true if the FabArray is well-defined. That is, the FabArray has a BoxArray and DistributionMapping, the FABs are allocated for each Box in the BoxArray and the sizes of the FABs and the number of components are consistent with the definition of the FabArray.

◆ operator=() [1/3]

template<class FAB >
FabArray<FAB>& amrex::FabArray< FAB >::operator= ( const FabArray< FAB > &  rhs)
delete

◆ operator=() [2/3]

template<class FAB >
FabArray< FAB > & amrex::FabArray< FAB >::operator= ( FabArray< FAB > &&  rhs)
noexcept

◆ operator=() [3/3]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
FabArray< FAB > & amrex::FabArray< FAB >::operator= ( value_type  val)

Set all components in the entire region of each FAB to val.

◆ operator[]() [1/4]

template<class FAB >
const FAB& amrex::FabArray< FAB >::operator[] ( const MFIter mfi) const
inlinenoexcept

Return a constant reference to the FAB associated with mfi.

◆ operator[]() [2/4]

template<class FAB >
FAB& amrex::FabArray< FAB >::operator[] ( const MFIter mfi)
inlinenoexcept

Returns a reference to the FAB associated mfi.

◆ operator[]() [3/4]

template<class FAB >
const FAB& amrex::FabArray< FAB >::operator[] ( int  K) const
inlinenoexcept

Return a constant reference to the FAB associated with the Kth element.

◆ operator[]() [4/4]

template<class FAB >
FAB& amrex::FabArray< FAB >::operator[] ( int  K)
inlinenoexcept

Return a reference to the FAB associated with the Kth element.

◆ OverrideSync() [1/2]

template<class FAB >
void amrex::FabArray< FAB >::OverrideSync ( const Periodicity period = Periodicity::NonPeriodic())

Synchronize nodal data. The synchronization will override valid regions by the intersecting valid regions with a higher precedence. The smaller the global box index is, the higher precedence the box has. With periodic boundaries, for cells in the same box, those near the lower corner have higher precedence than those near the upper corner.

Parameters
periodperiodic length if it's non-zero

◆ OverrideSync() [2/2]

template<class FAB >
void amrex::FabArray< FAB >::OverrideSync ( int  scomp,
int  ncomp,
const Periodicity period 
)

Synchronize nodal data. The synchronization will override valid regions by the intersecting valid regions with a higher precedence. The smaller the global box index is, the higher precedence the box has. With periodic boundaries, for cells in the same box, those near the lower corner have higher precedence than those near the upper corner.

Parameters
scompstarting component
ncompnumber of components
periodperiodic length if it's non-zero

◆ OverrideSync_finish()

template<class FAB >
void amrex::FabArray< FAB >::OverrideSync_finish

◆ OverrideSync_nowait() [1/2]

template<class FAB >
void amrex::FabArray< FAB >::OverrideSync_nowait ( const Periodicity period = Periodicity::NonPeriodic())

◆ OverrideSync_nowait() [2/2]

template<class FAB >
void amrex::FabArray< FAB >::OverrideSync_nowait ( int  scomp,
int  ncomp,
const Periodicity period 
)

◆ pack_send_buffer_cpu() [1/2]

template<class FAB >
template<typename BUF = value_type>
static void amrex::FabArray< FAB >::pack_send_buffer_cpu ( FabArray< FAB > const &  src,
int  scomp,
int  ncomp,
Vector< char * > const &  send_data,
Vector< std::size_t > const &  send_size,
Vector< const CopyComTagsContainer * > const &  send_cctc 
)
static

◆ pack_send_buffer_cpu() [2/2]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::pack_send_buffer_cpu ( FabArray< FAB > const &  src,
int  scomp,
int  ncomp,
Vector< char * > const &  send_data,
Vector< std::size_t > const &  send_size,
Vector< CopyComTagsContainer const * > const &  send_cctc 
)

◆ pack_send_buffer_gpu() [1/2]

template<class FAB >
template<typename BUF = value_type>
static void amrex::FabArray< FAB >::pack_send_buffer_gpu ( FabArray< FAB > const &  src,
int  scomp,
int  ncomp,
Vector< char * > const &  send_data,
Vector< std::size_t > const &  send_size,
Vector< const CopyComTagsContainer * > const &  send_cctc 
)
static

◆ pack_send_buffer_gpu() [2/2]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::pack_send_buffer_gpu ( FabArray< FAB > const &  src,
int  scomp,
int  ncomp,
Vector< char * > const &  send_data,
Vector< std::size_t > const &  send_size,
Vector< CopyComTagsContainer const * > const &  send_cctc 
)

◆ ParallelAdd() [1/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelAdd ( const FabArray< FAB > &  src,
const Periodicity period = Periodicity::NonPeriodic() 
)
inline

This function copies data from src to this FabArray. Each FAB in fa is intersected with all FABs in this FabArray and a copy is performed on the region of intersection. The intersection is restricted to the valid regions.

◆ ParallelAdd() [2/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelAdd ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
const IntVect src_nghost,
const IntVect dst_nghost,
const Periodicity period = Periodicity::NonPeriodic() 
)
inline

◆ ParallelAdd() [3/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelAdd ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
const Periodicity period = Periodicity::NonPeriodic() 
)
inline

This function copies data from src to this FabArray. Each FAB in src is intersected with all FABs in this FabArray and a copy is performed on the region of intersection. The intersection is restricted to the num_comp components starting at src_comp in the FabArray src, with the destination components in this FabArray starting at dest_comp.

◆ ParallelAdd() [4/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelAdd ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
int  src_nghost,
int  dst_nghost,
const Periodicity period = Periodicity::NonPeriodic() 
)
inline

Similar to the above function, except that source and destination are grown by src_nghost and dst_nghost, respectively.

◆ ParallelAdd_nowait() [1/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelAdd_nowait ( const FabArray< FAB > &  src,
const Periodicity period = Periodicity::NonPeriodic() 
)
inline

◆ ParallelAdd_nowait() [2/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelAdd_nowait ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
const IntVect src_nghost,
const IntVect dst_nghost,
const Periodicity period = Periodicity::NonPeriodic() 
)
inline

◆ ParallelAdd_nowait() [3/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelAdd_nowait ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
const Periodicity period = Periodicity::NonPeriodic() 
)
inline

◆ ParallelAdd_nowait() [4/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelAdd_nowait ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
int  src_nghost,
int  dst_nghost,
const Periodicity period = Periodicity::NonPeriodic() 
)
inline

◆ ParallelCopy() [1/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopy ( const FabArray< FAB > &  src,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY 
)
inline

◆ ParallelCopy() [2/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopy ( const FabArray< FAB > &  src,
int  scomp,
int  dcomp,
int  ncomp,
const IntVect snghost,
const IntVect dnghost,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY,
const FabArrayBase::CPC a_cpc = nullptr 
)

◆ ParallelCopy() [3/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopy ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY 
)
inline

◆ ParallelCopy() [4/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopy ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
int  src_nghost,
int  dst_nghost,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY 
)
inline

◆ ParallelCopy_finish()

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopy_finish ( )

◆ ParallelCopy_nowait() [1/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopy_nowait ( const FabArray< FAB > &  src,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY 
)
inline

◆ ParallelCopy_nowait() [2/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopy_nowait ( const FabArray< FAB > &  src,
int  scomp,
int  dcomp,
int  ncomp,
const IntVect snghost,
const IntVect dnghost,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY,
const FabArrayBase::CPC a_cpc = nullptr,
bool  to_ghost_cells_only = false 
)

◆ ParallelCopy_nowait() [3/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopy_nowait ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY 
)
inline

◆ ParallelCopy_nowait() [4/4]

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopy_nowait ( const FabArray< FAB > &  src,
int  src_comp,
int  dest_comp,
int  num_comp,
int  src_nghost,
int  dst_nghost,
const Periodicity period = Periodicity::NonPeriodic(),
CpOp  op = FabArrayBase::COPY 
)
inline

◆ ParallelCopyToGhost()

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopyToGhost ( const FabArray< FAB > &  src,
int  scomp,
int  dcomp,
int  ncomp,
const IntVect snghost,
const IntVect dnghost,
const Periodicity period = Periodicity::NonPeriodic() 
)

◆ ParallelCopyToGhost_finish()

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopyToGhost_finish ( )

◆ ParallelCopyToGhost_nowait()

template<class FAB >
void amrex::FabArray< FAB >::ParallelCopyToGhost_nowait ( const FabArray< FAB > &  src,
int  scomp,
int  dcomp,
int  ncomp,
const IntVect snghost,
const IntVect dnghost,
const Periodicity period = Periodicity::NonPeriodic() 
)

◆ PC_local_cpu()

template<class FAB >
void FabArray::PC_local_cpu ( const CPC thecpc,
FabArray< FAB > const &  src,
int  scomp,
int  dcomp,
int  ncomp,
CpOp  op 
)

◆ PC_local_gpu()

template<class FAB >
void FabArray::PC_local_gpu ( const CPC thecpc,
FabArray< FAB > const &  src,
int  scomp,
int  dcomp,
int  ncomp,
CpOp  op 
)

◆ plus() [1/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::plus ( value_type  val,
const Box region,
int  comp,
int  num_comp,
int  nghost = 0 
)

◆ plus() [2/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::plus ( value_type  val,
int  comp,
int  num_comp,
int  nghost = 0 
)

◆ prefetchToDevice()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::prefetchToDevice ( const MFIter mfi) const
noexcept

◆ prefetchToHost()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::prefetchToHost ( const MFIter mfi) const
noexcept

◆ RecvLayoutMask()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
LayoutData< int > amrex::FabArray< FAB >::RecvLayoutMask ( const CommMetaData thecmd)

◆ Redistribute()

template<class FAB >
void FabArray::Redistribute ( const FabArray< FAB > &  src,
int  scomp,
int  dcomp,
int  ncomp,
const IntVect nghost 
)

Copy from src to this. this and src have the same BoxArray, but different DistributionMapping.

◆ release() [1/2]

template<class FAB >
AMREX_NODISCARD FAB * amrex::FabArray< FAB >::release ( const MFIter mfi)

Release ownership of the FAB. This function is not thread safe.

◆ release() [2/2]

template<class FAB >
AMREX_NODISCARD FAB * amrex::FabArray< FAB >::release ( int  K)

Release ownership of the FAB. This function is not thread safe.

◆ Saxpy()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > FOO>
void amrex::FabArray< FAB >::Saxpy ( FabArray< FAB > &  y,
value_type  a,
FabArray< FAB > const &  x,
int  xcomp,
int  ycomp,
int  ncomp,
IntVect const &  nghost 
)
static

y += a*x

Parameters
yFabArray y
ascalar a
xFabArray x
xcompstarting component of x
ycompstarting component of y
ncompnumber of components
nghostnumber of ghost cells

◆ setBndry() [1/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setBndry ( value_type  val)

Set all values in the boundary region to val.

◆ setBndry() [2/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::setBndry ( value_type  val,
int  strt_comp,
int  ncomp 
)

Set ncomp values in the boundary region, starting at start_comp to val.

◆ setDomainBndry() [1/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setDomainBndry ( value_type  val,
const Geometry geom 
)

Set all values outside the Geometry domain to val.

◆ setDomainBndry() [2/2]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setDomainBndry ( value_type  val,
int  strt_comp,
int  ncomp,
const Geometry geom 
)

Set ncomp values outside the Geometry domain to val, starting at start_comp.

◆ setFab() [1/4]

template<class FAB >
template<class F , std::enable_if_t< std::is_move_constructible_v< F >, int > >
void amrex::FabArray< FAB >::setFab ( const MFIter mfi,
FAB &&  elem 
)

Explicitly set the FAB associated with mfi in the FabArray to point to elem.

◆ setFab() [2/4]

template<class FAB >
void amrex::FabArray< FAB >::setFab ( const MFIter mfi,
std::unique_ptr< FAB >  elem 
)

Explicitly set the FAB associated with mfi in the FabArray to point to elem.

◆ setFab() [3/4]

template<class FAB >
template<class F , std::enable_if_t< std::is_move_constructible_v< F >, int > >
void amrex::FabArray< FAB >::setFab ( int  boxno,
FAB &&  elem 
)

Explicitly set the Kth FAB in the FabArray to point to elem.

◆ setFab() [4/4]

template<class FAB >
void amrex::FabArray< FAB >::setFab ( int  boxno,
std::unique_ptr< FAB >  elem 
)

Explicitly set the Kth FAB in the FabArray to point to elem.

◆ setFab_assert()

template<class FAB >
void amrex::FabArray< FAB >::setFab_assert ( int  K,
FAB const &  fab 
) const
private

◆ setVal() [1/10]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setVal ( value_type  val)

Set all components in the entire region of each FAB to val.

◆ setVal() [2/10]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setVal ( value_type  val,
const Box region,
const IntVect nghost 
)

◆ setVal() [3/10]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::setVal ( value_type  val,
const Box region,
int  comp,
int  ncomp,
const IntVect nghost 
)

◆ setVal() [4/10]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setVal ( value_type  val,
const Box region,
int  comp,
int  ncomp,
int  nghost = 0 
)

Set the value of num_comp components in the valid region of each FAB in the FabArray, starting at component comp, as well as nghost boundary cells, to val, provided they also intersect with the Box region.

◆ setVal() [5/10]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setVal ( value_type  val,
const Box region,
int  nghost 
)

Set all components in the valid region of each FAB in the FabArray to val, including nghost boundary cells, that also intersect the Box region.

◆ setVal() [6/10]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setVal ( value_type  val,
const CommMetaData thecmd,
int  scomp,
int  ncomp 
)

◆ setVal() [7/10]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setVal ( value_type  val,
const IntVect nghost 
)

◆ setVal() [8/10]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > Z>
void amrex::FabArray< FAB >::setVal ( value_type  val,
int  comp,
int  ncomp,
const IntVect nghost 
)

◆ setVal() [9/10]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setVal ( value_type  val,
int  comp,
int  ncomp,
int  nghost = 0 
)

Set the value of num_comp components in the valid region of each FAB in the FabArray, starting at component comp to val. Also set the value of nghost boundary cells.

◆ setVal() [10/10]

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > >
void amrex::FabArray< FAB >::setVal ( value_type  val,
int  nghost 
)

Set all components in the valid region of each FAB in the FabArray to val, including nghost boundary cells.

◆ SharedMemory()

template<class FAB >
bool amrex::FabArray< FAB >::SharedMemory ( ) const
inlineprotectednoexcept

◆ shift()

template<class FAB >
void amrex::FabArray< FAB >::shift ( const IntVect v)

Shift the boxarray by vector v.

◆ singleChunkPtr() [1/2]

template<class FAB >
value_type const* amrex::FabArray< FAB >::singleChunkPtr ( ) const
inlinenoexcept

Return the data pointer to the single chunk memory if this object uses a single contiguous chunk of memory, nullptr otherwise.

◆ singleChunkPtr() [2/2]

template<class FAB >
value_type* amrex::FabArray< FAB >::singleChunkPtr ( )
inlinenoexcept

Return the data pointer to the single chunk memory if this object uses a single contiguous chunk of memory, nullptr otherwise.

◆ singleChunkSize()

template<class FAB >
std::size_t amrex::FabArray< FAB >::singleChunkSize ( ) const
inlinenoexcept

Return the size of the single chunk memory if this object uses a single contiguous chunk of memory, 0 otherwise.

◆ sum()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > FOO>
F::value_type amrex::FabArray< FAB >::sum ( int  comp,
IntVect const &  nghost,
bool  local = false 
) const

Returns the sum of component "comp".

Parameters
compcomponent
nghostnumber of ghost cells
localIf true, MPI communication is skipped.

◆ SumBoundary() [1/4]

template<class FAB >
void amrex::FabArray< FAB >::SumBoundary ( const Periodicity period = Periodicity::NonPeriodic())

Sum values in overlapped cells. The destination is limited to valid cells.

◆ SumBoundary() [2/4]

template<class FAB >
void amrex::FabArray< FAB >::SumBoundary ( int  scomp,
int  ncomp,
const Periodicity period = Periodicity::NonPeriodic() 
)

◆ SumBoundary() [3/4]

template<class FAB >
void amrex::FabArray< FAB >::SumBoundary ( int  scomp,
int  ncomp,
IntVect const &  nghost,
const Periodicity period = Periodicity::NonPeriodic() 
)

Sum values in overlapped cells. The destination is limited to valid + ngrow cells.

◆ SumBoundary() [4/4]

template<class FAB >
void amrex::FabArray< FAB >::SumBoundary ( int  scomp,
int  ncomp,
IntVect const &  src_nghost,
IntVect const &  dst_nghost,
const Periodicity period = Periodicity::NonPeriodic() 
)

Sum values in overlapped cells. For computing the overlap, the dst is grown by dst_ngrow, while the src uses src_ngrow.

◆ SumBoundary_finish()

template<class FAB >
void amrex::FabArray< FAB >::SumBoundary_finish

◆ SumBoundary_nowait() [1/4]

template<class FAB >
void amrex::FabArray< FAB >::SumBoundary_nowait ( const Periodicity period = Periodicity::NonPeriodic())

◆ SumBoundary_nowait() [2/4]

template<class FAB >
void amrex::FabArray< FAB >::SumBoundary_nowait ( int  scomp,
int  ncomp,
const Periodicity period = Periodicity::NonPeriodic() 
)

◆ SumBoundary_nowait() [3/4]

template<class FAB >
void amrex::FabArray< FAB >::SumBoundary_nowait ( int  scomp,
int  ncomp,
IntVect const &  nghost,
const Periodicity period = Periodicity::NonPeriodic() 
)

◆ SumBoundary_nowait() [4/4]

template<class FAB >
void amrex::FabArray< FAB >::SumBoundary_nowait ( int  scomp,
int  ncomp,
IntVect const &  src_nghost,
IntVect const &  dst_nghost,
const Periodicity period = Periodicity::NonPeriodic() 
)

◆ tags()

template<class FAB >
const Vector<std::string>& amrex::FabArray< FAB >::tags ( ) const
inlinenoexcept

◆ unpack_recv_buffer_cpu() [1/2]

template<class FAB >
template<typename BUF = value_type>
static void amrex::FabArray< FAB >::unpack_recv_buffer_cpu ( FabArray< FAB > &  dst,
int  dcomp,
int  ncomp,
Vector< char * > const &  recv_data,
Vector< std::size_t > const &  recv_size,
Vector< const CopyComTagsContainer * > const &  recv_cctc,
CpOp  op,
bool  is_thread_safe 
)
static

◆ unpack_recv_buffer_cpu() [2/2]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::unpack_recv_buffer_cpu ( FabArray< FAB > &  dst,
int  dcomp,
int  ncomp,
Vector< char * > const &  recv_data,
Vector< std::size_t > const &  recv_size,
Vector< CopyComTagsContainer const * > const &  recv_cctc,
CpOp  op,
bool  is_thread_safe 
)

◆ unpack_recv_buffer_gpu() [1/2]

template<class FAB >
template<typename BUF = value_type>
static void amrex::FabArray< FAB >::unpack_recv_buffer_gpu ( FabArray< FAB > &  dst,
int  dcomp,
int  ncomp,
Vector< char * > const &  recv_data,
Vector< std::size_t > const &  recv_size,
Vector< const CopyComTagsContainer * > const &  recv_cctc,
CpOp  op,
bool  is_thread_safe 
)
static

◆ unpack_recv_buffer_gpu() [2/2]

template<class FAB >
template<typename BUF >
void amrex::FabArray< FAB >::unpack_recv_buffer_gpu ( FabArray< FAB > &  dst,
int  dcomp,
int  ncomp,
Vector< char * > const &  recv_data,
Vector< std::size_t > const &  recv_size,
Vector< CopyComTagsContainer const * > const &  recv_cctc,
CpOp  op,
bool  is_thread_safe 
)

◆ Xpay()

template<class FAB >
template<class F , std::enable_if_t< IsBaseFab< F >::value, int > FOO>
void amrex::FabArray< FAB >::Xpay ( FabArray< FAB > &  y,
value_type  a,
FabArray< FAB > const &  x,
int  xcomp,
int  ycomp,
int  ncomp,
IntVect const &  nghost 
)
static

y = x + a*y

Parameters
yFabArray y
ascalar a
xFabArray x
xcompstarting component of x
ycompstarting component of y
ncompnumber of components
nghostnumber of ghost cells

Member Data Documentation

◆ define_function_called

template<class FAB >
bool amrex::FabArray< FAB >::define_function_called = false
protected

has define() been called?

◆ fbd

template<class FAB >
std::unique_ptr<FBData<FAB> > amrex::FabArray< FAB >::fbd

◆ m_arrays

template<class FAB >
MultiArray4<value_type> amrex::FabArray< FAB >::m_arrays
mutableprotected

◆ m_const_arrays

template<class FAB >
MultiArray4<value_type const> amrex::FabArray< FAB >::m_const_arrays
mutableprotected

◆ m_dallocator

template<class FAB >
DataAllocator amrex::FabArray< FAB >::m_dallocator
protected

◆ m_dp_arrays

template<class FAB >
void* amrex::FabArray< FAB >::m_dp_arrays = nullptr
mutableprotected

◆ m_fabs_v

template<class FAB >
std::vector<FAB*> amrex::FabArray< FAB >::m_fabs_v
protected

The data.

◆ m_factory

template<class FAB >
std::unique_ptr<FabFactory<FAB> > amrex::FabArray< FAB >::m_factory
protected

◆ m_hp_arrays

template<class FAB >
void* amrex::FabArray< FAB >::m_hp_arrays = nullptr
mutableprotected

◆ m_single_chunk_arena

template<class FAB >
std::unique_ptr<detail::SingleChunkArena> amrex::FabArray< FAB >::m_single_chunk_arena
protected

◆ m_single_chunk_size

template<class FAB >
Long amrex::FabArray< FAB >::m_single_chunk_size = 0
protected

◆ m_tags

template<class FAB >
Vector<std::string> amrex::FabArray< FAB >::m_tags
protected

◆ os_temp

template<class FAB >
std::unique_ptr< FabArray<FAB> > amrex::FabArray< FAB >::os_temp

◆ pcd

template<class FAB >
std::unique_ptr<PCData<FAB> > amrex::FabArray< FAB >::pcd

◆ shmem

template<class FAB >
ShMem amrex::FabArray< FAB >::shmem
protected

The documentation for this class was generated from the following files: