MaMiCo 1.2
Loading...
Searching...
No Matches
coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim > Class Template Reference

This class relaxes velocities of molecules towards an interpolated avergaged velocity value. More...

#include <VelocityGradientRelaxationMapping.h>

Inheritance diagram for coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >:
Collaboration diagram for coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >:

Public Member Functions

 VelocityGradientRelaxationMapping (const double &velocityRelaxationFactor, const tarch::la::Vector< dim, double > &currentVelocity, const I02 &cellIndex, coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface, const coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > *const couplingCells)
 
virtual ~VelocityGradientRelaxationMapping ()
 
void beginCellIteration ()
 
void endCellIteration ()
 
void handleCell (LinkedCell &cell)
 

Protected Member Functions

virtual bool relaxMolecule (const tarch::la::Vector< dim, double > &position) const
 
bool ignoreThisCell (const I02 &idx) const
 

Protected Attributes

coupling::interface::MDSolverInterface< LinkedCell, dim > *const _mdSolverInterface
 
const coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > *const _couplingCells
 
const double _velocityRelaxationFactor
 
const tarch::la::Vector< dim, double > _currentVelocity
 
const tarch::la::Vector< dim, double > _innerLowerLeft
 
const tarch::la::Vector< dim, double > _innerUpperRight
 
const tarch::la::Vector< dim, double > _outerLowerLeft
 
const tarch::la::Vector< dim, double > _outerUpperRight
 
I02 _cellIdx
 
bool _ignoreThisCell
 

Private Member Functions

tarch::la::Vector< dim, double > getInnerLowerLeftCorner () const
 
tarch::la::Vector< dim, double > getInnerUpperRightCorner () const
 
tarch::la::Vector< dim, double > getOuterLowerLeftCorner () const
 
tarch::la::Vector< dim, double > getOuterUpperRightCorner () const
 
void createCouplingCellIndex4SecondOrderInterpolation (const tarch::la::Vector< dim, double > &position, tarch::la::Vector< dim, double > &normalisedPosition, bool &secondCake, I02 *res) const
 
void interpolateVelocitySecondOrder (I02 *cellIndex, const tarch::la::Vector< dim, double > &normalisedPosition, const bool &secondCake, tarch::la::Vector< dim, double > &newVelocity) const
 

Detailed Description

template<class LinkedCell, unsigned int dim>
class coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >

This class relaxes velocities of molecules towards an interpolated avergaged velocity value.

This class relaxes velocities of molecules towards an interpolated avergaged velocity value. Only molecules within a three cell-wide boundary strip are considered if they are inside the one cell-wide boundary strip that is spanned by the outermost non-ghost coupling cell midpoints. Currently, a second-order interpolation of the molecules in the outer boundary strip is used (that is the first layer with three coupling cells needs to be initialised with valid LB velocities).

Template Parameters
LinkedCellcell type
dimNumber of dimensions; it can be 1, 2 or 3
Author
Philipp Neumann
Note
ONLY SUPPORTS 3D AT THE MOMENT!
Todo
Philipp please take a look on this class

Constructor & Destructor Documentation

◆ VelocityGradientRelaxationMapping()

template<class LinkedCell, unsigned int dim>
coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::VelocityGradientRelaxationMapping ( const double & velocityRelaxationFactor,
const tarch::la::Vector< dim, double > & currentVelocity,
const I02 & cellIndex,
coupling::interface::MDSolverInterface< LinkedCell, dim > *const mdSolverInterface,
const coupling::datastructures::CouplingCellWithLinkedCells< LinkedCell, dim > *const couplingCells )
inline

obtains relaxation factor and current velocity (the velocity towards which the relaxation shall be done is later obtained from the microscopicmomentum-buffers).

Parameters
velocityRelaxationFactor
currentVelocity
cellIndex
mdSolverInterface
couplingCells

◆ ~VelocityGradientRelaxationMapping()

template<class LinkedCell, unsigned int dim>
virtual coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::~VelocityGradientRelaxationMapping ( )
inlinevirtual

Destructor

Member Function Documentation

◆ beginCellIteration()

template<class LinkedCell, unsigned int dim>
void coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::beginCellIteration ( )
inline

empty function

◆ createCouplingCellIndex4SecondOrderInterpolation()

template<class LinkedCell, unsigned int dim>
void coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::createCouplingCellIndex4SecondOrderInterpolation ( const tarch::la::Vector< dim, double > & position,
tarch::la::Vector< dim, double > & normalisedPosition,
bool & secondCake,
I02 * res ) const
inlineprivate

creates a coupling cell index for the second order interpolation.

Parameters
position
normalisedPosition
secondCake
res

◆ endCellIteration()

template<class LinkedCell, unsigned int dim>
void coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::endCellIteration ( )
inline

empty function

◆ getInnerLowerLeftCorner()

template<class LinkedCell, unsigned int dim>
tarch::la::Vector< dim, double > coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::getInnerLowerLeftCorner ( ) const
inlineprivate
Returns
the inner lower left corner of the cell

◆ getInnerUpperRightCorner()

template<class LinkedCell, unsigned int dim>
tarch::la::Vector< dim, double > coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::getInnerUpperRightCorner ( ) const
inlineprivate
Returns
the inner upper right corner of the cell

◆ getOuterLowerLeftCorner()

template<class LinkedCell, unsigned int dim>
tarch::la::Vector< dim, double > coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::getOuterLowerLeftCorner ( ) const
inlineprivate
Returns
the outer lower left corner of the cell

◆ getOuterUpperRightCorner()

template<class LinkedCell, unsigned int dim>
tarch::la::Vector< dim, double > coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::getOuterUpperRightCorner ( ) const
inlineprivate
Returns
the outer upper right corner of the cell

◆ handleCell()

template<class LinkedCell, unsigned int dim>
void coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::handleCell ( LinkedCell & cell)
inline

computes the current velocity directly from coupling cell and the new velocity (microscopicMomentum) with second-order interpolation multiplies the difference between the two with the velocity relaxation factor add it to the velocity of the molecule and applies it to the molecule.

Parameters
cell

◆ ignoreThisCell()

template<class LinkedCell, unsigned int dim>
bool coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::ignoreThisCell ( const I02 & idx) const
inlineprotected
Parameters
idx
Returns
true if all molecules in this coupling cell do not require any velocity relaxation (-> used to speed up the code)

◆ interpolateVelocitySecondOrder()

template<class LinkedCell, unsigned int dim>
void coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::interpolateVelocitySecondOrder ( I02 * cellIndex,
const tarch::la::Vector< dim, double > & normalisedPosition,
const bool & secondCake,
tarch::la::Vector< dim, double > & newVelocity ) const
inlineprivate

carries out second order interpolation of the velocity value (microscopicmomentum-buffer) at position 'position'

Parameters
cellIndex
normalisedPosition
secondCake
newVelocity

◆ relaxMolecule()

template<class LinkedCell, unsigned int dim>
virtual bool coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::relaxMolecule ( const tarch::la::Vector< dim, double > & position) const
inlineprotectedvirtual
Parameters
position
Returns
true, if the position 'position' is within the respective boundary strip that is spanned by the two outermost coupling cell midpoints

Reimplemented in coupling::cellmappings::VelocityGradientRelaxationTopOnlyMapping< LinkedCell, dim >.

Member Data Documentation

◆ _currentVelocity

template<class LinkedCell, unsigned int dim>
const tarch::la::Vector<dim, double> coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::_currentVelocity
protected

current velocity in this coupling cell

◆ _ignoreThisCell

template<class LinkedCell, unsigned int dim>
bool coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::_ignoreThisCell
protected

true, if all molecules in this cell do not require any velocity relaxation

◆ _innerLowerLeft

template<class LinkedCell, unsigned int dim>
const tarch::la::Vector<dim, double> coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::_innerLowerLeft
protected

boundary points of the boundary strip under consideration

◆ _velocityRelaxationFactor

template<class LinkedCell, unsigned int dim>
const double coupling::cellmappings::VelocityGradientRelaxationMapping< LinkedCell, dim >::_velocityRelaxationFactor
protected

relaxation factor for velocity relaxation


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