Block-Structured AMR Software Framework
amrex::MFIter Class Reference

#include <AMReX_MFIter.H>

Inheritance diagram for amrex::MFIter:
amrex::ParIterBase_impl< true, T_ParticleType, 0, 0, DefaultAllocator, DefaultAssignor > amrex::ParIterBase_impl< false, T_ParticleType, 0, 0, DefaultAllocator, DefaultAssignor > amrex::FabSetIter amrex::FillPatchIterator amrex::MultiMaskIter amrex::ParIterBase_impl< is_const, T_ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor > amrex::ParConstIter_impl< T_ParticleType, NArrayReal, NArrayInt, Allocator, T_CellAssignor > amrex::ParIter_impl< T_ParticleType, NArrayReal, NArrayInt, Allocator, T_CellAssignor >

Classes

struct  DeviceSync
 

Public Types

enum  Flags { Tiling = 0x01 , AllBoxes = 0x02 , NoTeamBarrier = 0x04 }
 Flags that specify tiling modes. All these flags are off by default. More...
 

Public Member Functions

 MFIter (const FabArrayBase &fabarray, unsigned char flags_=0)
 The default constructor does not enable tiling (flags_ is set to 0 by default). However, the tiling mode can be enabled by explicitly turning the tiling flag on (i.e. flags_ = Tiling). The tile size in this case is defined by FabArrayBase::mfiter_tile_size. More...
 
 MFIter (const FabArrayBase &fabarray, bool do_tiling)
 Enable tiling with the default tile size, which is defined by FabArrayBase::mfiter_tile_size. More...
 
 MFIter (const FabArrayBase &fabarray, const IntVect &tilesize, unsigned char flags_=0)
 Enable tiling with explicit tile size and flags (See type Flags for more information) More...
 
 MFIter (const BoxArray &ba, const DistributionMapping &dm, unsigned char flags_=0)
 
 MFIter (const BoxArray &ba, const DistributionMapping &dm, bool do_tiling)
 
 MFIter (const BoxArray &ba, const DistributionMapping &dm, const IntVect &tilesize, unsigned char flags_=0)
 
 MFIter (const FabArrayBase &fabarray, const MFItInfo &info)
 
 MFIter (const BoxArray &ba, const DistributionMapping &dm, const MFItInfo &info)
 
 MFIter (MFIter &&rhs)=default
 
 MFIter (MFIter const &)=delete
 
MFIteroperator= (MFIter const &)=delete
 
MFIteroperator= (MFIter &&)=delete
 
 ~MFIter ()
 
Box tilebox () const noexcept
 Return the tile Box at the current index. More...
 
Box tilebox (const IntVect &nodal) const noexcept
 Return the tilebox with provided nodal flag. More...
 
Box tilebox (const IntVect &nodal, const IntVect &ngrow) const noexcept
 Return the tilebox with provided nodal flag and grown cells. More...
 
Box nodaltilebox (int dir=-1) const noexcept
 Return the dir-nodal (or all nodal if dir<0) Box at the current index. More...
 
Box growntilebox (int ng=-1000000) const noexcept
 Return the tile box at the current index grown to include ghost cells. More...
 
Box growntilebox (const IntVect &ng) const noexcept
 
Box grownnodaltilebox (int dir=-1, int ng=-1000000) const noexcept
 Return the dir-nodal (or all nodal if dir<0) box grown to include ghost cells. More...
 
Box grownnodaltilebox (int dir, const IntVect &ng) const noexcept
 
Box validbox () const noexcept
 Return the valid Box in which the current tile resides. More...
 
Box fabbox () const noexcept
 Return the Box of the FAB at which we currently point. More...
 
void operator++ () noexcept
 Increment iterator to the next tile we own. More...
 
bool isValid () const noexcept
 Is the iterator valid i.e. is it associated with a FAB? More...
 
int index () const noexcept
 The index into the underlying BoxArray of the current FAB. More...
 
int length () const noexcept
 The number of indices. More...
 
int LocalTileIndex () const noexcept
 The current local tile index in the current grid;. More...
 
int numLocalTiles () const noexcept
 The the number of tiles in the current grid;. More...
 
int LocalIndex () const noexcept
 Return local index into the vector of fab pointers, m_fabs_v When AllBoxes is on, local_index_map is a nullptr and local index is current index. More...
 
const FabArrayBasetheFabArrayBase () const noexcept
 Constant reference to FabArray over which we're iterating. More...
 
int tileIndex () const noexcept
 
const DistributionMappingDistributionMap () const noexcept
 
void Finalize ()
 

Static Public Member Functions

static int allowMultipleMFIters (int allow)
 
static int currentDepth ()
 

Protected Member Functions

void Initialize ()
 

Protected Attributes

std::unique_ptr< FabArrayBasem_fa
 This must be the first member! More...
 
const FabArrayBasefabArray
 
IntVect tile_size
 
unsigned char flags
 
int currentIndex
 
int beginIndex
 
int endIndex
 
int streams
 
IndexType typ
 
bool dynamic
 
bool finalized = false
 
DeviceSync device_sync
 
const Vector< int > * index_map
 
const Vector< int > * local_index_map
 
const Vector< Box > * tile_array
 
const Vector< int > * local_tile_index_map
 
const Vector< int > * num_local_tiles
 

Static Protected Attributes

static AMREX_EXPORT int nextDynamicIndex = std::numeric_limits<int>::min()
 
static AMREX_EXPORT int depth = 0
 
static AMREX_EXPORT int allow_multiple_mfiters = 0
 

Member Enumeration Documentation

◆ Flags

Flags that specify tiling modes. All these flags are off by default.

Enumerator
Tiling 

Tiling: Enabling the tiling mode.

AllBoxes 

AllBoxes: If on, all threads/workers loop over all boxes without tiling. This essentially loops over indexMap. Note that many functions won't work with this.

NoTeamBarrier 

NoTeamBarrier: This option is for Team only. If on, there is no barrier in MFIter dtor.

Constructor & Destructor Documentation

◆ MFIter() [1/10]

amrex::MFIter::MFIter ( const FabArrayBase fabarray,
unsigned char  flags_ = 0 
)
explicit

The default constructor does not enable tiling (flags_ is set to 0 by default). However, the tiling mode can be enabled by explicitly turning the tiling flag on (i.e. flags_ = Tiling). The tile size in this case is defined by FabArrayBase::mfiter_tile_size.

◆ MFIter() [2/10]

amrex::MFIter::MFIter ( const FabArrayBase fabarray,
bool  do_tiling 
)

Enable tiling with the default tile size, which is defined by FabArrayBase::mfiter_tile_size.

◆ MFIter() [3/10]

amrex::MFIter::MFIter ( const FabArrayBase fabarray,
const IntVect tilesize,
unsigned char  flags_ = 0 
)

Enable tiling with explicit tile size and flags (See type Flags for more information)

◆ MFIter() [4/10]

amrex::MFIter::MFIter ( const BoxArray ba,
const DistributionMapping dm,
unsigned char  flags_ = 0 
)

◆ MFIter() [5/10]

amrex::MFIter::MFIter ( const BoxArray ba,
const DistributionMapping dm,
bool  do_tiling 
)

◆ MFIter() [6/10]

amrex::MFIter::MFIter ( const BoxArray ba,
const DistributionMapping dm,
const IntVect tilesize,
unsigned char  flags_ = 0 
)

◆ MFIter() [7/10]

amrex::MFIter::MFIter ( const FabArrayBase fabarray,
const MFItInfo info 
)

◆ MFIter() [8/10]

amrex::MFIter::MFIter ( const BoxArray ba,
const DistributionMapping dm,
const MFItInfo info 
)

◆ MFIter() [9/10]

amrex::MFIter::MFIter ( MFIter &&  rhs)
default

◆ MFIter() [10/10]

amrex::MFIter::MFIter ( MFIter const &  )
delete

◆ ~MFIter()

amrex::MFIter::~MFIter ( )

Member Function Documentation

◆ allowMultipleMFIters()

int amrex::MFIter::allowMultipleMFIters ( int  allow)
static

◆ currentDepth()

int amrex::MFIter::currentDepth ( )
static

◆ DistributionMap()

const DistributionMapping& amrex::MFIter::DistributionMap ( ) const
inlinenoexcept

◆ fabbox()

Box amrex::MFIter::fabbox ( ) const
inlinenoexcept

Return the Box of the FAB at which we currently point.

◆ Finalize()

void amrex::MFIter::Finalize ( )

◆ grownnodaltilebox() [1/2]

Box amrex::MFIter::grownnodaltilebox ( int  dir,
const IntVect ng 
) const
noexcept

◆ grownnodaltilebox() [2/2]

Box amrex::MFIter::grownnodaltilebox ( int  dir = -1,
int  ng = -1000000 
) const
noexcept

Return the dir-nodal (or all nodal if dir<0) box grown to include ghost cells.

◆ growntilebox() [1/2]

Box amrex::MFIter::growntilebox ( const IntVect ng) const
noexcept

◆ growntilebox() [2/2]

Box amrex::MFIter::growntilebox ( int  ng = -1000000) const
noexcept

Return the tile box at the current index grown to include ghost cells.

◆ index()

int amrex::MFIter::index ( ) const
inlinenoexcept

The index into the underlying BoxArray of the current FAB.

◆ Initialize()

void amrex::MFIter::Initialize ( )
protected

◆ isValid()

bool amrex::MFIter::isValid ( ) const
inlinenoexcept

Is the iterator valid i.e. is it associated with a FAB?

◆ length()

int amrex::MFIter::length ( ) const
inlinenoexcept

The number of indices.

◆ LocalIndex()

int amrex::MFIter::LocalIndex ( ) const
inlinenoexcept

Return local index into the vector of fab pointers, m_fabs_v When AllBoxes is on, local_index_map is a nullptr and local index is current index.

◆ LocalTileIndex()

int amrex::MFIter::LocalTileIndex ( ) const
inlinenoexcept

The current local tile index in the current grid;.

◆ nodaltilebox()

Box amrex::MFIter::nodaltilebox ( int  dir = -1) const
noexcept

Return the dir-nodal (or all nodal if dir<0) Box at the current index.

◆ numLocalTiles()

int amrex::MFIter::numLocalTiles ( ) const
inlinenoexcept

The the number of tiles in the current grid;.

◆ operator++()

void amrex::MFIter::operator++ ( )
noexcept

Increment iterator to the next tile we own.

◆ operator=() [1/2]

MFIter& amrex::MFIter::operator= ( MFIter &&  )
delete

◆ operator=() [2/2]

MFIter& amrex::MFIter::operator= ( MFIter const &  )
delete

◆ theFabArrayBase()

const FabArrayBase& amrex::MFIter::theFabArrayBase ( ) const
inlinenoexcept

Constant reference to FabArray over which we're iterating.

◆ tilebox() [1/3]

Box amrex::MFIter::tilebox ( ) const
noexcept

Return the tile Box at the current index.

◆ tilebox() [2/3]

Box amrex::MFIter::tilebox ( const IntVect nodal) const
noexcept

Return the tilebox with provided nodal flag.

◆ tilebox() [3/3]

Box amrex::MFIter::tilebox ( const IntVect nodal,
const IntVect ngrow 
) const
noexcept

Return the tilebox with provided nodal flag and grown cells.

◆ tileIndex()

int amrex::MFIter::tileIndex ( ) const
inlinenoexcept

◆ validbox()

Box amrex::MFIter::validbox ( ) const
inlinenoexcept

Return the valid Box in which the current tile resides.

Member Data Documentation

◆ allow_multiple_mfiters

int amrex::MFIter::allow_multiple_mfiters = 0
staticprotected

◆ beginIndex

int amrex::MFIter::beginIndex
protected

◆ currentIndex

int amrex::MFIter::currentIndex
protected

◆ depth

int amrex::MFIter::depth = 0
staticprotected

◆ device_sync

DeviceSync amrex::MFIter::device_sync
protected

◆ dynamic

bool amrex::MFIter::dynamic
protected

◆ endIndex

int amrex::MFIter::endIndex
protected

◆ fabArray

const FabArrayBase* amrex::MFIter::fabArray
protected

◆ finalized

bool amrex::MFIter::finalized = false
protected

◆ flags

unsigned char amrex::MFIter::flags
protected

◆ index_map

const Vector<int>* amrex::MFIter::index_map
protected

◆ local_index_map

const Vector<int>* amrex::MFIter::local_index_map
protected

◆ local_tile_index_map

const Vector<int>* amrex::MFIter::local_tile_index_map
protected

◆ m_fa

std::unique_ptr<FabArrayBase> amrex::MFIter::m_fa
protected

This must be the first member!

◆ nextDynamicIndex

int amrex::MFIter::nextDynamicIndex = std::numeric_limits<int>::min()
staticprotected

◆ num_local_tiles

const Vector<int>* amrex::MFIter::num_local_tiles
protected

◆ streams

int amrex::MFIter::streams
protected

◆ tile_array

const Vector<Box>* amrex::MFIter::tile_array
protected

◆ tile_size

IntVect amrex::MFIter::tile_size
protected

◆ typ

IndexType amrex::MFIter::typ
protected

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