24#ifndef SUPER_MIN_2D_HH
25#define SUPER_MIN_2D_HH
33template <
typename T,
typename W>
36 :
SuperF2D<T,W>(f->getSuperStructure(), f->getTargetDim()),
38 _indicatorF(std::move(indicatorF))
40 this->
getName() =
"Min("+_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>::max();
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 if (_indicatorF(inputTmp)) {
87 _f(outputTmp,inputTmp);
88 for (
int i = 0; i < this->getTargetDim(); ++i) {
89 if (outputTmp[i] < output[i]) {
90 output[i] = outputTmp[i];
99 for (
int iC = 0; iC < load.
size(); ++iC) {
100 this->getBlockF(iC)(output, input);
104#ifdef PARALLEL_MODE_MPI
105 for (
int i = 0; i < this->getTargetDim(); ++i) {
BlockMin2D returns the min in each component of f on a indicated subset.
A regular single 2D cuboid is the basic component of a 2D cuboid structure which defines the grid.
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.
SuperMin2D returns the min in each component of f on a indicated subset.
SuperMin2D(FunctorPtr< SuperF2D< T, W > > &&f, FunctorPtr< SuperIndicatorF2D< T > > &&indicatorF)
Constructor for determining the minimum 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.