OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::opti::BlockLatticeDphysDissipationDf3D< T, DESCRIPTOR > Class Template Reference

functor to get the pointwise dual dissipation density on local lattices, if globIC is not on the local processor, the returned vector is empty More...

#include <dualFunctors3D.h>

+ Inheritance diagram for olb::opti::BlockLatticeDphysDissipationDf3D< T, DESCRIPTOR >:
+ Collaboration diagram for olb::opti::BlockLatticeDphysDissipationDf3D< T, DESCRIPTOR >:

Public Member Functions

 BlockLatticeDphysDissipationDf3D (BlockLattice< T, DESCRIPTOR > &blockLattice, int overlap, const UnitConverter< T, DESCRIPTOR > &converter)
 
bool operator() (T output[], const int input[])
 has to be implemented for 'every' derived class
 
- Public Member Functions inherited from olb::BlockLatticeF3D< T, DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & getBlock ()
 Copy Constructor.
 
- Public Member Functions inherited from olb::BlockF3D< T >
 ~BlockF3D () override
 virtual destructor for defined behaviour
 
virtual BlockStructureD< 3 > & getBlockStructure () const
 
BlockF3D< T > & operator- (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator+ (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator* (BlockF3D< T > &rhs)
 
BlockF3D< T > & operator/ (BlockF3D< T > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, int >
virtual ~GenericF ()=default
 
int getSourceDim () const
 read only access to member variable _m
 
int getTargetDim () const
 read only access to member variable _n
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], int input0)
 
bool operator() (T output[], int input0, int input1)
 
bool operator() (T output[], int input0, int input1, int input2)
 
bool operator() (T output[], int input0, int input1, int input2, int input3)
 

Protected Attributes

const int _overlap
 
const UnitConverter< T, DESCRIPTOR > & _converter
 
- Protected Attributes inherited from olb::BlockLatticeF3D< T, DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & _blockLattice
 
- Protected Attributes inherited from olb::BlockF3D< T >
BlockStructureD< 3 > & _blockStructure
 

Additional Inherited Members

- Public Types inherited from olb::GenericF< T, int >
using targetType
 
using sourceType
 
- Public Attributes inherited from olb::GenericF< T, int >
std::shared_ptr< GenericF< T, int > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Protected Member Functions inherited from olb::BlockLatticeF3D< T, DESCRIPTOR >
 BlockLatticeF3D (BlockLattice< T, DESCRIPTOR > &blockLattice, int targetDim)
 
- Protected Member Functions inherited from olb::BlockF3D< T >
 BlockF3D (BlockStructureD< 3 > &blockStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, int >
 GenericF (int targetDim, int sourceDim)
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::opti::BlockLatticeDphysDissipationDf3D< T, DESCRIPTOR >

functor to get the pointwise dual dissipation density on local lattices, if globIC is not on the local processor, the returned vector is empty

Definition at line 38 of file dualFunctors3D.h.

Constructor & Destructor Documentation

◆ BlockLatticeDphysDissipationDf3D()

template<typename T , typename DESCRIPTOR >
olb::opti::BlockLatticeDphysDissipationDf3D< T, DESCRIPTOR >::BlockLatticeDphysDissipationDf3D ( BlockLattice< T, DESCRIPTOR > & blockLattice,
int overlap,
const UnitConverter< T, DESCRIPTOR > & converter )

Definition at line 36 of file dualFunctors3D.hh.

40 : BlockLatticeF3D<T,DESCRIPTOR>(blockLattice,DESCRIPTOR::q),
41 _overlap(overlap),
42 _converter(converter)
43{
44 this->getName() = "dPhysDissipationDf";
45}
std::string & getName()
read and write access to name
Definition genericF.hh:51
const UnitConverter< T, DESCRIPTOR > & _converter

References olb::GenericF< T, int >::getName().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename T , typename DESCRIPTOR >
bool olb::opti::BlockLatticeDphysDissipationDf3D< T, DESCRIPTOR >::operator() ( T output[],
const int input[] )
virtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, int >.

Definition at line 48 of file dualFunctors3D.hh.

49{
50 T omega = _converter.getLatticeRelaxationFrequency();
51 T dt = _converter.getConversionFactorTime();
52
53 T rho;
54 T u[3];
55 T pi[6];
56
57 /*const int localLatticeR[3] = {
58 latticeR[0] + _overlap,
59 latticeR[1] + _overlap,
60 latticeR[2] + _overlap
61 };
62 this->_blockLattice.get(localLatticeR).computeAllMomenta(rho, u, pi);*/
63 this->_blockLattice.get(latticeR).computeAllMomenta(rho, u, pi);
64
65 for (int i=0; i<DESCRIPTOR::q; i++) { //output default 0
66 dDdf[i] = T();
67 }
68
69 T pi2[DESCRIPTOR::d][DESCRIPTOR::d];
70
71 pi2[0][0]=pi[0];
72 pi2[0][1]=pi[1];
74 pi2[0][2]=pi[2];
75 }
76 else {
77 pi2[1][1]=pi[2];
78 }
79 pi2[1][0]=pi[1];
81 pi2[1][1]=pi[3];
82 pi2[1][2]=pi[4];
83 pi2[2][0]=pi[2];
84 pi2[2][1]=pi[4];
85 pi2[2][2]=pi[5];
86 }
87
88 for (int jPop=0; jPop < DESCRIPTOR::q; ++jPop) {
89 for (int iDim=0; iDim < DESCRIPTOR::d; ++iDim) {
90 for (int jDim=0; jDim < DESCRIPTOR::d; ++jDim) {
91 T dPidf2ndTerm = T();
92 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
93 dPidf2ndTerm += descriptors::c<DESCRIPTOR>(iPop)[iDim] * descriptors::c<DESCRIPTOR>(iPop)[jDim]
94 * dualLbHelpers<T,DESCRIPTOR>::equilibrium(iPop, jPop, rho, u);
95 }
96 T dpidf = descriptors::c<DESCRIPTOR>(jPop,iDim)*descriptors::c<DESCRIPTOR>(jPop,jDim) - dPidf2ndTerm;
97 // rho2 instead of rho vs simon!
98 dDdf[jPop] += 2.*(pi2[iDim][jDim]*(dpidf - pi2[iDim][jDim]/2./rho*2.));
99 }
100 }
101 dDdf[jPop] *= util::pow(omega*descriptors::invCs2<T,DESCRIPTOR>()/rho,2)/2.*_converter.getPhysViscosity()/_converter.getLatticeViscosity()/dt/dt;
102 }
103 return true;
104}
BlockLattice< T, DESCRIPTOR > & _blockLattice
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112
static T equilibrium(int iPop, int jPop, T rho, const T u[DESCRIPTOR::d])
static constexpr int n
result stored in n
Definition util.h:211

References olb::opti::dualLbHelpers< T, DESCRIPTOR >::equilibrium(), and olb::util::pow().

+ Here is the call graph for this function:

Member Data Documentation

◆ _converter

template<typename T , typename DESCRIPTOR >
const UnitConverter<T,DESCRIPTOR>& olb::opti::BlockLatticeDphysDissipationDf3D< T, DESCRIPTOR >::_converter
protected

Definition at line 41 of file dualFunctors3D.h.

◆ _overlap

template<typename T , typename DESCRIPTOR >
const int olb::opti::BlockLatticeDphysDissipationDf3D< T, DESCRIPTOR >::_overlap
protected

Definition at line 40 of file dualFunctors3D.h.


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