chombo-discharge
CD_EBMGRestrict.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2022 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_EBMGRestrict_H
13 #define CD_EBMGRestrict_H
14 
15 // Chombo includes
16 #include <EBLevelGrid.H>
17 #include <ProblemDomain.H>
18 #include <LevelData.H>
19 #include <EBCellFAB.H>
20 
21 // Our includes
22 #include <CD_NamespaceHeader.H>
23 
30 {
31 public:
35  EBMGRestrict() noexcept;
36 
43  EBMGRestrict(const EBLevelGrid& a_eblgFine, const EBLevelGrid& a_eblgCoar, const int& a_refRat) noexcept;
44 
48  virtual ~EBMGRestrict() noexcept;
49 
56  virtual void
57  define(const EBLevelGrid& a_eblgFine, const EBLevelGrid& a_eblgCoar, const int& a_refRat) noexcept;
58 
67  virtual void
68  restrictResidual(LevelData<EBCellFAB>& a_coarData,
69  const LevelData<EBCellFAB>& a_fineData,
70  const Interval a_variables) const noexcept;
71 
72 protected:
77 
81  int m_refRat;
82 
86  IntVect m_ghostPhi;
87 
91  EBLevelGrid m_eblgFine;
92 
96  EBLevelGrid m_eblgCoar;
97 
101  EBLevelGrid m_eblgCoFi;
102 
106  Copier m_copier;
107 
111  mutable LayoutData<VoFIterator> m_vofitCoar;
112 
117  LayoutData<BaseIVFAB<VoFStencil>> m_restrictStencils;
118 };
119 
120 #include <CD_NamespaceFooter.H>
121 
122 #endif
Class for restricting multigrid residual onto a coarser grid.
Definition: CD_EBMGRestrict.H:30
EBLevelGrid m_eblgFine
Fine grid.
Definition: CD_EBMGRestrict.H:91
Copier m_copier
Copier for making copying from the coarsened fine grids to the coarse grid go faster.
Definition: CD_EBMGRestrict.H:106
IntVect m_ghostPhi
Number of ghost cells in data holders.
Definition: CD_EBMGRestrict.H:86
bool m_isDefined
Defined or not.
Definition: CD_EBMGRestrict.H:76
EBMGRestrict() noexcept
Default constructor. User must subsequently call the define function.
Definition: CD_EBMGRestrict.cpp:22
virtual void define(const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgCoar, const int &a_refRat) noexcept
Define function.
Definition: CD_EBMGRestrict.cpp:44
int m_refRat
Refinement ratio.
Definition: CD_EBMGRestrict.H:81
LayoutData< VoFIterator > m_vofitCoar
Iterator for iterating over cut-cells on the coarse level.
Definition: CD_EBMGRestrict.H:111
EBLevelGrid m_eblgCoar
Coarse grid.
Definition: CD_EBMGRestrict.H:96
EBLevelGrid m_eblgCoFi
Coarsened fine grids.
Definition: CD_EBMGRestrict.H:101
virtual ~EBMGRestrict() noexcept
Destructor.
Definition: CD_EBMGRestrict.cpp:38
virtual void restrictResidual(LevelData< EBCellFAB > &a_coarData, const LevelData< EBCellFAB > &a_fineData, const Interval a_variables) const noexcept
Restrict residual onto the coarse grid.
Definition: CD_EBMGRestrict.cpp:113
LayoutData< BaseIVFAB< VoFStencil > > m_restrictStencils
Restriction stencils near the EB.
Definition: CD_EBMGRestrict.H:117