39 :
SuperF2D<T,W>(f->getSuperStructure(), f->getTargetDim()),
41 _indicatorF(std::move(indicatorF)),
44 this->
getName() =
"LocalAverage(" + _f->getName() +
")";
48 if ( _f->getBlockFSize() == load.
size() &&
49 _indicatorF->getBlockFSize() == load.
size() ) {
50 for (
int iC = 0; iC < load.
size(); ++iC) {
53 _indicatorF->getBlockIndicatorF(iC),
63 const auto& geometry = this->getSuperStructure().getCuboidGeometry();
64 const auto& load = this->getSuperStructure().getLoadBalancer();
66 for (
int i = 0; i < this->getTargetDim(); ++i) {
70 if (!_indicatorF(input)) {
75 geometry.getPhysR(centerOfCircle, input);
79 _indicatorF->getSuperGeometry());
81 std::size_t voxels(0);
84 for (
int iC = 0; iC < load.size(); ++iC) {
85 inputTmp[0] = load.glob(iC);
86 const auto& cuboid = geometry.get(inputTmp[0]);
88 for (inputTmp[1] = 0; inputTmp[1] < cuboid.getNx(); ++inputTmp[1]) {
89 for (inputTmp[2] = 0; inputTmp[2] < cuboid.getNy(); ++inputTmp[2]) {
90 if (latticeCircle(inputTmp) && _indicatorF(inputTmp)) {
91 T outputTmp[_f->getTargetDim()];
92 _f(outputTmp, inputTmp);
93 for (
int i = 0; i < this->getTargetDim(); ++i) {
94 output[i] += outputTmp[i];
102#ifdef PARALLEL_MODE_MPI
107 for (
int i = 0; i < this->getTargetDim(); ++i) {
108#ifdef PARALLEL_MODE_MPI
void reduceAndBcast(T &reductVal, MPI_Op op, int root=0, MPI_Comm comm=MPI_COMM_WORLD)
Reduction operation, followed by a broadcast.