walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder > Class Template Referenceabstract

Detailed Description

template<typename CollisionModel_T, bool Compressible, typename ForceModel_T, int EquilibriumAccuracyOrder = 2>
class walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >

Base class that is supposed (but not required) to be used for defining specific lattice models.

The concept each lattice model has to follow (for an actual implementation see for example lbm::D3Q19) is as follows:

  1. It must define a type "Stencil" that refers to a stencil located in module "stencil"
  2. It must define a type "CommunicationStencil" that is used to determine which neighbors are involved during communication
  3. There must be a static array named 'w' of size 'Stencil::Size' that contains the weights for each direction. If you want to retrieve the weight that corresponds to a specific direction 'dir' you first have to map this direction to the appropriate array index by using the underlying stencil: the weight of direction 'dir' is equal to w[ Stencil::idx[dir] ]! In Addition to 'w', there must also be a static array 'wInv' containing the inverse values of 'w'.
  4. It must define a type "CollisionModel". An object of type "CollisionModel" must be returned when calling the member function 'collisionModel()' - this function also needs to be implemented. Each "CollisionModel" must define a type "tag" which may evaluate to SRT_tag, TRT_tag, or MRT_tag (see "CollisionModel.h"). For an exemplary implementation of such a "CollisionModel" see classes lbm::collision_model::SRT or lbm::collision_model::TRT.
  5. It must define a type "ForceModel". An object of type "ForceModel" must be returned when calling the member function 'forceModel()' - this function also needs to be implemented. For details on force models see Force Model for the LBM in 'ForceModel.h'.
  6. There must be a static boolean value named 'compressible' that must be set to false for incompressible lattice models, otherwise it must be set to true.
  7. There must be a member function "configure( IBlock & block, StructuredBlockStorage & sbs )" that returns nothing and takes a block and a structured block storage as arguments. Everytime a PDF field is assigned to a specific block, the "configure" function is called for the lattice model that is stored within this PDF field (see lbm/field/AddToStorage.h).

#include <LatticeModelBase.h>

Public Types

using CollisionModel = CollisionModel_T
 
using ForceModel = ForceModel_T
 

Public Member Functions

 LatticeModelBase (const CollisionModel_T &cm, const ForceModel_T &fm)
 
virtual ~LatticeModelBase ()=default
 
virtual void pack (mpi::SendBuffer &buffer) const
 
virtual void unpack (mpi::RecvBuffer &buffer)
 
void configure (IBlock &block, StructuredBlockStorage &sbs)
 
const CollisionModel_T & collisionModel () const
 
CollisionModel_T & collisionModel ()
 
const ForceModel_T & forceModel () const
 
ForceModel_T & forceModel ()
 

Static Public Attributes

static const bool compressible = Compressible
 
static const int equilibriumAccuracyOrder = EquilibriumAccuracyOrder
 

Protected Member Functions

virtual void config (IBlock &block, StructuredBlockStorage &sbs)=0
 

Protected Attributes

CollisionModel_T collisionModel_
 
ForceModel_T forceModel_
 

Member Typedef Documentation

◆ CollisionModel

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
using walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::CollisionModel = CollisionModel_T

◆ ForceModel

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
using walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::ForceModel = ForceModel_T

Constructor & Destructor Documentation

◆ LatticeModelBase()

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::LatticeModelBase ( const CollisionModel_T &  cm,
const ForceModel_T &  fm 
)
inline

◆ ~LatticeModelBase()

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
virtual walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::~LatticeModelBase ( )
virtualdefault

Member Function Documentation

◆ collisionModel() [1/2]

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
CollisionModel_T& walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::collisionModel ( )
inline

◆ collisionModel() [2/2]

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
const CollisionModel_T& walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::collisionModel ( ) const
inline

◆ config()

◆ configure()

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
void walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::configure ( IBlock block,
StructuredBlockStorage sbs 
)
inline

◆ forceModel() [1/2]

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
ForceModel_T& walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::forceModel ( )
inline

◆ forceModel() [2/2]

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
const ForceModel_T& walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::forceModel ( ) const
inline

◆ pack()

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
virtual void walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::pack ( mpi::SendBuffer buffer) const
inlinevirtual

◆ unpack()

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
virtual void walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::unpack ( mpi::RecvBuffer buffer)
inlinevirtual

Member Data Documentation

◆ collisionModel_

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
CollisionModel_T walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::collisionModel_
protected

◆ compressible

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
const bool walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::compressible = Compressible
static

◆ equilibriumAccuracyOrder

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
const int walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::equilibriumAccuracyOrder = EquilibriumAccuracyOrder
static

◆ forceModel_

template<typename CollisionModel_T , bool Compressible, typename ForceModel_T , int EquilibriumAccuracyOrder = 2>
ForceModel_T walberla::lbm::LatticeModelBase< CollisionModel_T, Compressible, ForceModel_T, EquilibriumAccuracyOrder >::forceModel_
protected

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