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>
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) {
121#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 3D cuboid is the basic component of a 3D cuboid structure which defines the grid.
T getDeltaR() const
Read only access to the distance of cuboid nodes.
int getNz() const
Read access to cuboid depth.
int getNy() const
Read access to cuboid height.
int getNx() const
Read access to cuboid width.
A cuboid geometry represents a voxel mesh.
Cuboid3D< T > & get(int iC)
Read and write access to a single cuboid.
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,3> in general
SuperStructure< T, 3 > & getSuperStructure()
std::vector< std::unique_ptr< BlockF3D< W > > > _blockF
Super functors may consist of several BlockF3D<W> derived functors.
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.
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.