walberla::field::FieldPointer< Field_T, FieldMember, Value_T > Class Template Reference

Detailed Description

template<typename Field_T, typename FieldMember, typename Value_T>
class walberla::field::FieldPointer< Field_T, FieldMember, Value_T >

Class representing on Field coordinate.

What is this class good for?

Suppose there is a PDF field, and a function that calculates the density of a cell

void calcDensity( const GhostLayerField<real_t,19>::base_iterator & it ) {
// calculates density using it.neighbor() or it.getF()
}

This function cannot be called when only a x,y,z coordinate is available. A FieldPointer is a class that behaves like a FieldIterator but can be constructed from x,y,z,f coordinates. So the code can be rewritten as:

template< typename Iter>
void calcDensity( const Iter & it );
// and calculate the density of cell 3,2,4 using a FieldPointer
calcDensity( GhostLayerField<real_t,19>::Ptr( 3,2,4) );

Do not use this directly use the typedef Field::Ptr

#include <FieldPointer.h>

Public Types

typedef Value_T value_type
 

Public Member Functions

 FieldPointer (FieldMember &field, cell_idx_t _x, cell_idx_t _y, cell_idx_t _z, cell_idx_t _f=0)
 
void set (cell_idx_t _x, cell_idx_t _y, cell_idx_t _z)
 
value_typeoperator* () const
 
value_typeoperator-> () const
 
value_typegetF (cell_idx_t cf) const
 
value_typegetF (uint_t cf) const
 
value_typeoperator[] (cell_idx_t cf) const
 
value_typeoperator[] (uint_t cf) const
 
value_typeneighbor (stencil::Direction d, cell_idx_t cf=0) const
 
value_typeneighbor (stencil::Direction d, uint_t cf) const
 
value_typeneighbor (cell_idx_t cx, cell_idx_t cy, cell_idx_t cz, cell_idx_t cf=0) const
 
value_typeneighbor (cell_idx_t cx, cell_idx_t cy, cell_idx_t cz, uint_t cf) const
 
cell_idx_tx ()
 
cell_idx_t x () const
 
cell_idx_ty ()
 
cell_idx_t y () const
 
cell_idx_tz ()
 
cell_idx_t z () const
 
cell_idx_tf ()
 
cell_idx_t f () const
 
Cell cell () const
 
const FieldMember * getField () const
 

Static Public Attributes

static const uint_t F_SIZE = Field_T::F_SIZE
 

Protected Attributes

cell_idx_t x_
 
cell_idx_t y_
 
cell_idx_t z_
 
cell_idx_t f_
 
FieldMember & field_
 

Member Typedef Documentation

template<typename Field_T , typename FieldMember , typename Value_T >
typedef Value_T walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::value_type

Constructor & Destructor Documentation

template<typename Field_T , typename FieldMember , typename Value_T >
walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::FieldPointer ( FieldMember &  field,
cell_idx_t  _x,
cell_idx_t  _y,
cell_idx_t  _z,
cell_idx_t  _f = 0 
)
inline

Member Function Documentation

template<typename Field_T , typename FieldMember , typename Value_T >
Cell walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::cell ( ) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::f ( )
inline
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::f ( ) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::getF ( cell_idx_t  cf) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::getF ( uint_t  cf) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
const FieldMember* walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::getField ( ) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::neighbor ( stencil::Direction  d,
cell_idx_t  cf = 0 
) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::neighbor ( stencil::Direction  d,
uint_t  cf 
) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::neighbor ( cell_idx_t  cx,
cell_idx_t  cy,
cell_idx_t  cz,
cell_idx_t  cf = 0 
) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::neighbor ( cell_idx_t  cx,
cell_idx_t  cy,
cell_idx_t  cz,
uint_t  cf 
) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::operator* ( ) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::operator-> ( ) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::operator[] ( cell_idx_t  cf) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::operator[] ( uint_t  cf) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
void walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::set ( cell_idx_t  _x,
cell_idx_t  _y,
cell_idx_t  _z 
)
inline
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::x ( )
inline
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::x ( ) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::y ( )
inline
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::y ( ) const
inline
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::z ( )
inline
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::z ( ) const
inline

Member Data Documentation

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::f_
protected
template<typename Field_T , typename FieldMember , typename Value_T >
const uint_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::F_SIZE = Field_T::F_SIZE
static
template<typename Field_T , typename FieldMember , typename Value_T >
FieldMember& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::field_
protected
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::x_
protected
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::y_
protected
template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::z_
protected

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