AMReX-Hydro
AMReX-based hydro routines for low Mach number flows
Loading...
Searching...
No Matches
Hydro::MacProjector Class Reference

#include <hydro_MacProjector.H>

Collaboration diagram for Hydro::MacProjector:

Public Member Functions

 MacProjector (const amrex::Vector< amrex::Geometry > &a_geom, amrex::MLMG::Location a_umac_loc, amrex::MLMG::Location a_beta_loc, amrex::MLMG::Location a_phi_loc, amrex::MLMG::Location a_divu_loc=amrex::MLMG::Location::CellCenter)
 MacProjector (const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > &a_umac, amrex::MLMG::Location a_umac_loc, const amrex::Vector< amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > > &a_beta, amrex::MLMG::Location a_beta_loc, amrex::MLMG::Location a_phi_loc, const amrex::Vector< amrex::Geometry > &a_geom, const amrex::LPInfo &a_lpinfo, const amrex::Vector< amrex::MultiFab const * > &a_divu, amrex::MLMG::Location a_divu_loc, const amrex::Vector< amrex::iMultiFab const * > &a_overset_mask={})
 MacProjector (const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > &a_umac, amrex::MLMG::Location a_umac_loc, const amrex::Vector< amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > > &a_beta, amrex::MLMG::Location a_beta_loc, amrex::MLMG::Location a_phi_loc, const amrex::Vector< amrex::Geometry > &a_geom, const amrex::LPInfo &a_lpinfo, const amrex::Vector< amrex::MultiFab const * > &a_divu={})
void initProjector (amrex::LPInfo a_lpinfo, const amrex::Vector< amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > > &a_beta, const amrex::Vector< amrex::iMultiFab const * > &a_overset_mask={})
void updateBeta (const amrex::Vector< amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > > &)
 Update Bcoeffs for the linear operator.
void updateCoeffs (const amrex::Vector< amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > > &)
 Update Bcoeff and if Robin BC also reset scalars in order to reuse the linear operator.
void setUMAC (const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > &)
 Set Umac before calling the projection step.
void setDivU (const amrex::Vector< amrex::MultiFab const * > &)
void setEBInflowVelocity (int amrlev, const amrex::MultiFab &eb_vel)
void setDomainBC (const amrex::Array< amrex::LinOpBCType, AMREX_SPACEDIM > &lobc, const amrex::Array< amrex::LinOpBCType, AMREX_SPACEDIM > &hibc)
void setLevelBC (int amrlev, const amrex::MultiFab *levelbcdata, const amrex::MultiFab *robin_a=nullptr, const amrex::MultiFab *robin_b=nullptr, const amrex::MultiFab *robin_f=nullptr)
void setCoarseFineBC (const amrex::MultiFab *crse, int crse_ratio)
void project (const amrex::Vector< amrex::MultiFab * > &phi_in, amrex::Real reltol, amrex::Real atol)
void project (amrex::Real reltol, amrex::Real atol)
void project_doit (amrex::Real reltol, amrex::Real atol)
void getFluxes (const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > &a_flux, const amrex::Vector< amrex::MultiFab * > &a_sol, amrex::MLMG::Location a_loc) const
void setVerbose (int v) noexcept
void setThrowException (bool t)
 Throw std::runtime_error instead of aborting when the solve fails.
int getNumIters () const noexcept
amrex::MLLinOp & getLinOp () noexcept
amrex::MLMG & getMLMG () noexcept
bool needInitialization () const noexcept
const amrex::Vector< amrex::MultiFab > & getPhi () const noexcept
const amrex::Vector< amrex::MultiFab > & getRHS () const noexcept

Private Member Functions

void setOptions ()
void queryMLHypre ()
void averageDownVelocity ()

Private Attributes

std::unique_ptr< amrex::MLPoisson > m_poisson
std::unique_ptr< amrex::MLABecLaplacian > m_abeclap
std::unique_ptr< amrex::MLEBABecLap > m_eb_abeclap
amrex::Vector< amrex::EBFArrayBoxFactory const * > m_eb_factory
amrex::Vector< std::unique_ptr< amrex::MultiFab > > m_eb_vel
amrex::MLLinOp * m_linop = nullptr
amrex::Real m_const_beta = amrex::Real(0.)
std::unique_ptr< amrex::MLMG > m_mlmg
amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > m_umac
amrex::Vector< amrex::MultiFab > m_rhs
amrex::Vector< amrex::MultiFab > m_phi
amrex::Vector< amrex::MultiFab > m_divu
amrex::Vector< amrex::Array< amrex::MultiFab, AMREX_SPACEDIM > > m_fluxes
amrex::Vector< amrex::Geometry > m_geom
int m_verbose = 0
int m_maxiter = 200
int m_num_iters = 0
bool m_throw_exception = false
int m_use_gmres = 0
int m_gmres_fallback = 0
int m_gmres_maxiter = 200
bool m_needs_domain_bcs = true
amrex::Vector< int > m_needs_level_bcs
bool m_has_robin = false
amrex::Array< amrex::LinOpBCType, AMREX_SPACEDIM > m_lobc
amrex::Array< amrex::LinOpBCType, AMREX_SPACEDIM > m_hibc
amrex::MLMG::Location m_umac_loc
amrex::MLMG::Location m_beta_loc
amrex::MLMG::Location m_phi_loc
amrex::MLMG::Location m_divu_loc
bool m_needs_init = true
bool m_use_mlhypre = false

Constructor & Destructor Documentation

◆ MacProjector() [1/3]

Hydro::MacProjector::MacProjector ( const amrex::Vector< amrex::Geometry > & a_geom,
amrex::MLMG::Location a_umac_loc,
amrex::MLMG::Location a_beta_loc,
amrex::MLMG::Location a_phi_loc,
amrex::MLMG::Location a_divu_loc = amrex::MLMG::Location::CellCenter )

◆ MacProjector() [2/3]

Hydro::MacProjector::MacProjector ( const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > & a_umac,
amrex::MLMG::Location a_umac_loc,
const amrex::Vector< amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > > & a_beta,
amrex::MLMG::Location a_beta_loc,
amrex::MLMG::Location a_phi_loc,
const amrex::Vector< amrex::Geometry > & a_geom,
const amrex::LPInfo & a_lpinfo,
const amrex::Vector< amrex::MultiFab const * > & a_divu,
amrex::MLMG::Location a_divu_loc,
const amrex::Vector< amrex::iMultiFab const * > & a_overset_mask = {} )

◆ MacProjector() [3/3]

Hydro::MacProjector::MacProjector ( const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > & a_umac,
amrex::MLMG::Location a_umac_loc,
const amrex::Vector< amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > > & a_beta,
amrex::MLMG::Location a_beta_loc,
amrex::MLMG::Location a_phi_loc,
const amrex::Vector< amrex::Geometry > & a_geom,
const amrex::LPInfo & a_lpinfo,
const amrex::Vector< amrex::MultiFab const * > & a_divu = {} )
inline

Member Function Documentation

◆ averageDownVelocity()

void Hydro::MacProjector::averageDownVelocity ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getFluxes()

void Hydro::MacProjector::getFluxes ( const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > & a_flux,
const amrex::Vector< amrex::MultiFab * > & a_sol,
amrex::MLMG::Location a_loc ) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getLinOp()

amrex::MLLinOp & Hydro::MacProjector::getLinOp ( )
inlinenoexcept

◆ getMLMG()

amrex::MLMG & Hydro::MacProjector::getMLMG ( )
inlinenoexcept

◆ getNumIters()

int Hydro::MacProjector::getNumIters ( ) const
inlinenodiscardnoexcept

Iterations of the last projection: MLMG's, or with use_mlhypre hypre's (HypreMLABecLap's IJ mode only)

◆ getPhi()

const amrex::Vector< amrex::MultiFab > & Hydro::MacProjector::getPhi ( ) const
inlinenodiscardnoexcept

◆ getRHS()

const amrex::Vector< amrex::MultiFab > & Hydro::MacProjector::getRHS ( ) const
inlinenodiscardnoexcept

◆ initProjector()

void Hydro::MacProjector::initProjector ( amrex::LPInfo a_lpinfo,
const amrex::Vector< amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > > & a_beta,
const amrex::Vector< amrex::iMultiFab const * > & a_overset_mask = {} )

Initialize the underlying linear operator and MLMG instances

Here is the call graph for this function:
Here is the caller graph for this function:

◆ needInitialization()

bool Hydro::MacProjector::needInitialization ( ) const
inlinenodiscardnoexcept

◆ project() [1/2]

void Hydro::MacProjector::project ( amrex::Real reltol,
amrex::Real atol )
Here is the call graph for this function:

◆ project() [2/2]

void Hydro::MacProjector::project ( const amrex::Vector< amrex::MultiFab * > & phi_in,
amrex::Real reltol,
amrex::Real atol )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ project_doit()

void Hydro::MacProjector::project_doit ( amrex::Real reltol,
amrex::Real atol )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ queryMLHypre()

void Hydro::MacProjector::queryMLHypre ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCoarseFineBC()

void Hydro::MacProjector::setCoarseFineBC ( const amrex::MultiFab * crse,
int crse_ratio )
inline

◆ setDivU()

void Hydro::MacProjector::setDivU ( const amrex::Vector< amrex::MultiFab const * > & a_divu)

Set div(U)

The source term S is copied into internal storage and persists until it is overwritten by another call. Passing an empty vector, or a vector whose entry for a level is a nullptr, resets S to zero on the levels not supplied. This matters when one MacProjector object is reused across time steps.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDomainBC()

void Hydro::MacProjector::setDomainBC ( const amrex::Array< amrex::LinOpBCType, AMREX_SPACEDIM > & lobc,
const amrex::Array< amrex::LinOpBCType, AMREX_SPACEDIM > & hibc )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setEBInflowVelocity()

void Hydro::MacProjector::setEBInflowVelocity ( int amrlev,
const amrex::MultiFab & eb_vel )
Here is the call graph for this function:

◆ setLevelBC()

void Hydro::MacProjector::setLevelBC ( int amrlev,
const amrex::MultiFab * levelbcdata,
const amrex::MultiFab * robin_a = nullptr,
const amrex::MultiFab * robin_b = nullptr,
const amrex::MultiFab * robin_f = nullptr )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setOptions()

void Hydro::MacProjector::setOptions ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setThrowException()

void Hydro::MacProjector::setThrowException ( bool t)
inline

Throw std::runtime_error instead of aborting when the solve fails.

◆ setUMAC()

void Hydro::MacProjector::setUMAC ( const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > & a_umac)

Set Umac before calling the projection step.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVerbose()

void Hydro::MacProjector::setVerbose ( int v)
inlinenoexcept

◆ updateBeta()

void Hydro::MacProjector::updateBeta ( const amrex::Vector< amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > > & a_beta)

Update Bcoeffs for the linear operator.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateCoeffs()

void Hydro::MacProjector::updateCoeffs ( const amrex::Vector< amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > > & a_beta)

Update Bcoeff and if Robin BC also reset scalars in order to reuse the linear operator.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_abeclap

std::unique_ptr<amrex::MLABecLaplacian> Hydro::MacProjector::m_abeclap
private

◆ m_beta_loc

amrex::MLMG::Location Hydro::MacProjector::m_beta_loc
private

◆ m_const_beta

amrex::Real Hydro::MacProjector::m_const_beta = amrex::Real(0.)
private

◆ m_divu

amrex::Vector<amrex::MultiFab> Hydro::MacProjector::m_divu
private

◆ m_divu_loc

amrex::MLMG::Location Hydro::MacProjector::m_divu_loc
private

◆ m_eb_abeclap

std::unique_ptr<amrex::MLEBABecLap> Hydro::MacProjector::m_eb_abeclap
private

◆ m_eb_factory

amrex::Vector<amrex::EBFArrayBoxFactory const*> Hydro::MacProjector::m_eb_factory
private

◆ m_eb_vel

amrex::Vector<std::unique_ptr<amrex::MultiFab> > Hydro::MacProjector::m_eb_vel
private

◆ m_fluxes

amrex::Vector<amrex::Array<amrex::MultiFab,AMREX_SPACEDIM> > Hydro::MacProjector::m_fluxes
private

◆ m_geom

amrex::Vector<amrex::Geometry> Hydro::MacProjector::m_geom
private

◆ m_gmres_fallback

int Hydro::MacProjector::m_gmres_fallback = 0
private

◆ m_gmres_maxiter

int Hydro::MacProjector::m_gmres_maxiter = 200
private

◆ m_has_robin

bool Hydro::MacProjector::m_has_robin = false
private

◆ m_hibc

amrex::Array<amrex::LinOpBCType,AMREX_SPACEDIM> Hydro::MacProjector::m_hibc
private

◆ m_linop

amrex::MLLinOp* Hydro::MacProjector::m_linop = nullptr
private

◆ m_lobc

amrex::Array<amrex::LinOpBCType,AMREX_SPACEDIM> Hydro::MacProjector::m_lobc
private

◆ m_maxiter

int Hydro::MacProjector::m_maxiter = 200
private

◆ m_mlmg

std::unique_ptr<amrex::MLMG> Hydro::MacProjector::m_mlmg
private

◆ m_needs_domain_bcs

bool Hydro::MacProjector::m_needs_domain_bcs = true
private

◆ m_needs_init

bool Hydro::MacProjector::m_needs_init = true
private

◆ m_needs_level_bcs

amrex::Vector<int> Hydro::MacProjector::m_needs_level_bcs
private

◆ m_num_iters

int Hydro::MacProjector::m_num_iters = 0
private

◆ m_phi

amrex::Vector<amrex::MultiFab> Hydro::MacProjector::m_phi
private

◆ m_phi_loc

amrex::MLMG::Location Hydro::MacProjector::m_phi_loc
private

◆ m_poisson

std::unique_ptr<amrex::MLPoisson> Hydro::MacProjector::m_poisson
private

◆ m_rhs

amrex::Vector<amrex::MultiFab> Hydro::MacProjector::m_rhs
private

◆ m_throw_exception

bool Hydro::MacProjector::m_throw_exception = false
private

◆ m_umac

amrex::Vector<amrex::Array<amrex::MultiFab*,AMREX_SPACEDIM> > Hydro::MacProjector::m_umac
private

◆ m_umac_loc

amrex::MLMG::Location Hydro::MacProjector::m_umac_loc
private

◆ m_use_gmres

int Hydro::MacProjector::m_use_gmres = 0
private

◆ m_use_mlhypre

bool Hydro::MacProjector::m_use_mlhypre = false
private

◆ m_verbose

int Hydro::MacProjector::m_verbose = 0
private

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