walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum > Class Template Reference

Detailed Description

template<typename LatticeModel_T, typename BoundaryHandling_T, typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
class walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >

Maps the moving bodies into the simulation domain and updates the mapping.

Cells that are inside a body, will be marked with the 'obstacle' flag. 'Inside' means that the cell center is contained in the body. Thus, the body has to provide a valid containsPoint(x,y,z) function.

Cells that in the last time step were inside the body but are now outside of it, i.e. the body has moved, will be marked with the 'formerObstacle' flag. The 'formerObstacle' flag is used in a second step by the PDFReconstruction class (see PDFReconstruction.h) to re-initialize the missing PDFs. Afterwards, the 'formerObstacle' flag is removed and the 'fluid' flag is set.

It is not required that the mapping has been initialized with one of the free functions from below.

The 'mappingBodySelectorFct' can be used to decide which bodies should be mapped or not.

#include <BodyMapping.h>

Public Types

typedef lbm::PdfField< LatticeModel_TPdfField_T
 
typedef BoundaryHandling_T::FlagField FlagField_T
 
typedef BoundaryHandling_T::flag_t flag_t
 
typedef Field< pe::BodyID, 1 > BodyField_T
 

Public Member Functions

 BodyMapping (const shared_ptr< StructuredBlockStorage > &blockStorage, const BlockDataID &pdfFieldID, const BlockDataID &boundaryHandlingID, const BlockDataID &bodyStorageID, const shared_ptr< pe::BodyStorage > &globalBodyStorage, const BlockDataID &bodyFieldID, const Destroyer_T &destroyer, const FlagUID &obstacle, const FlagUID &formerObstacle, const std::function< bool(pe::BodyID)> &mappingBodySelectorFct=selectRegularBodies)
 
 BodyMapping (const shared_ptr< StructuredBlockStorage > &blockStorage, const BlockDataID &pdfFieldID, const BlockDataID &boundaryHandlingID, const BlockDataID &bodyStorageID, const shared_ptr< pe::BodyStorage > &globalBodyStorage, const BlockDataID &bodyFieldID, const FlagUID &obstacle, const FlagUID &formerObstacle, const std::function< bool(pe::BodyID)> &mappingBodySelectorFct=selectRegularBodies)
 
void operator() (IBlock *const block)
 

Private Member Functions

void mapBodyAndUpdateMapping (pe::BodyID body, IBlock *const block, PdfField_T *pdfField, BoundaryHandling_T *boundaryHandling, FlagField_T *flagField, BodyField_T *bodyField, const flag_t &obstacle, const flag_t &formerObstacle, real_t dx, real_t dy, real_t dz)
 

Private Attributes

shared_ptr< StructuredBlockStorage > blockStorage_
 
const BlockDataID pdfFieldID_
 
const BlockDataID boundaryHandlingID_
 
const BlockDataID bodyStorageID_
 
shared_ptr< pe::BodyStorageglobalBodyStorage_
 
const BlockDataID bodyFieldID_
 
Destroyer_T destroyer_
 
const FlagUID obstacle_
 
const FlagUID formerObstacle_
 
std::function< bool(pe::BodyID)> mappingBodySelectorFct_
 

Member Typedef Documentation

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
typedef Field< pe::BodyID, 1 > walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::BodyField_T
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
typedef BoundaryHandling_T::flag_t walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::flag_t
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
typedef BoundaryHandling_T::FlagField walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::FlagField_T
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
typedef lbm::PdfField< LatticeModel_T > walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::PdfField_T

Constructor & Destructor Documentation

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::BodyMapping ( const shared_ptr< StructuredBlockStorage > &  blockStorage,
const BlockDataID &  pdfFieldID,
const BlockDataID &  boundaryHandlingID,
const BlockDataID &  bodyStorageID,
const shared_ptr< pe::BodyStorage > &  globalBodyStorage,
const BlockDataID &  bodyFieldID,
const Destroyer_T &  destroyer,
const FlagUID &  obstacle,
const FlagUID &  formerObstacle,
const std::function< bool(pe::BodyID)> &  mappingBodySelectorFct = selectRegularBodies 
)
inline
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::BodyMapping ( const shared_ptr< StructuredBlockStorage > &  blockStorage,
const BlockDataID &  pdfFieldID,
const BlockDataID &  boundaryHandlingID,
const BlockDataID &  bodyStorageID,
const shared_ptr< pe::BodyStorage > &  globalBodyStorage,
const BlockDataID &  bodyFieldID,
const FlagUID &  obstacle,
const FlagUID &  formerObstacle,
const std::function< bool(pe::BodyID)> &  mappingBodySelectorFct = selectRegularBodies 
)
inline

Member Function Documentation

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
void walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::mapBodyAndUpdateMapping ( pe::BodyID  body,
IBlock *const  block,
PdfField_T pdfField,
BoundaryHandling_T boundaryHandling,
FlagField_T flagField,
BodyField_T bodyField,
const flag_t obstacle,
const flag_t formerObstacle,
real_t  dx,
real_t  dy,
real_t  dz 
)
inlineprivate
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
void walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::operator() ( IBlock *const  block)
inline

Member Data Documentation

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
shared_ptr<StructuredBlockStorage> walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::blockStorage_
private
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
const BlockDataID walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::bodyFieldID_
private
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
const BlockDataID walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::bodyStorageID_
private
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
const BlockDataID walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::boundaryHandlingID_
private
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
Destroyer_T walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::destroyer_
private
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
const FlagUID walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::formerObstacle_
private
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
shared_ptr<pe::BodyStorage> walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::globalBodyStorage_
private
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
std::function<bool(pe::BodyID)> walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::mappingBodySelectorFct_
private
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
const FlagUID walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::obstacle_
private
template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
const BlockDataID walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::pdfFieldID_
private

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