chombo-discharge
CD_EBAMRSurfaceDeposition.H
Go to the documentation of this file.
1 /* chombo-discharge
2  * Copyright © 2023 SINTEF Energy Research.
3  * Please refer to Copyright.txt and LICENSE in the chombo-discharge root directory.
4  */
5 
12 #ifndef CD_EBAMRSurfaceDeposition_H
13 #define CD_EBAMRSurfaceDeposition_H
14 
15 // Chombo includes
16 #include <RefCountedPtr.H>
17 #include <Copier.H>
18 #include <EBLevelGrid.H>
19 
20 // Our includes
21 #include <CD_EBAMRData.H>
22 #include <CD_ParticleContainer.H>
23 #include <CD_NamespaceHeader.H>
24 
29 {
30 public:
34  EBAMRSurfaceDeposition() noexcept;
35 
47  EBAMRSurfaceDeposition(const Vector<RefCountedPtr<EBLevelGrid>>& a_ebGrids,
48  const Vector<RefCountedPtr<EBLevelGrid>>& a_ebGridsCoarsenedFine,
49  const Vector<RefCountedPtr<EBLevelGrid>>& a_ebGridsRefinedCoar,
50  const Vector<int>& a_refRat,
51  const Vector<Real>& a_dx,
52  const RealVect& a_probLo,
53  const int a_finestLevel,
54  const int a_radius) noexcept;
55 
59  virtual ~EBAMRSurfaceDeposition() noexcept;
60 
72  virtual void
73  define(const Vector<RefCountedPtr<EBLevelGrid>>& a_ebGrids,
74  const Vector<RefCountedPtr<EBLevelGrid>>& a_ebGridsCoarsenedFine,
75  const Vector<RefCountedPtr<EBLevelGrid>>& a_ebGridsRefinedCoar,
76  const Vector<int>& a_refRat,
77  const Vector<Real>& a_dx,
78  const RealVect& a_probLo,
79  const int a_finestLevel,
80  const int a_radius) noexcept;
81 
87  template <class P, const Real& (P::*particleScalarField)() const>
88  void
89  deposit(EBAMRIVData& a_meshData, const ParticleContainer<P>& a_particles) const noexcept;
90 
96  template <class P, Real (P::*particleScalarField)()>
97  void
98  deposit(EBAMRIVData& a_meshData, const ParticleContainer<P>& a_particles) const noexcept;
99 
100 protected:
104  bool m_debug;
105 
110 
114  bool m_verbose;
115 
119  RealVect m_probLo;
120 
125 
129  int m_radius;
130 
134  Vector<RefCountedPtr<EBLevelGrid>> m_ebGrids;
135 
140  Vector<RefCountedPtr<EBLevelGrid>> m_ebGridsCoarsenedFine;
141 
146  Vector<RefCountedPtr<EBLevelGrid>> m_ebGridsRefinedCoar;
147 
151  Vector<int> m_refRat;
152 
156  Vector<Real> m_dx;
157 
161  Vector<RefCountedPtr<LayoutData<BaseIVFAB<VoFStencil>>>> m_depositionStencils;
162 
167  Vector<RefCountedPtr<LayoutData<BaseIVFAB<VoFStencil>>>> m_coarseToFineStencils;
168 
173  Vector<RefCountedPtr<LayoutData<BaseIVFAB<VoFStencil>>>> m_fineToCoarseStencils;
174 
180 
185 
190 
194  Vector<Copier> m_validToValidCopiers;
195 
200  Vector<Copier> m_copierLevel;
201 
206 
211 
215  virtual void
216  defineBuffers() noexcept;
217 
221  virtual void
222  defineDataMotion() noexcept;
223 
227  virtual void
228  defineDepositionStencils() noexcept;
229 
233  virtual void
234  defineCoarseToFineStencils() noexcept;
235 
239  virtual void
240  defineFineToCoarseStencils() noexcept;
241 
247  virtual void
248  addInvalidCoarseDataToFineData() const noexcept;
249 
254  virtual void
255  addFineGhostDataToValidCoarData() const noexcept;
256 };
257 
258 #include <CD_NamespaceFooter.H>
259 
261 
262 #endif
Class for holding data across EBAMR hierarchies.
Implementation of CD_EBAMRSurfaceDeposition.H.
Declaration of a class for holding particles on an AMR hierarchy.
class for handling surface deposition of particles with EB and AMR.
Definition: CD_EBAMRSurfaceDeposition.H:29
virtual void define(const Vector< RefCountedPtr< EBLevelGrid >> &a_ebGrids, const Vector< RefCountedPtr< EBLevelGrid >> &a_ebGridsCoarsenedFine, const Vector< RefCountedPtr< EBLevelGrid >> &a_ebGridsRefinedCoar, const Vector< int > &a_refRat, const Vector< Real > &a_dx, const RealVect &a_probLo, const int a_finestLevel, const int a_radius) noexcept
Define function. Puts objects in usable state.
Definition: CD_EBAMRSurfaceDeposition.cpp:58
virtual void defineBuffers() noexcept
Define buffer data.
Definition: CD_EBAMRSurfaceDeposition.cpp:120
virtual void defineDataMotion() noexcept
Define copiers.
Definition: CD_EBAMRSurfaceDeposition.cpp:226
Vector< Copier > m_validToValidCopiers
Valid to valid copiers.
Definition: CD_EBAMRSurfaceDeposition.H:194
RealVect m_probLo
Lower-left corner of computational domain.
Definition: CD_EBAMRSurfaceDeposition.H:119
EBAMRIVData m_coarsenedFineData
Coarsening of the fine-grid data.
Definition: CD_EBAMRSurfaceDeposition.H:189
EBAMRSurfaceDeposition() noexcept
Default constructor. Leaves the object in undefined state and requires the user to call the define fu...
Definition: CD_EBAMRSurfaceDeposition.cpp:23
int m_radius
Deposition radius.
Definition: CD_EBAMRSurfaceDeposition.H:129
Vector< RefCountedPtr< EBLevelGrid > > m_ebGridsRefinedCoar
Refined grids.
Definition: CD_EBAMRSurfaceDeposition.H:146
Vector< Copier > m_copierRefinedCoarToFineNoGhosts
Copier for copying data from the refined coarse level to the fine level.
Definition: CD_EBAMRSurfaceDeposition.H:205
virtual void defineCoarseToFineStencils() noexcept
Define stencils for interpolating coarse-grid data to the fine grid.
Definition: CD_EBAMRSurfaceDeposition.cpp:384
int m_finestLevel
Finest grid level.
Definition: CD_EBAMRSurfaceDeposition.H:124
Vector< Real > m_dx
Grid resolutions.
Definition: CD_EBAMRSurfaceDeposition.H:156
Vector< int > m_refRat
Refinement ratios between levels.
Definition: CD_EBAMRSurfaceDeposition.H:151
bool m_verbose
Turn on/off chattiness.
Definition: CD_EBAMRSurfaceDeposition.H:114
virtual void defineFineToCoarseStencils() noexcept
Define stencils for coarsening data in fine-grid ghost cells to the coarse grid.
Definition: CD_EBAMRSurfaceDeposition.cpp:468
virtual ~EBAMRSurfaceDeposition() noexcept
Destructor.
Definition: CD_EBAMRSurfaceDeposition.cpp:52
virtual void addFineGhostDataToValidCoarData() const noexcept
Add the ghosted fine-level data to the coarse data.
Definition: CD_EBAMRSurfaceDeposition.cpp:605
Vector< RefCountedPtr< LayoutData< BaseIVFAB< VoFStencil > > > > m_depositionStencils
Deposition weights for each irregular cell. This contains 1.0/sum(alpha * dx^(D-1)) and the cells.
Definition: CD_EBAMRSurfaceDeposition.H:161
Vector< RefCountedPtr< LayoutData< BaseIVFAB< VoFStencil > > > > m_fineToCoarseStencils
Stencils for conservatively coarsening fine-grid data (in ghost cells) to the coarse grid.
Definition: CD_EBAMRSurfaceDeposition.H:173
bool m_debug
Debug or not.
Definition: CD_EBAMRSurfaceDeposition.H:104
Vector< RefCountedPtr< EBLevelGrid > > m_ebGridsCoarsenedFine
Coarsened grids.
Definition: CD_EBAMRSurfaceDeposition.H:140
void deposit(EBAMRIVData &a_meshData, const ParticleContainer< P > &a_particles) const noexcept
Deposit function. Deposits particle on surface.
Definition: CD_EBAMRSurfaceDepositionImplem.H:28
Vector< Copier > m_copierLevel
Level copier for adding data from valid+ghost -> valid.
Definition: CD_EBAMRSurfaceDeposition.H:200
virtual void addInvalidCoarseDataToFineData() const noexcept
Add the invalid coarse data (i.e., underneath the fine grid) to the fine level.
Definition: CD_EBAMRSurfaceDeposition.cpp:551
virtual void defineDepositionStencils() noexcept
Define deposition weights.
Definition: CD_EBAMRSurfaceDeposition.cpp:275
Vector< RefCountedPtr< EBLevelGrid > > m_ebGrids
Grids on each level.
Definition: CD_EBAMRSurfaceDeposition.H:134
EBAMRIVData m_data
Data on each level.
Definition: CD_EBAMRSurfaceDeposition.H:179
EBAMRIVData m_refinedCoarData
Data defined on a refinement of the coarse grid.
Definition: CD_EBAMRSurfaceDeposition.H:184
Vector< RefCountedPtr< LayoutData< BaseIVFAB< VoFStencil > > > > m_coarseToFineStencils
Stencils for interpolating coarse-grid data to the fine grid.
Definition: CD_EBAMRSurfaceDeposition.H:167
bool m_isDefined
Is defined or not.
Definition: CD_EBAMRSurfaceDeposition.H:109
Vector< Copier > m_copierCoarsenedFineToCoar
Copier for copying data from the coarsened fine level to the coarse level.
Definition: CD_EBAMRSurfaceDeposition.H:210
Templated class for holding particles on an AMR hierarchy with particle remapping.
Definition: CD_ParticleContainer.H:50