chombo-discharge
Loading...
Searching...
No Matches
CD_EBHelmholtzOpFactory.H
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2021-2026 SINTEF Energy Research
3 *
4 * SPDX-License-Identifier: GPL-3.0-or-later
5 */
6
13#ifndef CD_EBHELMHOLTZOPFACTORY_H
14#define CD_EBHELMHOLTZOPFACTORY_H
15
16// Chombo includes
17#include <RealVect.H>
18#include <EBLevelGrid.H>
19#include <EBCellFAB.H>
20#include <EBFluxFAB.H>
21#include <BaseIVFAB.H>
22#include <ConductivityBaseDomainBC.H>
23#include <BaseEBBC.H>
24
25// Our includes
26#include <CD_Location.H>
27#include <CD_EBCoarAve.H>
28#include <CD_EBReflux.H>
30#include <CD_EBHelmholtzOp.H>
31#include <CD_EBHelmholtzEBBCFactory.H>
32#include <CD_EBHelmholtzDomainBCFactory.H>
33#include <CD_NamespaceHeader.H>
34
41class EBHelmholtzOpFactory : public AMRLevelOpFactory<LevelData<EBCellFAB>>
42{
43public:
44 // Various alias for cutting down on typing.
47
58
65
70
72 using DomainBCFactory = RefCountedPtr<EBHelmholtzDomainBCFactory>; // Will be replaced with better BC class...
75
80
85
90
122 const Real& a_alpha,
123 const Real& a_beta,
124 const RealVect& a_probLo,
126 const AmrMask& a_validCells,
132 const AmrCellData& a_amrAcoef,
133 const AmrFluxData& a_amrBcoef,
137 const IntVect& a_ghostPhi,
138 const IntVect& a_ghostRHS,
139 const Smoother& a_smoother,
140 const Real& a_relaxFactor,
142 const int& a_mgBlockingFactor,
144
148 ~EBHelmholtzOpFactory() override;
149
153 void
155
159 void
161
165 void
167
177
185
192 int
194
200
205
210
215
220
225
230
235
240
245
250
251 // Things that pertain to AMR levels. The first entry corresponds to the coarsest AMR level.
256
261
266
271
276
281
286
291
296
301
306
311
316
321
326
331
336
341
346
351
355 void
357
364 static bool
366
373 static bool
375
384 bool
386
399 static void
408 int a_refRat);
409
416 int
418};
419
420#include <CD_NamespaceFooter.H>
421
422#endif
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:42
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:350
int m_mgBlockingFactor
Blocking factor for when we create intermediate and deep multigrid levels.
Definition CD_EBHelmholtzOpFactory.H:320
AmrIrreData m_amrBcoefIrreg
Helmholtz B-coefficient (on EB faces.
Definition CD_EBHelmholtzOpFactory.H:300
AmrCoarseners m_amrCoarseners
Data coarseners.
Definition CD_EBHelmholtzOpFactory.H:275
EBHelmholtzOp * MGnewOp(const ProblemDomain &a_fineDomain, int a_depth, bool a_homogeneousOnly=true) final
Create multigrid operator.
Definition CD_EBHelmholtzOpFactory.cpp:422
AmrResolutions m_amrResolutions
Resolutions one each level.
Definition CD_EBHelmholtzOpFactory.H:285
Vector< RefCountedPtr< LevelData< BaseFab< bool > > > > AmrMask
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:51
std::vector< bool > m_hasMgLevels
For checking if an AMR level has multigrid levels.
Definition CD_EBHelmholtzOpFactory.H:330
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:643
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:340
int findAmrLevel(const ProblemDomain &a_domain) const
Find level corresponding to amr level.
Definition CD_EBHelmholtzOpFactory.cpp:666
IntVect m_ghostRhs
Number of ghost cells that are used. Need because of Chombo prolongation objects.
Definition CD_EBHelmholtzOpFactory.H:229
EBBCFactory m_ebBcFactory
EB BC factory.
Definition CD_EBHelmholtzOpFactory.H:310
Vector< RefCountedPtr< EBCoarAve > > AmrCoarseners
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:57
Vector< RefCountedPtr< EBLevelGrid > > AmrLevelGrids
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:49
Vector< RefCountedPtr< EBMultigridInterpolator > > AmrInterpolators
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:53
EBHelmholtzOpFactory(const EBHelmholtzOpFactory &&a_otherFactory)=delete
Disallowed move constructor. Use the full constructor.
AmrFluxRegisters m_amrFluxRegisters
Flux registers.
Definition CD_EBHelmholtzOpFactory.H:270
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:199
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:335
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:325
static bool isCoarser(const ProblemDomain &a_domainOne, const ProblemDomain &B)
Check if a domain is coarser than the other.
Definition CD_EBHelmholtzOpFactory.cpp:337
EBHelmholtzOp * AMRnewOp(const ProblemDomain &a_domain) final
Create AMR operator for specified domain.
Definition CD_EBHelmholtzOpFactory.cpp:561
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:315
Smoother m_smoother
Smoother.
Definition CD_EBHelmholtzOpFactory.H:214
int m_numAmrLevels
Number of AMR levels.
Definition CD_EBHelmholtzOpFactory.H:219
Vector< RefCountedPtr< LevelData< BaseIVFAB< Real > > > > AmrIrreData
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:64
EBHelmholtzOpFactory(const EBHelmholtzOpFactory &a_otherFactory)=delete
Disallowed constructor. Use the full constructor.
Location::Cell m_dataLocation
Data location.
Definition CD_EBHelmholtzOpFactory.H:209
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:345
IntVect m_ghostPhi
Number of ghost cells that are used. Need because of Chombo prolongation objects.
Definition CD_EBHelmholtzOpFactory.H:224
RefCountedPtr< EBHelmholtzEBBCFactory > EBBCFactory
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:74
static constexpr int m_nComp
Number of components that we solve for.
Definition CD_EBHelmholtzOpFactory.H:204
AmrFluxData m_amrBcoef
Helmholtz B-coefficient.
Definition CD_EBHelmholtzOpFactory.H:295
Vector< RefCountedPtr< EBReflux > > AmrFluxRegisters
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:55
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:353
~EBHelmholtzOpFactory() override
Destructor. Does nothing.
Definition CD_EBHelmholtzOpFactory.cpp:88
Real m_relaxFactor
Relaxation factor.
Definition CD_EBHelmholtzOpFactory.H:244
AmrLevelGrids m_amrLevelGrids
AMR grids.
Definition CD_EBHelmholtzOpFactory.H:255
AmrMask m_validCells
Valid cells.
Definition CD_EBHelmholtzOpFactory.H:260
AmrCellData m_amrAcoef
Helmholtz A-coefficient.
Definition CD_EBHelmholtzOpFactory.H:290
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:296
void coarsenCoefficientsMG()
Go through all MG levels and coarsen the coefficients from the finer levels.
Definition CD_EBHelmholtzOpFactory.cpp:249
void defineMultigridLevels()
Function which defines the multigrid levels for this operator factory.
Definition CD_EBHelmholtzOpFactory.cpp:94
Real m_beta
Operator beta.
Definition CD_EBHelmholtzOpFactory.H:239
static bool isFiner(const ProblemDomain &a_domainOne, const ProblemDomain &B)
Check if a domain is finer than the other.
Definition CD_EBHelmholtzOpFactory.cpp:345
DomainBCFactory m_domainBcFactory
Domain BC factory.
Definition CD_EBHelmholtzOpFactory.H:305
Vector< RefCountedPtr< LevelData< EBCellFAB > > > AmrCellData
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:60
AmrRefRatios m_amrRefRatios
Refinement ratios.
Definition CD_EBHelmholtzOpFactory.H:280
RealVect m_probLo
Lower-left corner of computational domain.
Definition CD_EBHelmholtzOpFactory.H:249
Real m_alpha
Operator alpha.
Definition CD_EBHelmholtzOpFactory.H:234
Vector< RefCountedPtr< LevelData< EBFluxFAB > > > AmrFluxData
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:62
Vector< Real > AmrResolutions
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:67
RefCountedPtr< EBHelmholtzDomainBCFactory > DomainBCFactory
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:72
Vector< int > AmrRefRatios
alias type alias.
Definition CD_EBHelmholtzOpFactory.H:69
AmrInterpolators m_amrInterpolators
Ghost cell interpolations.
Definition CD_EBHelmholtzOpFactory.H:265
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
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:38
Namespace for encapsulating various data centerings.
Definition CD_Location.H:25
Cell
Enum for distinguishing between cell locations.
Definition CD_Location.H:31