24#ifndef SUPER_LP_NORM_3D_HH
25#define SUPER_LP_NORM_3D_HH
37template <
typename T,
typename W,
int P>
40 :
SuperF3D<T,W>(f->getSuperStructure(),1),
42 _indicatorF(std::move(indicatorF))
44 OLB_ASSERT(_f->getSourceDim() == _indicatorF->getSourceDim(),
45 "functor source dimension equals indicator source dimension");
47 this->
getName() =
"L" + std::to_string(P) +
"Norm(" + _f->getName() +
")";
51 if ( _f->getBlockFSize() == load.
size() &&
52 _indicatorF->getBlockFSize() == load.
size() ) {
53 for (
int iC = 0; iC < load.
size(); ++iC) {
56 _indicatorF->getBlockIndicatorF(iC))
62template <
typename T,
typename W,
int P>
67 std::forward<decltype(indicatorF)>(indicatorF))
70template <
typename T,
typename W,
int P>
73 std::vector<int> materials)
75 geometry.getMaterialIndicator(std::move(materials)))
78template <
typename T,
typename W,
int P>
83 geometry.getMaterialIndicator(material))
86template <
typename T,
typename W,
int P>
90 auto& cGeometry = _f->getSuperStructure().getCuboidDecomposition();
94 W outputTmp[_f->getTargetDim()];
95 int inputTmp[_f->getSourceDim()];
97 for (
int iC = 0; iC < load.
size(); ++iC) {
100 const int nX = cuboid.
getNx();
101 const int nY = cuboid.
getNy();
102 const int nZ = cuboid.
getNz();
105 inputTmp[0] = load.
glob(iC);
107 for (inputTmp[1] = 0; inputTmp[1] < nX; ++inputTmp[1]) {
108 for (inputTmp[2] = 0; inputTmp[2] < nY; ++inputTmp[2]) {
109 for (inputTmp[3] = 0; inputTmp[3] < nZ; ++inputTmp[3]) {
110 if (_indicatorF(inputTmp)) {
111 _f(outputTmp, inputTmp);
112 for (
int iDim = 0; iDim < _f->getTargetDim(); ++iDim) {
122#ifdef PARALLEL_MODE_MPI
Block level functor that returns the Lp norm over omega of the euklid norm of the input block functor...
T getDeltaR() const
Returns spacing of cuboid nodes.
Smart pointer for managing the various ways of passing functors around.
Base class for all LoadBalancer.
represents all functors that operate on a SuperStructure<T,3> in general
SuperStructure< T, 3 > & getSuperStructure()
std::vector< std::unique_ptr< BlockF3D< W > > > _blockF
Representation of a statistic for a parallel 2D geometry.
Base indicator functor (discrete)
Functor that returns the Lp norm over omega of the the euklid norm of the input functor.
SuperLpNorm3D(FunctorPtr< SuperF3D< T, W > > &&f, FunctorPtr< SuperIndicatorF3D< T > > &&indicatorF)
bool operator()(W output[], const int input[]) override
has to be implemented for 'every' derived class
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.
Expr pow(Expr base, Expr 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.