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

Detailed Description

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

Class representing one Field coordinate with access only to neighbor values.

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 it.getF()
}

This function cannot be called when only a x,y,z coordinate is available. A FieldNeighborPointer is a class that behaves like a FieldPointer, except accessing the neighbor values by default. 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 FieldNeighborPointer
calcDensity( GhostLayerField<real_t,19>::Ptr( 3,2,4) );

#include <FieldNeighborPointer.h>

Public Types

using value_type = Value_T
 

Public Member Functions

 FieldNeighborPointer (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
 
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::FieldNeighborPointer< Field_T, FieldMember, Value_T >::value_type = Value_T

Constructor & Destructor Documentation

◆ FieldNeighborPointer()

template<typename Field_T , typename FieldMember , typename Value_T >
walberla::field::FieldNeighborPointer< Field_T, FieldMember, Value_T >::FieldNeighborPointer ( 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::FieldNeighborPointer< 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::FieldNeighborPointer< Field_T, FieldMember, Value_T >::f ( )
inline

◆ f() [2/2]

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

◆ getF() [1/2]

template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldNeighborPointer< 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::FieldNeighborPointer< 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::FieldNeighborPointer< Field_T, FieldMember, Value_T >::getField ( ) const
inline

◆ operator*()

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

◆ operator->()

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

◆ operator[]() [1/2]

template<typename Field_T , typename FieldMember , typename Value_T >
value_type& walberla::field::FieldNeighborPointer< 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::FieldNeighborPointer< Field_T, FieldMember, Value_T >::operator[] ( uint_t  cf) const
inline

◆ set()

template<typename Field_T , typename FieldMember , typename Value_T >
void walberla::field::FieldNeighborPointer< 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::FieldNeighborPointer< Field_T, FieldMember, Value_T >::x ( )
inline

◆ x() [2/2]

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldNeighborPointer< 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::FieldNeighborPointer< Field_T, FieldMember, Value_T >::y ( )
inline

◆ y() [2/2]

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldNeighborPointer< 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::FieldNeighborPointer< Field_T, FieldMember, Value_T >::z ( )
inline

◆ z() [2/2]

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldNeighborPointer< 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::FieldNeighborPointer< Field_T, FieldMember, Value_T >::f_
protected

◆ F_SIZE

template<typename Field_T , typename FieldMember , typename Value_T >
const uint_t walberla::field::FieldNeighborPointer< 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::FieldNeighborPointer< Field_T, FieldMember, Value_T >::field_
protected

◆ x_

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

◆ y_

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

◆ z_

template<typename Field_T , typename FieldMember , typename Value_T >
cell_idx_t walberla::field::FieldNeighborPointer< 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