13#ifndef CD_EBHELMHOLTZOPFACTORY_H
14#define CD_EBHELMHOLTZOPFACTORY_H
18#include <EBLevelGrid.H>
22#include <ConductivityBaseDomainBC.H>
31#include <CD_EBHelmholtzEBBCFactory.H>
32#include <CD_EBHelmholtzDomainBCFactory.H>
33#include <CD_NamespaceHeader.H>
60 using AmrMask = Vector<RefCountedPtr<LevelData<BaseFab<bool>>>>;
80 using AmrCellData = Vector<RefCountedPtr<LevelData<EBCellFAB>>>;
85 using AmrFluxData = Vector<RefCountedPtr<LevelData<EBFluxFAB>>>;
90 using AmrIrreData = Vector<RefCountedPtr<LevelData<BaseIVFAB<Real>>>>;
168 const RealVect& a_probLo,
181 const IntVect& a_ghostPhi,
182 const IntVect& a_ghostRHS,
184 const Real& a_relaxFactor,
185 const int& a_chebyOrder,
186 const Real& a_chebyEigRatio,
187 const int& a_rasInnerSweeps,
188 const ProblemDomain& a_bottomDomain,
189 const int& a_mgBlockingFactor,
190 const bool a_refluxFree =
false,
225 MGnewOp(
const ProblemDomain& a_fineDomain,
int a_depth,
bool a_homogeneousOnly =
true) final;
233 AMRnewOp(const ProblemDomain& a_domain) final;
242 refToFiner(const ProblemDomain& a_domain) const final;
441 isCoarser(const ProblemDomain& a_domainOne, const ProblemDomain& B);
450 isFiner(const ProblemDomain& a_domainOne, const ProblemDomain& B);
462 getCoarserLayout(EBLevelGrid& a_coarEblg, const EBLevelGrid& a_fineEblg,
int a_refRat,
int a_blockingFactor) const;
478 LevelData<EBFluxFAB>& a_coarBcoef,
479 LevelData<BaseIVFAB<Real>>& a_coarBcoefIrreg,
480 const LevelData<EBCellFAB>& a_fineAcoef,
481 const LevelData<EBFluxFAB>& a_fineBcoef,
482 const LevelData<BaseIVFAB<Real>>& a_fineBcoefIrreg,
483 const EBLevelGrid& a_eblgCoar,
484 const EBLevelGrid& a_eblgFine,
497#include <CD_NamespaceFooter.H>
Declaration of conservative coarsening utility.
Declaration of Helmholtz multigrid operators.
Parent base class for multigrid interpolation.
Declaration of a class which can reflux over the coarse-fine interface.
Declaration of cell positions.
Factory class for making variable-coefficient Helmholtz operators.
Definition CD_EBHelmholtzOpFactory.H:43
Vector< AmrIrreData > m_mgBcoefIrreg
B-coefficient on deeper grids. Always weird to write this but e.g. m_mgLevelGrids[0] corresponds to t...
Definition CD_EBHelmholtzOpFactory.H:426
int m_mgBlockingFactor
Blocking factor for when we create intermediate and deep multigrid levels.
Definition CD_EBHelmholtzOpFactory.H:391
AmrIrreData m_amrBcoefIrreg
Helmholtz B-coefficient (on EB faces.
Definition CD_EBHelmholtzOpFactory.H:371
AmrCoarseners m_amrCoarseners
Data coarseners.
Definition CD_EBHelmholtzOpFactory.H:346
EBHelmholtzOp * MGnewOp(const ProblemDomain &a_fineDomain, int a_depth, bool a_homogeneousOnly=true) final
Create multigrid operator.
Definition CD_EBHelmholtzOpFactory.cpp:435
AmrResolutions m_amrResolutions
Resolutions one each level.
Definition CD_EBHelmholtzOpFactory.H:356
Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > AmrMask
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:60
std::vector< bool > m_hasMgLevels
For checking if an AMR level has multigrid levels.
Definition CD_EBHelmholtzOpFactory.H:402
EBHelmholtzOpFactory()=delete
Disallowed constructor. Use the full constructor.
int refToFiner(const ProblemDomain &a_domain) const final
Get refinement ratio to next finest level.
Definition CD_EBHelmholtzOpFactory.cpp:664
Vector< AmrCellData > m_mgAcoef
A-coefficient on deeper grids. Always weird to write this but e.g. m_mgLevelGrids[0] corresponds to t...
Definition CD_EBHelmholtzOpFactory.H:414
int findAmrLevel(const ProblemDomain &a_domain) const
Find level corresponding to amr level.
Definition CD_EBHelmholtzOpFactory.cpp:687
IntVect m_ghostRhs
Number of ghost cells that are used. Need because of Chombo prolongation objects.
Definition CD_EBHelmholtzOpFactory.H:294
EBBCFactory m_ebBcFactory
EB BC factory.
Definition CD_EBHelmholtzOpFactory.H:381
Vector< RefCountedPtr< EBCoarAve > > AmrCoarseners
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:75
Vector< RefCountedPtr< EBLevelGrid > > AmrLevelGrids
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:55
Vector< RefCountedPtr< EBMultigridInterpolator > > AmrInterpolators
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:65
EBHelmholtzOpFactory(const EBHelmholtzOpFactory &&a_otherFactory)=delete
Disallowed move constructor. Use the full constructor.
AmrFluxRegisters m_amrFluxRegisters
Flux registers.
Definition CD_EBHelmholtzOpFactory.H:341
void operator=(const EBHelmholtzOpFactory &&a_opin)=delete
Disallowed move assignment.
static constexpr int m_comp
Component number that is solved for.
Definition CD_EBHelmholtzOpFactory.H:248
Vector< AmrLevelGrids > m_mgLevelGrids
Deeper grids. Always weird to write this but e.g. m_mgLevelGrids[0] corresponds to the the multigrid ...
Definition CD_EBHelmholtzOpFactory.H:408
bool m_refluxFree
Use reflux-free AMR operator.
Definition CD_EBHelmholtzOpFactory.H:314
AmrLevelGrids m_deeperLevelGrids
This is for using pre-defined grids for the deeper multigrid levels, i.e. for the levels that are coa...
Definition CD_EBHelmholtzOpFactory.H:397
static bool isCoarser(const ProblemDomain &a_domainOne, const ProblemDomain &B)
Check if a domain is coarser than the other.
Definition CD_EBHelmholtzOpFactory.cpp:350
EBHelmholtzOp * AMRnewOp(const ProblemDomain &a_domain) final
Create AMR operator for specified domain.
Definition CD_EBHelmholtzOpFactory.cpp:578
Real m_chebyEigRatio
Chebyshev eigenvalue ratio lambda_max/lambda_min (only used when m_smoother is Smoother::Chebyshev)
Definition CD_EBHelmholtzOpFactory.H:273
void operator=(const EBHelmholtzOpFactory &a_opin)=delete
Disallowed assignment operator.
ProblemDomain m_bottomDomain
Bottom domain, i.e. the coarsest domain which will be used in multigrid.
Definition CD_EBHelmholtzOpFactory.H:386
Smoother m_smoother
Smoother.
Definition CD_EBHelmholtzOpFactory.H:263
int m_numAmrLevels
Number of AMR levels.
Definition CD_EBHelmholtzOpFactory.H:284
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > AmrIrreData
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:90
EBHelmholtzOpFactory(const EBHelmholtzOpFactory &a_otherFactory)=delete
Disallowed constructor. Use the full constructor.
Location::Cell m_dataLocation
Data location.
Definition CD_EBHelmholtzOpFactory.H:258
Vector< AmrFluxData > m_mgBcoef
B-coefficient on deeper grids. Always weird to write this but e.g. m_mgLevelGrids[0] corresponds to t...
Definition CD_EBHelmholtzOpFactory.H:420
IntVect m_ghostPhi
Number of ghost cells that are used. Need because of Chombo prolongation objects.
Definition CD_EBHelmholtzOpFactory.H:289
RefCountedPtr< EBHelmholtzEBBCFactory > EBBCFactory
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:110
static constexpr int m_nComp
Number of components that we solve for.
Definition CD_EBHelmholtzOpFactory.H:253
AmrFluxData m_amrBcoef
Helmholtz B-coefficient.
Definition CD_EBHelmholtzOpFactory.H:366
Vector< RefCountedPtr< EBReflux > > AmrFluxRegisters
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:70
bool getCoarserLayout(EBLevelGrid &a_coarEblg, const EBLevelGrid &a_fineEblg, int a_refRat, int a_blockingFactor) const
Construct coarsening of a grid level.
Definition CD_EBHelmholtzOpFactory.cpp:366
~EBHelmholtzOpFactory() override
Destructor. Does nothing.
Definition CD_EBHelmholtzOpFactory.cpp:96
Real m_relaxFactor
Relaxation factor.
Definition CD_EBHelmholtzOpFactory.H:309
AmrLevelGrids m_amrLevelGrids
AMR grids.
Definition CD_EBHelmholtzOpFactory.H:326
AmrMask m_validCells
Valid cells.
Definition CD_EBHelmholtzOpFactory.H:331
AmrCellData m_amrAcoef
Helmholtz A-coefficient.
Definition CD_EBHelmholtzOpFactory.H:361
static void coarsenCoefficients(LevelData< EBCellFAB > &a_coarAcoef, LevelData< EBFluxFAB > &a_coarBcoef, LevelData< BaseIVFAB< Real > > &a_coarBcoefIrreg, const LevelData< EBCellFAB > &a_fineAcoef, const LevelData< EBFluxFAB > &a_fineBcoef, const LevelData< BaseIVFAB< Real > > &a_fineBcoefIrreg, const EBLevelGrid &a_eblgCoar, const EBLevelGrid &a_eblgFine, int a_refRat)
Coarsen coefficients (conservatively)
Definition CD_EBHelmholtzOpFactory.cpp:309
void coarsenCoefficientsMG()
Go through all MG levels and coarsen the coefficients from the finer levels.
Definition CD_EBHelmholtzOpFactory.cpp:261
void defineMultigridLevels()
Function which defines the multigrid levels for this operator factory.
Definition CD_EBHelmholtzOpFactory.cpp:102
Real m_beta
Operator beta.
Definition CD_EBHelmholtzOpFactory.H:304
static bool isFiner(const ProblemDomain &a_domainOne, const ProblemDomain &B)
Check if a domain is finer than the other.
Definition CD_EBHelmholtzOpFactory.cpp:358
DomainBCFactory m_domainBcFactory
Domain BC factory.
Definition CD_EBHelmholtzOpFactory.H:376
Vector< RefCountedPtr< LevelData< EBCellFAB > > > AmrCellData
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:80
AmrRefRatios m_amrRefRatios
Refinement ratios.
Definition CD_EBHelmholtzOpFactory.H:351
int m_rasInnerSweeps
Number of inner frozen-ghost sweeps per restricted-additive-Schwarz iteration (only used when m_smoot...
Definition CD_EBHelmholtzOpFactory.H:279
RealVect m_probLo
Lower-left corner of computational domain.
Definition CD_EBHelmholtzOpFactory.H:319
Real m_alpha
Operator alpha.
Definition CD_EBHelmholtzOpFactory.H:299
Vector< RefCountedPtr< LevelData< EBFluxFAB > > > AmrFluxData
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:85
Vector< Real > AmrResolutions
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:95
RefCountedPtr< EBHelmholtzDomainBCFactory > DomainBCFactory
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:105
Vector< int > AmrRefRatios
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:100
AmrInterpolators m_amrInterpolators
Ghost cell interpolations.
Definition CD_EBHelmholtzOpFactory.H:336
int m_chebyOrder
Chebyshev polynomial degree (only used when m_smoother is Smoother::Chebyshev)
Definition CD_EBHelmholtzOpFactory.H:268
Helmholtz operator for equations like alpha*a(x)*phi(x) + beta*div(b(x)*grad(phi(x))) = rho.
Definition CD_EBHelmholtzOp.H:42
Smoother
Relaxation method for the operators.
Definition CD_EBHelmholtzOp.H:48
Namespace for encapsulating various data centerings.
Definition CD_Location.H:25
Cell
Enum for distinguishing between cell locations.
Definition CD_Location.H:31