Block-Structured AMR Software Framework
amrex::LayoutData< T > Class Template Reference

a one-thingy-per-box distributed object More...

#include <AMReX_LayoutData.H>

Inheritance diagram for amrex::LayoutData< T >:
amrex::FabArrayBase

Public Member Functions

 LayoutData ()=default
 
 LayoutData (const BoxArray &a_grids, const DistributionMapping &a_dm)
 
void define (const BoxArray &a_grids, const DistributionMapping &a_dm)
 
 ~LayoutData ()
 
 LayoutData (const LayoutData &rhs) noexcept
 
 LayoutData (LayoutData &&rhs) noexcept
 
LayoutDataoperator= (const LayoutData &rhs) noexcept
 
LayoutDataoperator= (LayoutData &&rhs) noexcept
 
T & operator[] (const MFIter &a_mfi) noexcept
 
const T & operator[] (const MFIter &a_mfi) const noexcept
 
T & operator[] (int a_box_index) noexcept
 
const T & operator[] (int a_box_index) const noexcept
 
const T * data () const noexcept
 
T * data () noexcept
 
- 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...
 

Private Attributes

Vector< T > m_data
 
bool m_need_to_clear_bd = false
 

Additional Inherited Members

- 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
 
- 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 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
 
- 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 T>
class amrex::LayoutData< T >

a one-thingy-per-box distributed object

Constructor & Destructor Documentation

◆ LayoutData() [1/4]

template<class T >
amrex::LayoutData< T >::LayoutData ( )
default

◆ LayoutData() [2/4]

template<class T >
amrex::LayoutData< T >::LayoutData ( const BoxArray a_grids,
const DistributionMapping a_dm 
)
inline

◆ ~LayoutData()

template<class T >
amrex::LayoutData< T >::~LayoutData ( )
inline

◆ LayoutData() [3/4]

template<class T >
amrex::LayoutData< T >::LayoutData ( const LayoutData< T > &  rhs)
inlinenoexcept

◆ LayoutData() [4/4]

template<class T >
amrex::LayoutData< T >::LayoutData ( LayoutData< T > &&  rhs)
inlinenoexcept

Member Function Documentation

◆ data() [1/2]

template<class T >
const T* amrex::LayoutData< T >::data ( ) const
inlinenoexcept

◆ data() [2/2]

template<class T >
T* amrex::LayoutData< T >::data ( )
inlinenoexcept

◆ define()

template<class T >
void amrex::LayoutData< T >::define ( const BoxArray a_grids,
const DistributionMapping a_dm 
)
inline

◆ operator=() [1/2]

template<class T >
LayoutData& amrex::LayoutData< T >::operator= ( const LayoutData< T > &  rhs)
inlinenoexcept

◆ operator=() [2/2]

template<class T >
LayoutData& amrex::LayoutData< T >::operator= ( LayoutData< T > &&  rhs)
inlinenoexcept

◆ operator[]() [1/4]

template<class T >
const T& amrex::LayoutData< T >::operator[] ( const MFIter a_mfi) const
inlinenoexcept

◆ operator[]() [2/4]

template<class T >
T& amrex::LayoutData< T >::operator[] ( const MFIter a_mfi)
inlinenoexcept

◆ operator[]() [3/4]

template<class T >
const T& amrex::LayoutData< T >::operator[] ( int  a_box_index) const
inlinenoexcept

◆ operator[]() [4/4]

template<class T >
T& amrex::LayoutData< T >::operator[] ( int  a_box_index)
inlinenoexcept

Member Data Documentation

◆ m_data

template<class T >
Vector<T> amrex::LayoutData< T >::m_data
private

◆ m_need_to_clear_bd

template<class T >
bool amrex::LayoutData< T >::m_need_to_clear_bd = false
private

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