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

#include <hydro_NodalProjector.H>

Collaboration diagram for Hydro::NodalProjector:

Public Member Functions

 NodalProjector (amrex::Vector< amrex::MultiFab * > a_vel, amrex::Vector< const amrex::MultiFab * > a_sigma, amrex::Vector< amrex::Geometry > a_geom, const amrex::LPInfo &a_lpinfo, amrex::Vector< amrex::MultiFab * > a_S_cc={}, amrex::Vector< const amrex::MultiFab * > a_S_nd={})
 NodalProjector (amrex::Vector< amrex::MultiFab * > a_vel, amrex::Vector< const amrex::MultiFab * > a_sigma, amrex::Vector< amrex::Geometry > a_geom, amrex::Vector< amrex::MultiFab * > a_S_cc={}, amrex::Vector< const amrex::MultiFab * > a_S_nd={})
 NodalProjector (amrex::Vector< amrex::MultiFab * > a_vel, amrex::Real a_const_sigma, amrex::Vector< amrex::Geometry > a_geom, const amrex::LPInfo &a_lpinfo, amrex::Vector< amrex::MultiFab * > a_S_cc={}, amrex::Vector< const amrex::MultiFab * > a_S_nd={})
void project (amrex::Real a_rtol=amrex::Real(1.0e-11), amrex::Real a_atol=amrex::Real(1.0e-14))
void project (const amrex::Vector< amrex::MultiFab * > &a_phi, amrex::Real a_rtol=amrex::Real(1.0e-11), amrex::Real a_atol=amrex::Real(1.0e-14))
amrex::Vector< amrex::MultiFab * > getGradPhi ()
amrex::Vector< const amrex::MultiFab * > getGradPhiConst () const
amrex::Vector< amrex::MultiFab * > getPhi ()
amrex::Vector< const amrex::MultiFab * > getPhiConst () const
amrex::Vector< amrex::MultiFab * > getRHS ()
amrex::Vector< const amrex::MultiFab * > getRHSConst () const
amrex::Vector< amrex::MultiFab * > calcGradPhi (const amrex::Vector< amrex::MultiFab * > &a_phi)
void computeRHS (const amrex::Vector< amrex::MultiFab * > &a_rhs, const amrex::Vector< amrex::MultiFab * > &a_vel, const amrex::Vector< amrex::MultiFab * > &a_S_cc={}, const amrex::Vector< const amrex::MultiFab * > &a_S_nd={})
void setAlpha (const amrex::Vector< const amrex::MultiFab * > &a_alpha)
void setCustomRHS (amrex::Vector< const amrex::MultiFab * > a_rhs)
void setVerbose (int v) noexcept
void setDomainBC (std::array< amrex::LinOpBCType, AMREX_SPACEDIM > a_bc_lo, std::array< amrex::LinOpBCType, AMREX_SPACEDIM > a_bc_hi)
void setThrowException (bool t)
 Throw std::runtime_error instead of aborting when the solve fails.
int getNumIters () const noexcept
 Iterations of the last projection (MLMG, or hypre with use_mlhypre).
amrex::MLNodeLaplacian & getLinOp () noexcept
amrex::MLMG & getMLMG () noexcept
void setSyncResidualFine (amrex::MultiFab *a_sync_resid_fine)
void setSyncResidualCrse (amrex::MultiFab *a_sync_resid_crse, amrex::IntVect a_ref_ratio, amrex::BoxArray a_fine_grids)

Private Member Functions

void setOptions ()
void setCoarseBoundaryVelocityForSync ()
void computeSyncResidual ()
void averageDown (amrex::Vector< amrex::MultiFab * > const &a_var)
void define (amrex::LPInfo const &a_lpinfo)
void printInfo ()

Private Attributes

bool m_has_rhs = false
bool m_has_alpha = false
bool m_need_bcs = true
int m_verbose = 0
amrex::Vector< amrex::Geometry > m_geom
amrex::Vector< amrex::EBFArrayBoxFactory const * > m_ebfactory
amrex::Vector< amrex::MultiFab * > m_vel
amrex::Vector< amrex::MultiFab > m_fluxes
amrex::Vector< const amrex::MultiFab * > m_alpha
amrex::Vector< amrex::MultiFab * > m_S_cc
amrex::Vector< const amrex::MultiFab * > m_sigma
amrex::Real m_const_sigma = amrex::Real(0.0)
amrex::Vector< amrex::MultiFab > m_phi
amrex::Vector< amrex::MultiFab > m_rhs
amrex::Vector< const amrex::MultiFab * > m_S_nd
std::unique_ptr< amrex::MLNodeLaplacian > m_linop
std::unique_ptr< amrex::MLMG > m_mlmg
int m_maxiter = 100
int m_num_iters = 0
bool m_throw_exception = false
bool m_use_mlhypre = false
std::string m_mlhypre_prefix = "hypre_mlnodelap"
std::array< amrex::LinOpBCType, AMREX_SPACEDIM > m_bc_lo
std::array< amrex::LinOpBCType, AMREX_SPACEDIM > m_bc_hi
amrex::IntVect m_ref_ratio
amrex::BoxArray m_fine_grids
amrex::MultiFab * m_sync_resid_crse = nullptr
amrex::MultiFab * m_sync_resid_fine = nullptr

Constructor & Destructor Documentation

◆ NodalProjector() [1/3]

Hydro::NodalProjector::NodalProjector ( amrex::Vector< amrex::MultiFab * > a_vel,
amrex::Vector< const amrex::MultiFab * > a_sigma,
amrex::Vector< amrex::Geometry > a_geom,
const amrex::LPInfo & a_lpinfo,
amrex::Vector< amrex::MultiFab * > a_S_cc = {},
amrex::Vector< const amrex::MultiFab * > a_S_nd = {} )
Here is the call graph for this function:

◆ NodalProjector() [2/3]

Hydro::NodalProjector::NodalProjector ( amrex::Vector< amrex::MultiFab * > a_vel,
amrex::Vector< const amrex::MultiFab * > a_sigma,
amrex::Vector< amrex::Geometry > a_geom,
amrex::Vector< amrex::MultiFab * > a_S_cc = {},
amrex::Vector< const amrex::MultiFab * > a_S_nd = {} )
Here is the call graph for this function:

◆ NodalProjector() [3/3]

Hydro::NodalProjector::NodalProjector ( amrex::Vector< amrex::MultiFab * > a_vel,
amrex::Real a_const_sigma,
amrex::Vector< amrex::Geometry > a_geom,
const amrex::LPInfo & a_lpinfo,
amrex::Vector< amrex::MultiFab * > a_S_cc = {},
amrex::Vector< const amrex::MultiFab * > a_S_nd = {} )
Here is the call graph for this function:

Member Function Documentation

◆ averageDown()

void Hydro::NodalProjector::averageDown ( amrex::Vector< amrex::MultiFab * > const & a_var)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ calcGradPhi()

amrex::Vector< amrex::MultiFab * > Hydro::NodalProjector::calcGradPhi ( const amrex::Vector< amrex::MultiFab * > & a_phi)
Here is the call graph for this function:

◆ computeRHS()

void Hydro::NodalProjector::computeRHS ( const amrex::Vector< amrex::MultiFab * > & a_rhs,
const amrex::Vector< amrex::MultiFab * > & a_vel,
const amrex::Vector< amrex::MultiFab * > & a_S_cc = {},
const amrex::Vector< const amrex::MultiFab * > & a_S_nd = {} )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ computeSyncResidual()

void Hydro::NodalProjector::computeSyncResidual ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ define()

void Hydro::NodalProjector::define ( amrex::LPInfo const & a_lpinfo)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGradPhi()

amrex::Vector< amrex::MultiFab * > Hydro::NodalProjector::getGradPhi ( )
inline

◆ getGradPhiConst()

amrex::Vector< const amrex::MultiFab * > Hydro::NodalProjector::getGradPhiConst ( ) const
inline

◆ getLinOp()

amrex::MLNodeLaplacian & Hydro::NodalProjector::getLinOp ( )
inlinenoexcept

◆ getMLMG()

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

◆ getNumIters()

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

Iterations of the last projection (MLMG, or hypre with use_mlhypre).

◆ getPhi()

amrex::Vector< amrex::MultiFab * > Hydro::NodalProjector::getPhi ( )
inline

◆ getPhiConst()

amrex::Vector< const amrex::MultiFab * > Hydro::NodalProjector::getPhiConst ( ) const
inline

◆ getRHS()

amrex::Vector< amrex::MultiFab * > Hydro::NodalProjector::getRHS ( )
inline

◆ getRHSConst()

amrex::Vector< const amrex::MultiFab * > Hydro::NodalProjector::getRHSConst ( ) const
inline

◆ printInfo()

void Hydro::NodalProjector::printInfo ( )
private
Here is the caller graph for this function:

◆ project() [1/2]

void Hydro::NodalProjector::project ( amrex::Real a_rtol = amrex::Real(1.0e-11),
amrex::Real a_atol = amrex::Real(1.0e-14) )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ project() [2/2]

void Hydro::NodalProjector::project ( const amrex::Vector< amrex::MultiFab * > & a_phi,
amrex::Real a_rtol = amrex::Real(1.0e-11),
amrex::Real a_atol = amrex::Real(1.0e-14) )
Here is the call graph for this function:

◆ setAlpha()

void Hydro::NodalProjector::setAlpha ( const amrex::Vector< const amrex::MultiFab * > & a_alpha)
inline

Set alpha for the custom mode. alpha is stored as raw pointers, so it must outlive the projector, and it persists until it is reset. Pass an empty vector to go back to the default alpha = 1.

Here is the call graph for this function:

◆ setCoarseBoundaryVelocityForSync()

void Hydro::NodalProjector::setCoarseBoundaryVelocityForSync ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCustomRHS()

void Hydro::NodalProjector::setCustomRHS ( amrex::Vector< const amrex::MultiFab * > a_rhs)

Set a custom RHS. It persists until it is reset; pass an empty vector to go back to computing "div(vel) + S_nd + S_cc" in project().

Here is the call graph for this function:

◆ setDomainBC()

void Hydro::NodalProjector::setDomainBC ( std::array< amrex::LinOpBCType, AMREX_SPACEDIM > a_bc_lo,
std::array< amrex::LinOpBCType, AMREX_SPACEDIM > a_bc_hi )

◆ setOptions()

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

◆ setSyncResidualCrse()

void Hydro::NodalProjector::setSyncResidualCrse ( amrex::MultiFab * a_sync_resid_crse,
amrex::IntVect a_ref_ratio,
amrex::BoxArray a_fine_grids )
inline

◆ setSyncResidualFine()

void Hydro::NodalProjector::setSyncResidualFine ( amrex::MultiFab * a_sync_resid_fine)
inline

◆ setThrowException()

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

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

◆ setVerbose()

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

Member Data Documentation

◆ m_alpha

amrex::Vector<const amrex::MultiFab*> Hydro::NodalProjector::m_alpha
private

◆ m_bc_hi

std::array<amrex::LinOpBCType,AMREX_SPACEDIM> Hydro::NodalProjector::m_bc_hi
private

◆ m_bc_lo

std::array<amrex::LinOpBCType,AMREX_SPACEDIM> Hydro::NodalProjector::m_bc_lo
private

◆ m_const_sigma

amrex::Real Hydro::NodalProjector::m_const_sigma = amrex::Real(0.0)
private

◆ m_ebfactory

amrex::Vector<amrex::EBFArrayBoxFactory const *> Hydro::NodalProjector::m_ebfactory
private

◆ m_fine_grids

amrex::BoxArray Hydro::NodalProjector::m_fine_grids
private

◆ m_fluxes

amrex::Vector<amrex::MultiFab> Hydro::NodalProjector::m_fluxes
private

◆ m_geom

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

◆ m_has_alpha

bool Hydro::NodalProjector::m_has_alpha = false
private

◆ m_has_rhs

bool Hydro::NodalProjector::m_has_rhs = false
private

◆ m_linop

std::unique_ptr< amrex::MLNodeLaplacian > Hydro::NodalProjector::m_linop
private

◆ m_maxiter

int Hydro::NodalProjector::m_maxiter = 100
private

◆ m_mlhypre_prefix

std::string Hydro::NodalProjector::m_mlhypre_prefix = "hypre_mlnodelap"
private

◆ m_mlmg

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

◆ m_need_bcs

bool Hydro::NodalProjector::m_need_bcs = true
private

◆ m_num_iters

int Hydro::NodalProjector::m_num_iters = 0
private

◆ m_phi

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

◆ m_ref_ratio

amrex::IntVect Hydro::NodalProjector::m_ref_ratio
private

◆ m_rhs

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

◆ m_S_cc

amrex::Vector<amrex::MultiFab*> Hydro::NodalProjector::m_S_cc
private

◆ m_S_nd

amrex::Vector<const amrex::MultiFab*> Hydro::NodalProjector::m_S_nd
private

◆ m_sigma

amrex::Vector<const amrex::MultiFab*> Hydro::NodalProjector::m_sigma
private

◆ m_sync_resid_crse

amrex::MultiFab* Hydro::NodalProjector::m_sync_resid_crse = nullptr
private

◆ m_sync_resid_fine

amrex::MultiFab* Hydro::NodalProjector::m_sync_resid_fine = nullptr
private

◆ m_throw_exception

bool Hydro::NodalProjector::m_throw_exception = false
private

◆ m_use_mlhypre

bool Hydro::NodalProjector::m_use_mlhypre = false
private

◆ m_vel

amrex::Vector<amrex::MultiFab*> Hydro::NodalProjector::m_vel
private

◆ m_verbose

int Hydro::NodalProjector::m_verbose = 0
private

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