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().getCuboidDecomposition();
64 const auto& load = this->getSuperStructure().getLoadBalancer();
66 for (
int i = 0; i < this->getTargetDim(); ++i) {
70 if (!_indicatorF(input)) {
74 auto centerOfCircle = geometry.getPhysR(latticeR);
78 _indicatorF->getSuperGeometry());
80 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 summators[i].add(outputTmp[i]);
102 for (
int i = 0; i < _f->getTargetDim(); ++i) {
103 output[i] = summators[i].getSum();
106#ifdef PARALLEL_MODE_MPI
111 for (
int i = 0; i < this->getTargetDim(); ++i) {
112#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.