39 :
SuperF3D<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(centerOfSphere, 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 for (inputTmp[3] = 0; inputTmp[3] < cuboid.getNz(); ++inputTmp[3]) {
91 if (latticeSphere(inputTmp) && _indicatorF(inputTmp)) {
92 T outputTmp[_f->getTargetDim()];
93 _f(outputTmp, inputTmp);
94 for (
int i = 0; i < this->getTargetDim(); ++i) {
95 output[i] += outputTmp[i];
104#ifdef PARALLEL_MODE_MPI
109 for (
int i = 0; i < this->getTargetDim(); ++i) {
110#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.