Block-Structured AMR Software Framework
AMReX_MultiFabUtil.H File Reference
#include <AMReX_Config.H>
#include <AMReX_MultiFab.H>
#include <AMReX_iMultiFab.H>
#include <AMReX_LayoutData.H>
#include <AMReX_MFIter.H>
#include <AMReX_Array.H>
#include <AMReX_Vector.H>
#include <AMReX_MultiFabUtil_C.H>
#include <AMReX_MultiFabUtilI.H>

Go to the source code of this file.

Namespaces

 amrex
 

Functions

void amrex::average_node_to_cellcenter (MultiFab &cc, int dcomp, const MultiFab &nd, int scomp, int ncomp, int ngrow=0)
 Average nodal-based MultiFab onto cell-centered MultiFab. More...
 
void amrex::average_edge_to_cellcenter (MultiFab &cc, int dcomp, const Vector< const MultiFab * > &edge, int ngrow=0)
 Average edge-based MultiFab onto cell-centered MultiFab. More...
 
void amrex::average_face_to_cellcenter (MultiFab &cc, int dcomp, const Vector< const MultiFab * > &fc, int ngrow=0)
 Average face-based MultiFab onto cell-centered MultiFab. More...
 
template<typename CMF , typename FMF , std::enable_if_t< IsFabArray_v< CMF > &&IsFabArray_v< FMF >, int > = 0>
void amrex::average_face_to_cellcenter (CMF &cc, int dcomp, const Array< const FMF *, AMREX_SPACEDIM > &fc, int ngrow=0)
 Average face-based FabArray onto cell-centered FabArray. More...
 
void amrex::average_face_to_cellcenter (MultiFab &cc, const Vector< const MultiFab * > &fc, const Geometry &geom)
 Average face-based MultiFab onto cell-centered MultiFab with geometric weighting. More...
 
void amrex::average_face_to_cellcenter (MultiFab &cc, const Array< const MultiFab *, AMREX_SPACEDIM > &fc, const Geometry &geom)
 Average face-based MultiFab onto cell-centered MultiFab with geometric weighting. More...
 
void amrex::average_cellcenter_to_face (const Vector< MultiFab * > &fc, const MultiFab &cc, const Geometry &geom, int ncomp=1, bool use_harmonic_averaging=false)
 Average cell-centered MultiFab onto face-based MultiFab with geometric weighting. More...
 
void amrex::average_cellcenter_to_face (const Array< MultiFab *, AMREX_SPACEDIM > &fc, const MultiFab &cc, const Geometry &geom, int ncomp=1, bool use_harmonic_averaging=false)
 Average cell-centered MultiFab onto face-based MultiFab with geometric weighting. More...
 
template<typename MF , std::enable_if_t< IsFabArray< MF >::value, int > = 0>
void amrex::average_down_faces (const Vector< const MF * > &fine, const Vector< MF * > &crse, const IntVect &ratio, int ngcrse=0)
 Average fine face-based FabArray onto crse face-based FabArray. More...
 
template<typename MF , std::enable_if_t< IsFabArray< MF >::value, int > = 0>
void amrex::average_down_faces (const Vector< const MF * > &fine, const Vector< MF * > &crse, int ratio, int ngcrse=0)
 Average fine face-based FabArray onto crse face-based FabArray. More...
 
template<typename MF , std::enable_if_t< IsFabArray< MF >::value, int > = 0>
void amrex::average_down_faces (const Array< const MF *, AMREX_SPACEDIM > &fine, const Array< MF *, AMREX_SPACEDIM > &crse, const IntVect &ratio, int ngcrse=0)
 Average fine face-based FabArray onto crse face-based FabArray. More...
 
template<typename MF , std::enable_if_t< IsFabArray< MF >::value, int > = 0>
void amrex::average_down_faces (const Array< const MF *, AMREX_SPACEDIM > &fine, const Array< MF *, AMREX_SPACEDIM > &crse, int ratio, int ngcrse=0)
 Average fine face-based FabArray onto crse face-based FabArray. More...
 
template<typename FAB >
void amrex::average_down_faces (const FabArray< FAB > &fine, FabArray< FAB > &crse, const IntVect &ratio, int ngcrse=0)
 This version does average down for one face direction. More...
 
template<typename MF , std::enable_if_t< IsFabArray< MF >::value, int > = 0>
void amrex::average_down_faces (const Array< const MF *, AMREX_SPACEDIM > &fine, const Array< MF *, AMREX_SPACEDIM > &crse, const IntVect &ratio, const Geometry &crse_geom)
 
template<typename FAB >
void amrex::average_down_faces (const FabArray< FAB > &fine, FabArray< FAB > &crse, const IntVect &ratio, const Geometry &crse_geom)
 
void amrex::average_down_edges (const Vector< const MultiFab * > &fine, const Vector< MultiFab * > &crse, const IntVect &ratio, int ngcrse=0)
 Average fine edge-based MultiFab onto crse edge-based MultiFab. More...
 
void amrex::average_down_edges (const Array< const MultiFab *, AMREX_SPACEDIM > &fine, const Array< MultiFab *, AMREX_SPACEDIM > &crse, const IntVect &ratio, int ngcrse)
 
void amrex::average_down_edges (const MultiFab &fine, MultiFab &crse, const IntVect &ratio, int ngcrse)
 
template<typename FAB >
void amrex::average_down_nodal (const FabArray< FAB > &S_fine, FabArray< FAB > &S_crse, const IntVect &ratio, int ngcrse=0, bool mfiter_is_definitely_safe=false)
 Average fine node-based MultiFab onto crse node-centered MultiFab. More...
 
void amrex::average_down (const MultiFab &S_fine, MultiFab &S_crse, const Geometry &fgeom, const Geometry &cgeom, int scomp, int ncomp, const IntVect &ratio)
 Volume weighed average of fine MultiFab onto coarse MultiFab. More...
 
void amrex::average_down (const MultiFab &S_fine, MultiFab &S_crse, const Geometry &fgeom, const Geometry &cgeom, int scomp, int ncomp, int rr)
 
template<typename FAB >
void amrex::average_down (const FabArray< FAB > &S_fine, FabArray< FAB > &S_crse, int scomp, int ncomp, const IntVect &ratio)
 
template<typename FAB >
void amrex::average_down (const FabArray< FAB > &S_fine, FabArray< FAB > &S_crse, int scomp, int ncomp, int rr)
 
void amrex::sum_fine_to_coarse (const MultiFab &S_fine, MultiFab &S_crse, int scomp, int ncomp, const IntVect &ratio, const Geometry &cgeom, const Geometry &)
 
void amrex::print_state (const MultiFab &mf, const IntVect &cell, int n=-1, const IntVect &ng=IntVect::TheZeroVector())
 Output state data for a single zone. More...
 
void amrex::writeFabs (const MultiFab &mf, const std::string &name)
 Write each fab individually. More...
 
void amrex::writeFabs (const MultiFab &mf, int comp, int ncomp, const std::string &name)
 
std::unique_ptr< MultiFabamrex::get_slice_data (int dir, Real coord, const MultiFab &cc, const Geometry &geom, int start_comp, int ncomp, bool interpolate, RealBox const &bnd_rbx)
 
template<typename MF , std::enable_if_t< IsFabArray< MF >::value, int > FOO = 0>
Vector< typename MF::value_type > amrex::get_cell_data (MF const &mf, IntVect const &cell)
 Get data in a cell of MultiFab/FabArray. More...
 
template<typename MF , std::enable_if_t< IsFabArray< MF >::value, int > FOO = 0>
MF amrex::get_line_data (MF const &mf, int dir, IntVect const &cell, Box const &bnd_bx=Box())
 Get data in a line of MultiFab/FabArray. More...
 
template<typename FAB >
iMultiFab amrex::makeFineMask (const FabArray< FAB > &cmf, const BoxArray &fba, const IntVect &ratio, int crse_value=0, int fine_value=1)
 
iMultiFab amrex::makeFineMask (const BoxArray &cba, const DistributionMapping &cdm, const BoxArray &fba, const IntVect &ratio, int crse_value, int fine_value)
 
template<typename FAB >
iMultiFab amrex::makeFineMask (const FabArray< FAB > &cmf, const BoxArray &fba, const IntVect &ratio, Periodicity const &period, int crse_value, int fine_value)
 
iMultiFab amrex::makeFineMask (const BoxArray &cba, const DistributionMapping &cdm, const IntVect &cnghost, const BoxArray &fba, const IntVect &ratio, Periodicity const &period, int crse_value, int fine_value)
 
template<typename FAB >
iMultiFab amrex::makeFineMask (const FabArray< FAB > &cmf, const FabArray< FAB > &fmf, const IntVect &cnghost, const IntVect &ratio, Periodicity const &period, int crse_value, int fine_value)
 
template<typename FAB >
iMultiFab amrex::makeFineMask (const FabArray< FAB > &cmf, const FabArray< FAB > &fmf, const IntVect &cnghost, const IntVect &ratio, Periodicity const &period, int crse_value, int fine_value, LayoutData< int > &has_cf)
 
MultiFab amrex::makeFineMask (const BoxArray &cba, const DistributionMapping &cdm, const BoxArray &fba, const IntVect &ratio, Real crse_value, Real fine_value)
 
void amrex::computeDivergence (MultiFab &divu, const Array< MultiFab const *, AMREX_SPACEDIM > &umac, const Geometry &geom)
 Computes divergence of face-data stored in the umac MultiFab. More...
 
void amrex::computeGradient (MultiFab &grad, const Array< MultiFab const *, AMREX_SPACEDIM > &umac, const Geometry &geom)
 Computes gradient of face-data stored in the umac MultiFab. More...
 
MultiFab amrex::ToMultiFab (const iMultiFab &imf)
 Convert iMultiFab to MultiFab. More...
 
FabArray< BaseFab< Long > > amrex::ToLongMultiFab (const iMultiFab &imf)
 Convert iMultiFab to Long. More...
 
MultiFab amrex::periodicShift (MultiFab const &mf, IntVect const &offset, Periodicity const &period)
 Periodic shift MultiFab. More...
 
template<typename T , typename U >
amrex::cast (U const &mf_in)
 example: auto mf = amrex::cast<MultiFab>(imf); More...
 
template<typename Op , typename T , typename FAB , typename F , std::enable_if_t< IsBaseFab< FAB >::value, int > FOO = 0>
BaseFab< T > amrex::ReduceToPlane (int direction, Box const &domain, FabArray< FAB > const &mf, F const &f)
 Reduce FabArray/MultiFab data to a plane. More...
 
Gpu::HostVector< Real > amrex::sumToLine (MultiFab const &mf, int icomp, int ncomp, Box const &domain, int direction, bool local=false)
 Sum MultiFab data to line. More...
 
Real amrex::volumeWeightedSum (Vector< MultiFab const * > const &mf, int icomp, Vector< Geometry > const &geom, Vector< IntVect > const &ratio, bool local=false)
 Volume weighted sum for a vector of MultiFabs. More...
 
void amrex::FourthOrderInterpFromFineToCoarse (MultiFab &cmf, int scomp, int ncomp, MultiFab const &fmf, IntVect const &ratio)
 Fourth-order interpolation from fine to coarse level. More...
 
void amrex::FillRandom (MultiFab &mf, int scomp, int ncomp)
 Fill MultiFab with random numbers from uniform distribution. More...
 
void amrex::FillRandomNormal (MultiFab &mf, int scomp, int ncomp, Real mean, Real stddev)
 Fill MultiFab with random numbers from normal distribution. More...
 
Vector< MultiFabamrex::convexify (Vector< MultiFab const * > const &mf, Vector< IntVect > const &refinement_ratio)
 Convexify AMR data. More...
 
template<typename F >
Real amrex::NormHelper (const MultiFab &x, int xcomp, const MultiFab &y, int ycomp, F const &f, int numcomp, IntVect nghost, bool local)
 Returns part of a norm based on two MultiFabs. More...
 
template<typename MMF , typename Pred , typename F >
Real amrex::NormHelper (const MMF &mask, const MultiFab &x, int xcomp, const MultiFab &y, int ycomp, Pred const &pf, F const &f, int numcomp, IntVect nghost, bool local)
 Returns part of a norm based on three MultiFabs. More...