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

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

#include <superLatticeRefinementMetricF3D.h>

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

Public Member Functions

 SuperLatticeRefinementMetricKnudsen3D (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::SuperLatticeF3D< T, DESCRIPTOR >
SuperLattice< T, DESCRIPTOR > & getSuperLattice ()
 
bool operator() (T output[], const int input[])
 
- Public Member Functions inherited from olb::SuperF3D< T, T >
SuperF3D< T, T > & operator- (SuperF3D< T, T > &rhs)
 
SuperF3D< T, T > & operator+ (SuperF3D< T, T > &rhs)
 
SuperF3D< T, T > & operator* (SuperF3D< T, T > &rhs)
 
SuperF3D< T, T > & operator/ (SuperF3D< T, T > &rhs)
 
SuperStructure< T, 3 > & getSuperStructure ()
 
int getBlockFSize () const
 
BlockF3D< T > & getBlockF (int iCloc)
 
bool operator() (T output[], const int input[])
 
- 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::SuperLatticeF3D< T, DESCRIPTOR >
using identity_functor_type = SuperLatticeIdentity3D<T,DESCRIPTOR>
 
- Public Types inherited from olb::SuperF3D< 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)
 
- Static Public Attributes inherited from olb::SuperF3D< T, T >
static constexpr bool isSuper
 
static constexpr unsigned d
 
- Protected Member Functions inherited from olb::SuperLatticeF3D< T, DESCRIPTOR >
 SuperLatticeF3D (SuperLattice< T, DESCRIPTOR > &superLattice, int targetDim)
 
- Protected Member Functions inherited from olb::SuperF3D< T, T >
 SuperF3D (SuperStructure< T, 3 > &superStructure, int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, S >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::SuperLatticeF3D< T, DESCRIPTOR >
SuperLattice< T, DESCRIPTOR > & _sLattice
 
- Protected Attributes inherited from olb::SuperF3D< T, T >
SuperStructure< T, 3 > & _superStructure
 
std::vector< std::unique_ptr< BlockF3D< T > > > _blockF
 Super functors may consist of several BlockF3D<W> derived functors.
 

Detailed Description

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

SuperLatticeRefinementMetricKnudsen3D 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 54 of file superLatticeRefinementMetricF3D.h.

Constructor & Destructor Documentation

◆ SuperLatticeRefinementMetricKnudsen3D()

template<typename T , typename DESCRIPTOR >
olb::SuperLatticeRefinementMetricKnudsen3D< T, DESCRIPTOR >::SuperLatticeRefinementMetricKnudsen3D ( 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 50 of file superLatticeRefinementMetricF3D.hh.

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

References olb::SuperF3D< 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::SuperLatticeRefinementMetricKnudsen3D< 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 66 of file superLatticeRefinementMetricF3D.hh.

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

◆ print()

template<typename T , typename DESCRIPTOR >
void olb::SuperLatticeRefinementMetricKnudsen3D< 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 81 of file superLatticeRefinementMetricF3D.hh.

82{
83 const int nC = this->_sLattice.getCuboidGeometry().getNc();
84
85 std::vector<T> factors(nC, T{});
86 T output[1] = { };
87
88 auto& load = this->_sLattice.getLoadBalancer();
89
90 for (int iC = 0; iC < load.size(); ++iC) {
91 this->getBlockF(iC)(output, iC);
92
93 factors[load.glob(iC)] = output[0];
94 }
95
96 OstreamManager clout(std::cout, "refinement");
97
98 for (int i = 0; i < nC; ++i) {
99#ifdef PARALLEL_MODE_MPI
100 singleton::mpi().sendToMaster(&factors[i], 1, load.isLocal(i));
101#endif
102
103 clout << "factors[" << i << "]: " << factors[i] << std::endl;
104 }
105}
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: