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
12
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
116 MFHelmholtzOp(const Location::Cell a_dataLocation,
117 const MFLevelGrid& a_mflgFine,
118 const MFLevelGrid& a_mflg,
119 const MFLevelGrid& a_mflgCoFi,
120 const MFLevelGrid& a_mflgCoar,
121 const MFLevelGrid& a_mflgCoFiMG,
122 const MFLevelGrid& a_mflgCoarMG,
123 const MFMultigridInterpolator& a_interpolator,
124 const MFReflux& a_fluxReg,
125 const MFCoarAve& a_coarAve,
126 const RefCountedPtr<LevelData<BaseFab<bool>>>& a_validCells,
127 const RefCountedPtr<MFHelmholtzDomainBCFactory>& a_domainBC,
128 const RefCountedPtr<MFHelmholtzEBBCFactory>& a_ebBC,
129 const RefCountedPtr<MFHelmholtzJumpBCFactory>& a_jumpBcFactory,
130 const RealVect& a_probLo,
131 const Real& a_dx,
132 const int& a_refToFine,
133 const int& a_refToCoar,
134 const bool& a_hasFine,
135 const bool& a_hasCoar,
136 const bool& a_hasMGObjects,
137 const bool& a_isMGOperator,
138 const Real& a_alpha,
139 const Real& a_beta,
140 const RefCountedPtr<LevelData<MFCellFAB>>& a_Acoef,
141 const RefCountedPtr<LevelData<MFFluxFAB>>& a_Bcoef,
142 const RefCountedPtr<LevelData<MFBaseIVFAB>>& a_BcoefIrreg,
143 const IntVect& a_ghostPhi,
144 const IntVect& a_ghostRhs,
145 const int& a_jumpOrder,
146 const int& a_jumpWeight,
147 const int& a_preCondSmooth,
148 const Smoother& a_relaxType,
149 const Real& a_relaxFactor,
150 const int& a_chebyOrder,
151 const Real& a_chebyEigRatio,
152 const int& a_rasInnerSweeps,
153 const bool a_refluxFree = false);
154
158 virtual ~MFHelmholtzOp();
159
164 operator=(const MFHelmholtzOp& a_oper) = delete;
165
170 operator=(const MFHelmholtzOp&& a_oper) = delete;
171
178 void
179 setAcoAndBco(const RefCountedPtr<LevelData<MFCellFAB>>& a_Acoef,
180 const RefCountedPtr<LevelData<MFFluxFAB>>& a_Bcoef,
181 const RefCountedPtr<LevelData<MFBaseIVFAB>>& a_BcoefIrreg);
182
187 const RefCountedPtr<LevelData<MFCellFAB>>&
188 getAcoef();
189
194 const RefCountedPtr<LevelData<MFFluxFAB>>&
195 getBcoef();
196
201 const RefCountedPtr<LevelData<MFBaseIVFAB>>&
203
208 void
209 setJump(RefCountedPtr<LevelData<BaseIVFAB<Real>>>& a_jump);
210
216 RefCountedPtr<EBHelmholtzOp>&
217 getHelmOp(const int a_phase);
218
223 int
224 refToCoarser() override final;
225
231 void
232 setAlphaAndBeta(const Real& a_alpha, const Real& a_beta) override final;
233
238 void
239 divideByIdentityCoef(LevelData<MFCellFAB>& a_rhs) override final;
240
246 void
247 applyOpNoBoundary(LevelData<MFCellFAB>& a_ans, const LevelData<MFCellFAB>& a_phi) override final;
248
253 void
254 fillGrad(const LevelData<MFCellFAB>& a_phi) override final;
255
264 void
265 getFlux(MFFluxFAB& a_flux,
266 const LevelData<MFCellFAB>& a_data,
267 const Box& a_grid,
268 const DataIndex& a_dit,
269 Real a_scale) override final;
270
278 void
279 residual(LevelData<MFCellFAB>& a_residual,
280 const LevelData<MFCellFAB>& a_phi,
281 const LevelData<MFCellFAB>& a_rhs,
282 const bool a_homogeneousPhysBc) override final;
283
290 void
291 preCond(LevelData<MFCellFAB>& a_corr, const LevelData<MFCellFAB>& a_residual) override final;
292
300 void
301 applyOp(LevelData<MFCellFAB>& a_Lphi, const LevelData<MFCellFAB>& a_phi, bool a_homogeneousPhysBc) override final;
302
309 template <typename Duration = std::chrono::microseconds>
310 Vector<long long>
311 computeOperatorLoads(LevelData<MFCellFAB>& a_phi, const int a_numApply) noexcept;
312
319 void
320 relax(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_residual, int a_iterations) override final;
321
328 void
329 relaxPointJacobi(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_residual, const int a_iterations);
330
337 void
338 relaxGSRedBlack(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_residual, const int a_iterations);
339
346 void
347 relaxGSMultiColor(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_residual, const int a_iterations);
348
355 void
356 relaxChebyshev(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_residual, const int a_iterations);
357
367 void
368 relaxRestrictedAdditiveSchwarz(LevelData<MFCellFAB>& a_correction,
369 const LevelData<MFCellFAB>& a_residual,
370 const int a_iterations);
371
377 void
378 create(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs) override final;
379
386 void
387 createCoarser(LevelData<MFCellFAB>& a_coarse, const LevelData<MFCellFAB>& a_fine, bool a_ghosted) override final;
388
395 void
396 createCoarsened(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs, const int& a_refRat) override final;
397
404 void
405 incr(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs, Real a_scale) override final;
406
413 Real
414 dotProduct(const LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs) override final;
415
432 void
433 dotProductMaskedLocal(Real& a_sumKappaXY,
434 Real& a_sumVolume,
435 const LevelData<MFCellFAB>& a_lhs,
436 const LevelData<MFCellFAB>& a_rhs,
437 const LevelData<BaseFab<bool>>& a_mask,
438 const bool a_needVolume) const noexcept;
439
445 void
446 scale(LevelData<MFCellFAB>& a_lhs, const Real& a_scale) override final;
447
452 void
453 setToZero(LevelData<MFCellFAB>& a_lhs) override final;
454
460 void
461 assign(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs) override final;
462
471 void
472 assignCopier(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs, const Copier& a_copier) override final;
473
479 void
480 assignLocal(LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs) override final;
481
488 void
489 buildCopier(Copier& a_copier, const LevelData<MFCellFAB>& a_lhs, const LevelData<MFCellFAB>& a_rhs) override;
490
497 Real
498 norm(const LevelData<MFCellFAB>& a_lhs, int a_order) override final;
499
508 void
509 axby(LevelData<MFCellFAB>& a_lhs,
510 const LevelData<MFCellFAB>& a_x,
511 const LevelData<MFCellFAB>& a_y,
512 const Real a_a,
513 const Real a_b) override final;
514
521 void
522 restrictResidual(LevelData<MFCellFAB>& a_resCoar,
523 LevelData<MFCellFAB>& a_phi,
524 const LevelData<MFCellFAB>& a_rhs) override final;
525
531 void
532 prolongIncrement(LevelData<MFCellFAB>& a_phi, const LevelData<MFCellFAB>& a_correctCoarse) override final;
533
540 void
541 AMRUpdateResidual(LevelData<MFCellFAB>& a_residual,
542 const LevelData<MFCellFAB>& a_correction,
543 const LevelData<MFCellFAB>& a_coarseCorrection) override final;
544
553 void
554 AMRRestrict(LevelData<MFCellFAB>& a_residualCoarse,
555 const LevelData<MFCellFAB>& a_residual,
556 const LevelData<MFCellFAB>& a_correction,
557 const LevelData<MFCellFAB>& a_coarseCorrection,
558 bool a_skip_res) override final;
559
565 void
566 AMRProlong(LevelData<MFCellFAB>& a_correction, const LevelData<MFCellFAB>& a_coarseCorrection) override final;
567
578 void
579 AMRResidual(LevelData<MFCellFAB>& a_residual,
580 const LevelData<MFCellFAB>& a_phiFine,
581 const LevelData<MFCellFAB>& a_phi,
582 const LevelData<MFCellFAB>& a_phiCoar,
583 const LevelData<MFCellFAB>& a_rhs,
584 bool a_homogeneousPhysBC,
585 AMRLevelOp<LevelData<MFCellFAB>>* a_finerOp) override final;
586
595 void
596 AMRResidualNF(LevelData<MFCellFAB>& a_residual,
597 const LevelData<MFCellFAB>& a_phi,
598 const LevelData<MFCellFAB>& a_phiCoar,
599 const LevelData<MFCellFAB>& a_rhs,
600 bool a_homogeneousPhysBC) override final;
601
611 void
612 AMRResidualNC(LevelData<MFCellFAB>& a_residual,
613 const LevelData<MFCellFAB>& a_phiFine,
614 const LevelData<MFCellFAB>& a_phi,
615 const LevelData<MFCellFAB>& a_rhs,
616 bool a_homogeneousPhysBC,
617 AMRLevelOp<LevelData<MFCellFAB>>* a_finerOp) override final;
618
627 void
628 AMROperatorNF(LevelData<MFCellFAB>& a_Lphi,
629 const LevelData<MFCellFAB>& a_phi,
630 const LevelData<MFCellFAB>& a_phiCoar,
631 bool a_homogeneousPhysBC) override final;
632
642 void
643 AMROperatorNC(LevelData<MFCellFAB>& a_Lphi,
644 const LevelData<MFCellFAB>& a_phiFine,
645 const LevelData<MFCellFAB>& a_phi,
646 bool a_homogeneousPhysBC,
647 AMRLevelOp<LevelData<MFCellFAB>>* a_finerOp) override final;
648
649protected:
653 static constexpr int m_comp = 0;
654
658 static constexpr int m_nComp = 1;
659
664
669
673 Vector<IntVect> m_colors;
674
679 std::map<int, RefCountedPtr<EBHelmholtzOp>> m_helmOps;
680
685
689 RefCountedPtr<LevelData<BaseIVFAB<Real>>> m_jump;
690
694 RefCountedPtr<LevelData<BaseFab<bool>>> m_validCells;
695
699 std::map<int, RefCountedPtr<LevelData<BaseIVFAB<Real>>>> m_dirichletBcValues;
700
705
710
715
720
725
730
735
739 RefCountedPtr<LevelData<MFCellFAB>> m_Acoef;
740
744 RefCountedPtr<LevelData<MFFluxFAB>> m_Bcoef;
745
749 RefCountedPtr<LevelData<MFBaseIVFAB>> m_BcoefIrreg;
750
755
760
765
770
775
780
784 IntVect m_ghostPhi;
785
789 IntVect m_ghostRhs;
790
795
800
805
811 void
812 updateJumpBC(const LevelData<MFCellFAB>& a_phi, const bool a_homogeneousPhysBC);
813
818 void
819 exchangeGhost(const LevelData<MFCellFAB>& a_phi) const;
820
828 void
829 interpolateCF(const LevelData<MFCellFAB>& a_phi, const LevelData<MFCellFAB>* a_phiCoar, const bool a_homogeneousCF);
830
840 void
841 applyOp(LevelData<MFCellFAB>& a_Lphi,
842 const LevelData<MFCellFAB>& a_phi,
843 const LevelData<MFCellFAB>* const a_phiCoar,
844 const bool a_homogeneousPhysBC,
845 const bool a_homogeneousCFBC);
846
857 void
858 AMROperator(LevelData<MFCellFAB>& a_Lphi,
859 const LevelData<MFCellFAB>& a_phiFine,
860 const LevelData<MFCellFAB>& a_phi,
861 const LevelData<MFCellFAB>& a_phiCoar,
862 const bool a_homogeneousPhysBC,
863 AMRLevelOp<LevelData<MFCellFAB>>* a_finerOp) override;
864};
865
866#include <CD_NamespaceFooter.H>
867
869
870#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
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:1442
void fillGrad(const LevelData< MFCellFAB > &a_phi) override final
Not called, I think.
Definition CD_MFHelmholtzOp.cpp:350
RefCountedPtr< MFHelmholtzJumpBC > m_jumpBC
BC jump object. This is the one that has the stencils and can compute derivatives.
Definition CD_MFHelmholtzOp.H:684
MFHelmholtzOp()=delete
Constructor. Must subsequently call define(...).
Copier m_exchangeCopier
Copier for exchange operation.
Definition CD_MFHelmholtzOp.H:754
void prolongIncrement(LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > &a_correctCoarse) override final
Prolongation method.
Definition CD_MFHelmholtzOp.cpp:1199
void scale(LevelData< MFCellFAB > &a_lhs, const Real &a_scale) override final
Scale function.
Definition CD_MFHelmholtzOp.cpp:382
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:374
const RefCountedPtr< LevelData< MFFluxFAB > > & getBcoef()
Get the Helmholtz B-coefficient on faces.
Definition CD_MFHelmholtzOp.cpp:282
void applyOpNoBoundary(LevelData< MFCellFAB > &a_ans, const LevelData< MFCellFAB > &a_phi) override final
Apply operator but turn off all BCs.
Definition CD_MFHelmholtzOp.cpp:334
MFLevelGrid m_mflg
Level grid.
Definition CD_MFHelmholtzOp.H:704
void preCond(LevelData< MFCellFAB > &a_corr, const LevelData< MFCellFAB > &a_residual) override final
Precondition system before bottom solve.
Definition CD_MFHelmholtzOp.cpp:636
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:974
MFLevelGrid m_mflgCoar
Coarse grid.
Definition CD_MFHelmholtzOp.H:714
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:364
static constexpr int m_nComp
Number of components that we solve for.
Definition CD_MFHelmholtzOp.H:658
void createCoarser(LevelData< MFCellFAB > &a_coarse, const LevelData< MFCellFAB > &a_fine, bool a_ghosted) override final
Create coarsened data.
Definition CD_MFHelmholtzOp.cpp:604
RefCountedPtr< LevelData< BaseFab< bool > > > m_validCells
Valid grid cells (will be nullpointer on MG levels).
Definition CD_MFHelmholtzOp.H:694
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:1308
void AMRProlong(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_coarseCorrection) override final
Prolongation onto AMR level.
Definition CD_MFHelmholtzOp.cpp:1292
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:822
MFCoarAve m_coarAve
Coarsener.
Definition CD_MFHelmholtzOp.H:734
void assign(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs) override final
Assignment function.
Definition CD_MFHelmholtzOp.cpp:398
int m_numPhases
Number of phases.
Definition CD_MFHelmholtzOp.H:774
void applyOp(LevelData< MFCellFAB > &a_Lphi, const LevelData< MFCellFAB > &a_phi, bool a_homogeneousPhysBc) override final
Apply operator.
Definition CD_MFHelmholtzOp.cpp:657
int m_numSmoothPreCond
Number of smoothings in the preconditioner.
Definition CD_MFHelmholtzOp.H:769
bool m_hasFine
True if there is a finer AMR level.
Definition CD_MFHelmholtzOp.H:799
const RefCountedPtr< LevelData< MFBaseIVFAB > > & getBcoefIrreg()
Get the Helmholtz B-coefficient on the EB.
Definition CD_MFHelmholtzOp.cpp:288
RefCountedPtr< LevelData< MFFluxFAB > > m_Bcoef
Helmholtz B-coefficient.
Definition CD_MFHelmholtzOp.H:744
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:1170
IntVect m_ghostPhi
Number of ghost cells.
Definition CD_MFHelmholtzOp.H:784
std::map< int, RefCountedPtr< LevelData< BaseIVFAB< Real > > > > m_dirichletBcValues
Dirichlet BC values for each phase.
Definition CD_MFHelmholtzOp.H:699
Location::Cell m_dataLocation
Interpretation of data. Either on cell center or on cell centroid.
Definition CD_MFHelmholtzOp.H:663
void divideByIdentityCoef(LevelData< MFCellFAB > &a_rhs) override final
Divide by the a-coefficient.
Definition CD_MFHelmholtzOp.cpp:320
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:1358
virtual ~MFHelmholtzOp()
Destructor.
Definition CD_MFHelmholtzOp.cpp:241
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:1215
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:778
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:764
void relaxGSMultiColor(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_residual, const int a_iterations)
Multi-colored gauss-seidel relaxation.
Definition CD_MFHelmholtzOp.cpp:1036
static constexpr int m_comp
Component that we solve for.
Definition CD_MFHelmholtzOp.H:653
bool m_multifluid
Multifluid operator or not.
Definition CD_MFHelmholtzOp.H:759
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:1252
bool m_hasMGObjects
Has MG objects or not.
Definition CD_MFHelmholtzOp.H:764
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:1392
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:1342
Vector< IntVect > m_colors
"Colors" for the multi-coloered relaxation method
Definition CD_MFHelmholtzOp.H:673
void relaxPointJacobi(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_residual, const int a_iterations)
Jacobi relaxation.
Definition CD_MFHelmholtzOp.cpp:863
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:249
void interpolateCF(const LevelData< MFCellFAB > &a_phi, const LevelData< MFCellFAB > *a_phiCoar, const bool a_homogeneousCF)
Do coarse-fine interpolation.
Definition CD_MFHelmholtzOp.cpp:710
IntVect m_ghostRhs
Number of ghost cells.
Definition CD_MFHelmholtzOp.H:789
void relaxChebyshev(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_residual, const int a_iterations)
Chebyshev polynomial smoother.
Definition CD_MFHelmholtzOp.cpp:1096
MFHelmholtzOp & operator=(const MFHelmholtzOp &&a_oper)=delete
No move assignment allowed.
bool m_hasMGObjcts
True if there are multigrid levels.
Definition CD_MFHelmholtzOp.H:804
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:1326
void relaxGSRedBlack(LevelData< MFCellFAB > &a_correction, const LevelData< MFCellFAB > &a_residual, const int a_iterations)
Jacobi relaxation.
Definition CD_MFHelmholtzOp.cpp:917
Real dotProduct(const LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs) override final
Dot product.
Definition CD_MFHelmholtzOp.cpp:449
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:689
void setToZero(LevelData< MFCellFAB > &a_lhs) override final
Set to zero.
Definition CD_MFHelmholtzOp.cpp:390
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:620
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:679
Smoother m_smoother
Relaxation method.
Definition CD_MFHelmholtzOp.H:668
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:800
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:719
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:794
void assignCopier(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs, const Copier &a_copier) override final
Assign lhs.
Definition CD_MFHelmholtzOp.cpp:406
int refToCoarser() override final
Return coarsening factor to coarser level (1 if there is no coarser level);.
Definition CD_MFHelmholtzOp.cpp:302
MFLevelGrid m_mflgFine
Fine level grid.
Definition CD_MFHelmholtzOp.H:709
Real norm(const LevelData< MFCellFAB > &a_lhs, int a_order) override final
Compute solution norm.
Definition CD_MFHelmholtzOp.cpp:430
void setAlphaAndBeta(const Real &a_alpha, const Real &a_beta) override final
Set alpha and beta.
Definition CD_MFHelmholtzOp.cpp:310
RefCountedPtr< LevelData< MFBaseIVFAB > > m_BcoefIrreg
Helmholtz B-coefficient on EB.
Definition CD_MFHelmholtzOp.H:749
int m_refToCoar
Refinement factor to coarser AMR level.
Definition CD_MFHelmholtzOp.H:779
const RefCountedPtr< LevelData< MFCellFAB > > & getAcoef()
Get the Helmholtz A-coefficient on cell centers.
Definition CD_MFHelmholtzOp.cpp:276
RefCountedPtr< LevelData< MFCellFAB > > m_Acoef
Helmholtz A-coefficient.
Definition CD_MFHelmholtzOp.H:739
void setJump(RefCountedPtr< LevelData< BaseIVFAB< Real > > > &a_jump)
Set the jump boundary condition.
Definition CD_MFHelmholtzOp.cpp:294
MFMultigridInterpolator m_interpolator
Multi grid interpolator.
Definition CD_MFHelmholtzOp.H:729
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:513
MFHelmholtzOp & operator=(const MFHelmholtzOp &a_oper)=delete
No copy assignment allowed.
MFLevelGrid m_mflgCoarMG
Coarse multigrid-grid.
Definition CD_MFHelmholtzOp.H:724
void assignLocal(LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs) override final
Local assignment function.
Definition CD_MFHelmholtzOp.cpp:414
void buildCopier(Copier &a_copier, const LevelData< MFCellFAB > &a_lhs, const LevelData< MFCellFAB > &a_rhs) override
Build copier.
Definition CD_MFHelmholtzOp.cpp:422
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:588
void exchangeGhost(const LevelData< MFCellFAB > &a_phi) const
Perform an exchange operation, event if the data is const.
Definition CD_MFHelmholtzOp.cpp:808
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