Block-Structured AMR Software Framework
amrex::EBFluxRegister Class Reference

#include <AMReX_EBFluxRegister.H>

Inheritance diagram for amrex::EBFluxRegister:
amrex::YAFluxRegisterT< MF >

Public Member Functions

 EBFluxRegister ()=default
 
 EBFluxRegister (const BoxArray &fba, const BoxArray &cba, const DistributionMapping &fdm, const DistributionMapping &cdm, const Geometry &fgeom, const Geometry &cgeom, const IntVect &ref_ratio, int fine_lev, int nvar)
 
void define (const BoxArray &fba, const BoxArray &cba, const DistributionMapping &fdm, const DistributionMapping &cdm, const Geometry &fgeom, const Geometry &cgeom, const IntVect &ref_ratio, int fine_lev, int nvar)
 
void CrseAdd (const MFIter &mfi, const std::array< FArrayBox const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, const FArrayBox &volfrac, const std::array< FArrayBox const *, AMREX_SPACEDIM > &areafrac, RunOn runon)
 
void CrseAdd (const MFIter &mfi, const std::array< FArrayBox const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, const FArrayBox &volfrac, const std::array< FArrayBox const *, AMREX_SPACEDIM > &areafrac, int srccomp, int destcomp, int numcomp, RunOn runon)
 
void FineAdd (const MFIter &mfi, const std::array< FArrayBox const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, const FArrayBox &volfrac, const std::array< FArrayBox const *, AMREX_SPACEDIM > &areafrac, const FArrayBox &dm, RunOn runon)
 
void FineAdd (const MFIter &mfi, const std::array< FArrayBox const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, const FArrayBox &volfrac, const std::array< FArrayBox const *, AMREX_SPACEDIM > &areafrac, const FArrayBox &dm, int srccomp, int destcomp, int numcomp, RunOn runon)
 
void FineAdd (const MFIter &mfi, const std::array< FArrayBox const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, const FArrayBox &volfrac, const std::array< FArrayBox const *, AMREX_SPACEDIM > &areafrac, int srccomp, int destcomp, int numcomp, RunOn runon)
 This version does not do re-redistribution. More...
 
void Reflux (MultiFab &crse_state, const amrex::MultiFab &crse_vfrac, MultiFab &fine_state, const amrex::MultiFab &fine_vfrac)
 
void Reflux (MultiFab &crse_state, const amrex::MultiFab &crse_vfrac, MultiFab &fine_state, const amrex::MultiFab &fine_vfrac, int srccomp, int destcomp, int numcomp)
 
void Reflux (MultiFab &crse_state, const amrex::MultiFab &crse_vfrac, int srccomp, int destcomp, int numcomp)
 This version does not do re-redistribution. More...
 
FArrayBoxgetCrseData (const MFIter &mfi)
 
const IArrayBoxgetCrseFlag (const MFIter &mfi) const
 
void defineExtra (const BoxArray &fba, const DistributionMapping &fdm)
 
void CrseAdd (const MFIter &mfi, const std::array< FAB const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, RunOn runon) noexcept
 
void CrseAdd (const MFIter &mfi, const std::array< FAB const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, int srccomp, int destcomp, int numcomp, RunOn runon) noexcept
 
void FineAdd (const MFIter &mfi, const std::array< FAB const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, RunOn runon) noexcept
 
void FineAdd (const MFIter &mfi, const std::array< FAB const *, AMREX_SPACEDIM > &a_flux, const Real *dx, Real dt, int srccomp, int destcomp, int numcomp, RunOn runon) noexcept
 
- Public Member Functions inherited from amrex::YAFluxRegisterT< MF >
 YAFluxRegisterT ()=default
 
 YAFluxRegisterT (const BoxArray &fba, const BoxArray &cba, const DistributionMapping &fdm, const DistributionMapping &cdm, const Geometry &fgeom, const Geometry &cgeom, const IntVect &ref_ratio, int fine_lev, int nvar)
 
void define (const BoxArray &fba, const BoxArray &cba, const DistributionMapping &fdm, const DistributionMapping &cdm, const Geometry &fgeom, const Geometry &cgeom, const IntVect &ref_ratio, int fine_lev, int nvar)
 
void reset ()
 
void CrseAdd (const MFIter &mfi, const std::array< FAB const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, RunOn runon) noexcept
 
void CrseAdd (const MFIter &mfi, const std::array< FAB const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, int srccomp, int destcomp, int numcomp, RunOn runon) noexcept
 
void FineAdd (const MFIter &mfi, const std::array< FAB const *, AMREX_SPACEDIM > &flux, const Real *dx, Real dt, RunOn runon) noexcept
 
void FineAdd (const MFIter &mfi, const std::array< FAB const *, AMREX_SPACEDIM > &a_flux, const Real *dx, Real dt, int srccomp, int destcomp, int numcomp, RunOn runon) noexcept
 
void Reflux (MF &state, int dc=0)
 
void Reflux (MF &state, int srccomp, int destcomp, int numcomp)
 
bool CrseHasWork (const MFIter &mfi) const noexcept
 
bool FineHasWork (const MFIter &mfi) const noexcept
 
MF & getFineData ()
 
MF & getCrseData ()
 
void setCrseVolume (MF const *cvol)
 

Private Attributes

iMultiFab m_cfp_inside_mask
 

Additional Inherited Members

- Public Types inherited from amrex::YAFluxRegisterT< MF >
enum  CellType : int { crse_cell = 0 , crse_fine_boundary_cell , fine_cell }
 
using T = typename MF::value_type
 
using FAB = typename MF::fab_type
 
- Protected Attributes inherited from amrex::YAFluxRegisterT< MF >
MF m_crse_data
 
iMultiFab m_crse_flag
 
Vector< intm_crse_fab_flag
 
MF m_cfpatch
 This is built on crse/fine patches. More...
 
MF m_cfp_mask
 
Vector< Vector< FAB * > > m_cfp_fab
 The size of this is (# of local fine grids (# of crse/fine patches for that grid)) More...
 
Vector< intm_cfp_localindex
 
Geometry m_fine_geom
 
Geometry m_crse_geom
 
IntVect m_ratio
 
int m_fine_level
 
int m_ncomp
 
MF const * m_cvol = nullptr
 

Detailed Description

EBFluxRegister is used for refluxing, re-redistribution, re-refluxing, and re-re-redistribution. See Tutorials/EB/CNS for an example of using this class.

Reflux for EB is somewhat similar to non-EB. At the beginning of a coarse step, reset() is called. In MFIter for the coarse level advance, CrseAdd is called with coarse flux. There are two versions of CrseAdd, one for regular fab/tile and the other for fab/tile containing cutcells. For the cutcell version, the flux is is at centroid, not face center. The flux is not scaled. In MFIter for the fine level advance, FineAdd is called. There are also two version of FineAdd, one for regular and the other for fab/tile containing cutcells. The cutcell version also takes dm for re-redistribution explained below. After the fine level finished its time steps, Reflux is called to update the coarse cells next to the coarse/fine boundary. Note that re-redistribution is also performed in Reflux.

Re-redistribution is unfortunately more complicated. The coarse level needs to accumulate the density (e.g., g/cm^3 for mass density) loss of coarse/fine boundary cells (i.e., coarse cells on the coarse side of the coarse/fine boundary) due to redistribution from/to coarse cells covered by the fine level. If a coarse/fine boundary cell redistributes mass to a covered cell, this counts as a positive loss. Here covered means covered be the fine level, not EB. If a covered cell redistributes mass to a boundary cell, this counts as a negative loss for that boundary cell. The accumulation as the coarse level is performed on FArrayBox returned by EBFluxRegister::getCrseData(MFIter const&). EBFluxRegister also has getCrseFlag(MFIte cons&) function returning IArrayBox that contains flags for genuine coarse cell, coarse/fine boundary cells and covered cells.

The fine level in re-redistribution needs to accumulate the mass (e.g., g for density) gain of ghost cells due to redistribution from/to valid cells. The application code can use a local FArrayBox to store this and then EBFLuxRegister::FineAdd is called to add the part in ghost cells (excluding ghost cells covered by valid cells of other grids) to EBFluxRegister's internal data.

Constructor & Destructor Documentation

◆ EBFluxRegister() [1/2]

amrex::EBFluxRegister::EBFluxRegister ( )
default

◆ EBFluxRegister() [2/2]

amrex::EBFluxRegister::EBFluxRegister ( const BoxArray fba,
const BoxArray cba,
const DistributionMapping fdm,
const DistributionMapping cdm,
const Geometry fgeom,
const Geometry cgeom,
const IntVect ref_ratio,
int  fine_lev,
int  nvar 
)

Member Function Documentation

◆ CrseAdd() [1/4]

void amrex::YAFluxRegisterT< MF >::CrseAdd
noexcept

◆ CrseAdd() [2/4]

void amrex::YAFluxRegisterT< MF >::CrseAdd
noexcept

◆ CrseAdd() [3/4]

void amrex::EBFluxRegister::CrseAdd ( const MFIter mfi,
const std::array< FArrayBox const *, AMREX_SPACEDIM > &  flux,
const Real *  dx,
Real  dt,
const FArrayBox volfrac,
const std::array< FArrayBox const *, AMREX_SPACEDIM > &  areafrac,
int  srccomp,
int  destcomp,
int  numcomp,
RunOn  runon 
)

◆ CrseAdd() [4/4]

void amrex::EBFluxRegister::CrseAdd ( const MFIter mfi,
const std::array< FArrayBox const *, AMREX_SPACEDIM > &  flux,
const Real *  dx,
Real  dt,
const FArrayBox volfrac,
const std::array< FArrayBox const *, AMREX_SPACEDIM > &  areafrac,
RunOn  runon 
)

◆ define()

void amrex::EBFluxRegister::define ( const BoxArray fba,
const BoxArray cba,
const DistributionMapping fdm,
const DistributionMapping cdm,
const Geometry fgeom,
const Geometry cgeom,
const IntVect ref_ratio,
int  fine_lev,
int  nvar 
)

◆ defineExtra()

void amrex::EBFluxRegister::defineExtra ( const BoxArray fba,
const DistributionMapping fdm 
)

◆ FineAdd() [1/5]

void amrex::YAFluxRegisterT< MF >::FineAdd
noexcept

◆ FineAdd() [2/5]

void amrex::YAFluxRegisterT< MF >::FineAdd
noexcept

◆ FineAdd() [3/5]

void amrex::EBFluxRegister::FineAdd ( const MFIter mfi,
const std::array< FArrayBox const *, AMREX_SPACEDIM > &  flux,
const Real *  dx,
Real  dt,
const FArrayBox volfrac,
const std::array< FArrayBox const *, AMREX_SPACEDIM > &  areafrac,
const FArrayBox dm,
int  srccomp,
int  destcomp,
int  numcomp,
RunOn  runon 
)

◆ FineAdd() [4/5]

void amrex::EBFluxRegister::FineAdd ( const MFIter mfi,
const std::array< FArrayBox const *, AMREX_SPACEDIM > &  flux,
const Real *  dx,
Real  dt,
const FArrayBox volfrac,
const std::array< FArrayBox const *, AMREX_SPACEDIM > &  areafrac,
const FArrayBox dm,
RunOn  runon 
)

◆ FineAdd() [5/5]

void amrex::EBFluxRegister::FineAdd ( const MFIter mfi,
const std::array< FArrayBox const *, AMREX_SPACEDIM > &  flux,
const Real *  dx,
Real  dt,
const FArrayBox volfrac,
const std::array< FArrayBox const *, AMREX_SPACEDIM > &  areafrac,
int  srccomp,
int  destcomp,
int  numcomp,
RunOn  runon 
)

This version does not do re-redistribution.

◆ getCrseData()

FArrayBox* amrex::EBFluxRegister::getCrseData ( const MFIter mfi)
inline

◆ getCrseFlag()

const IArrayBox* amrex::EBFluxRegister::getCrseFlag ( const MFIter mfi) const
inline

◆ Reflux() [1/3]

void amrex::EBFluxRegister::Reflux ( MultiFab crse_state,
const amrex::MultiFab crse_vfrac,
int  srccomp,
int  destcomp,
int  numcomp 
)

This version does not do re-redistribution.

◆ Reflux() [2/3]

void amrex::EBFluxRegister::Reflux ( MultiFab crse_state,
const amrex::MultiFab crse_vfrac,
MultiFab fine_state,
const amrex::MultiFab fine_vfrac 
)

◆ Reflux() [3/3]

void amrex::EBFluxRegister::Reflux ( MultiFab crse_state,
const amrex::MultiFab crse_vfrac,
MultiFab fine_state,
const amrex::MultiFab fine_vfrac,
int  srccomp,
int  destcomp,
int  numcomp 
)

Member Data Documentation

◆ m_cfp_inside_mask

iMultiFab amrex::EBFluxRegister::m_cfp_inside_mask
private

The documentation for this class was generated from the following files: