chombo-discharge
CD_EBCoarseFineParticleMesh.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_EBCoarseFineParticleMesh_H
13 #define CD_EBCoarseFineParticleMesh_H
14 
15 // Chombo includes
16 #include <DisjointBoxLayout.H>
17 #include <EBLevelGrid.H>
18 #include <EBCellFAB.H>
19 #include <ProblemDomain.H>
20 
21 // Our includes
22 #include <CD_NamespaceHeader.H>
23 
36 {
37 public:
41  EBCoarseFineParticleMesh() noexcept;
42 
50  EBCoarseFineParticleMesh(const EBLevelGrid& a_eblgCoar,
51  const EBLevelGrid& a_eblgFine,
52  const int a_refRat,
53  const IntVect a_ghost) noexcept;
54 
58  virtual ~EBCoarseFineParticleMesh() noexcept;
59 
67  virtual void
68  define(const EBLevelGrid& a_eblgCoar,
69  const EBLevelGrid& a_eblgFine,
70  const int a_refRat,
71  const IntVect a_ghost) noexcept;
72 
81  virtual void
82  addFineGhostsToCoarse(LevelData<EBCellFAB>& a_coarData, const LevelData<EBCellFAB>& a_fineData) const noexcept;
83 
92  virtual void
93  addFiCoDataToFine(LevelData<EBCellFAB>& a_fineData, const LevelData<EBCellFAB>& a_fiCoData) const noexcept;
94 
102  virtual void
103  addInvalidCoarseToFine(LevelData<EBCellFAB>& a_fineData, const LevelData<EBCellFAB>& a_coarData) const noexcept;
104 
108  const EBLevelGrid&
109  getEblgFiCo() const;
110 
111 protected:
115  static constexpr int m_comp = 0;
116 
120  static constexpr int m_nComp = 1;
121 
126 
130  EBLevelGrid m_eblgCoar;
131 
135  EBLevelGrid m_eblgFine;
136 
140  EBLevelGrid m_eblgFiCo;
141 
145  EBLevelGrid m_eblgCoFi;
146 
152 
158 
164 
168  mutable LayoutData<VoFIterator> m_vofIterFineGhosts;
169 
174  mutable LayoutData<VoFIterator> m_vofIterCoFiGhosts;
175 
179  mutable LayoutData<VoFIterator> m_vofIterCoar;
180 
184  int m_refRat;
185 
189  IntVect m_ghost;
190 
194  void
195  defineVoFIterators() noexcept;
196 };
197 
198 #include <CD_NamespaceFooter.H>
199 
200 #endif
A class for handling particle deposition clouds that hang over refinement boundaries....
Definition: CD_EBCoarseFineParticleMesh.H:36
LayoutData< VoFIterator > m_vofIterCoar
VoFIterator for coarse cells, including ghost cells.
Definition: CD_EBCoarseFineParticleMesh.H:179
EBLevelGrid m_eblgFine
Fine EBLevelGrid.
Definition: CD_EBCoarseFineParticleMesh.H:135
EBLevelGrid m_eblgFiCo
Refined coarse EBLevelGrid.
Definition: CD_EBCoarseFineParticleMesh.H:140
virtual void addFineGhostsToCoarse(LevelData< EBCellFAB > &a_coarData, const LevelData< EBCellFAB > &a_fineData) const noexcept
Coarsen the fine-level ghost cells and add them to the coarse level.
Definition: CD_EBCoarseFineParticleMesh.cpp:159
EBLevelGrid m_eblgCoar
Coarse EBLevelGrid.
Definition: CD_EBCoarseFineParticleMesh.H:130
void defineVoFIterators() noexcept
Define the vof iterators.
Definition: CD_EBCoarseFineParticleMesh.cpp:91
Copier m_copierFiCoToFineNoGhosts
Copier for copying data from the refined coarse level to the fine level.
Definition: CD_EBCoarseFineParticleMesh.H:163
LayoutData< VoFIterator > m_vofIterCoFiGhosts
VoFIterator for coarse grid cells that are coarsenings of fine-grid ghost irregular cells.
Definition: CD_EBCoarseFineParticleMesh.H:174
virtual void addFiCoDataToFine(LevelData< EBCellFAB > &a_fineData, const LevelData< EBCellFAB > &a_fiCoData) const noexcept
Add the valid+ghost cells on the refined coarse level to the valid cells on the fine level.
Definition: CD_EBCoarseFineParticleMesh.cpp:279
LayoutData< VoFIterator > m_vofIterFineGhosts
VoFIterator for fine-grid irregular ghost cells.
Definition: CD_EBCoarseFineParticleMesh.H:168
static constexpr int m_nComp
Maximum number of components.
Definition: CD_EBCoarseFineParticleMesh.H:120
virtual ~EBCoarseFineParticleMesh() noexcept
Destructor (does nothing)
Definition: CD_EBCoarseFineParticleMesh.cpp:45
virtual void addInvalidCoarseToFine(LevelData< EBCellFAB > &a_fineData, const LevelData< EBCellFAB > &a_coarData) const noexcept
Function which piecewise interpolates the data underneath the fine grid and adds it to the fine grid.
Definition: CD_EBCoarseFineParticleMesh.cpp:296
bool m_isDefined
Is defined or not.
Definition: CD_EBCoarseFineParticleMesh.H:125
virtual void define(const EBLevelGrid &a_eblgCoar, const EBLevelGrid &a_eblgFine, const int a_refRat, const IntVect a_ghost) noexcept
Define function.
Definition: CD_EBCoarseFineParticleMesh.cpp:51
EBLevelGrid m_eblgCoFi
Coarsening of m_eblgFine.
Definition: CD_EBCoarseFineParticleMesh.H:145
EBCoarseFineParticleMesh() noexcept
Default constructor. Leaves object in undefined state and subsequently requires a call to define.
Definition: CD_EBCoarseFineParticleMesh.cpp:28
IntVect m_ghost
Number of ghost cells in data holders.
Definition: CD_EBCoarseFineParticleMesh.H:189
Copier m_copierCoFiToCoarIncludeGhosts
Copier for copying data from the coarsened fine level to the coarse level.
Definition: CD_EBCoarseFineParticleMesh.H:157
Copier m_copierFiCoToFineIncludeGhosts
Copier for copying data from the refined coarse level to the fine level.
Definition: CD_EBCoarseFineParticleMesh.H:151
static constexpr int m_comp
Default component.
Definition: CD_EBCoarseFineParticleMesh.H:115
int m_refRat
Refinement ratio between the two levels.
Definition: CD_EBCoarseFineParticleMesh.H:184
const EBLevelGrid & getEblgFiCo() const
Get the refined version of the coarse eblevelgrid.
Definition: CD_EBCoarseFineParticleMesh.cpp:378