chombo-discharge
Loading...
Searching...
No Matches
CD_EBMassRedistribution.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_EBMASSREDISTRIBUTION_H
14#define CD_EBMASSREDISTRIBUTION_H
15
16// Chombo includes
17#include <EBLevelGrid.H>
18#include <LevelData.H>
19#include <EBCellFAB.H>
20#include <BaseIVFAB.H>
21
22// Our includes
23#include <CD_NamespaceHeader.H>
24
50{
51public:
55 EBMassRedistribution() noexcept;
56
61
76 EBMassRedistribution(const EBLevelGrid& a_eblgCoar,
77 const EBLevelGrid& a_eblgCoarsened,
78 const EBLevelGrid& a_eblg,
79 const EBLevelGrid& a_eblgRefined,
80 const EBLevelGrid& a_eblgFine,
81 const int a_refToCoar,
82 const int a_refToFine,
83 const int a_redistRadius) noexcept;
84
88 virtual ~EBMassRedistribution() noexcept;
89
104 virtual void
105 define(const EBLevelGrid& a_eblgCoar,
106 const EBLevelGrid& a_eblgCoarsened,
107 const EBLevelGrid& a_eblg,
108 const EBLevelGrid& a_eblgRefined,
109 const EBLevelGrid& a_eblgFine,
110 const int a_refToCoar,
111 const int a_refToFine,
112 const int a_redistRadius) noexcept;
113
122 virtual void
123 redistributeCoar(LevelData<EBCellFAB>& a_phiCoar,
124 const LevelData<BaseIVFAB<Real>>& a_deltaM,
125 const Real& a_scaleCoar,
126 const Interval& a_variables) const noexcept;
127
136 virtual void
137 redistributeLevel(LevelData<EBCellFAB>& a_phi,
138 const LevelData<BaseIVFAB<Real>>& a_deltaM,
139 const Real& a_scale,
140 const Interval& a_variables) const noexcept;
141
150 virtual void
151 redistributeFine(LevelData<EBCellFAB>& a_phiFine,
152 const LevelData<BaseIVFAB<Real>>& a_deltaM,
153 const Real& a_scaleFine,
154 const Interval& a_variables) const noexcept;
155
156protected:
161
166
171
176
181
186
190 EBLevelGrid m_eblgCoar;
191
195 EBLevelGrid m_eblgCoarsened;
196
200 EBLevelGrid m_eblg;
201
205 EBLevelGrid m_eblgRefined;
206
210 EBLevelGrid m_eblgFine;
211
216
221
226
231 LayoutData<BaseIVFAB<VoFStencil>> m_redistStencilsCoar;
232
237 LayoutData<BaseIVFAB<VoFStencil>> m_redistStencilsLevel;
238
243 LayoutData<BaseIVFAB<VoFStencil>> m_redistStencilsFine;
244
248 mutable LayoutData<VoFIterator> m_vofit;
249
254 mutable LevelData<EBCellFAB> m_coarBuffer;
255
260 mutable LevelData<EBCellFAB> m_levelBuffer;
261
267 mutable LevelData<EBCellFAB> m_fineBuffer;
268
272 virtual void
273 defineStencils() noexcept;
274
278 virtual void
279 defineBuffers() noexcept;
280
285 virtual void
286 defineValidCells(LevelData<BaseFab<bool>>& a_validCells) const noexcept;
287
292 virtual void
293 defineInterfaceCells(LevelData<BaseFab<bool>>& a_interfaceCells) const noexcept;
294};
295
296#include <CD_NamespaceFooter.H>
297
298#endif
Copier m_levelCopier
Copier for adding data from this level to this level (yes, really).
Definition CD_EBMassRedistribution.H:220
int m_refToFine
Refinement factor between this level and the fine level.
Definition CD_EBMassRedistribution.H:180
EBLevelGrid m_eblgRefined
Grids on this level that are a coarsening of the fine level.
Definition CD_EBMassRedistribution.H:205
virtual void defineBuffers() noexcept
Define the copiers and the buffers of the coarse, level and fine redistribution.
Definition CD_EBMassRedistribution.cpp:416
LayoutData< BaseIVFAB< VoFStencil > > m_redistStencilsFine
Stencils for redistribution into valid grid cells on the fine level.
Definition CD_EBMassRedistribution.H:243
virtual void defineInterfaceCells(LevelData< BaseFab< bool > > &a_interfaceCells) const noexcept
Define the cells on the coarse side of the CF interface that we would redistribute to.
Definition CD_EBMassRedistribution.cpp:372
int m_redistRadius
Radius of the redistribution neighbourhood, in cells.
Definition CD_EBMassRedistribution.H:185
virtual void defineValidCells(LevelData< BaseFab< bool > > &a_validCells) const noexcept
Define the valid region of this level.
Definition CD_EBMassRedistribution.cpp:302
LevelData< EBCellFAB > m_fineBuffer
Buffer for the mass redistributed to the finer level, on the refinement of the grids of this level,...
Definition CD_EBMassRedistribution.H:267
EBLevelGrid m_eblg
Grids on this level.
Definition CD_EBMassRedistribution.H:200
virtual void define(const EBLevelGrid &a_eblgCoar, const EBLevelGrid &a_eblgCoarsened, const EBLevelGrid &a_eblg, const EBLevelGrid &a_eblgRefined, const EBLevelGrid &a_eblgFine, const int a_refToCoar, const int a_refToFine, const int a_redistRadius) noexcept
Define function. Puts object in usable state.
Definition CD_EBMassRedistribution.cpp:52
bool m_hasCoar
Has coarse level or not.
Definition CD_EBMassRedistribution.H:165
Copier m_coarCopier
Copier for copying from the coarsening of this level to the coarse level.
Definition CD_EBMassRedistribution.H:215
int m_refToCoar
Refinement factor between this level and the coarse level.
Definition CD_EBMassRedistribution.H:175
bool m_isDefined
Is defined or not.
Definition CD_EBMassRedistribution.H:160
LayoutData< BaseIVFAB< VoFStencil > > m_redistStencilsLevel
Stencils for redistribution into valid grid cells on this level.
Definition CD_EBMassRedistribution.H:237
LayoutData< VoFIterator > m_vofit
Iterator for going through all cells on this level that we redistribute from.
Definition CD_EBMassRedistribution.H:248
EBMassRedistribution(const EBMassRedistribution &a_other)=delete
Copy constructor is not allowed.
virtual void defineStencils() noexcept
Define redistribution stencils.
Definition CD_EBMassRedistribution.cpp:129
EBMassRedistribution() noexcept
Weak constructor. Need to call define afterwards.
Definition CD_EBMassRedistribution.cpp:26
virtual void redistributeFine(LevelData< EBCellFAB > &a_phiFine, const LevelData< BaseIVFAB< Real > > &a_deltaM, const Real &a_scaleFine, const Interval &a_variables) const noexcept
Redistribute the input quantity to the fine level.
Definition CD_EBMassRedistribution.cpp:572
Copier m_fineCopier
Copier for copying from the refinement of this level to the fine level.
Definition CD_EBMassRedistribution.H:225
virtual void redistributeCoar(LevelData< EBCellFAB > &a_phiCoar, const LevelData< BaseIVFAB< Real > > &a_deltaM, const Real &a_scaleCoar, const Interval &a_variables) const noexcept
Redistribute the input quantity to the coarse level.
Definition CD_EBMassRedistribution.cpp:456
virtual ~EBMassRedistribution() noexcept
Destructor (does nothing).
Definition CD_EBMassRedistribution.cpp:46
bool m_hasFine
Has fine level or not.
Definition CD_EBMassRedistribution.H:170
LayoutData< BaseIVFAB< VoFStencil > > m_redistStencilsCoar
Stencils for redistribution into valid grid cells on the coarse level.
Definition CD_EBMassRedistribution.H:231
LevelData< EBCellFAB > m_levelBuffer
Buffer for the mass redistributed on this level, with the redistribution radius as ghost cells....
Definition CD_EBMassRedistribution.H:260
LevelData< EBCellFAB > m_coarBuffer
Buffer for the mass redistributed to the coarser level, on the coarsening of the grids of this level,...
Definition CD_EBMassRedistribution.H:254
EBLevelGrid m_eblgFine
Fine grids.
Definition CD_EBMassRedistribution.H:210
virtual void redistributeLevel(LevelData< EBCellFAB > &a_phi, const LevelData< BaseIVFAB< Real > > &a_deltaM, const Real &a_scale, const Interval &a_variables) const noexcept
Redistribute the input quantity to this level.
Definition CD_EBMassRedistribution.cpp:514
EBLevelGrid m_eblgCoarsened
Grids on this level that are a refinement of the coarser level.
Definition CD_EBMassRedistribution.H:195
EBLevelGrid m_eblgCoar
Grids on coarser level.
Definition CD_EBMassRedistribution.H:190