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

using value_type = Value_T
 

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

◆ value_type

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

Constructor & Destructor Documentation

◆ FieldPointer()

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

◆ cell()

template<typename Field_T , typename FieldMember , typename Value_T >
Cell walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::cell ( ) const
inline

◆ f() [1/2]

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::f ( )
inline

◆ f() [2/2]

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::f ( ) const
inline

◆ getF() [1/2]

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

◆ getF() [2/2]

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

◆ getField()

template<typename Field_T , typename FieldMember , typename Value_T >
const FieldMember* walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::getField ( ) const
inline

◆ neighbor() [1/4]

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

◆ neighbor() [2/4]

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

◆ neighbor() [3/4]

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

◆ neighbor() [4/4]

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

◆ operator*()

template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::operator* ( ) const
inline

◆ operator->()

template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::operator-> ( ) const
inline

◆ operator[]() [1/2]

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

◆ operator[]() [2/2]

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

◆ set()

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

◆ x() [1/2]

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::x ( )
inline

◆ x() [2/2]

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::x ( ) const
inline

◆ y() [1/2]

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::y ( )
inline

◆ y() [2/2]

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::y ( ) const
inline

◆ z() [1/2]

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::z ( )
inline

◆ z() [2/2]

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

◆ f_

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::f_
protected

◆ F_SIZE

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

◆ field_

template<typename Field_T , typename FieldMember , typename Value_T >
FieldMember& walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::field_
protected

◆ x_

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::x_
protected

◆ y_

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldPointer< Field_T, FieldMember, Value_T >::y_
protected

◆ z_

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:
typename Field< T, fSize_ >::base_iterator base_iterator
Definition: GhostLayerField.h:64
typename Field< T, fSize_ >::Ptr Ptr
Definition: GhostLayerField.h:67