include/pops/mesh/layout/refinement.hpp File ReferenceΒΆ

adc_cpp: include/pops/mesh/layout/refinement.hpp File Reference
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
refinement.hpp File Reference

AMR inter-level transfer operators (integer ratio r) + parallel_copy. More...

#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <cstdio>
#include <pops/core/foundation/types.hpp>
#include <pops/mesh/layout/box_array.hpp>
#include <pops/mesh/index/box_hash.hpp>
#include <pops/mesh/storage/fab2d.hpp>
#include <pops/mesh/boundary/fill_boundary.hpp>
#include <pops/mesh/storage/multifab.hpp>
#include <utility>
#include <vector>
+ Include dependency graph for refinement.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  pops::detail::AverageDownKernel
 CONSERVATIVE average of an r x r block: C(I, J, c) = (sum of the r^2 fine cells) * inv. More...
 
struct  pops::detail::InterpolateKernel
 Piecewise-CONSTANT injection: F(i, j, c) receives the value of its covering coarse cell. More...
 

Namespaces

namespace  pops
 
namespace  pops::detail
 

Functions

POPS_HD int pops::coarsen_index (int a, int r)
 Index of the coarse cell containing the fine cell a (FLOOR division by r, handles a < 0).
 
BoxArray pops::coarsen (const BoxArray &ba, int r)
 Coarsens each box of the BoxArray by a ratio r (coarsen box by box, order preserved).
 
void pops::parallel_copy (MultiFab &dst, const MultiFab &src)
 Copies the valid regions that OVERLAP from src to dst (same indices, no shift).
 
void pops::average_down (const MultiFab &fine, MultiFab &coarse, int r, MultiFab &cfine)
 CONSERVATIVE average fine -> coarse (ratio r): coarse(I, J) = average of the r^2 fine cells of the block.
 
void pops::average_down (const MultiFab &fine, MultiFab &coarse, int r)
 
void pops::interpolate (const MultiFab &coarse, MultiFab &fine, int r, MultiFab &cfine)
 Interpolation coarse -> fine (ratio r) by piecewise-CONSTANT injection: each fine cell (including the box ghosts) receives the value of its coarse cell (coarsen_index).
 
void pops::interpolate (const MultiFab &coarse, MultiFab &fine, int r)
 

Detailed Description

AMR inter-level transfer operators (integer ratio r) + parallel_copy.

average_down (fine -> coarse): CONSERVATIVE average over r x r blocks (one coarse cell = average of the r^2 fine cells). interpolate (coarse -> fine): piecewise-CONSTANT injection (each fine cell receives the value of its coarse cell). Both go through a temporary "fine coarsen" MultiFab sharing the fine DistributionMapping (LOCAL per-block computation), followed by a parallel_copy to the target (the AMReX scheme). parallel_copy: general redistribution between two MultiFab over the SAME domain with possibly different decompositions (the AMReX ParallelCopy); single-rank = direct copies, multi-rank = jobs enumerated deterministically (tag 1).