$treeview $search $mathjax
Palabos  Version 1.1
$projectbrief
$projectbrief
$searchbox

plb::BlockLattice3D< T, Descriptor > Class Template Reference

A regular lattice for highly efficient 3D LB dynamics. More...

#include <blockLattice3D.h>

Inheritance diagram for plb::BlockLattice3D< T, Descriptor >:
Collaboration diagram for plb::BlockLattice3D< T, Descriptor >:

List of all members.

Public Member Functions

 BlockLattice3D (plint nx_, plint ny_, plint nz_, Dynamics< T, Descriptor > *backgroundDynamics_)
 Construction of an nx_ by ny_ by nz_ lattice.
 ~BlockLattice3D ()
 Destruction of the lattice.
 BlockLattice3D (BlockLattice3D< T, Descriptor > const &rhs)
 Copy construction.
BlockLattice3Doperator= (BlockLattice3D< T, Descriptor > const &rhs)
 Copy assignment.
void swap (BlockLattice3D &rhs)
 Swap the content of two BlockLattices.
virtual Cell< T, Descriptor > & get (plint iX, plint iY, plint iZ)
 Read/write access to lattice cells.
virtual Cell< T, Descriptor >
const & 
get (plint iX, plint iY, plint iZ) const
 Read only access to lattice cells.
virtual void specifyStatisticsStatus (Box3D domain, bool status)
 Specify wheter statistics measurements are done on a rect. domain.
virtual void collide (Box3D domain)
 Apply collision step to a 3D sub-box.
virtual void collide ()
 Apply collision step to the whole domain.
virtual void stream (Box3D domain)
 Apply streaming step to a 3D sub-box.
virtual void stream ()
 Apply streaming step to the whole domain.
virtual void collideAndStream (Box3D domain)
 Apply first collision, then streaming step to a 3D sub-box.
virtual void collideAndStream ()
 Apply first collision, then streaming step to the whole domain.
virtual void incrementTime ()
 Increment time counter.
virtual
BlockLatticeDataTransfer3D< T,
Descriptor > & 
getDataTransfer ()
 Get access to data transfer between blocks.
virtual
BlockLatticeDataTransfer3D< T,
Descriptor > const & 
getDataTransfer () const
 Get access to data transfer between blocks (const version).
void attributeDynamics (plint iX, plint iY, plint iZ, Dynamics< T, Descriptor > *dynamics)
 Attribute dynamics to a cell.
Dynamics< T, Descriptor > & getBackgroundDynamics ()
 Get a reference to the background dynamics.
Dynamics< T, Descriptor > const & getBackgroundDynamics () const
 Get a const reference to the background dynamics.
void bulkStream (Box3D domain)
 Apply streaming step to bulk (non-boundary) cells.
void boundaryStream (Box3D bound, Box3D domain)
 Apply streaming step to boundary cells.
void bulkCollideAndStream (Box3D domain)
 Apply collision and streaming step to bulk (non-boundary) cells.

Static Public Member Functions

static CachePolicy3DcachePolicy ()

Friends

class ExternalRhoJcollideAndStream3D
class OnLinkExternalRhoJcollideAndStream3D

Detailed Description

template<typename T, template< typename U > class Descriptor>
class plb::BlockLattice3D< T, Descriptor >

A regular lattice for highly efficient 3D LB dynamics.

A block lattice contains a regular array of Cell objects and some useful methods to execute the LB dynamics on the lattice.

This class is not intended to be derived from.


Constructor & Destructor Documentation

template<typename T, template< typename U > class Descriptor>
plb::BlockLattice3D< T, Descriptor >::BlockLattice3D ( plint  nx_,
plint  ny_,
plint  nz_,
Dynamics< T, Descriptor > *  backgroundDynamics_ 
) [inline]

Construction of an nx_ by ny_ by nz_ lattice.

Parameters:
nx_ lattice width (first index)
ny_ lattice height (second index)
nz_ lattice depth (third index)

References plb::BlockStatistics::evaluate(), plb::AtomicBlock3D::getInternalStatistics(), plb::AtomicBlock3D::getNx(), plb::AtomicBlock3D::getNy(), and plb::AtomicBlock3D::getNz().

template<typename T , template< typename U > class Descriptor>
plb::BlockLattice3D< T, Descriptor >::~BlockLattice3D (  )  [inline]

Destruction of the lattice.

During destruction, the memory for the lattice and the contained cells is released. However, the dynamics objects pointed to by the cells must be deleted manually by the user.

template<typename T, template< typename U > class Descriptor>
plb::BlockLattice3D< T, Descriptor >::BlockLattice3D ( BlockLattice3D< T, Descriptor > const &  rhs  )  [inline]

Copy construction.

The whole data of the lattice is duplicated. This includes both particle distribution function and external fields.

Warning:
The dynamics objects and internalProcessors are not copied
Parameters:
rhs the lattice to be duplicated

References plb::Cell< T, Descriptor >::getDynamics(), plb::AtomicBlock3D::getNx(), plb::AtomicBlock3D::getNy(), and plb::AtomicBlock3D::getNz().


Member Function Documentation

template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::boundaryStream ( Box3D  bound,
Box3D  domain 
) [inline]

Apply streaming step to boundary cells.

This method is slower than bulkStream(int,int,int,int), because it must be verified which distribution functions are to be kept from leaving the domain.

See also:
stream(int,int,int,int)
stream()

References plb::contained(), plb::AtomicBlock3D::getBoundingBox(), PLB_PRECONDITION, plb::BlockLattice3D< T, Descriptor >::swap(), plb::Box3D::x0, plb::Box3D::x1, plb::Box3D::y0, plb::Box3D::y1, plb::Box3D::z0, and plb::Box3D::z1.

Referenced by plb::BlockLattice3D< T, Descriptor >::collideAndStream(), and plb::BlockLattice3D< T, Descriptor >::stream().

template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::bulkCollideAndStream ( Box3D  domain  )  [inline]

Apply collision and streaming step to bulk (non-boundary) cells.

This method is fast, but it is erroneous when applied to boundary cells.

See also:
collideAndStream(int,int,int,int,int,int)
collideAndStream()

References plb::contained(), plb::AtomicBlock3D::getBoundingBox(), and PLB_PRECONDITION.

Referenced by plb::BlockLattice3D< T, Descriptor >::collideAndStream().

template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::bulkStream ( Box3D  domain  )  [inline]

Apply streaming step to bulk (non-boundary) cells.

This method is faster than boundaryStream(int,int,int,int,int,int), but it is erroneous when applied to boundary cells.

See also:
stream(int,int,int,int,int,int)
stream()

References plb::contained(), plb::AtomicBlock3D::getBoundingBox(), PLB_PRECONDITION, plb::BlockLattice3D< T, Descriptor >::swap(), plb::Box3D::x0, plb::Box3D::x1, plb::Box3D::y0, plb::Box3D::y1, plb::Box3D::z0, and plb::Box3D::z1.

Referenced by plb::BlockLattice3D< T, Descriptor >::stream().

template<typename T , template< typename U > class Descriptor>
CachePolicy3D & plb::BlockLattice3D< T, Descriptor >::cachePolicy (  )  [inline, static]
template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::collide (  )  [inline, virtual]

Apply collision step to the whole domain.

See also:
collide(int,int,int,int)

Implements plb::BlockLatticeBase3D< T, Descriptor >.

References plb::AtomicBlock3D::getBoundingBox().

Referenced by plb::BlockLattice3D< T, Descriptor >::collideAndStream().

template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::collide ( Box3D  domain  )  [inline, virtual]
template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::collideAndStream (  )  [inline, virtual]

Apply first collision, then streaming step to the whole domain.

At the end of this method, finalizeIteration() and executeInternalProcessors() are automatically invoked.

See also:
collideAndStream(int,int,int,int,int,int)

Implements plb::BlockLatticeBase3D< T, Descriptor >.

References plb::AtomicBlock3D::evaluateStatistics(), plb::AtomicBlock3D::executeInternalProcessors(), plb::AtomicBlock3D::getBoundingBox(), and plb::BlockLattice3D< T, Descriptor >::incrementTime().

template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::collideAndStream ( Box3D  domain  )  [inline, virtual]

Apply first collision, then streaming step to a 3D sub-box.

This operation is more efficient than a successive application of collide(int,int,int,int,int,int) and stream(int,int,int,int,int,int), because memory is traversed only once instead of twice.

Implements plb::BlockLatticeBase3D< T, Descriptor >.

References plb::BlockLattice3D< T, Descriptor >::boundaryStream(), plb::BlockLattice3D< T, Descriptor >::bulkCollideAndStream(), plb::BlockLattice3D< T, Descriptor >::collide(), plb::contained(), plb::AtomicBlock3D::getBoundingBox(), plb::Box3D::nCells(), PLB_PRECONDITION, plb::global::profiler(), plb::Box3D::x0, plb::Box3D::x1, plb::Box3D::y0, plb::Box3D::y1, plb::Box3D::z0, and plb::Box3D::z1.

template<typename T, template< typename U > class Descriptor>
virtual Cell<T,Descriptor> const& plb::BlockLattice3D< T, Descriptor >::get ( plint  iX,
plint  iY,
plint  iZ 
) const [inline, virtual]

Read only access to lattice cells.

Implements plb::BlockLatticeBase3D< T, Descriptor >.

template<typename T, template< typename U > class Descriptor>
virtual Cell<T,Descriptor>& plb::BlockLattice3D< T, Descriptor >::get ( plint  iX,
plint  iY,
plint  iZ 
) [inline, virtual]

Read/write access to lattice cells.

Implements plb::BlockLatticeBase3D< T, Descriptor >.

Referenced by plb::BinaryFreeSurfaceProcessorParam3D< T, FluidDescriptor >::cell(), plb::FreeSurfaceProcessorParam3D< T, FluidDescriptor >::cell(), plb::NLD_VelocityNeumannBoundaryDynamics3D< T, Descriptor >::cornerBoundaryCompletion(), plb::NLD_VelocityBoundaryDynamics3D< T, Descriptor >::cornerBoundaryCompletion(), plb::NLD_VelocityNeumannBoundaryDynamics3D< T, Descriptor >::cornerComputeMacroscopic(), plb::cubicInterpolationOverCoarseLineX(), plb::cubicInterpolationOverCoarseLineY(), plb::cubicInterpolationOverFineLineX(), plb::NLD_VelocityNeumannBoundaryDynamics3D< T, Descriptor >::edgeBoundaryCompletion(), plb::NLD_VelocityBoundaryDynamics3D< T, Descriptor >::edgeBoundaryCompletion(), plb::NLD_VelocityNeumannBoundaryDynamics3D< T, Descriptor >::edgeComputeMacroscopic(), plb::fdLattice::firstOrderBulkVorticity(), plb::InterpolateOverLineAndExcess(), plb::fd::DirectedGradients3D< T, Descriptor, direction, orientation, deriveDirection, true >::o1_densityDerivative(), plb::fd::DirectedGradients3D< T, Descriptor, direction, orientation, deriveDirection, true >::o1_velocityDerivative(), plb::fd::DirectedGradients3D< T, Descriptor, direction, orientation, deriveDirection, false >::o2_densityDerivative(), plb::fd::DirectedGradients3D< T, Descriptor, direction, orientation, deriveDirection, true >::o2_densityDerivative(), plb::fd::DirectedGradients3D< T, Descriptor, direction, orientation, deriveDirection, false >::o2_velocityDerivative(), plb::fd::DirectedGradients3D< T, Descriptor, direction, orientation, deriveDirection, true >::o2_velocityDerivative(), plb::NLD_VelocityNeumannBoundaryDynamics3D< T, Descriptor >::planeBoundaryCompletion(), plb::WrappedLocalBoundaryFunctional3D< T, Descriptor >::process(), plb::BoxSumVelocityTemperatureFunctional3D< T, FluidDescriptor, TemperatureDescriptor >::process(), plb::StaticSmagorinskyFunctional3D< T, Descriptor, SmagoFunction >::process(), plb::ShanChenSingleComponentProcessor3D< T, Descriptor >::process(), plb::ExecuteNonLocalDynamics3D< T, Descriptor >::process(), plb::ExecuteCornerNLD_3D< T, Descriptor >::process(), plb::ExecuteEdgeNLD_3D< T, Descriptor >::process(), plb::ExecutePlaneNLD_3D< T, Descriptor >::process(), plb::CopyDensityFunctional3D< T, Descriptor, normalX, normalY, normalZ >::process(), plb::CopyNormalVelocityFunctional3D< T, Descriptor, normalX, normalY, normalZ >::process(), plb::CopyTangentialVelocityFunctional3D< T, Descriptor, normalX, normalY, normalZ >::process(), plb::CopyVelocityFunctional3D< T, Descriptor, normalX, normalY, normalZ >::process(), plb::CopyAllPopulationsFunctional3D< T, Descriptor, normalX, normalY, normalZ >::process(), plb::CopyUnknownPopulationsFunctional3D< T, Descriptor, direction, orientation >::process(), plb::AssignEntireCellFunctional3D< T, Descriptor >::process(), plb::ExtractBottomMostDynamicsFunctional3D< T, Descriptor >::process(), plb::ExtractTopMostDynamicsFunctional3D< T, Descriptor >::process(), plb::ExtractDynamicsChainFunctional3D< T, Descriptor >::process(), plb::InterpolateCoarseToFineCornerDynamics3D< T, Descriptor1, Descriptor2 >::process(), plb::InterpolateCoarseToFineDynamics3D< T, Descriptor1, Descriptor2 >::process(), plb::LatticeInterpolateCoarseToFine3D< T, Descriptor >::process(), plb::LatticeCopyFineToCoarseZerothOrder3D< T, Descriptor >::process(), plb::FreeSurfaceFadingArea3D< T, Descriptor >::process(), plb::Copy_t1_to_t0_3D< T, Descriptor >::process(), plb::CopyDecomposedValuesToFine3D< T, Descriptor >::process(), plb::CopyDecomposedValuesFromCoarse3D< T, Descriptor >::process(), plb::ComputeSmagoViscosityFunctional3D< T, Descriptor >::process(), plb::InterpolatePopulationsFunctional3D< T, Descriptor >::process(), plb::SetExternalVectorFromTensorFieldFunctional3D< T, Descriptor, nDim >::process(), plb::SetExternalVectorFunctional3D< T, Descriptor >::process(), plb::SetExternalScalarFunctional3D< T, Descriptor >::process(), plb::InstantiateCompositeDynamicsFunctional3D< T, Descriptor >::process(), plb::StripeOffDensityOffsetFunctional3D< T, Descriptor >::process(), plb::IniConstEquilibriumFunctional3D< T, Descriptor >::process(), plb::SetConstBoundaryDensityFunctional3D< T, Descriptor >::process(), plb::SetConstBoundaryVelocityFunctional3D< T, Descriptor >::process(), plb::AssignOmegaFunctional3D< T, Descriptor >::process(), plb::GenericIndexedLatticeFunctional3D< T, Descriptor >::process(), plb::GenericLatticeFunctional3D< T, Descriptor >::process(), plb::CountLatticeElementsFunctional3D< T, Descriptor, BoolMask >::process(), plb::BoxOmegaFunctional3D< T, Descriptor >::process(), plb::BoxAllPopulationsToLatticeFunctional3D< T, Descriptor >::process(), plb::BoxAllPopulationsFunctional3D< T, Descriptor >::process(), plb::BoxEquilibriumFunctional3D< T, Descriptor >::process(), plb::BoxPopulationFunctional3D< T, Descriptor >::process(), plb::BoxStrainRateFromStressFunctional3D< T, Descriptor >::process(), plb::BoxDeviatoricStressFunctional3D< T, Descriptor >::process(), plb::BoxTemperatureFunctional3D< T, Descriptor >::process(), plb::BoxVelocityFunctional3D< T, Descriptor >::process(), plb::BoxVelocityComponentFunctional3D< T, Descriptor >::process(), plb::BoxVelocityNormFunctional3D< T, Descriptor >::process(), plb::BoxKineticEnergyFunctional3D< T, Descriptor >::process(), plb::PackedRhoBarJfunctional3D< T, Descriptor >::process(), plb::BoxRhoBarFunctional3D< T, Descriptor >::process(), plb::BoxDensityFunctional3D< T, Descriptor >::process(), plb::LatticeRegenerateFunctional3D< T, Descriptor >::process(), plb::LatticeCopyAllFunctional3D< T, Descriptor >::process(), plb::CopyConvertPopulationsFunctional3D< T1, Descriptor1, T2, Descriptor2 >::process(), plb::CopyPopulationsFunctional3D< T, Descriptor >::process(), plb::VelocitySingleProbe3D< T, Descriptor >::process(), plb::DensitySingleProbe3D< T, Descriptor >::process(), plb::BoxSumEnergyFunctional3D< T, Descriptor >::process(), plb::BoxSumRhoBarFunctional3D< T, Descriptor >::process(), plb::CopyFineToCoarse3D< T, Descriptor1, Descriptor2 >::process(), plb::LatticeToPassiveAdvDiff3D< T, FluidDescriptor, ScalarDescriptor >::process(), plb::VelocityToPassiveAdvDiff3D< T, TemperatureDescriptor >::process(), plb::BoussinesqThermalProcessor3D< T, FluidDescriptor, TemperatureDescriptor >::process(), plb::InitializeDotMomentumExchangeFunctional3D< T, Descriptor >::process(), plb::MomentumExchangeComplexDomainFunctional3D< T, Descriptor >::process(), plb::InitializeMomentumExchangeFunctional3D< T, Descriptor >::process(), plb::AsinariPostCollide3D< T, Descriptor >::process(), plb::FlatAdiabaticBoundaryFunctional3D< T, Descriptor, direction, orientation >::process(), plb::OuterVelocityCornerFunctional3D< T, Descriptor, xNormal, yNormal, zNormal >::processCell(), plb::OuterVelocityEdgeFunctional3D< T, Descriptor, plane, normal1, normal2 >::processCell(), plb::PlaneFdBoundaryFunctional3D< T, Descriptor, direction, orientation >::processCell(), plb::RecomposeFromFlowVariablesFunctional3D< T, Descriptor >::processGenericBlocks(), plb::BoxRhoBarJfunctional3D< T, Descriptor >::processGenericBlocks(), plb::multiPhaseTemplates3D< T, descriptors::ForcedShanChenD3Q19Descriptor >::shanChenInteraction(), plb::multiPhaseTemplates3D< T, Descriptor >::shanChenInteraction(), plb::NonLocalBoundaryDynamics3D< T, Descriptor >::staticCornerComputeMacroscopic(), plb::NonLocalBoundaryDynamics3D< T, Descriptor >::staticEdgeComputeMacroscopic(), and plb::NonLocalBoundaryDynamics3D< T, Descriptor >::staticPlaneComputeMacroscopic().

template<typename T , template< typename U > class Descriptor>
Dynamics< T, Descriptor > const & plb::BlockLattice3D< T, Descriptor >::getBackgroundDynamics (  )  const [inline]

Get a const reference to the background dynamics.

template<typename T , template< typename U > class Descriptor>
Dynamics< T, Descriptor > & plb::BlockLattice3D< T, Descriptor >::getBackgroundDynamics (  )  [inline]

Get a reference to the background dynamics.

template<typename T , template< typename U > class Descriptor>
BlockLatticeDataTransfer3D< T, Descriptor > const & plb::BlockLattice3D< T, Descriptor >::getDataTransfer (  )  const [inline, virtual]

Get access to data transfer between blocks (const version).

Implements plb::AtomicBlock3D.

template<typename T , template< typename U > class Descriptor>
BlockLatticeDataTransfer3D< T, Descriptor > & plb::BlockLattice3D< T, Descriptor >::getDataTransfer (  )  [inline, virtual]

Get access to data transfer between blocks.

Implements plb::AtomicBlock3D.

Referenced by plb::transferFromCoProcessors(), and plb::transferToCoProcessors().

template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::incrementTime (  )  [inline, virtual]
template<typename T, template< typename U > class Descriptor>
BlockLattice3D< T, Descriptor > & plb::BlockLattice3D< T, Descriptor >::operator= ( BlockLattice3D< T, Descriptor > const &  rhs  )  [inline]

Copy assignment.

The current lattice is deallocated, then the lattice from the rhs is duplicated. This includes both particle distribution function and external fields.

Warning:
The dynamics objects and internalProcessors are not copied
Parameters:
rhs the lattice to be duplicated

References plb::BlockLattice3D< T, Descriptor >::swap().

template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::specifyStatisticsStatus ( Box3D  domain,
bool  status 
) [inline, virtual]
template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::stream (  )  [inline, virtual]

Apply streaming step to the whole domain.

At the end of this method, the methods finalizeIteration() and executeInternalProcessors() are automatically invoked.

See also:
stream(int,int,int,int,int,int)

Implements plb::BlockLatticeBase3D< T, Descriptor >.

References plb::AtomicBlock3D::evaluateStatistics(), plb::AtomicBlock3D::executeInternalProcessors(), plb::AtomicBlock3D::getBoundingBox(), and plb::BlockLattice3D< T, Descriptor >::incrementTime().

template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::stream ( Box3D  domain  )  [inline, virtual]

Apply streaming step to a 3D sub-box.

The distribution function never leave the rectangular domain. On the domain boundaries, the (outgoing) distribution functions that should be streamed outside are simply left untouched. The finalization of an iteration step is not automatically executed, as it is in the method stream(). If you want it to be executed, you must explicitly call the methods finalizeIteration() and executeInternalProcessors().

See also:
stream()

Implements plb::BlockLatticeBase3D< T, Descriptor >.

References plb::BlockLattice3D< T, Descriptor >::boundaryStream(), plb::BlockLattice3D< T, Descriptor >::bulkStream(), plb::contained(), plb::AtomicBlock3D::getBoundingBox(), PLB_PRECONDITION, plb::Box3D::x0, plb::Box3D::x1, plb::Box3D::y0, plb::Box3D::y1, plb::Box3D::z0, and plb::Box3D::z1.

template<typename T , template< typename U > class Descriptor>
void plb::BlockLattice3D< T, Descriptor >::swap ( BlockLattice3D< T, Descriptor > &  rhs  )  [inline]

Swap the content of two BlockLattices.

The swap is efficient, in the sense that only pointers to the lattice are copied, and not the lattice itself.

Referenced by plb::BlockLattice3D< T, Descriptor >::boundaryStream(), plb::BlockLattice3D< T, Descriptor >::bulkStream(), and plb::BlockLattice3D< T, Descriptor >::operator=().


Friends And Related Function Documentation

template<typename T, template< typename U > class Descriptor>
friend class ExternalRhoJcollideAndStream3D [friend]
template<typename T, template< typename U > class Descriptor>
friend class OnLinkExternalRhoJcollideAndStream3D [friend]

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