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

using PdfField_T = lbm::PdfField< LatticeModel_T >
 
using FlagField_T = typename BoundaryHandling_T::FlagField
 
using flag_t = typename BoundaryHandling_T::flag_t
 
using BodyField_T = Field< pe::BodyID, 1 >
 

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< StructuredBlockStorageblockStorage_
 
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

◆ BodyField_T

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
using walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::BodyField_T = Field<pe::BodyID, 1>

◆ flag_t

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

◆ FlagField_T

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

◆ PdfField_T

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Destroyer_T = NaNDestroyer<LatticeModel_T>, bool conserveMomentum = false>
using walberla::pe_coupling::BodyMapping< LatticeModel_T, BoundaryHandling_T, Destroyer_T, conserveMomentum >::PdfField_T = lbm::PdfField<LatticeModel_T>

Constructor & Destructor Documentation

◆ BodyMapping() [1/2]

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

◆ BodyMapping() [2/2]

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

◆ mapBodyAndUpdateMapping()

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

◆ operator()()

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

◆ blockStorage_

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

◆ bodyFieldID_

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

◆ bodyStorageID_

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

◆ boundaryHandlingID_

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

◆ destroyer_

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

◆ formerObstacle_

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

◆ globalBodyStorage_

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

◆ mappingBodySelectorFct_

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

◆ obstacle_

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

◆ pdfFieldID_

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: