WarpX
Functions
ablastr::coarsen::sample Namespace Reference

Functions

void Loop (amrex::MultiFab &mf_dst, const amrex::MultiFab &mf_src, int dcomp, int scomp, int ncomp, amrex::IntVect ngrow, amrex::IntVect crse_ratio=amrex::IntVect(1))
 Loops over the boxes of the coarsened MultiFab mf_dst and fills them by interpolating the data contained in the fine MultiFab mf_src. More...
 
void Coarsen (amrex::MultiFab &mf_dst, const amrex::MultiFab &mf_src, int dcomp, int scomp, int ncomp, int ngrow, amrex::IntVect crse_ratio=amrex::IntVect(1))
 Stores in the coarsened MultiFab mf_dst the values obtained by interpolating the data contained in the fine MultiFab mf_src. More...
 
void Coarsen (amrex::MultiFab &mf_dst, const amrex::MultiFab &mf_src, const int dcomp, const int scomp, const int ncomp, const amrex::IntVect ngrowvect, const amrex::IntVect crse_ratio)
 
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Interp (amrex::Array4< amrex::Real const > const &arr_src, amrex::GpuArray< int, 3 > const &sf, amrex::GpuArray< int, 3 > const &sc, amrex::GpuArray< int, 3 > const &cr, const int i, const int j, const int k, const int comp)
 Interpolates the floating point data contained in the source Array4 arr_src, extracted from a fine MultiFab, by averaging over either 1 point or 2 equally distant points. More...
 

Detailed Description

Mesh Coarsening by Sampling

These methods are mostly used for I/O.

Function Documentation

◆ Coarsen() [1/2]

void ablastr::coarsen::sample::Coarsen ( amrex::MultiFab mf_dst,
const amrex::MultiFab mf_src,
const int  dcomp,
const int  scomp,
const int  ncomp,
const amrex::IntVect  ngrowvect,
const amrex::IntVect  crse_ratio 
)

◆ Coarsen() [2/2]

void ablastr::coarsen::sample::Coarsen ( amrex::MultiFab mf_dst,
const amrex::MultiFab mf_src,
int  dcomp,
int  scomp,
int  ncomp,
int  ngrow,
amrex::IntVect  crse_ratio = amrex::IntVect(1) 
)

Stores in the coarsened MultiFab mf_dst the values obtained by interpolating the data contained in the fine MultiFab mf_src.

Parameters
[in,out]mf_dstcoarsened MultiFab containing the floating point data to be filled by interpolating the fine MultiFab mf_src
[in]mf_srcfine MultiFab containing the floating point data to be interpolated
[in]dcompoffset for the fourth component of the coarsened Array4 object, extracted from its MultiFab, where the interpolated values will be stored
[in]scompoffset for the fourth component of the fine Array4 object, extracted from its MultiFab, containing the data to be interpolated
[in]ncompnumber of components to loop over for the coarsened Array4 extracted from the coarsened MultiFab mf_dst
[in]ngrownumber of guard cells to fill
[in]crse_ratiocoarsening ratio between the fine MultiFab mf_src and the coarsened MultiFab mf_dst along each spatial direction

◆ Interp()

AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real ablastr::coarsen::sample::Interp ( amrex::Array4< amrex::Real const > const &  arr_src,
amrex::GpuArray< int, 3 > const &  sf,
amrex::GpuArray< int, 3 > const &  sc,
amrex::GpuArray< int, 3 > const &  cr,
const int  i,
const int  j,
const int  k,
const int  comp 
)

Interpolates the floating point data contained in the source Array4 arr_src, extracted from a fine MultiFab, by averaging over either 1 point or 2 equally distant points.

Parameters
[in]arr_srcfloating point data to be interpolated
[in]sfstaggering of the source fine MultiFab
[in]scstaggering of the destination coarsened MultiFab
[in]crcoarsening ratio along each spatial direction
[in]iindex along x of the coarsened Array4 to be filled
[in]jindex along y of the coarsened Array4 to be filled
[in]kindex along z of the coarsened Array4 to be filled
[in]compindex along the fourth component of the Array4 arr_src containing the data to be interpolated
Returns
interpolated field at cell (i,j,k) of a coarsened Array4

◆ Loop()

void ablastr::coarsen::sample::Loop ( amrex::MultiFab mf_dst,
const amrex::MultiFab mf_src,
int  dcomp,
int  scomp,
int  ncomp,
amrex::IntVect  ngrow,
amrex::IntVect  crse_ratio = amrex::IntVect(1) 
)

Loops over the boxes of the coarsened MultiFab mf_dst and fills them by interpolating the data contained in the fine MultiFab mf_src.

Parameters
[in,out]mf_dstcoarsened MultiFab containing the floating point data to be filled by interpolating the source fine MultiFab
[in]mf_srcfine MultiFab containing the floating point data to be interpolated
[in]dcompoffset for the fourth component of the coarsened Array4 object, extracted from its MultiFab, where the interpolated values will be stored
[in]scompoffset for the fourth component of the fine Array4 object, extracted from its MultiFab, containing the data to be interpolated
[in]ncompnumber of components to loop over for the coarsened Array4 extracted from the coarsened MultiFab mf_dst
[in]ngrownumber of guard cells to fill
[in]crse_ratiocoarsening ratio between the fine MultiFab mf_src and the coarsened MultiFab mf_dst along each spatial direction