chombo-discharge
Loading...
Searching...
No Matches
CD_EBReflux.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_EBREFLUX_H
14#define CD_EBREFLUX_H
15
16// Std includes
17#include <map>
18
19// Chombo includes
20#include <Copier.H>
21#include <EBLevelGrid.H>
22
23// Our includes
24#include <CD_NamespaceHeader.H>
25
38{
39public:
43 EBReflux() noexcept;
44
48 EBReflux(const EBReflux& a_other) = delete;
49
57 EBReflux(const EBLevelGrid& a_eblg,
58 const EBLevelGrid& a_eblgFine,
59 const EBLevelGrid& a_eblgCoFi,
60 const int a_refRat) noexcept;
61
65 virtual ~EBReflux() noexcept;
66
74 virtual void
75 define(const EBLevelGrid& a_eblg,
76 const EBLevelGrid& a_eblgFine,
77 const EBLevelGrid& a_eblgCoFi,
78 const int a_refRat) noexcept;
79
91 virtual void
92 reflux(LevelData<EBCellFAB>& a_Lphi,
93 const LevelData<EBFluxFAB>& a_flux,
94 const LevelData<EBFluxFAB>& a_fineFlux,
95 const Interval a_variables,
96 const Real a_scaleCoarFlux,
97 const Real a_scaleFineFlux) const noexcept;
98
106 const LayoutData<std::map<std::pair<int, Side::LoHiSide>, DenseIntVectSet>>&
107 getRegularCoarseFineRegions() const noexcept;
108
115 LayoutData<std::map<std::pair<int, Side::LoHiSide>, VoFIterator>>&
117
126 const LayoutData<std::map<std::pair<int, Side::LoHiSide>, Box>>&
127 getFineCoarseFineBoxes() const noexcept;
128
129protected:
134
139
143 EBLevelGrid m_eblgFine;
144
148 EBLevelGrid m_eblg;
149
153 EBLevelGrid m_eblgCoFi;
154
158 Copier m_copier;
159
163 LayoutData<std::map<std::pair<int, Side::LoHiSide>, BaseIFFAB<FaceStencil>>> m_fluxCoarseningStencils;
164
168 LayoutData<std::map<std::pair<int, Side::LoHiSide>, DenseIntVectSet>> m_regularCoarseFineRegions;
169
173 mutable LayoutData<std::map<std::pair<int, Side::LoHiSide>, FaceIterator>> m_fluxCoarseningRegions;
174
179 mutable LayoutData<std::map<std::pair<int, Side::LoHiSide>, VoFIterator>> m_irregularCoarseFineRegions;
180
185 LayoutData<std::map<std::pair<int, Side::LoHiSide>, Box>> m_fineCoarseFineBoxes;
186
190 mutable LevelData<EBFluxFAB> m_fluxCoFi;
191
195 mutable LevelData<EBFluxFAB> m_fluxCoar;
196
200 virtual void
201 defineRegionsCF() noexcept;
202
206 virtual void
207 defineStencils() noexcept;
208
212 virtual void
213 defineBuffers() noexcept;
214
224 virtual void
225 coarsenFluxesCF(LevelData<EBFluxFAB>& a_coarFluxes,
226 const LevelData<EBFluxFAB>& a_fineFluxes,
227 const int a_coarVar,
228 const int a_fineVar) const noexcept;
229
243 virtual void
244 refluxIntoCoarse(LevelData<EBCellFAB>& a_Lphi,
245 const LevelData<EBFluxFAB>& a_oldFluxes,
246 const LevelData<EBFluxFAB>& a_newFluxes,
247 const int a_phiVar,
248 const int a_oldFluxVar,
249 const int a_newFluxVar,
250 const Real a_scaleCoarFlux,
251 const Real a_scaleFineFlux) const noexcept;
252};
253
254#include <CD_NamespaceFooter.H>
255
256#endif
EBLevelGrid m_eblgFine
Fine grids.
Definition CD_EBReflux.H:143
LayoutData< std::map< std::pair< int, Side::LoHiSide >, VoFIterator > > m_irregularCoarseFineRegions
Cut-cells in each patch that lie on the coarse-fine interface.
Definition CD_EBReflux.H:179
virtual void define(const EBLevelGrid &a_eblg, const EBLevelGrid &a_eblgFine, const EBLevelGrid &a_eblgCoFi, const int a_refRat) noexcept
Define method. Puts object in usable state.
Definition CD_EBReflux.cpp:45
virtual void defineStencils() noexcept
Define the stencils required for coarsening the fine-grid fluxes onto the coarse grid.
Definition CD_EBReflux.cpp:202
LayoutData< std::map< std::pair< int, Side::LoHiSide >, Box > > m_fineCoarseFineBoxes
Bounding boxes of the fine cells whose faces lie on the refinement boundary.
Definition CD_EBReflux.H:185
int m_refRat
Refinement factor between fine and coarse level.
Definition CD_EBReflux.H:138
virtual void defineBuffers() noexcept
Define buffers.
Definition CD_EBReflux.cpp:271
LayoutData< std::map< std::pair< int, Side::LoHiSide >, BaseIFFAB< FaceStencil > > > m_fluxCoarseningStencils
Stencils for conservatively coarsening fine-grid fluxes onto the coarse grid.
Definition CD_EBReflux.H:163
const LayoutData< std::map< std::pair< int, Side::LoHiSide >, DenseIntVectSet > > & getRegularCoarseFineRegions() const noexcept
Get the regular coarse-grid cells on the refinement boundary.
Definition CD_EBReflux.cpp:300
LayoutData< std::map< std::pair< int, Side::LoHiSide >, VoFIterator > > & getIrregularCoarseFineRegions() noexcept
Get the cut coarse-grid cells on the refinement boundary.
Definition CD_EBReflux.cpp:308
const LayoutData< std::map< std::pair< int, Side::LoHiSide >, Box > > & getFineCoarseFineBoxes() const noexcept
Get the fine-grid cells on the refinement boundary.
Definition CD_EBReflux.cpp:316
virtual void reflux(LevelData< EBCellFAB > &a_Lphi, const LevelData< EBFluxFAB > &a_flux, const LevelData< EBFluxFAB > &a_fineFlux, const Interval a_variables, const Real a_scaleCoarFlux, const Real a_scaleFineFlux) const noexcept
Reflux into the coarse data.
Definition CD_EBReflux.cpp:324
LevelData< EBFluxFAB > m_fluxCoFi
Buffer for the fine-grid fluxes coarsened onto the coarsened fine grids.
Definition CD_EBReflux.H:190
EBReflux() noexcept
Disallowed constructor.
Definition CD_EBReflux.cpp:24
EBLevelGrid m_eblg
Grid on this level.
Definition CD_EBReflux.H:148
LevelData< EBFluxFAB > m_fluxCoar
Buffer for the coarsened fine-grid fluxes copied to the coarse grids.
Definition CD_EBReflux.H:195
Copier m_copier
Copier for copying from the coarsened fine grids to the coarse grids.
Definition CD_EBReflux.H:158
EBReflux(const EBReflux &a_other)=delete
Disallowed copy constructor.
virtual ~EBReflux() noexcept
Destructor (does nothing).
Definition CD_EBReflux.cpp:39
LayoutData< std::map< std::pair< int, Side::LoHiSide >, DenseIntVectSet > > m_regularCoarseFineRegions
Regular coarse-fine regions for coarse-grid patches.
Definition CD_EBReflux.H:168
virtual void refluxIntoCoarse(LevelData< EBCellFAB > &a_Lphi, const LevelData< EBFluxFAB > &a_oldFluxes, const LevelData< EBFluxFAB > &a_newFluxes, const int a_phiVar, const int a_oldFluxVar, const int a_newFluxVar, const Real a_scaleCoarFlux, const Real a_scaleFineFlux) const noexcept
Reflux data into a_Lphi.
Definition CD_EBReflux.cpp:466
bool m_isDefined
Is defined or not.
Definition CD_EBReflux.H:133
LayoutData< std::map< std::pair< int, Side::LoHiSide >, FaceIterator > > m_fluxCoarseningRegions
Stencils for conservatively coarsening fine-grid fluxes onto the coarse grid.
Definition CD_EBReflux.H:173
EBLevelGrid m_eblgCoFi
Coarsened fine grids.
Definition CD_EBReflux.H:153
virtual void defineRegionsCF() noexcept
Define coarse-fine interface regions so that we can compute things later.
Definition CD_EBReflux.cpp:65
virtual void coarsenFluxesCF(LevelData< EBFluxFAB > &a_coarFluxes, const LevelData< EBFluxFAB > &a_fineFluxes, const int a_coarVar, const int a_fineVar) const noexcept
Coarsen the input fine fluxes onto the coarse fluxes.
Definition CD_EBReflux.cpp:355