OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::SuperLatticeRefinementMetricKnudsen2D< T, DESCRIPTOR > Class Template Referencefinal

SuperLatticeRefinementMetricKnudsen2D suggests a per-block grid refinement factor. More...

#include <superLatticeRefinementMetricF2D.h>

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

Public Member Functions

 SuperLatticeRefinementMetricKnudsen2D (SuperLattice< T, DESCRIPTOR > &lattice, const UnitConverter< T, DESCRIPTOR > &converter)
 Constructor.
 
bool operator() (T output[], int glob)
 
void print ()
 Convenience method for printing per-block refinement factors.
 
- Public Member Functions inherited from olb::SuperLatticeF2D< T, DESCRIPTOR >
SuperLattice< T, DESCRIPTOR > & getSuperLattice ()
 
bool operator() (T output[], const int input[])
 
- Public Member Functions inherited from olb::SuperF2D< T, T >
SuperF2D< T, T > & operator- (SuperF2D< T, T > &rhs)
 
SuperF2D< T, T > & operator+ (SuperF2D< T, T > &rhs)
 
SuperF2D< T, T > & operator* (SuperF2D< T, T > &rhs)
 
SuperF2D< T, T > & operator/ (SuperF2D< T, T > &rhs)
 
SuperStructure< T, 2 > & getSuperStructure ()
 
int getBlockFSize () const
 
BlockF2D< T > & getBlockF (int iCloc)
 
bool operator() (T output[], const int input[]) override
 
- Public Member Functions inherited from olb::GenericF< T, S >
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
 
virtual bool operator() (T output[], const S input[])=0
 has to be implemented for 'every' derived class
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], S input0)
 
bool operator() (T output[], S input0, S input1)
 
bool operator() (T output[], S input0, S input1, S input2)
 
bool operator() (T output[], S input0, S input1, S input2, S input3)
 

Additional Inherited Members

- Public Types inherited from olb::SuperF2D< T, T >
using identity_functor_type
 
- Public Types inherited from olb::GenericF< T, S >
using targetType = T
 
using sourceType = S
 
- Public Attributes inherited from olb::GenericF< T, S >
std::shared_ptr< GenericF< T, S > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Protected Member Functions inherited from olb::SuperLatticeF2D< T, DESCRIPTOR >
 SuperLatticeF2D (SuperLattice< T, DESCRIPTOR > &superLattice, int targetDim)
 
- Protected Member Functions inherited from olb::SuperF2D< T, T >
 SuperF2D (SuperStructure< T, 2 > &superStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::SuperLatticeF2D< T, DESCRIPTOR >
SuperLattice< T, DESCRIPTOR > & _sLattice
 
- Protected Attributes inherited from olb::SuperF2D< T, T >
SuperStructure< T, 2 > & _superStructure
 
std::vector< std::unique_ptr< BlockF2D< T > > > _blockF
 Super functors may consist of several BlockF2D<W> derived functors.
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::SuperLatticeRefinementMetricKnudsen2D< T, DESCRIPTOR >

SuperLatticeRefinementMetricKnudsen2D suggests a per-block grid refinement factor.

This functor is a direct implementation of the refinement criterion described in "Automatic grid refinement criterion for lattice Boltzmann method" [arXiv:1507.06767] by D. Lagrava et al.

Definition at line 55 of file superLatticeRefinementMetricF2D.h.

Constructor & Destructor Documentation

◆ SuperLatticeRefinementMetricKnudsen2D()

template<typename T , typename DESCRIPTOR >
olb::SuperLatticeRefinementMetricKnudsen2D< T, DESCRIPTOR >::SuperLatticeRefinementMetricKnudsen2D ( SuperLattice< T, DESCRIPTOR > & lattice,
const UnitConverter< T, DESCRIPTOR > & converter )

Constructor.

Parameters
converterRequired to get the theoretical Knudsen number as reference
roundingConfigures the quality of the grid by rounding the output

Definition at line 52 of file superLatticeRefinementMetricF2D.hh.

55 : SuperLatticeF2D<T, DESCRIPTOR>(lattice, 1)
56{
57 this->getName() = "refinementMetricKnudsen";
58
59 for (int iC = 0; iC < lattice.getLoadBalancer().size(); ++iC) {
60 this->_blockF.emplace_back(
61 new BlockLatticeRefinementMetricKnudsen2D<T, DESCRIPTOR>(
62 lattice.getBlock(iC), converter)
63 );
64 }
65}
std::string & getName()
read and write access to name
Definition genericF.hh:51
std::vector< std::unique_ptr< BlockF2D< T > > > _blockF
Super functors may consist of several BlockF2D<W> derived functors.

References olb::SuperF2D< T, T >::_blockF, olb::SuperLattice< T, DESCRIPTOR >::getBlock(), olb::SuperStructure< T, D >::getLoadBalancer(), and olb::GenericF< T, S >::getName().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename T , typename DESCRIPTOR >
bool olb::SuperLatticeRefinementMetricKnudsen2D< T, DESCRIPTOR >::operator() ( T output[],
int glob )
Parameters
outputoutput[0] == 0 suggests sufficient grid resolution, output[0] > 0 suggests the grid to be refined output[0] times
globcuboid to be considered

Definition at line 68 of file superLatticeRefinementMetricF2D.hh.

69{
70 auto& load = this->_sLattice.getLoadBalancer();
71
72 if (load.isLocal(glob)) {
73 const int loc = load.loc(glob);
74
75 return this->getBlockF(loc)(output);
76 }
77 else {
78 return false;
79 }
80}
BlockF2D< T > & getBlockF(int iCloc)
SuperLattice< T, DESCRIPTOR > & _sLattice

◆ print()

template<typename T , typename DESCRIPTOR >
void olb::SuperLatticeRefinementMetricKnudsen2D< T, DESCRIPTOR >::print ( )

Convenience method for printing per-block refinement factors.

Parameters
outputoutput[0] == 0 suggests sufficient grid resolution, output[0] > 0 suggests the grid to be refined output[0] times \input input grid cell to be considered

Definition at line 85 of file superLatticeRefinementMetricF2D.hh.

86{
87 const int nC = this->_sLattice.getCuboidGeometry().getNc();
88
89 std::vector<T> factors(nC, T{});
90 T output[1] = { };
91
92 auto& load = this->_sLattice.getLoadBalancer();
93
94 for (int iC = 0; iC < load.size(); ++iC) {
95 this->getBlockF(iC)(output, iC);
96
97 factors[load.glob(iC)] = output[0];
98 }
99
100 OstreamManager clout(std::cout, "refinement");
101
102 for (int i = 0; i < nC; ++i) {
103#ifdef PARALLEL_MODE_MPI
104 singleton::mpi().sendToMaster(&factors[i], 1, load.isLocal(i));
105#endif
106
107 clout << "factors[" << i << "]: " << factors[i] << std::endl;
108 }
109}
void sendToMaster(T *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm=MPI_COMM_WORLD)
Sends data to master processor.
MpiManager & mpi()

References olb::singleton::mpi(), and olb::singleton::MpiManager::sendToMaster().

+ Here is the call graph for this function:

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