24#ifndef SUPER_MAX_3D_HH
25#define SUPER_MAX_3D_HH
33template <
typename T,
typename W>
36 :
SuperF3D<T,W>(f->getSuperStructure(), f->getTargetDim()),
38 _indicatorF(std::move(indicatorF))
40 this->
getName() =
"Max("+_f->getName()+
")";
45 if ( _f->getBlockFSize() == load.
size() &&
46 _indicatorF->getBlockFSize() == load.
size() ) {
47 for (
int iC = 0; iC < load.
size(); ++iC) {
50 _indicatorF->getBlockIndicatorF(iC),
57template <
typename T,
typename W>
62 std::forward<decltype(f)>(f),
63 superGeometry.getMaterialIndicator(material))
66template <
typename T,
typename W>
73 for (
int i = 0; i < this->getTargetDim(); ++i) {
74 output[i] = std::numeric_limits<W>::min();
77 if (this->_blockF.empty()) {
78 W outputTmp[_f->getTargetDim()];
79 int inputTmp[_f->getSourceDim()];
81 for (
int iC = 0; iC < load.
size(); ++iC) {
83 inputTmp[0] = load.
glob(iC);
84 for (inputTmp[1] = 0; inputTmp[1] < cuboid.
getNx(); ++inputTmp[1]) {
85 for (inputTmp[2] = 0; inputTmp[2] < cuboid.
getNy(); ++inputTmp[2]) {
86 for (inputTmp[3] = 0; inputTmp[3] < cuboid.
getNz(); ++inputTmp[3]) {
87 if (_indicatorF(inputTmp)) {
88 _f(outputTmp,inputTmp);
89 for (
int i = 0; i < this->getTargetDim(); ++i) {
90 if (outputTmp[i] > output[i]) {
91 output[i] = outputTmp[i];
101 for (
int iC = 0; iC < load.
size(); ++iC) {
102 this->getBlockF(iC)(output, input);
106#ifdef PARALLEL_MODE_MPI
107 for (
int i = 0; i < this->getTargetDim(); ++i) {
BlockMax3D returns the max in each component of f on a indicated subset.
A regular single 3D cuboid is the basic component of a 3D cuboid structure which defines the grid.
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)
SuperMax3D returns the max in each component of f on a indicated subset.
SuperMax3D(FunctorPtr< SuperF3D< T, W > > &&f, FunctorPtr< SuperIndicatorF3D< T > > &&indicatorF)
Constructor for determining the maximum of f on a indicated subset.
bool operator()(W output[], const int input[]) override
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.
Top level namespace for all of OpenLB.