25#ifndef SUPER_BASE_F_2D_HH
26#define SUPER_BASE_F_2D_HH
33template<
typename T,
typename W>
35 :
GenericF<W,int>(targetDim,2), _superStructure(superStructure) { }
37template<
typename T,
typename W>
40 return _superStructure;
43template <
typename T,
typename W>
47 "it is safe to cast std::size_t to int");
48 return _blockF.size();
51template <
typename T,
typename W>
54 OLB_ASSERT(
size_t(iCloc) < _blockF.size() && iCloc >= 0,
55 "block functor index within bounds");
56 return *(_blockF[iCloc]);
59template <
typename T,
typename W>
66 const int loc = load.
loc(input[0]);
68 return this->getBlockF(loc)(output, &input[1]);
77template <
typename T,
typename BaseType>
82 for (
int iC = 0; iC < _superData.getLoadBalancer().size(); ++iC) {
87template <
typename T,
typename BaseType>
90 const auto& load = _superData.getLoadBalancer();
91 if (load.rank(input[0]) == singleton::mpi().getRank()) {
92 return this->getBlockF(load.loc(input[0]))(output, &input[1]);
99template <
typename T,
typename BaseType>
106template <
typename T,
typename W>
108 :
SuperF2D<T,W>(f->getSuperStructure(), f->getTargetDim()),
111 this->getName() =
"Id(" + _f->
getName() +
")";
113 for (
int iC = 0; iC < _f->getBlockFSize(); ++iC) {
114 this->_blockF.emplace_back(
119template <
typename T,
typename W>
122 return _f(output, input);
125template <
typename T,
typename DESCRIPTOR>
128 :
SuperF2D<T,T>(superLattice, targetDim), _sLattice(superLattice) { }
130template <
typename T,
typename DESCRIPTOR>
136template<
typename T,
typename DESCRIPTOR>
138 T output[],
const int input[])
142 if (load.isLocal(input[0])) {
143 const int loc = load.loc(input[0]);
145 return this->getBlockF(loc)(output, &input[1]);
152template <
typename T,
typename DESCRIPTOR>
156 :
SuperLatticeF2D<T,DESCRIPTOR>(sLattice, targetDim), _converter(converter) { }
158template <
typename T,
typename DESCRIPTOR>
161 return this->_converter;
164template <
typename T,
typename DESCRIPTOR,
typename TDESCRIPTOR>
168 :
SuperLatticeF2D<T,TDESCRIPTOR>(sLattice, targetDim), _converter(converter) { }
170template <
typename T,
typename DESCRIPTOR,
typename TDESCRIPTOR>
173 return this->_converter;
BlockDataF2D can store data of any BlockFunctor2D.
represents all functors that operate on a cuboid in general, mother class of BlockLatticeF,...
Smart pointer for managing the various ways of passing functors around.
GenericF is a base class, that can represent continuous as well as discrete functions.
std::string & getName()
read and write access to name
Base class for all LoadBalancer.
bool isLocal(const int &glob)
returns whether glob is on this process
SuperDataF2D(SuperData< 2, T, BaseType > &superData)
Constructor from SuperData2D - stores _superData reference.
represents all functors that operate on a SuperStructure<T,2> in general
int getBlockFSize() const
bool operator()(W output[], const int input[]) override
SuperStructure< T, 2 > & getSuperStructure()
SuperF2D(SuperStructure< T, 2 > &superStructure, int targetDim)
BlockF2D< W > & getBlockF(int iCloc)
identity functor for memory management
represents all functors that operate on a SuperLattice in general, e.g. getVelocity(),...
bool operator()(T output[], const int input[])
SuperLattice< T, DESCRIPTOR > & getSuperLattice()
UnitConverter< T, DESCRIPTOR > const & getConverter() const
SuperLatticePhysF2D(SuperLattice< T, DESCRIPTOR > &sLattice, const UnitConverter< T, DESCRIPTOR > &converter, int targetDim)
SuperLatticeThermalPhysF2D(SuperLattice< T, TDESCRIPTOR > &sLattice, const ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR > &converter, int targetDim)
ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR > const & getConverter() const
Super class maintaining block lattices for a cuboid decomposition.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
Conversion between physical and lattice units, as well as discretization specialized for thermal appl...
Conversion between physical and lattice units, as well as discretization.
Top level namespace for all of OpenLB.
typename util::BaseTypeHelper< T >::type BaseType
#define OLB_ASSERT(COND, MESSAGE)