24#ifndef SUPER_LATTICE_REFINEMENT_METRIC_F_2D_HH
25#define SUPER_LATTICE_REFINEMENT_METRIC_F_2D_HH
34template<
typename T,
typename DESCRIPTOR>
51template<
typename T,
typename DESCRIPTOR>
57 this->
getName() =
"refinementMetricKnudsen";
67template<
typename T,
typename DESCRIPTOR>
70 auto& load = this->_sLattice.getLoadBalancer();
72 if (load.isLocal(glob)) {
73 const int loc = load.loc(glob);
75 return this->getBlockF(loc)(output);
84template<
typename T,
typename DESCRIPTOR>
87 const int nC = this->_sLattice.getCuboidGeometry().getNc();
89 std::vector<T> factors(nC, T{});
92 auto& load = this->_sLattice.getLoadBalancer();
94 for (
int iC = 0; iC < load.size(); ++iC) {
95 this->getBlockF(iC)(output, iC);
97 factors[load.glob(iC)] = output[0];
102 for (
int i = 0; i < nC; ++i) {
103#ifdef PARALLEL_MODE_MPI
107 clout <<
"factors[" << i <<
"]: " << factors[i] << std::endl;
std::string & getName()
read and write access to name
class for marking output with some text
std::vector< std::unique_ptr< BlockF2D< T > > > _blockF
Super functors may consist of several BlockF2D<W> derived functors.
represents all functors that operate on a SuperLattice in general, e.g. getVelocity(),...
SuperLatticeKnudsen2D(SuperLattice< T, DESCRIPTOR > &lattice)
SuperLatticeRefinementMetricKnudsen2D(SuperLattice< T, DESCRIPTOR > &lattice, const UnitConverter< T, DESCRIPTOR > &converter)
Constructor.
void print()
Convenience method for printing per-block refinement factors.
bool operator()(T output[], int glob)
Super class maintaining block lattices for a cuboid decomposition.
BlockLattice< T, DESCRIPTOR > & getBlock(int locC)
Return BlockLattice with local index locC.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
Conversion between physical and lattice units, as well as discretization.
void sendToMaster(T *sendBuf, int sendCount, bool iAmRoot, MPI_Comm comm=MPI_COMM_WORLD)
Sends data to master processor.
Top level namespace for all of OpenLB.