chombo-discharge
Loading...
Searching...
No Matches
CD_MFHelmholtzOp.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_MFHELMHOLTZOP_H
14#define CD_MFHELMHOLTZOP_H
15
16// Std includes
17#include <map>
18#include <chrono>
19
20// Chombo includes
21#include <MFCellFAB.H>
22#include <MFFluxFAB.H>
23
24// Our includes
25#include <CD_Location.H>
27#include <CD_MFCoarAve.H>
28#include <CD_MFReflux.H>
29#include <CD_MFLevelGrid.H>
30#include <CD_MFBaseIVFAB.H>
32#include <CD_EBHelmholtzOp.H>
36#include <CD_NamespaceHeader.H>
37
43class MFHelmholtzOp : public LevelTGAHelmOp<LevelData<MFCellFAB>, MFFluxFAB>
44{
45public:
49 enum class Smoother
50 {
51 PointJacobi,
52 GauSaiRedBlack,
53 GauSaiMultiColor,
54 Chebyshev,
55 RestrictedAdditiveSchwarz,
56 };
57
61 MFHelmholtzOp() = delete;
62
66 MFHelmholtzOp(const MFHelmholtzOp& a_op) = delete;
67
71 MFHelmholtzOp(const MFHelmholtzOp&& a_op) = delete;
72
115 MFHelmholtzOp(const Location::Cell a_dataLocation,
116 const MFLevelGrid& a_mflgFine,
117 const MFLevelGrid& a_mflg,
118 const MFLevelGrid& a_mflgCoFi,
119 const MFLevelGrid& a_mflgCoar,
120 const MFLevelGrid& a_mflgCoarMG,
121 const MFMultigridInterpolator& a_interpolator,
122 const MFReflux& a_fluxReg,
123 const MFCoarAve& a_coarAve,
124 const RefCountedPtr<LevelData<BaseFab<bool>>>& a_validCells,
125 const RefCountedPtr<MFHelmholtzDomainBCFactory>& a_domainBC,
126 const RefCountedPtr<MFHelmholtzEBBCFactory>& a_ebBC,
127 const RefCountedPtr<MFHelmholtzJumpBCFactory>& a_jumpBcFactory,
128 const RealVect& a_probLo,
129 const Real& a_dx,
130 const int& a_refToFine,
131 const int& a_refToCoar,
132 const bool& a_hasFine,
133 const bool& a_hasCoar,
134 const bool& a_hasMGObjects,
135 const bool& a_isMGOperator,
136 const Real& a_alpha,
137 const Real& a_beta,
138 const RefCountedPtr<LevelData<MFCellFAB>>& a_Acoef,
139 const RefCountedPtr<LevelData<MFFluxFAB>>& a_Bcoef,
140 const RefCountedPtr<LevelData<MFBaseIVFAB>>& a_BcoefIrreg,
141 const IntVect& a_ghostPhi,
142 const IntVect& a_ghostRhs,
143 const int& a_jumpOrder,
144 const int& a_jumpWeight,
145 const int& a_preCondSmooth,
146 const Smoother& a_relaxType,
147 const Real& a_relaxFactor,
148 const int& a_chebyOrder,
149 const Real& a_chebyEigRatio,
150 const int& a_rasInnerSweeps,
151 const bool a_refluxFree = false);
152
156 virtual ~MFHelmholtzOp();
157
162 operator=(const MFHelmholtzOp& a_oper) = delete;
163
168 operator=(const MFHelmholtzOp&& a_oper) = delete;
169
176 void
177 setAcoAndBco(const RefCountedPtr<LevelData<MFCellFAB>>& a_Acoef,
178 const RefCountedPtr<LevelData<MFFluxFAB>>& a_Bcoef,
179 const RefCountedPtr<LevelData<MFBaseIVFAB>>& a_BcoefIrreg);
180
185 const RefCountedPtr<LevelData<MFCellFAB>>&
186 getAcoef();
187
192 const RefCountedPtr<LevelData<MFFluxFAB>>&
193 getBcoef();
194
199 const RefCountedPtr<LevelData<MFBaseIVFAB>>&
201
206 void
207 setJump(RefCountedPtr<LevelData<BaseIVFAB<Real>>>& a_jump);
208
214 RefCountedPtr<EBHelmholtzOp>&
215 getHelmOp(const int a_phase);
216
221 int
222 refToCoarser() override final;
223
229 void
230 setAlphaAndBeta(const Real& a_alpha, const Real& a_beta) override final;
231
236 void
237 divideByIdentityCoef(LevelData<MFCellFAB>& a_rhs) override final;
238
244 void
245 applyOpNoBoundary(LevelData<MFCellFAB>& a_ans, const LevelData<MFCellFAB>& a_phi) override final;
246
251 void
252 fillGrad(const LevelData<MFCellFAB>& a_phi) override final;
253
262 void
263 getFlux(MFFluxFAB& a_flux,
264 const LevelData<MFCellFAB>& a_data,
265 const Box& a_grid,
266 const DataIndex& a_dit,
267 Real a_scale) override final;
268
276 void
277 residual(LevelData<MFCellFAB>& a_residual,
278 const LevelData<MFCellFAB>& a_phi,
279 const LevelData<MFCellFAB>& a_rhs,
280 const bool a_homogeneousPhysBc) override final;
281
288 void
289 preCond(LevelData<MFCellFAB>& a_corr, const LevelData<MFCellFAB>& a_residual) override final;
290
298 void
299 applyOp(LevelData<MFCellFAB>& a_Lphi, const LevelData<MFCellFAB>& a_phi, bool a_homogeneousPhysBc) override final;
300
307 template <typename Duration = std::chrono::microseconds>
308 Vector<long long>
309 computeOperatorLoads(LevelData<MFCellFAB>& a_phi, const int a_numApply) noexcept;
310
317 void
318 relax(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_residual, int a_iterations) override final;
319
326 void
327 relaxPointJacobi(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_residual, const int a_iterations);
328
335 void
336 relaxGSRedBlack(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_residual, const int a_iterations);
337
344 void
345 relaxGSMultiColor(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_residual, const int a_iterations);
346
353 void
354 relaxChebyshev(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_residual, const int a_iterations);
355
365 void
366 relaxRestrictedAdditiveSchwarz(LevelData<MFCellFAB>& a_correction,
367 const LevelData<MFCellFAB>& a_residual,
368 const int a_iterations);
369
375 void
376 create(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs) override final;
377
384 void
385 createCoarser(LevelData<MFCellFAB>& a_coarse, const LevelData<MFCellFAB>& a_fine, bool a_ghosted) override final;
386
393 void
394 createCoarsened(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs, const int& a_refRat) override final;
395
402 void
403 incr(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs, Real a_scale) override final;
404
411 Real
412 dotProduct(const LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs) override final;
413
430 void
431 dotProductMaskedLocal(Real& a_sumKappaXY,
432 Real& a_sumVolume,
433 const LevelData<MFCellFAB>& a_lhs,
434 const LevelData<MFCellFAB>& a_rhs,
435 const LevelData<BaseFab<bool>>& a_mask,
436 const bool a_needVolume) const noexcept;
437
443 void
444 scale(LevelData<MFCellFAB>& a_lhs, const Real& a_scale) override final;
445
450 void
451 setToZero(LevelData<MFCellFAB>& a_lhs) override final;
452
458 void
459 assign(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs) override final;
460
469 void
470 assignCopier(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs, const Copier& a_copier) override final;
471
477 void
478 assignLocal(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs) override final;
479
486 void
487 buildCopier(Copier& a_copier, const LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs) override;
488
495 Real
496 norm(const LevelData<MFCellFAB>& a_lhs, int a_order) override final;
497
506 void
507 axby(LevelData<MFCellFAB>& a_lhs,
508 const LevelData<MFCellFAB>& a_x,
509 const LevelData<MFCellFAB>& a_y,
510 const Real a_a,
511 const Real a_b) override final;
512
519 void
520 restrictResidual(LevelData<MFCellFAB>& a_resCoar,
521 LevelData<MFCellFAB>& a_phi,
522 const LevelData<MFCellFAB>& a_rhs) override final;
523
529 void
530 prolongIncrement(LevelData<MFCellFAB>& a_phi, const LevelData<MFCellFAB>& a_correctCoarse) override final;
531
538 void
539 AMRUpdateResidual(LevelData<MFCellFAB>& a_residual,
540 const LevelData<MFCellFAB>& a_correction,
541 const LevelData<MFCellFAB>& a_coarseCorrection) override final;
542
551 void
552 AMRRestrict(LevelData<MFCellFAB>& a_residualCoarse,
553 const LevelData<MFCellFAB>& a_residual,
554 const LevelData<MFCellFAB>& a_correction,
555 const LevelData<MFCellFAB>& a_coarseCorrection,
556 bool a_skip_res) override final;
557
563 void
564 AMRProlong(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_coarseCorrection) override final;
565
576 void
577 AMRResidual(LevelData<MFCellFAB>& a_residual,
578 const LevelData<MFCellFAB>& a_phiFine,
579 const LevelData<MFCellFAB>& a_phi,
580 const LevelData<MFCellFAB>& a_phiCoar,
581 const LevelData<MFCellFAB>& a_rhs,
582 bool a_homogeneousPhysBC,
583 AMRLevelOp<LevelData<MFCellFAB>>* a_finerOp) override final;
584
593 void
594 AMRResidualNF(LevelData<MFCellFAB>& a_residual,
595 const LevelData<MFCellFAB>& a_phi,
596 const LevelData<MFCellFAB>& a_phiCoar,
597 const LevelData<MFCellFAB>& a_rhs,
598 bool a_homogeneousPhysBC) override final;
599
609 void
610 AMRResidualNC(LevelData<MFCellFAB>& a_residual,
611 const LevelData<MFCellFAB>& a_phiFine,
612 const LevelData<MFCellFAB>& a_phi,
613 const LevelData<MFCellFAB>& a_rhs,
614 bool a_homogeneousPhysBC,
615 AMRLevelOp<LevelData<MFCellFAB>>* a_finerOp) override final;
616
625 void
626 AMROperatorNF(LevelData<MFCellFAB>& a_Lphi,
627 const LevelData<MFCellFAB>& a_phi,
628 const LevelData<MFCellFAB>& a_phiCoar,
629 bool a_homogeneousPhysBC) override final;
630
640 void
641 AMROperatorNC(LevelData<MFCellFAB>& a_Lphi,
642 const LevelData<MFCellFAB>& a_phiFine,
643 const LevelData<MFCellFAB>& a_phi,
644 bool a_homogeneousPhysBC,
645 AMRLevelOp<LevelData<MFCellFAB>>* a_finerOp) override final;
646
647protected:
651 static constexpr int m_comp = 0;
652
656 static constexpr int m_nComp = 1;
657
662
667
671 Vector<IntVect> m_colors;
672
677 std::map<int, RefCountedPtr<EBHelmholtzOp>> m_helmOps;
678
683
687 RefCountedPtr<LevelData<BaseIVFAB<Real>>> m_jump;
688
692 RefCountedPtr<LevelData<BaseFab<bool>>> m_validCells;
693
697 std::map<int, RefCountedPtr<LevelData<BaseIVFAB<Real>>>> m_dirichletBcValues;
698
703
708
713
718
723
728
733
737 RefCountedPtr<LevelData<MFCellFAB>> m_Acoef;
738
742 RefCountedPtr<LevelData<MFFluxFAB>> m_Bcoef;
743
747 RefCountedPtr<LevelData<MFBaseIVFAB>> m_BcoefIrreg;
748
753
758
763
768
773
778
782 IntVect m_ghostPhi;
783
787 IntVect m_ghostRhs;
788
793
798
803
809 void
810 updateJumpBC(const LevelData<MFCellFAB>& a_phi, const bool a_homogeneousPhysBC);
811
816 void
817 exchangeGhost(const LevelData<MFCellFAB>& a_phi) const;
818
826 void
827 interpolateCF(const LevelData<MFCellFAB>& a_phi, const LevelData<MFCellFAB>* a_phiCoar, const bool a_homogeneousCF);
828
838 void
839 applyOp(LevelData<MFCellFAB>& a_Lphi,
840 const LevelData<MFCellFAB>& a_phi,
841 const LevelData<MFCellFAB>* const a_phiCoar,
842 const bool a_homogeneousPhysBC,
843 const bool a_homogeneousCFBC);
844
855 void
856 AMROperator(LevelData<MFCellFAB>& a_Lphi,
857 const LevelData<MFCellFAB>& a_phiFine,
858 const LevelData<MFCellFAB>& a_phi,
859 const LevelData<MFCellFAB>& a_phiCoar,
860 const bool a_homogeneousPhysBC,
861 AMRLevelOp<LevelData<MFCellFAB>>* a_finerOp) override;
862};
863
864#include <CD_NamespaceFooter.H>
865
867
868#endif
Declaration of Helmholtz multigrid operators.
Declaration of cell positions.
Declaration of a multiphase BaseIVFAB<Real>
Wrapper class for holding multifluid EBCoarAves.
Declaration of a factory class for making boundary condition objects for MFHelmholtzOp.
Declaration of an EB boundary condition factory class for MFHelmholtzOp.
Declaration of a factory class for making MFHelmholtzJumpBC objects for use in a multifluid MFHelmhol...
Declaration of class for computing "jump interface" boundary conditions for multifluid Helmholtz code...
Implementation of CD_MFHelmholtzOp.H.
Declaration of a wrapper for wrapping multifluid EBLevelGrids.
Declaration of a wrapper class for holding multifluid EBMultigridInterpolators.
Declaration of a class for refluxing in a multiphase context.
Helmholtz operator for equations like alpha*a(x)*phi(x) + beta*div(b(x)*grad(phi(x))) = rho.
Definition CD_EBHelmholtzOp.H:42
Multiphase BaseIVFAB<Real>.
Definition CD_MFBaseIVFAB.H:30
Class for coarsening data in a multifluid context.
Definition CD_MFCoarAve.H:27
Class for computing "jump interface" boundary conditions for multifluid code.
Definition CD_MFHelmholtzJumpBC.H:45
Operator for solving multifluid Helmholtz on a grid level.
Definition CD_MFHelmholtzOp.H:44
void AMROperator(LevelData< MFCellFAB > &a_Lphi, const LevelData< MFCellFAB > &a_phiFine, const LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > &a_phiCoar, const bool a_homogeneousPhysBC, AMRLevelOp< LevelData< MFCellFAB > > *a_finerOp) override
Apply the AMR operator, i.e. compute L(phi) in an AMR context.
Definition CD_MFHelmholtzOp.cpp:1439
void fillGrad(const LevelData< MFCellFAB > &a_phi) override final
Not called, I think.
Definition CD_MFHelmholtzOp.cpp:347
RefCountedPtr< MFHelmholtzJumpBC > m_jumpBC
BC jump object. This is the one that has the stencils and can compute derivatives.
Definition CD_MFHelmholtzOp.H:682
MFHelmholtzOp()=delete
Constructor. Must subsequently call define(...)
Copier m_exchangeCopier
Copier for exchange operation.
Definition CD_MFHelmholtzOp.H:752
void prolongIncrement(LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > &a_correctCoarse) override final
Prolongation method.
Definition CD_MFHelmholtzOp.cpp:1196
void scale(LevelData< MFCellFAB > &a_lhs, const Real &a_scale) override final
Scale function.
Definition CD_MFHelmholtzOp.cpp:379
MFHelmholtzOp(const MFHelmholtzOp &a_op)=delete
No copy construction allowed.
void incr(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs, Real a_scale) override final
Increment function.
Definition CD_MFHelmholtzOp.cpp:371
const RefCountedPtr< LevelData< MFFluxFAB > > & getBcoef()
Get the Helmholtz B-coefficient on faces.
Definition CD_MFHelmholtzOp.cpp:279
void applyOpNoBoundary(LevelData< MFCellFAB > &a_ans, const LevelData< MFCellFAB > &a_phi) override final
Apply operator but turn off all BCs.
Definition CD_MFHelmholtzOp.cpp:331
MFLevelGrid m_mflg
Level grid.
Definition CD_MFHelmholtzOp.H:702
void preCond(LevelData< MFCellFAB > &a_corr, const LevelData< MFCellFAB > &a_residual) override final
Precondition system before bottom solve.
Definition CD_MFHelmholtzOp.cpp:633
void relaxRestrictedAdditiveSchwarz(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_residual, const int a_iterations)
Restricted additive Schwarz smoother (block smoother).
Definition CD_MFHelmholtzOp.cpp:971
MFLevelGrid m_mflgCoar
Coarse grid.
Definition CD_MFHelmholtzOp.H:712
void getFlux(MFFluxFAB &a_flux, const LevelData< MFCellFAB > &a_data, const Box &a_grid, const DataIndex &a_dit, Real a_scale) override final
Fill flux.
Definition CD_MFHelmholtzOp.cpp:361
static constexpr int m_nComp
Number of components that we solve for.
Definition CD_MFHelmholtzOp.H:656
void createCoarser(LevelData< MFCellFAB > &a_coarse, const LevelData< MFCellFAB > &a_fine, bool a_ghosted) override final
Create coarsened data.
Definition CD_MFHelmholtzOp.cpp:601
RefCountedPtr< LevelData< BaseFab< bool > > > m_validCells
Valid grid cells (will be nullpointer on MG levels)
Definition CD_MFHelmholtzOp.H:692
void AMRResidual(LevelData< MFCellFAB > &a_residual, const LevelData< MFCellFAB > &a_phiFine, const LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > &a_phiCoar, const LevelData< MFCellFAB > &a_rhs, bool a_homogeneousPhysBC, AMRLevelOp< LevelData< MFCellFAB > > *a_finerOp) override final
Compute residual on this level. AMR version.
Definition CD_MFHelmholtzOp.cpp:1305
void AMRProlong(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_coarseCorrection) override final
Prolongation onto AMR level.
Definition CD_MFHelmholtzOp.cpp:1289
void relax(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_residual, int a_iterations) override final
Relaxation method. This does smoothing for the system L(correction) = residual.
Definition CD_MFHelmholtzOp.cpp:819
MFCoarAve m_coarAve
Coarsener.
Definition CD_MFHelmholtzOp.H:732
void assign(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs) override final
Assignment function.
Definition CD_MFHelmholtzOp.cpp:395
int m_numPhases
Number of phases.
Definition CD_MFHelmholtzOp.H:772
void applyOp(LevelData< MFCellFAB > &a_Lphi, const LevelData< MFCellFAB > &a_phi, bool a_homogeneousPhysBc) override final
Apply operator.
Definition CD_MFHelmholtzOp.cpp:654
int m_numSmoothPreCond
Number of smoothings in the preconditioner.
Definition CD_MFHelmholtzOp.H:767
bool m_hasFine
True if there is a finer AMR level.
Definition CD_MFHelmholtzOp.H:797
const RefCountedPtr< LevelData< MFBaseIVFAB > > & getBcoefIrreg()
Get the Helmholtz B-coefficient on the EB.
Definition CD_MFHelmholtzOp.cpp:285
RefCountedPtr< LevelData< MFFluxFAB > > m_Bcoef
Helmholtz B-coefficient.
Definition CD_MFHelmholtzOp.H:742
void restrictResidual(LevelData< MFCellFAB > &a_resCoar, LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > &a_rhs) override final
Restrict residual onto coarse level.
Definition CD_MFHelmholtzOp.cpp:1167
IntVect m_ghostPhi
Number of ghost cells.
Definition CD_MFHelmholtzOp.H:782
std::map< int, RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_dirichletBcValues
Dirichlet BC values for each phase.
Definition CD_MFHelmholtzOp.H:697
Location::Cell m_dataLocation
Interpretation of data. Either on cell center or on cell centroid.
Definition CD_MFHelmholtzOp.H:661
void divideByIdentityCoef(LevelData< MFCellFAB > &a_rhs) override final
Divide by the a-coefficient.
Definition CD_MFHelmholtzOp.cpp:317
void AMROperatorNF(LevelData< MFCellFAB > &a_Lphi, const LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > &a_phiCoar, bool a_homogeneousPhysBC) override final
Apply the AMR operator, i.e. compute L(phi) in an AMR context, assuming no finer levels.
Definition CD_MFHelmholtzOp.cpp:1355
virtual ~MFHelmholtzOp()
Destructor.
Definition CD_MFHelmholtzOp.cpp:238
void AMRUpdateResidual(LevelData< MFCellFAB > &a_residual, const LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_coarseCorrection) override final
Update AMR residual.
Definition CD_MFHelmholtzOp.cpp:1212
void axby(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_x, const LevelData< MFCellFAB > &a_y, const Real a_a, const Real a_b) override final
Set a_lhs = a*x + b*y.
Definition CD_MFHelmholtzOp.cpp:775
void residual(LevelData< MFCellFAB > &a_residual, const LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > &a_rhs, const bool a_homogeneousPhysBc) override final
Compute residual on this level.
Definition CD_MFHelmholtzOp.cpp:761
void relaxGSMultiColor(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_residual, const int a_iterations)
Multi-colored gauss-seidel relaxation.
Definition CD_MFHelmholtzOp.cpp:1033
static constexpr int m_comp
Component that we solve for.
Definition CD_MFHelmholtzOp.H:651
bool m_multifluid
Multifluid operator or not.
Definition CD_MFHelmholtzOp.H:757
void AMRRestrict(LevelData< MFCellFAB > &a_residualCoarse, const LevelData< MFCellFAB > &a_residual, const LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_coarseCorrection, bool a_skip_res) override final
Restrict residual.
Definition CD_MFHelmholtzOp.cpp:1249
bool m_hasMGObjects
Has MG objects or not.
Definition CD_MFHelmholtzOp.H:762
void AMROperatorNC(LevelData< MFCellFAB > &a_Lphi, const LevelData< MFCellFAB > &a_phiFine, const LevelData< MFCellFAB > &a_phi, bool a_homogeneousPhysBC, AMRLevelOp< LevelData< MFCellFAB > > *a_finerOp) override final
Apply the AMR operator, i.e. compute L(phi) in an AMR context, assuming no coarser AMR levels.
Definition CD_MFHelmholtzOp.cpp:1389
void AMRResidualNC(LevelData< MFCellFAB > &a_residual, const LevelData< MFCellFAB > &a_phiFine, const LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > &a_rhs, bool a_homogeneousPhysBC, AMRLevelOp< LevelData< MFCellFAB > > *a_finerOp) override final
Compute AMR residual on coarsest.
Definition CD_MFHelmholtzOp.cpp:1339
Vector< IntVect > m_colors
"Colors" for the multi-coloered relaxation method
Definition CD_MFHelmholtzOp.H:671
void relaxPointJacobi(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_residual, const int a_iterations)
Jacobi relaxation.
Definition CD_MFHelmholtzOp.cpp:860
void setAcoAndBco(const RefCountedPtr< LevelData< MFCellFAB > > &a_Acoef, const RefCountedPtr< LevelData< MFFluxFAB > > &a_Bcoef, const RefCountedPtr< LevelData< MFBaseIVFAB > > &a_BcoefIrreg)
Update operators with new coefficients.
Definition CD_MFHelmholtzOp.cpp:246
void interpolateCF(const LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > *a_phiCoar, const bool a_homogeneousCF)
Do coarse-fine interpolation.
Definition CD_MFHelmholtzOp.cpp:707
IntVect m_ghostRhs
Number of ghost cells.
Definition CD_MFHelmholtzOp.H:787
void relaxChebyshev(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_residual, const int a_iterations)
Chebyshev polynomial smoother.
Definition CD_MFHelmholtzOp.cpp:1093
MFHelmholtzOp & operator=(const MFHelmholtzOp &&a_oper)=delete
No move assignment allowed.
bool m_hasMGObjcts
True if there are multigrid levels.
Definition CD_MFHelmholtzOp.H:802
void AMRResidualNF(LevelData< MFCellFAB > &a_residual, const LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > &a_phiCoar, const LevelData< MFCellFAB > &a_rhs, bool a_homogeneousPhysBC) override final
Compute AMR residual on finest AMR level.
Definition CD_MFHelmholtzOp.cpp:1323
void relaxGSRedBlack(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_residual, const int a_iterations)
Jacobi relaxation.
Definition CD_MFHelmholtzOp.cpp:914
Real dotProduct(const LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs) override final
Dot product.
Definition CD_MFHelmholtzOp.cpp:446
RefCountedPtr< LevelData< BaseIVFAB< Real > > > m_jump
Actual BC jump in data-based format. This is the right-hand side of dphi/dn1 + dphi/dn2 = jump.
Definition CD_MFHelmholtzOp.H:687
void setToZero(LevelData< MFCellFAB > &a_lhs) override final
Set to zero.
Definition CD_MFHelmholtzOp.cpp:387
void createCoarsened(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs, const int &a_refRat) override final
Create coarsening of data holder.
Definition CD_MFHelmholtzOp.cpp:617
std::map< int, RefCountedPtr< EBHelmholtzOp > > m_helmOps
Helmholtz operators on each phase. Note that I'm using int rather than Phase as identifier because th...
Definition CD_MFHelmholtzOp.H:677
Smoother m_smoother
Relaxation method.
Definition CD_MFHelmholtzOp.H:666
RefCountedPtr< EBHelmholtzOp > & getHelmOp(const int a_phase)
Get Helmholtz operator.
void updateJumpBC(const LevelData< MFCellFAB > &a_phi, const bool a_homogeneousPhysBC)
Update the jump condition.
Definition CD_MFHelmholtzOp.cpp:797
Vector< long long > computeOperatorLoads(LevelData< MFCellFAB > &a_phi, const int a_numApply) noexcept
Time the applyOp routine. Template parameter is std::chrono duration. E.g. std::chrono::microseconds.
Definition CD_MFHelmholtzOpImplem.H:20
MFLevelGrid m_mflgCoFi
Coarsened version of this grid.
Definition CD_MFHelmholtzOp.H:717
MFHelmholtzOp(const MFHelmholtzOp &&a_op)=delete
No move construction allowed.
bool m_hasCoar
True if there is a coarser AMR level.
Definition CD_MFHelmholtzOp.H:792
void assignCopier(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs, const Copier &a_copier) override final
Assign lhs.
Definition CD_MFHelmholtzOp.cpp:403
int refToCoarser() override final
Return coarsening factor to coarser level (1 if there is no coarser level);.
Definition CD_MFHelmholtzOp.cpp:299
MFLevelGrid m_mflgFine
Fine level grid.
Definition CD_MFHelmholtzOp.H:707
Real norm(const LevelData< MFCellFAB > &a_lhs, int a_order) override final
Compute solution norm.
Definition CD_MFHelmholtzOp.cpp:427
void setAlphaAndBeta(const Real &a_alpha, const Real &a_beta) override final
Set alpha and beta.
Definition CD_MFHelmholtzOp.cpp:307
RefCountedPtr< LevelData< MFBaseIVFAB > > m_BcoefIrreg
Helmholtz B-coefficient on EB.
Definition CD_MFHelmholtzOp.H:747
int m_refToCoar
Refinement factor to coarser AMR level.
Definition CD_MFHelmholtzOp.H:777
const RefCountedPtr< LevelData< MFCellFAB > > & getAcoef()
Get the Helmholtz A-coefficient on cell centers.
Definition CD_MFHelmholtzOp.cpp:273
RefCountedPtr< LevelData< MFCellFAB > > m_Acoef
Helmholtz A-coefficient.
Definition CD_MFHelmholtzOp.H:737
void setJump(RefCountedPtr< LevelData< BaseIVFAB< Real > > > &a_jump)
Set the jump boundary condition.
Definition CD_MFHelmholtzOp.cpp:291
MFMultigridInterpolator m_interpolator
Multi grid interpolator.
Definition CD_MFHelmholtzOp.H:727
void dotProductMaskedLocal(Real &a_sumKappaXY, Real &a_sumVolume, const LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs, const LevelData< BaseFab< bool > > &a_mask, const bool a_needVolume) const noexcept
Rank-local (un-reduced) partials for the masked AMR-composite Krylov inner product (summed over phase...
Definition CD_MFHelmholtzOp.cpp:510
MFHelmholtzOp & operator=(const MFHelmholtzOp &a_oper)=delete
No copy assignment allowed.
MFLevelGrid m_mflgCoarMG
Coarse multigrid-grid.
Definition CD_MFHelmholtzOp.H:722
void assignLocal(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs) override final
Local assignment function.
Definition CD_MFHelmholtzOp.cpp:411
void buildCopier(Copier &a_copier, const LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs) override
Build copier.
Definition CD_MFHelmholtzOp.cpp:419
Smoother
Relaxation methods for this operator.
Definition CD_MFHelmholtzOp.H:50
void create(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs) override final
Create method.
Definition CD_MFHelmholtzOp.cpp:585
void exchangeGhost(const LevelData< MFCellFAB > &a_phi) const
Perform an exchange operation, event if the data is const.
Definition CD_MFHelmholtzOp.cpp:805
Wrapper class for holding multifluid EBLevelGrids.
Definition CD_MFLevelGrid.H:30
Wrapper class for holding multifluid EBMultigridInterpolators.
Definition CD_MFMultigridInterpolator.H:27
Class which wraps EBRefluxs in multiphase.
Definition CD_MFReflux.H:27
Namespace for encapsulating various data centerings.
Definition CD_Location.H:25
Cell
Enum for distinguishing between cell locations.
Definition CD_Location.H:31