24#ifndef SUPER_LP_NORM_2D_HH
25#define SUPER_LP_NORM_2D_HH
36template <
typename T,
typename W,
int P>
39 :
SuperF2D<T,W>(f->getSuperStructure(),1),
41 _indicatorF(std::move(indicatorF))
43 OLB_ASSERT(_f->getSourceDim() == _indicatorF->getSourceDim(),
44 "functor source dimension equals indicator source dimension");
46 this->
getName() =
"L" + std::to_string(P) +
"Norm(" + _f->getName() +
")";
50 if ( _f->getBlockFSize() == load.
size() &&
51 _indicatorF->getBlockFSize() == load.
size() ) {
52 for (
int iC = 0; iC < load.
size(); ++iC) {
55 _indicatorF->getBlockIndicatorF(iC))
61template <
typename T,
typename W,
int P>
66 std::forward<decltype(indicatorF)>(indicatorF))
69template <
typename T,
typename W,
int P>
72 std::vector<int> materials)
74 geometry.getMaterialIndicator(std::move(materials)))
77template <
typename T,
typename W,
int P>
82 geometry.getMaterialIndicator(material))
85template <
typename T,
typename W,
int P>
93 W outputTmp[_f->getTargetDim()];
96 for (
int iC = 0; iC < load.
size(); ++iC) {
99 const int nX = cuboid.
getNx();
100 const int nY = cuboid.
getNy();
103 inputTmp[0] = load.
glob(iC);
105 for (inputTmp[1] = 0; inputTmp[1] < nX; ++inputTmp[1]) {
106 for (inputTmp[2] = 0; inputTmp[2] < nY; ++inputTmp[2]) {
107 if (_indicatorF(inputTmp)) {
108 _f(outputTmp, inputTmp);
109 for (
int iDim = 0; iDim < _f->getTargetDim(); ++iDim) {
117#ifdef PARALLEL_MODE_MPI
Block level functor that returns the Lp norm over omega of the euklid norm of the input block functor...
A regular single 2D cuboid is the basic component of a 2D cuboid structure which defines the grid.
T getDeltaR() const
Read access to the distance of cuboid nodes.
int getNx() const
Read access to cuboid width.
int getNy() const
Read access to cuboid height.
A cuboid structure represents the grid of a considered domain.
Cuboid2D< T > & get(int i)
Read and write access to the cuboids.
Smart pointer for managing the various ways of passing functors around.
std::string & getName()
read and write access to name
Base class for all LoadBalancer.
represents all functors that operate on a SuperStructure<T,2> in general
std::vector< std::unique_ptr< BlockF2D< W > > > _blockF
Super functors may consist of several BlockF2D<W> derived functors.
SuperStructure< T, 2 > & getSuperStructure()
Representation of a statistic for a parallel 2D geometry.
Functor that returns the Lp norm over omega of the the euklid norm of the input functor.
bool operator()(W output[], const int input[]) override
has to be implemented for 'every' derived class
SuperLpNorm2D(FunctorPtr< SuperF2D< T, W > > &&f, FunctorPtr< SuperIndicatorF2D< T > > &&indicatorF)
virtual void communicate()
void reduceAndBcast(T &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
Reduction operation, followed by a broadcast.
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Top level namespace for all of OpenLB.
#define OLB_ASSERT(COND, MESSAGE)
Lp norm functor implementation details specific to the P parameter.
Representation of a parallel 2D geometry – header file.