chombo-discharge
Loading...
Searching...
No Matches
CD_EBHelmholtzOpFactory.H
Go to the documentation of this file.
1/* chombo-discharge
2 * Copyright © 2021 SINTEF Energy Research.
3 * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4 */
5
12#ifndef CD_EBHelmholtzOpFactory_H
13#define CD_EBHelmholtzOpFactory_H
14
15// Chombo includes
16#include <RealVect.H>
17#include <EBLevelGrid.H>
18#include <EBCellFAB.H>
19#include <EBFluxFAB.H>
20#include <BaseIVFAB.H>
21#include <ConductivityBaseDomainBC.H>
22#include <BaseEBBC.H>
23
24// Our includes
25#include <CD_Location.H>
26#include <CD_EBCoarAve.H>
27#include <CD_EBReflux.H>
29#include <CD_EBHelmholtzOp.H>
30#include <CD_EBHelmholtzEBBCFactory.H>
31#include <CD_EBHelmholtzDomainBCFactory.H>
32#include <CD_NamespaceHeader.H>
33
40class EBHelmholtzOpFactory : public AMRLevelOpFactory<LevelData<EBCellFAB>>
41{
42public:
43 // Various alias for cutting down on typing.
45
46 using AmrLevelGrids = Vector<RefCountedPtr<EBLevelGrid>>;
48 using AmrInterpolators = Vector<RefCountedPtr<EBMultigridInterpolator>>;
49 using AmrFluxRegisters = Vector<RefCountedPtr<EBReflux>>;
50 using AmrCoarseners = Vector<RefCountedPtr<EBCoarAve>>;
51
55
56 using AmrResolutions = Vector<Real>;
57 using AmrRefRatios = Vector<int>;
58
59 using DomainBCFactory = RefCountedPtr<EBHelmholtzDomainBCFactory>; // Will be replaced with better BC class...
60 using EBBCFactory = RefCountedPtr<EBHelmholtzEBBCFactory>;
61
66
71
76
104 const Real& a_alpha,
105 const Real& a_beta,
106 const RealVect& a_probLo,
107 const AmrLevelGrids& a_amrLevelGrids,
108 const AmrMask& a_validCells,
109 const AmrInterpolators& a_amrInterpolators,
110 const AmrFluxRegisters& a_amrFluxRegisters,
111 const AmrCoarseners& a_amrCoarseners,
112 const AmrRefRatios& a_amrRefRatios,
113 const AmrResolutions& a_amrResolutions,
114 const AmrCellData& a_amrAcoef,
115 const AmrFluxData& a_amrBcoef,
116 const AmrIrreData& a_amrBcoefIrreg,
117 const DomainBCFactory& a_domainBcFactory,
118 const EBBCFactory& a_ebbcFactory,
119 const IntVect& a_ghostPhi,
120 const IntVect& a_ghostRHS,
122 const Real& a_relaxFactor,
124 const int& a_mgBlockingFactor,
125 const AmrLevelGrids& a_deeperLevelGrids = AmrLevelGrids());
126
130 virtual ~EBHelmholtzOpFactory();
131
135 void
137
141 void
143
147 void
149
158
165
170 int
172
178
183
188
193
198
203
208
213
218
223
228
229 // Things that pertain to AMR levels. The first entry corresponds to the coarsest AMR level.
233 AmrLevelGrids m_amrLevelGrids;
234
239
243 AmrInterpolators m_amrInterpolators;
244
248 AmrFluxRegisters m_amrFluxRegisters;
249
253 AmrCoarseners m_amrCoarseners;
254
258 AmrRefRatios m_amrRefRatios;
259
263 AmrResolutions m_amrResolutions;
264
268 AmrCellData m_amrAcoef;
269
273 AmrFluxData m_amrBcoef;
274
278 AmrIrreData m_amrBcoefIrreg;
279
283 DomainBCFactory m_domainBcFactory;
284
288 EBBCFactory m_ebBcFactory;
289
294
299
303 AmrLevelGrids m_deeperLevelGrids;
304
309
313 Vector<AmrLevelGrids> m_mgLevelGrids;
314
318 Vector<AmrCellData> m_mgAcoef;
319
323 Vector<AmrFluxData> m_mgBcoef;
324
328 Vector<AmrIrreData> m_mgBcoefIrreg;
329
333 void
335
342 bool
344
351 bool
353
362 bool
365 const int a_refRat,
367
380 void
389 const int a_refRat);
390
397 int
399};
400
401#include <CD_NamespaceFooter.H>
402
403#endif
Declaration of conservative coarsening utility.
Declaration of Helmholtz multigrid operators.
Declaration of a class that can interpolate more ghost cells near the coarse-fine boundary near the E...
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:41
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:328
int m_mgBlockingFactor
Blocking factor for when we create intermediate and deep multigrid levels.
Definition CD_EBHelmholtzOpFactory.H:298
AmrIrreData m_amrBcoefIrreg
Helmholtz B-coefficient (on EB faces.
Definition CD_EBHelmholtzOpFactory.H:278
AmrCoarseners m_amrCoarseners
Data coarseners.
Definition CD_EBHelmholtzOpFactory.H:253
AmrResolutions m_amrResolutions
Resolutions one each level.
Definition CD_EBHelmholtzOpFactory.H:263
bool isFiner(const ProblemDomain &a_domainOne, const ProblemDomain &a_domainTwo) const
Check if a domain is finer than the other.
Definition CD_EBHelmholtzOpFactory.cpp:345
std::vector< bool > m_hasMgLevels
For checking if an AMR level has multigrid levels.
Definition CD_EBHelmholtzOpFactory.H:308
EBHelmholtzOpFactory()=delete
Disallowed constructor. Use the full constructor.
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:318
int findAmrLevel(const ProblemDomain &a_domain) const
Find level corresponding to amr level.
Definition CD_EBHelmholtzOpFactory.cpp:664
bool getCoarserLayout(EBLevelGrid &a_coarseGrid, const EBLevelGrid &a_fineGrid, const int a_refRat, const int a_blockingFactor) const
Construct coarsening of a grid level.
Definition CD_EBHelmholtzOpFactory.cpp:353
IntVect m_ghostRhs
Number of ghost cells that are used. Need because of Chombo prolongation objects.
Definition CD_EBHelmholtzOpFactory.H:207
EBBCFactory m_ebBcFactory
EB BC factory.
Definition CD_EBHelmholtzOpFactory.H:288
EBHelmholtzOpFactory(const EBHelmholtzOpFactory &&a_otherFactory)=delete
Disallowed move constructor. Use the full constructor.
AmrFluxRegisters m_amrFluxRegisters
Flux registers.
Definition CD_EBHelmholtzOpFactory.H:248
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:177
int refToFiner(const ProblemDomain &a_indexspace) const override final
Get refinement ratio to next finest level.
Definition CD_EBHelmholtzOpFactory.cpp:641
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:313
virtual ~EBHelmholtzOpFactory()
Destructor. Does nothing.
Definition CD_EBHelmholtzOpFactory.cpp:93
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:303
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:293
Smoother m_smoother
Smoother.
Definition CD_EBHelmholtzOpFactory.H:192
int m_numAmrLevels
Number of AMR levels.
Definition CD_EBHelmholtzOpFactory.H:197
EBHelmholtzOpFactory(const EBHelmholtzOpFactory &a_otherFactory)=delete
Disallowed constructor. Use the full constructor.
Location::Cell m_dataLocation
Data location.
Definition CD_EBHelmholtzOpFactory.H:187
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:323
IntVect m_ghostPhi
Number of ghost cells that are used. Need because of Chombo prolongation objects.
Definition CD_EBHelmholtzOpFactory.H:202
EBHelmholtzOp * AMRnewOp(const ProblemDomain &a_domain) override final
Create AMR operator for specified domain.
Definition CD_EBHelmholtzOpFactory.cpp:559
static constexpr int m_nComp
Number of components that we solve for.
Definition CD_EBHelmholtzOpFactory.H:182
AmrFluxData m_amrBcoef
Helmholtz B-coefficient.
Definition CD_EBHelmholtzOpFactory.H:273
Real m_relaxFactor
Relaxation factor.
Definition CD_EBHelmholtzOpFactory.H:222
AmrLevelGrids m_amrLevelGrids
AMR grids.
Definition CD_EBHelmholtzOpFactory.H:233
bool isCoarser(const ProblemDomain &a_domainOne, const ProblemDomain &a_domainTwo) const
Check if a domain is coarser than the other.
Definition CD_EBHelmholtzOpFactory.cpp:337
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, const int a_refRat)
Coarsen coefficients (conservatively)
Definition CD_EBHelmholtzOpFactory.cpp:296
AmrMask m_validCells
Valid cells.
Definition CD_EBHelmholtzOpFactory.H:238
AmrCellData m_amrAcoef
Helmholtz A-coefficient.
Definition CD_EBHelmholtzOpFactory.H:268
void coarsenCoefficientsMG()
Go through all MG levels and coarsen the coefficients from the finer levels.
Definition CD_EBHelmholtzOpFactory.cpp:253
EBHelmholtzOp * MGnewOp(const ProblemDomain &a_fineDomain, int a_depth, bool a_homogeneousOnly=true) override final
Create multigrid operator.
Definition CD_EBHelmholtzOpFactory.cpp:422
void defineMultigridLevels()
Function which defines the multigrid levels for this operator factory.
Definition CD_EBHelmholtzOpFactory.cpp:99
Real m_beta
Operator beta.
Definition CD_EBHelmholtzOpFactory.H:217
DomainBCFactory m_domainBcFactory
Domain BC factory.
Definition CD_EBHelmholtzOpFactory.H:283
AmrRefRatios m_amrRefRatios
Refinement ratios.
Definition CD_EBHelmholtzOpFactory.H:258
RealVect m_probLo
Lower-left corner of computational domain.
Definition CD_EBHelmholtzOpFactory.H:227
Real m_alpha
Operator alpha.
Definition CD_EBHelmholtzOpFactory.H:212
AmrInterpolators m_amrInterpolators
Ghost cell interpolations.
Definition CD_EBHelmholtzOpFactory.H:243
Helmholtz operator for equations like alpha*a(x)*phi(x) + beta*div(b(x)*grad(phi(x))) = rho.
Definition CD_EBHelmholtzOp.H:41
Smoother
Relaxation method for the operators.
Definition CD_EBHelmholtzOp.H:47
Base class for a tracer particle solver. This solver can advance particles in a pre-defined velocity ...
Definition CD_TracerParticleSolver.H:37
Namespace for encapsulating various data centerings.
Definition CD_Location.H:24
Cell
Enum for distinguishing between cell locations.
Definition CD_Location.H:30