walberla::field::GhostLayerField< T, fSize_ > Class Template Reference

Detailed Description

template<typename T, uint_t fSize_>
class walberla::field::GhostLayerField< T, fSize_ >

Extends the Field with ghost-layer information.

All variants of the begin() function exist also in the "WithGhostLayer" variant which iterate over the field including the ghost layers. There are also iterators that go only over the ghost layer or, only over the last inner slice, which is useful when doing ghost layer based communication.

See also Overview of Field Module

#include <GhostLayerField.h>

+ Inheritance diagram for walberla::field::GhostLayerField< T, fSize_ >:

Public Types

Type Definitions
typedef Field< T, fSize_ >::value_type value_type
 
typedef Field< T, fSize_ >::iterator iterator
 
typedef Field< T, fSize_ >::const_iterator const_iterator
 
typedef Field< T, fSize_ >::reverse_iterator reverse_iterator
 
typedef Field< T, fSize_ >::const_reverse_iterator const_reverse_iterator
 
typedef Field< T, fSize_ >::base_iterator base_iterator
 
typedef Field< T, fSize_ >::const_base_iterator const_base_iterator
 
typedef Field< T, fSize_ >::Ptr Ptr
 
typedef Field< T, fSize_ >::ConstPtr ConstPtr
 
- Public Types inherited from walberla::field::Field< T, fSize_ >
typedef T value_type
 
typedef ForwardFieldIterator< T, fSize_ > iterator
 
typedef ForwardFieldIterator< const T, fSize_ > const_iterator
 
typedef ReverseFieldIterator< T, fSize_ > reverse_iterator
 
typedef ReverseFieldIterator< const T, fSize_ > const_reverse_iterator
 
typedef FieldIterator< T, fSize_ > base_iterator
 
typedef FieldIterator< const T, fSize_ > const_base_iterator
 
typedef FieldPointer< Field< T, fSize_ >, Field< T, fSize_ >, T > Ptr
 
typedef FieldPointer< Field< T, fSize_ >, const Field< T, fSize_ >, const T > ConstPtr
 
typedef boost::function< void(cell_idx_t x, cell_idx_t y, cell_idx_t z, cell_idx_t f, const T &value) > MonitorFunction
 

Public Member Functions

Construction & Destruction
 GhostLayerField (uint_t xSize, uint_t ySize, uint_t zSize, uint_t gl, const Layout &layout=zyxf, const shared_ptr< FieldAllocator< T > > &alloc=shared_ptr< FieldAllocator< T > >())
 Creates an uninitialized field of given size. More...
 
 GhostLayerField (uint_t xSize, uint_t ySize, uint_t zSize, uint_t gl, const T &initValue, const Layout &layout=zyxf, const shared_ptr< FieldAllocator< T > > &alloc=shared_ptr< FieldAllocator< T > >())
 Creates a field and initializes it with constant value. More...
 
 GhostLayerField (uint_t xSize, uint_t ySize, uint_t zSize, uint_t gl, const std::vector< T > &fValues, const Layout &layout=zyxf, const shared_ptr< FieldAllocator< T > > &alloc=shared_ptr< FieldAllocator< T > >())
 Creates a field and initializes f coordinate with vector values. More...
 
virtual ~GhostLayerField ()
 
void init (uint_t xSizeWithoutGhostLayer, uint_t ySizeWithoutGhostLayer, uint_t zSizeWithoutGhostLayer, uint_t nrGhostLayers, const Layout &layout=zyxf, const shared_ptr< FieldAllocator< T > > &alloc=shared_ptr< FieldAllocator< T > >())
 Initializes a field, must be called exactly once. More...
 
virtual void resize (uint_t xSize, uint_t ySize, uint_t zSize)
 Deletes all stored data, and resizes the field. More...
 
void resize (uint_t xSize, uint_t ySize, uint_t zSize, uint_t gl)
 Deletes all stored data, and resizes the field. More...
 
GhostLayerField< T, fSize_ > * clone () const
 
GhostLayerField< T, fSize_ > * cloneUninitialized () const
 
GhostLayerField< T, fSize_ > * cloneShallowCopy () const
 
Size Information
uint_t xSizeWithGhostLayer () const
 
uint_t ySizeWithGhostLayer () const
 
uint_t zSizeWithGhostLayer () const
 
uint_t sizeWithGhostLayer (uint_t i) const
 
uint_t nrOfGhostLayers () const
 
CellInterval xyzSizeWithGhostLayer () const
 Returns the x/y/z Size of the field with ghost layers. More...
 
Element Access
void setWithGhostLayer (const T &value)
 Sets all entries (including the ghost layer) of the field to given value. More...
 
void setWithGhostLayer (const std::vector< T > &fValues)
 Initializes the f coordinate to values from vector, in all cells including the ghost layers Sets the entry (x,y,z,f) to fValues[f]. More...
 
Iterators
iterator beginWithGhostLayer ()
 Iterator over all cells, including the ghost layers. More...
 
const_iterator beginWithGhostLayer () const
 Returns const_iterator, see beginWithGhostLayer() More...
 
iterator beginWithGhostLayer (cell_idx_t numGhostLayers)
 
const_iterator beginWithGhostLayer (cell_idx_t numGhostLayers) const
 
iterator beginWithGhostLayerXYZ ()
 Iterates only over all cells including ghost layers of XYZ coordinate, f is always 0. More...
 
const_iterator beginWithGhostLayerXYZ () const
 Const version of beginWithGhostLayerXYZ() More...
 
iterator beginWithGhostLayerXYZ (cell_idx_t numGhostLayers)
 
const_iterator beginWithGhostLayerXYZ (cell_idx_t numGhostLayers) const
 
iterator beginGhostLayerOnly (stencil::Direction dir, bool fullSlice=false)
 Iterates only over ghost layers of a given direction. More...
 
const_iterator beginGhostLayerOnly (stencil::Direction dir, bool fullSlice=false) const
 Const version of beginGhostLayersOnly() More...
 
iterator beginGhostLayerOnly (uint_t thickness, stencil::Direction dir, bool fullSlice=false)
 Iterates only over specified number of ghost layers of a given direction. More...
 
const_iterator beginGhostLayerOnly (uint_t thickness, stencil::Direction dir, bool fullSlice=false) const
 Const version of beginGhostLayersOnly(uint_t thickness, stencil::Direction) More...
 
iterator beginGhostLayerOnlyXYZ (stencil::Direction dir, cell_idx_t f=0, bool fullSlice=false)
 Iterates only over ghost layers of a given direction, only over xyz coordinates, f is fixed. More...
 
const_iterator beginGhostLayerOnlyXYZ (stencil::Direction dir, cell_idx_t f=0, bool fullSlice=false) const
 Const version of beginGhostLayersOnlyXYZ() More...
 
iterator beginGhostLayerOnlyXYZ (uint_t thickness, stencil::Direction dir, cell_idx_t f=0, bool fullSlice=false)
 Iterates only over ghost layers of a given direction, only over xyz coordinates, f is fixed. More...
 
const_iterator beginGhostLayerOnlyXYZ (uint_t thickness, stencil::Direction dir, cell_idx_t f=0, bool fullSlice=false) const
 Const version of beginGhostLayersOnlyXYZ() More...
 
iterator beginSliceBeforeGhostLayer (stencil::Direction dir, cell_idx_t thickness=1, bool fullSlice=false)
 Iterates only over the last slice before ghost layer. More...
 
const_iterator beginSliceBeforeGhostLayer (stencil::Direction dir, cell_idx_t thickness=1, bool fullSlice=false) const
 Const version of beginSliceBeforeGhostLayer() More...
 
iterator beginSliceBeforeGhostLayerXYZ (stencil::Direction dir, cell_idx_t thickness=1, cell_idx_t f=0, bool fullSlice=false)
 Iterates only over the last slice before ghost layer, only in XYZ direction, f is fixed. More...
 
const_iterator beginSliceBeforeGhostLayerXYZ (stencil::Direction dir, cell_idx_t thickness=1, cell_idx_t f=0, bool fullSlice=false) const
 Const version of beginSliceBeforeGhostLayerXYZ() More...
 
void getGhostRegion (stencil::Direction dir, CellInterval &ghostAreaOut, cell_idx_t thickness, bool fullSlice=false) const
 
void getSliceBeforeGhostLayer (stencil::Direction d, CellInterval &ci, cell_idx_t thickness=1, bool fullSlice=false) const
 
bool isInInnerPart (const Cell &cell) const
 Checks if a given cell is in the inner part of the field ( not in ghost region or outside ) More...
 
Reverse Iterators
reverse_iterator rbeginWithGhostLayer ()
 Reverse Iterator over all cells, including the ghost layers. More...
 
const_reverse_iterator rbeginWithGhostLayer () const
 Returns const_iterator, see beginWithGhostLayer() More...
 
reverse_iterator rbeginWithGhostLayerXYZ ()
 Iterates only over all cells including ghost layers of XYZ coordinate, f is always 0. More...
 
const_reverse_iterator rbeginWithGhostLayerXYZ () const
 Const version of beginWithGhostLayerXYZ() More...
 
Slicing
GhostLayerField< T, fSize_ > * getSlicedField (const CellInterval &interval) const
 
virtual void slice (const CellInterval &interval)
 Changes the coordinate system of the field. More...
 
virtual void shiftCoordinates (cell_idx_t cx, cell_idx_t cy, cell_idx_t cz)
 
- Public Member Functions inherited from walberla::field::Field< T, fSize_ >
 Field (uint_t xSize, uint_t ySize, uint_t zSize, const Layout &layout=zyxf, const shared_ptr< FieldAllocator< T > > &alloc=shared_ptr< FieldAllocator< T > >())
 Creates an uninitialized field of given size. More...
 
 Field (uint_t xSize, uint_t ySize, uint_t zSize, const T &initValue, const Layout &layout=zyxf, const shared_ptr< FieldAllocator< T > > &alloc=shared_ptr< FieldAllocator< T > >())
 Creates a field and initializes it with constant. More...
 
 Field (uint_t xSize, uint_t ySize, uint_t zSize, const std::vector< T > &fValues, const Layout &layout=zyxf, const shared_ptr< FieldAllocator< T > > &alloc=shared_ptr< FieldAllocator< T > >())
 Creates a field and initializes f coordinate with vector values. More...
 
virtual ~Field ()
 Destructor, using Allocator template parameter. More...
 
void init (uint_t xSize, uint_t ySize, uint_t zSize, const Layout &layout=zyxf, shared_ptr< FieldAllocator< T > > alloc=shared_ptr< FieldAllocator< T > >(), uint_t innerGhostLayerSizeForAlignedAlloc=0)
 Initializes the field with a given size, in a given layout. More...
 
Field< T, fSize_ > * clone () const
 Returns a deep copy of the current field. More...
 
Field< T, fSize_ > * cloneUninitialized () const
 Creates a new field that has equal size and layout as this field. More...
 
Field< T, fSize_ > * cloneShallowCopy () const
 Returns a shallow copy of the current field. More...
 
T & get (cell_idx_t x, cell_idx_t y, cell_idx_t z)
 get function with only (x,y,z) coordinates, assumes fSize=1 More...
 
const T & get (cell_idx_t x, cell_idx_t y, cell_idx_t z) const
 get function with only (x,y,z) coordinates, assumes fSize=1 More...
 
T & get (cell_idx_t x, cell_idx_t y, cell_idx_t z, cell_idx_t f)
 Non-Const variant of get() More...
 
const T & get (cell_idx_t x, cell_idx_t y, cell_idx_t z, cell_idx_t f) const
 Accesses the value at given coordinate. More...
 
T & get (cell_idx_t x, cell_idx_t y, cell_idx_t z, uint_t f)
 get() variant which takes a uint_t as last coordinate, as for example Stencil::toIdx() returns More...
 
const T & get (cell_idx_t x, cell_idx_t y, cell_idx_t z, uint_t f) const
 get() variant which takes a uint_t as last coordinate, as for example Stencil::toIdx() returns More...
 
T & get (const Cell &cell)
 get overload using a cell as input, only possible if fSize=1 More...
 
const T & get (const Cell &cell) const
 get overload using a cell as input, only possible if fSize=1 More...
 
T & get (const Cell &c, cell_idx_t f)
 
const T & get (const Cell &c, cell_idx_t f) const
 
T & get (const Cell &c, uint_t f)
 
const T & get (const Cell &c, uint_t f) const
 
T & get (const base_iterator &iter)
 get overload, where position is specified using an iterator of another field with equal size More...
 
const T & get (const base_iterator &iter) const
 get overload, where position is specified using an iterator of another field with equal size More...
 
T & operator() (cell_idx_t x, cell_idx_t y, cell_idx_t z)
 
const T & operator() (cell_idx_t x, cell_idx_t y, cell_idx_t z) const
 
T & operator() (cell_idx_t x, cell_idx_t y, cell_idx_t z, cell_idx_t f)
 
const T & operator() (cell_idx_t x, cell_idx_t y, cell_idx_t z, cell_idx_t f) const
 
T & operator() (cell_idx_t x, cell_idx_t y, cell_idx_t z, uint_t f)
 
const T & operator() (cell_idx_t x, cell_idx_t y, cell_idx_t z, uint_t f) const
 
T & operator() (const Cell &cell)
 
const T & operator() (const Cell &cell) const
 
T & operator() (const Cell &cell, cell_idx_t f)
 
const T & operator() (const Cell &cell, cell_idx_t f) const
 
T & operator() (const Cell &cell, uint_t f)
 
const T & operator() (const Cell &cell, uint_t f) const
 
T & operator() (const base_iterator &iter)
 
const T & operator() (const base_iterator &iter) const
 
T & getNeighbor (cell_idx_t x, cell_idx_t y, cell_idx_t z, stencil::Direction d)
 returns neighboring value of cell in the given direction More...
 
const T & getNeighbor (cell_idx_t x, cell_idx_t y, cell_idx_t z, stencil::Direction d) const
 returns neighboring value of cell in the given direction More...
 
T & getNeighbor (cell_idx_t x, cell_idx_t y, cell_idx_t z, uint_t f, stencil::Direction d)
 returns neighboring value of cell in the given direction More...
 
const T & getNeighbor (cell_idx_t x, cell_idx_t y, cell_idx_t z, uint_t f, stencil::Direction d) const
 returns neighboring value of cell in the given direction More...
 
T & getNeighbor (const Cell &cell, stencil::Direction d)
 get overload using a cell as input, only possible if fSize=1, with neighbor access More...
 
const T & getNeighbor (const Cell &cell, stencil::Direction d) const
 get overload using a cell as input, only possible if fSize=1, with neighbor access More...
 
T & getF (T *const xyz0, const cell_idx_t f)
 
const T & getF (const T *const xyz0, const cell_idx_t f) const
 
T & getF (T *const xyz0, const uint_t f)
 
const T & getF (const T *const xyz0, const uint_t f) const
 
void set (const T &value)
 Sets all entries of the field to given value. More...
 
void set (const std::vector< T > &fValues)
 Initializes the f coordinate to values from vector Sets the entry (x,y,z,f) to fValues[f]. More...
 
void set (const Field< T, fSize_ > &other)
 Copies all entries of the given field to this field. More...
 
void set (const Field< T, fSize_ > *other)
 
void swapDataPointers (Field< T, fSize_ > &other)
 Swap two fields efficiently by exchanging only values_ pointer The two fields have to have identical sizes and same layout. More...
 
void swapDataPointers (Field< T, fSize_ > *other)
 
bool operator== (const Field< T, fSize_ > &other) const
 Equality operator compares element-wise. More...
 
bool operator!= (const Field< T, fSize_ > &other) const
 Inequality operator compares element-wise. More...
 
bool hasSameAllocSize (const Field< T, fSize_ > &other) const
 True if allocation sizes of all dimensions match. More...
 
bool hasSameSize (const Field< T, fSize_ > &other) const
 True if sizes of all dimensions match. More...
 
iterator begin ()
 Returns iterator, which can iterate over complete field in a suitable order depending on layout. More...
 
const_iterator begin () const
 Returns const_iterator, see begin() More...
 
iterator beginXYZ ()
 Iterates only over XYZ coordinate, f is always 0. More...
 
const_iterator beginXYZ () const
 Const version of beginXYZ() More...
 
iterator beginSlice (cell_idx_t xBeg, cell_idx_t yBeg, cell_idx_t zBeg, cell_idx_t fBeg, cell_idx_t xEnd, cell_idx_t yEnd, cell_idx_t zEnd, cell_idx_t fEnd)
 Returns iterator which iterates over a sub-block of the field. More...
 
const_iterator beginSlice (cell_idx_t xBeg, cell_idx_t yBeg, cell_idx_t zBeg, cell_idx_t fBeg, cell_idx_t xEnd, cell_idx_t yEnd, cell_idx_t zEnd, cell_idx_t fEnd) const
 Const variant of beginSlice() More...
 
iterator beginSliceXYZ (const CellInterval &interval, cell_idx_t f=0)
 Returns iterator which iterates over a slice, but only in x,y,z coordinates. More...
 
const_iterator beginSliceXYZ (const CellInterval &interval, cell_idx_t f=0) const
 Const variant of beginSliceXYZ() More...
 
const iteratorend ()
 
const const_iteratorend () const
 
reverse_iterator rbegin ()
 Returns reverse iterator, which can iterate over complete field in a suitable order depending on layout. More...
 
const_reverse_iterator rbegin () const
 Returns const_reverse_iterator, see begin() More...
 
reverse_iterator rbeginXYZ ()
 Iterates only over XYZ coordinate, f is always 0. More...
 
const_reverse_iterator rbeginXYZ () const
 Const version of beginXYZ() More...
 
const reverse_iteratorrend ()
 
const const_reverse_iteratorrend () const
 
uint_t xSize () const
 
uint_t ySize () const
 
uint_t zSize () const
 
uint_t fSize () const
 
uint_t size (uint_t coord) const
 
uint_t xAllocSize () const
 
uint_t yAllocSize () const
 
uint_t zAllocSize () const
 
uint_t fAllocSize () const
 
uint_t allocSize () const
 
CellInterval xyzSize () const
 
CellInterval xyzAllocSize () const
 
Layout layout () const
 
cell_idx_t xStride () const
 
cell_idx_t yStride () const
 
cell_idx_t zStride () const
 
cell_idx_t fStride () const
 
cell_idx_t xOff () const
 
cell_idx_t yOff () const
 
cell_idx_t zOff () const
 
bool coordinatesValid (cell_idx_t x, cell_idx_t y, cell_idx_t z, cell_idx_t f) const
 
Field< T, fSize_ > * getSlicedField (const CellInterval &interval) const
 Create a different "view" of the field, where the created field has the size of the given sliceInterval. More...
 
T * data ()
 
const T * data () const
 
T * dataInner ()
 
const T * dataInner () const
 
shared_ptr< FieldAllocator< T > > getAllocator () const
 Returns internal data allocator. More...
 
void addMonitoringFunction (const MonitorFunction &func)
 Registers a monitoring function. More...
 

Protected Member Functions

 GhostLayerField ()
 Creates a field of zero size. More...
 
Shallow Copy
virtual Field< T, fSize_ > * cloneShallowCopyInternal () const
 See Field::cloneShallowCopyInternal() Has to be re-implemented because a new GhostLayerField is created. More...
 
 GhostLayerField (const GhostLayerField< T, fSize_ > &other)
 Private copy constructor, which does a shallow copy. More...
 
- Protected Member Functions inherited from walberla::field::Field< T, fSize_ >
 Field ()
 Creates an uninitialized field of size zero (no allocated memory) More...
 
 Field (const Field &other)
 Private copy constructor that creates a shallow copy i.e. More...
 
virtual uint_t referenceCount () const
 Returns the number of objects that internally use the same data. More...
 
void setOffsets (uint_t xOffset, uint_t xSize, uint_t yOffset, uint_t ySize, uint_t zOffset, uint_t zSizes)
 Moves the coordinate system of the field. More...
 
shared_ptr< FieldAllocator< T > > allocator () const
 
bool addressInsideAllocedSpace (const T *const value) const
 
void assertValidCoordinates (cell_idx_t x, cell_idx_t y, cell_idx_t z, cell_idx_t f) const
 

Protected Attributes

uint_t gl_
 Number of ghost layers. More...
 

Additional Inherited Members

- Static Public Attributes inherited from walberla::field::Field< T, fSize_ >
static const const_iterator staticConstEnd = ForwardFieldIterator<const T,fSize_>()
 Const end iterator, see end() More...
 
static const iterator staticEnd = ForwardFieldIterator<T,fSize_>()
 End iterator, can be used with begin() and beginBlock() More...
 
static const const_reverse_iterator staticConstREnd = ReverseFieldIterator<const T,fSize_>()
 Const end iterator, see end() More...
 
static const reverse_iterator staticREnd = ReverseFieldIterator<T,fSize_>()
 End iterator, can be used with begin() and beginBlock() More...
 
static const uint_t F_SIZE = fSize_
 

Member Typedef Documentation

template<typename T, uint_t fSize_>
typedef Field<T,fSize_>::base_iterator walberla::field::GhostLayerField< T, fSize_ >::base_iterator
template<typename T, uint_t fSize_>
typedef Field<T,fSize_>::const_base_iterator walberla::field::GhostLayerField< T, fSize_ >::const_base_iterator
template<typename T, uint_t fSize_>
typedef Field<T,fSize_>::const_iterator walberla::field::GhostLayerField< T, fSize_ >::const_iterator
template<typename T, uint_t fSize_>
typedef Field<T,fSize_>::const_reverse_iterator walberla::field::GhostLayerField< T, fSize_ >::const_reverse_iterator
template<typename T, uint_t fSize_>
typedef Field<T,fSize_>::ConstPtr walberla::field::GhostLayerField< T, fSize_ >::ConstPtr
template<typename T, uint_t fSize_>
typedef Field<T,fSize_>::iterator walberla::field::GhostLayerField< T, fSize_ >::iterator
template<typename T, uint_t fSize_>
typedef Field<T,fSize_>::Ptr walberla::field::GhostLayerField< T, fSize_ >::Ptr
template<typename T, uint_t fSize_>
typedef Field<T,fSize_>::reverse_iterator walberla::field::GhostLayerField< T, fSize_ >::reverse_iterator
template<typename T, uint_t fSize_>
typedef Field<T,fSize_>::value_type walberla::field::GhostLayerField< T, fSize_ >::value_type

Constructor & Destructor Documentation

template<typename T, uint_t fSize_>
walberla::field::GhostLayerField< T, fSize_ >::GhostLayerField ( uint_t  _xSize,
uint_t  _ySize,
uint_t  _zSize,
uint_t  gl,
const Layout l = zyxf,
const shared_ptr< FieldAllocator< T > > &  alloc = shared_ptr<FieldAllocator<T> >() 
)

Creates an uninitialized field of given size.

Parameters
xSizesize of x dimension without ghost layers
ySizesize of y dimension without ghost layers
zSizesize of z dimension without ghost layers
glnumber of ghost layers
layoutmemory layout of the field (see Layout)
allocclass that describes how to allocate memory for the field, see FieldAllocator
template<typename T, uint_t fSize_>
walberla::field::GhostLayerField< T, fSize_ >::GhostLayerField ( uint_t  _xSize,
uint_t  _ySize,
uint_t  _zSize,
uint_t  gl,
const T &  initVal,
const Layout l = zyxf,
const shared_ptr< FieldAllocator< T > > &  alloc = shared_ptr<FieldAllocator<T> >() 
)

Creates a field and initializes it with constant value.

Parameters
xSizesize of x dimension without ghost layers
ySizesize of y dimension without ghost layers
zSizesize of z dimension without ghost layers
glnumber of ghost layers
initValevery element of the field is set to initVal (also ghost layers)
layoutmemory layout of the field (see Layout)
allocclass that describes how to allocate memory for the field, see FieldAllocator
template<typename T, uint_t fSize_>
walberla::field::GhostLayerField< T, fSize_ >::GhostLayerField ( uint_t  _xSize,
uint_t  _ySize,
uint_t  _zSize,
uint_t  gl,
const std::vector< T > &  fValues,
const Layout l = zyxf,
const shared_ptr< FieldAllocator< T > > &  alloc = shared_ptr<FieldAllocator<T> >() 
)

Creates a field and initializes f coordinate with vector values.

Parameters
xSizesize of x dimension
ySizesize of y dimension
zSizesize of z dimension
glnumber of ghost layers
fValuesinitializes f coordinate with values from vector (see set(std::vector&) ) also ghost layers
layoutmemory layout of the field (see Layout)
allocclass that describes how to allocate memory for the field, see FieldAllocator
template<typename T, uint_t fSize_>
virtual walberla::field::GhostLayerField< T, fSize_ >::~GhostLayerField ( )
inlinevirtual
template<typename T, uint_t fSize_>
walberla::field::GhostLayerField< T, fSize_ >::GhostLayerField ( )
protected

Creates a field of zero size.

To use this field call the init function

template<typename T, uint_t fSize_>
walberla::field::GhostLayerField< T, fSize_ >::GhostLayerField ( const GhostLayerField< T, fSize_ > &  other)
protected

Private copy constructor, which does a shallow copy.

Member Function Documentation

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::iterator walberla::field::GhostLayerField< T, fSize_ >::beginGhostLayerOnly ( stencil::Direction  dir,
bool  fullSlice = false 
)
inline

Iterates only over ghost layers of a given direction.

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_iterator walberla::field::GhostLayerField< T, fSize_ >::beginGhostLayerOnly ( stencil::Direction  dir,
bool  fullSlice = false 
) const
inline

Const version of beginGhostLayersOnly()

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::iterator walberla::field::GhostLayerField< T, fSize_ >::beginGhostLayerOnly ( uint_t  thickness,
stencil::Direction  dir,
bool  fullSlice = false 
)
inline

Iterates only over specified number of ghost layers of a given direction.

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_iterator walberla::field::GhostLayerField< T, fSize_ >::beginGhostLayerOnly ( uint_t  thickness,
stencil::Direction  dir,
bool  fullSlice = false 
) const
inline

Const version of beginGhostLayersOnly(uint_t thickness, stencil::Direction)

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::iterator walberla::field::GhostLayerField< T, fSize_ >::beginGhostLayerOnlyXYZ ( stencil::Direction  dir,
cell_idx_t  f = 0,
bool  fullSlice = false 
)
inline

Iterates only over ghost layers of a given direction, only over xyz coordinates, f is fixed.

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_iterator walberla::field::GhostLayerField< T, fSize_ >::beginGhostLayerOnlyXYZ ( stencil::Direction  dir,
cell_idx_t  f = 0,
bool  fullSlice = false 
) const
inline

Const version of beginGhostLayersOnlyXYZ()

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::iterator walberla::field::GhostLayerField< T, fSize_ >::beginGhostLayerOnlyXYZ ( uint_t  thickness,
stencil::Direction  dir,
cell_idx_t  f = 0,
bool  fullSlice = false 
)
inline

Iterates only over ghost layers of a given direction, only over xyz coordinates, f is fixed.

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_iterator walberla::field::GhostLayerField< T, fSize_ >::beginGhostLayerOnlyXYZ ( uint_t  thickness,
stencil::Direction  dir,
cell_idx_t  f = 0,
bool  fullSlice = false 
) const
inline

Const version of beginGhostLayersOnlyXYZ()

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::iterator walberla::field::GhostLayerField< T, fSize_ >::beginSliceBeforeGhostLayer ( stencil::Direction  dir,
cell_idx_t  thickness = 1,
bool  fullSlice = false 
)
inline

Iterates only over the last slice before ghost layer.

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_iterator walberla::field::GhostLayerField< T, fSize_ >::beginSliceBeforeGhostLayer ( stencil::Direction  dir,
cell_idx_t  thickness = 1,
bool  fullSlice = false 
) const
inline

Const version of beginSliceBeforeGhostLayer()

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::iterator walberla::field::GhostLayerField< T, fSize_ >::beginSliceBeforeGhostLayerXYZ ( stencil::Direction  dir,
cell_idx_t  thickness = 1,
cell_idx_t  f = 0,
bool  fullSlice = false 
)
inline

Iterates only over the last slice before ghost layer, only in XYZ direction, f is fixed.

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_iterator walberla::field::GhostLayerField< T, fSize_ >::beginSliceBeforeGhostLayerXYZ ( stencil::Direction  dir,
cell_idx_t  thickness = 1,
cell_idx_t  f = 0,
bool  fullSlice = false 
) const
inline
template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::iterator walberla::field::GhostLayerField< T, fSize_ >::beginWithGhostLayer ( )
inline

Iterator over all cells, including the ghost layers.

same as begin() , but with ghost layer

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_iterator walberla::field::GhostLayerField< T, fSize_ >::beginWithGhostLayer ( ) const
inline

Returns const_iterator, see beginWithGhostLayer()

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::iterator walberla::field::GhostLayerField< T, fSize_ >::beginWithGhostLayer ( cell_idx_t  numGhostLayers)
inline
template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_iterator walberla::field::GhostLayerField< T, fSize_ >::beginWithGhostLayer ( cell_idx_t  numGhostLayers) const
inline
template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::iterator walberla::field::GhostLayerField< T, fSize_ >::beginWithGhostLayerXYZ ( )
inline

Iterates only over all cells including ghost layers of XYZ coordinate, f is always 0.

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_iterator walberla::field::GhostLayerField< T, fSize_ >::beginWithGhostLayerXYZ ( ) const
inline

Const version of beginWithGhostLayerXYZ()

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::iterator walberla::field::GhostLayerField< T, fSize_ >::beginWithGhostLayerXYZ ( cell_idx_t  numGhostLayers)
inline
template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_iterator walberla::field::GhostLayerField< T, fSize_ >::beginWithGhostLayerXYZ ( cell_idx_t  numGhostLayers) const
inline
template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ > * walberla::field::GhostLayerField< T, fSize_ >::clone ( ) const
inline
template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ > * walberla::field::GhostLayerField< T, fSize_ >::cloneShallowCopy ( ) const
inline
template<typename T , uint_t fSize_>
Field< T, fSize_ > * walberla::field::GhostLayerField< T, fSize_ >::cloneShallowCopyInternal ( ) const
protectedvirtual

See Field::cloneShallowCopyInternal() Has to be re-implemented because a new GhostLayerField is created.

Reimplemented from walberla::field::Field< T, fSize_ >.

Reimplemented in walberla::field::FlagField< T >.

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ > * walberla::field::GhostLayerField< T, fSize_ >::cloneUninitialized ( ) const
inline
template<typename T , uint_t fSize_>
void walberla::field::GhostLayerField< T, fSize_ >::getGhostRegion ( stencil::Direction  dir,
CellInterval &  ghostAreaOut,
cell_idx_t  thickness,
bool  fullSlice = false 
) const
template<typename T , uint_t fSize_>
void walberla::field::GhostLayerField< T, fSize_ >::getSliceBeforeGhostLayer ( stencil::Direction  d,
CellInterval &  ci,
cell_idx_t  thickness = 1,
bool  fullSlice = false 
) const
template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ > * walberla::field::GhostLayerField< T, fSize_ >::getSlicedField ( const CellInterval &  interval) const
template<typename T, uint_t fSize_>
void walberla::field::GhostLayerField< T, fSize_ >::init ( uint_t  _xSize,
uint_t  _ySize,
uint_t  _zSize,
uint_t  gl,
const Layout l = zyxf,
const shared_ptr< FieldAllocator< T > > &  alloc = shared_ptr<FieldAllocator<T> >() 
)

Initializes a field, must be called exactly once.

Is automatically called by constructors that take at least one argument

Parameters
xSizesize of x dimension without ghost layers
ySizesize of y dimension without ghost layers
zSizesize of z dimension without ghost layers
glnumber of ghost layers
layoutmemory layout of the field (see Layout)
allocclass that describes how to allocate memory for the field, see FieldAllocator
template<typename T , uint_t fSize_>
bool walberla::field::GhostLayerField< T, fSize_ >::isInInnerPart ( const Cell &  cell) const

Checks if a given cell is in the inner part of the field ( not in ghost region or outside )

template<typename T, uint_t fSize_>
uint_t walberla::field::GhostLayerField< T, fSize_ >::nrOfGhostLayers ( ) const
inline
template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::reverse_iterator walberla::field::GhostLayerField< T, fSize_ >::rbeginWithGhostLayer ( )
inline

Reverse Iterator over all cells, including the ghost layers.

same as rbegin() , but with ghost layer

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_reverse_iterator walberla::field::GhostLayerField< T, fSize_ >::rbeginWithGhostLayer ( ) const
inline

Returns const_iterator, see beginWithGhostLayer()

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::reverse_iterator walberla::field::GhostLayerField< T, fSize_ >::rbeginWithGhostLayerXYZ ( )
inline

Iterates only over all cells including ghost layers of XYZ coordinate, f is always 0.

template<typename T , uint_t fSize_>
GhostLayerField< T, fSize_ >::const_reverse_iterator walberla::field::GhostLayerField< T, fSize_ >::rbeginWithGhostLayerXYZ ( ) const
inline

Const version of beginWithGhostLayerXYZ()

template<typename T , uint_t fSize_>
void walberla::field::GhostLayerField< T, fSize_ >::resize ( uint_t  _xSize,
uint_t  _ySize,
uint_t  _zSize 
)
virtual

Deletes all stored data, and resizes the field.

The resized field is uninitialized.

Reimplemented from walberla::field::Field< T, fSize_ >.

template<typename T , uint_t fSize_>
void walberla::field::GhostLayerField< T, fSize_ >::resize ( uint_t  _xSize,
uint_t  _ySize,
uint_t  _zSize,
uint_t  _gl 
)

Deletes all stored data, and resizes the field.

The resized field is uninitialized.

template<typename T, uint_t fSize_>
void walberla::field::GhostLayerField< T, fSize_ >::setWithGhostLayer ( const T &  value)

Sets all entries (including the ghost layer) of the field to given value.

template<typename T, uint_t fSize_>
void walberla::field::GhostLayerField< T, fSize_ >::setWithGhostLayer ( const std::vector< T > &  fValues)

Initializes the f coordinate to values from vector, in all cells including the ghost layers Sets the entry (x,y,z,f) to fValues[f].

template<typename T , uint_t fSize_>
void walberla::field::GhostLayerField< T, fSize_ >::shiftCoordinates ( cell_idx_t  cx,
cell_idx_t  cy,
cell_idx_t  cz 
)
virtual
template<typename T, uint_t fSize_>
uint_t walberla::field::GhostLayerField< T, fSize_ >::sizeWithGhostLayer ( uint_t  i) const
inline
template<typename T , uint_t fSize_>
void walberla::field::GhostLayerField< T, fSize_ >::slice ( const CellInterval &  interval)
virtual

Changes the coordinate system of the field.

The origin of the new coordinates is at the cell given by min() of the CellInterval. The new size of the field, is the size of the the CellInterval, however the alloc size does not change. Cells that are not in this cell interval can still be accessed ( by coordinates smaller 0, or bigger than [xyz]Size)

Reimplemented from walberla::field::Field< T, fSize_ >.

template<typename T, uint_t fSize_>
uint_t walberla::field::GhostLayerField< T, fSize_ >::xSizeWithGhostLayer ( ) const
inline
template<typename T , uint_t fSize_>
CellInterval walberla::field::GhostLayerField< T, fSize_ >::xyzSizeWithGhostLayer ( ) const
inline

Returns the x/y/z Size of the field with ghost layers.

template<typename T, uint_t fSize_>
uint_t walberla::field::GhostLayerField< T, fSize_ >::ySizeWithGhostLayer ( ) const
inline
template<typename T, uint_t fSize_>
uint_t walberla::field::GhostLayerField< T, fSize_ >::zSizeWithGhostLayer ( ) const
inline

Member Data Documentation

template<typename T, uint_t fSize_>
uint_t walberla::field::GhostLayerField< T, fSize_ >::gl_
protected

Number of ghost layers.


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