chombo-discharge
Loading...
Searching...
No Matches
EBHelmholtzOpFactory Class Reference

Factory class for making variable-coefficient Helmholtz operators. More...

#include <CD_EBHelmholtzOpFactory.H>

Inheritance diagram for EBHelmholtzOpFactory:
Collaboration diagram for EBHelmholtzOpFactory:

Public Types

using Smoother = EBHelmholtzOp::Smoother
 Smoother type alias.
using AmrLevelGrids = Vector<RefCountedPtr<EBLevelGrid>>
 alias type alias.
using AmrMask = Vector<RefCountedPtr<LevelData<BaseFab<bool>>>>
 alias type alias.
using AmrInterpolators = Vector<RefCountedPtr<EBMultigridInterpolator>>
 alias type alias.
using AmrFluxRegisters = Vector<RefCountedPtr<EBReflux>>
 alias type alias.
using AmrCoarseners = Vector<RefCountedPtr<EBCoarAve>>
 alias type alias.
using AmrCellData = Vector<RefCountedPtr<LevelData<EBCellFAB>>>
 alias type alias.
using AmrFluxData = Vector<RefCountedPtr<LevelData<EBFluxFAB>>>
 alias type alias.
using AmrIrreData = Vector<RefCountedPtr<LevelData<BaseIVFAB<Real>>>>
 alias type alias.
using AmrResolutions = Vector<Real>
 alias type alias.
using AmrRefRatios = Vector<int>
 alias type alias.
using DomainBCFactory = RefCountedPtr<EBHelmholtzDomainBCFactory>
 alias type alias.
using EBBCFactory = RefCountedPtr<EBHelmholtzEBBCFactory>
 alias type alias.

Public Member Functions

 EBHelmholtzOpFactory ()=delete
 Disallowed constructor. Use the full constructor.
 EBHelmholtzOpFactory (const EBHelmholtzOpFactory &a_otherFactory)=delete
 Disallowed constructor. Use the full constructor.
 EBHelmholtzOpFactory (const EBHelmholtzOpFactory &&a_otherFactory)=delete
 Disallowed move constructor. Use the full constructor.
 EBHelmholtzOpFactory (Location::Cell a_dataLocation, const Real &a_alpha, const Real &a_beta, const RealVect &a_probLo, const AmrLevelGrids &a_amrLevelGrids, const AmrMask &a_validCells, const AmrInterpolators &a_amrInterpolators, const AmrFluxRegisters &a_amrFluxRegisters, const AmrCoarseners &a_amrCoarseners, const AmrRefRatios &a_amrRefRatios, const AmrResolutions &a_amrResolutions, const AmrCellData &a_amrAcoef, const AmrFluxData &a_amrBcoef, const AmrIrreData &a_amrBcoefIrreg, const DomainBCFactory &a_domainBcFactory, const EBBCFactory &a_ebbcFactory, const IntVect &a_ghostPhi, const IntVect &a_ghostRHS, const Smoother &a_smoother, const Real &a_relaxFactor, const int &a_chebyOrder, const Real &a_chebyEigRatio, const int &a_rasInnerSweeps, const Vector< AmrLevelGrids > &a_mgLevelGrids, const Vector< AmrLevelGrids > &a_mgLevelGridsCoFi, const Vector< AmrCoarseners > &a_mgCoarseners, const AmrLevelGrids &a_amrLevelGridsCoFi, const ProblemDomain &a_bottomDomain, const bool a_refluxFree)
 Full constructor.
 ~EBHelmholtzOpFactory () override
 Destructor. Does nothing.
void operator= (const EBHelmholtzOpFactory &a_opin)=delete
 Disallowed assignment operator.
void operator= (const EBHelmholtzOpFactory &&a_opin)=delete
 Disallowed move assignment.
void coarsenCoefficientsMG ()
 Go through all MG levels and coarsen the coefficients from the finer levels.
EBHelmholtzOp * MGnewOp (const ProblemDomain &a_fineDomain, int a_depth, bool a_homogeneousOnly=true) final
 Create multigrid operator.
EBHelmholtzOp * AMRnewOp (const ProblemDomain &a_domain) final
 Create AMR operator for specified domain.
int refToFiner (const ProblemDomain &a_domain) const final
 Get refinement ratio to next finest level.

Protected Member Functions

void defineMultigridLevels (const Vector< AmrLevelGrids > &a_mgLevelGrids, const Vector< AmrLevelGrids > &a_mgLevelGridsCoFi, const Vector< AmrCoarseners > &a_mgCoarseners)
 Define the multigrid levels for this operator factory, and the coefficients on them.
int findAmrLevel (const ProblemDomain &a_domain) const
 Find level corresponding to amr level.

Static Protected Member Functions

static bool isCoarser (const ProblemDomain &a_domainOne, const ProblemDomain &B)
 Check if a domain is coarser than the other.
static bool isFiner (const ProblemDomain &a_domainOne, const ProblemDomain &B)
 Check if a domain is finer than the other.

Protected Attributes

Location::Cell m_dataLocation
 Data location.
Smoother m_smoother
 Smoother.
int m_chebyOrder
 Chebyshev polynomial degree (only used when m_smoother is Smoother::Chebyshev).
Real m_chebyEigRatio
 Chebyshev eigenvalue ratio lambda_max/lambda_min (only used when m_smoother is Smoother::Chebyshev).
int m_rasInnerSweeps
 Number of inner frozen-ghost sweeps per restricted-additive-Schwarz iteration (only used when m_smoother is Smoother::RestrictedAdditiveSchwarz).
int m_numAmrLevels
 Number of AMR levels.
IntVect m_ghostPhi
 Number of ghost cells that are used. Need because of Chombo prolongation objects.
IntVect m_ghostRhs
 Number of ghost cells that are used. Need because of Chombo prolongation objects.
Real m_alpha
 Operator alpha.
Real m_beta
 Operator beta.
Real m_relaxFactor
 Relaxation factor.
bool m_refluxFree
 Use reflux-free AMR operator.
RealVect m_probLo
 Lower-left corner of computational domain.
AmrLevelGrids m_amrLevelGrids
 AMR grids.
AmrMask m_validCells
 Valid cells.
AmrInterpolators m_amrInterpolators
 Ghost cell interpolations.
AmrFluxRegisters m_amrFluxRegisters
 Flux registers.
AmrCoarseners m_amrCoarseners
 Data coarseners.
AmrRefRatios m_amrRefRatios
 Refinement ratios.
AmrResolutions m_amrResolutions
 Resolutions one each level.
AmrCellData m_amrAcoef
 Helmholtz A-coefficient.
AmrFluxData m_amrBcoef
 Helmholtz B-coefficient.
AmrIrreData m_amrBcoefIrreg
 Helmholtz B-coefficient (on EB faces.
DomainBCFactory m_domainBcFactory
 Domain BC factory.
EBBCFactory m_ebBcFactory
 EB BC factory.
ProblemDomain m_bottomDomain
 Bottom domain, i.e. the coarsest domain which will be used in multigrid.
AmrLevelGrids m_amrLevelGridsCoFi
 Coarsened grids between AMR levels. Entry lvl is AMR level lvl+1 coarsened to AMR level lvl.
std::vector< bool > m_hasMgLevels
 For checking if an AMR level has multigrid levels.
Vector< AmrLevelGrids > m_mgLevelGrids
 Deeper grids. Always weird to write this but e.g. m_mgLevelGrids[0] corresponds to the the multigrid levels below amr level 0.
Vector< AmrCellData > m_mgAcoef
 A-coefficient on deeper grids. Always weird to write this but e.g. m_mgLevelGrids[0] corresponds to the the multigrid levels below amr level 0.
Vector< AmrFluxData > m_mgBcoef
 B-coefficient on deeper grids. Always weird to write this but e.g. m_mgLevelGrids[0] corresponds to the the multigrid levels below amr level 0.
Vector< AmrIrreData > m_mgBcoefIrreg
 B-coefficient on deeper grids. Always weird to write this but e.g. m_mgLevelGrids[0] corresponds to the the multigrid levels below amr level 0.
Vector< AmrCoarseners > m_mgCoarseners
 Coarse averaging between consecutive multigrid levels. m_mgCoarseners[lvl][k] averages from m_mgLevelGrids[lvl][k] onto m_mgLevelGrids[lvl][k+1].
Vector< AmrLevelGrids > m_mgLevelGridsCoFi
 Coarsened grids between consecutive multigrid levels. m_mgLevelGridsCoFi[lvl][k] is m_mgLevelGrids[lvl][k] coarsened by 2.

Static Protected Attributes

static constexpr int m_comp = 0
 Component number that is solved for.
static constexpr int m_nComp = 1
 Number of components that we solve for.

Detailed Description

Factory class for making variable-coefficient Helmholtz operators.

Note
This factory is designed for making EBHelmholtzOps which have time-independent coefficients. If you need new coefficients you better set up multigrid again.
This factory is designed without time-dependence in BCs. Time-dependent BCs are still doable by letting the boundary condition classes carry a reference to an externally updated time.

Constructor & Destructor Documentation

◆ EBHelmholtzOpFactory()

EBHelmholtzOpFactory::EBHelmholtzOpFactory ( Location::Cell a_dataLocation,
const Real & a_alpha,
const Real & a_beta,
const RealVect & a_probLo,
const AmrLevelGrids & a_amrLevelGrids,
const AmrMask & a_validCells,
const AmrInterpolators & a_amrInterpolators,
const AmrFluxRegisters & a_amrFluxRegisters,
const AmrCoarseners & a_amrCoarseners,
const AmrRefRatios & a_amrRefRatios,
const AmrResolutions & a_amrResolutions,
const AmrCellData & a_amrAcoef,
const AmrFluxData & a_amrBcoef,
const AmrIrreData & a_amrBcoefIrreg,
const DomainBCFactory & a_domainBcFactory,
const EBBCFactory & a_ebbcFactory,
const IntVect & a_ghostPhi,
const IntVect & a_ghostRHS,
const Smoother & a_smoother,
const Real & a_relaxFactor,
const int & a_chebyOrder,
const Real & a_chebyEigRatio,
const int & a_rasInnerSweeps,
const Vector< AmrLevelGrids > & a_mgLevelGrids,
const Vector< AmrLevelGrids > & a_mgLevelGridsCoFi,
const Vector< AmrCoarseners > & a_mgCoarseners,
const AmrLevelGrids & a_amrLevelGridsCoFi,
const ProblemDomain & a_bottomDomain,
const bool a_refluxFree )

Full constructor.

Parameters
[in]a_dataLocationAssumed data centering
[in]a_alphaalpha-coefficient in Helmholtz operator.
[in]a_betabeta-coefficient in Helmholtz operator.
[in]a_probLoLower-left corner of domain
[in]a_amrInterpolatorsInterpolator objects between AMR levels.
[in]a_amrCoarsenersConservative coarseners between AMR levels.
[in]a_amrFluxRegistersFlux registers between AMR levels.
[in]a_amrResolutionsGrid resolutions for AMR levels.
[in]a_amrAcoefA-coefficient in Helmholtz operator.
[in]a_amrBcoefB-coefficient in Helmholtz operator.
[in]a_amrBcoefIrregB-coefficient in Helmholtz operator. This one is defined on EB faces.
[in]a_ebbcFactoryFactory class for making BC objects for EB boundary conditions.
[in]a_ghostPhiNumber of ghost cells in solution vector.
[in]a_smootherRelaxation method.
[in]a_relaxFactorRelaxation factor
[in]a_chebyOrderChebyshev polynomial degree (only used when a_smoother is Smoother::Chebyshev)
[in]a_chebyEigRatioChebyshev eigenvalue ratio lambda_max/lambda_min (only used when a_smoother is Smoother::Chebyshev)
[in]a_rasInnerSweepsNumber of inner frozen-ghost sweeps per restricted-additive-Schwarz iteration (only used when a_smoother is Smoother::RestrictedAdditiveSchwarz)
[in]a_mgLevelGridsMultigrid levels under each AMR level, as built by the realm (see PhaseRealm::getMultigridLevelGrids). The factory uses the entries that are not coarser than a_bottomDomain.
[in]a_mgLevelGridsCoFiCoarsened grids between consecutive multigrid levels, as built by the realm (see PhaseRealm::getMultigridLevelGridsCoFi).
[in]a_mgCoarsenersCoarse averaging between consecutive multigrid levels, as built by the realm (see PhaseRealm::getMultigridCoarseAverage).
[in]a_amrLevelGridsCoFiCoarsened grids between AMR levels. Entry lvl is AMR level lvl+1 coarsened to AMR level lvl (see PhaseRealm::getEBLevelGridCoFi).
[in]a_bottomDomainCoarsest domain on which we run multigrid. Must be a coarsening of the AMR problem domains.
[in]a_refluxFreeIf true, use the reflux-free AMR operator (skips coarse-fine flux refluxing)
Note
This operator is for time-independent a- and b-coefficients.
Parameters
[in]a_amrLevelGridsAmr level grids
[in]a_validCellsValid cells
[in]a_amrRefRatiosAmr ref ratios
[in]a_domainBcFactoryDomain bc factory
[in]a_ghostRHSGhost r h s

Member Function Documentation

◆ AMRnewOp()

EBHelmholtzOp * EBHelmholtzOpFactory::AMRnewOp ( const ProblemDomain & a_domain)
final

Create AMR operator for specified domain.

Parameters
[in]a_domainDomain
Returns
Return value

◆ defineMultigridLevels()

void EBHelmholtzOpFactory::defineMultigridLevels ( const Vector< AmrLevelGrids > & a_mgLevelGrids,
const Vector< AmrLevelGrids > & a_mgLevelGridsCoFi,
const Vector< AmrCoarseners > & a_mgCoarseners )
protected

Define the multigrid levels for this operator factory, and the coefficients on them.

Takes the entries of the realm's multigrid levels that are not coarser than the bottom domain.

Parameters
[in]a_mgLevelGridsMultigrid levels under each AMR level, as built by the realm.
[in]a_mgLevelGridsCoFiCoarsened grids between consecutive multigrid levels, as built by the realm.
[in]a_mgCoarsenersCoarse averaging between consecutive multigrid levels, as built by the realm.

◆ findAmrLevel()

int EBHelmholtzOpFactory::findAmrLevel ( const ProblemDomain & a_domain) const
protected

Find level corresponding to amr level.

Parameters
[in]a_domainProblem domain.
Returns
Depth in m_amrLevelGrids corresponding to a_domain.
Note
Run-time error if no level was found.

◆ isCoarser()

bool EBHelmholtzOpFactory::isCoarser ( const ProblemDomain & a_domainOne,
const ProblemDomain & B )
staticprotected

Check if a domain is coarser than the other.

Parameters
[in]a_domainOneThe first domain
[in]BThe second domain
Returns
Returns true of a_domainOne has fewer grid points than B

◆ isFiner()

bool EBHelmholtzOpFactory::isFiner ( const ProblemDomain & a_domainOne,
const ProblemDomain & B )
staticprotected

Check if a domain is finer than the other.

Parameters
[in]a_domainOneThe first domain
[in]BThe second domain
Returns
Returns true of a_domainOne has more grid points than B

◆ MGnewOp()

EBHelmholtzOp * EBHelmholtzOpFactory::MGnewOp ( const ProblemDomain & a_fineDomain,
int a_depth,
bool a_homogeneousOnly = true )
final

Create multigrid operator.

Parameters
[in]a_fineDomainDomain
[in]a_depthDepth. This specifies that the operator will be created at depth coarsen(a_fineDomain, 2^a_depth);
[in]a_homogeneousOnlyIf true, only homogeneous boundary conditions will be needed.
Returns
Return value

◆ refToFiner()

int EBHelmholtzOpFactory::refToFiner ( const ProblemDomain & a_domain) const
final

Get refinement ratio to next finest level.

Note
Returns -1 when there are no finer levels.
Returns
Return value
Parameters
[in]a_domainDomain

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