Chombo + EB + MF  3.2
MultiBlockFluxRegister.H
Go to the documentation of this file.
1 #ifdef CH_LANG_CC
2 /*
3  * _______ __
4  * / ___/ / ___ __ _ / / ___
5  * / /__/ _ \/ _ \/ V \/ _ \/ _ \
6  * \___/_//_/\___/_/_/_/_.__/\___/
7  * Please refer to Copyright.txt, in Chombo's root directory.
8  */
9 #endif
10 
11 #ifndef _MULTIBLOCKFLUXREGISTER_H_
12 #define _MULTIBLOCKFLUXREGISTER_H_
13 
14 #include "LevelFluxRegister.H"
15 #include "MultiBlockCoordSys.H"
16 #include <map>
17 #include "RemoteCopier.H"
18 #include "NamespaceHeader.H"
19 
20 //! \class MultiBlockFluxRegister
21 //! This subclass of LevelFluxRegister handles multi-block AMR refluxing.
23 {
24  public:
25 
26  //! Creates a flux register that handles multi-block refluxing.
27  //! This capability requires a multi-block coordinate system, which
28  //! handles block connectivity as well as coordinate mappings.
29  explicit MultiBlockFluxRegister(MultiBlockCoordSys* a_coordSysCoarse,
30  MultiBlockCoordSys* a_coordSysFine);
31 
32  //! Destructor.
34 
35  ///
36  /**
37  dProblem is at the fine resolution.
38  scaleFluxes means the same thing as in levelfluxregister
39  */
40  void define(const DisjointBoxLayout& a_dbl,
41  const DisjointBoxLayout& a_dblCoarse,
42  const ProblemDomain& a_dProblem,
43  int a_nRefine,
44  int a_nComp,
45  bool a_scaleFineFluxes,
46  int a_unrefinedDirection=-1);
47 
48  ///
49  /**
50  the vector interval is the interval over which the fancy vector transformations
51  are done.
52  */
53  void reflux(LevelData<FArrayBox>& a_uCoarse,
54  const Interval& a_coarseVectorIntv,
55  Real a_scale);
56 
57  ///
58  /**
59  the coarse interval is the interval over which refluxing is done.
60  the vector interval is the interval over which the fancy vector transformations
61  are done.
62  */
63  void reflux(LevelData<FArrayBox>& a_uCoarse,
64  const Interval& a_coarse_interval,
65  const Interval& a_coarseVectorIntv,
66  const Interval& a_flux_interval,
67  Real a_scale);
68 
69  ///
70  /**
71  Increment fine flux. For scalars, no change from LevelFluxRegister.
72  For vector fluxes, convert to frame of opposite block.
73  This is for face-CENTERED fluxes.
74  */
75  void incrementFineCentered(const FArrayBox& a_fineFlux,
76  Real a_scale,
77  const DataIndex& a_fineDataIndex,
78  const Interval& a_vectorFluxIntv,
79  const Interval& a_srcInterval,
80  const Interval& a_dstInterval,
81  int a_dir,
82  Side::LoHiSide a_sd);
83 
84  /// Call with a_sd == Side::Lo and a_sd == Side::Hi.
85  void incrementFineCentered(const FArrayBox& a_fineFlux,
86  Real a_scale,
87  const DataIndex& a_fineDataIndex,
88  const Interval& a_vectorFluxIntv,
89  const Interval& a_srcInterval,
90  const Interval& a_dstInterval,
91  int a_dir);
92 
93  ///
94  /**
95  Increment fine flux. For scalars, no change from LevelFluxRegister.
96  For vector fluxes, convert to frame of opposite block.
97  This is for face-AVERAGED fluxes.
98  The argument a_fineFlux2 is a 2nd-order approximation that
99  includes a ghost layer.
100  */
101  void incrementFineAveraged(const FArrayBox& a_fineFlux,
102  const FArrayBox& a_fineFlux2,
103  Real a_scale,
104  const DataIndex& a_fineDataIndex,
105  const Interval& a_vectorFluxIntv,
106  const Interval& a_srcInterval,
107  const Interval& a_dstInterval,
108  int a_dir,
109  Side::LoHiSide a_sd);
110 
111  /// Call with a_sd == Side::Lo and a_sd == Side::Hi.
112  void incrementFineAveraged(const FArrayBox& a_fineFlux,
113  const FArrayBox& a_fineFlux2,
114  Real a_scale,
115  const DataIndex& a_fineDataIndex,
116  const Interval& a_vectorFluxIntv,
117  const Interval& a_srcInterval,
118  const Interval& a_dstInterval,
119  int a_dir);
120 
121  private:
122 
123  //! Multi-block coordinate system at coarser level.
125 
126  //! Multi-block coordinate system at finer level.
128 
129  //! Copier for moving values from fine fluxes on other blocks to
130  //! blocks where the corresponding coarse fluxes are defined.
131  //! One copier per dimension.
133 
134  //! This stores (coarsened) fine fluxes on neighboring blocks.
135  //! We can ensure that the "destination" box layout is disjoint by
136  //! storing the different flux components separately.
138 
139  //! This stores (coarsened) fine fluxes that have been copied to
140  //! the blocks containing the coarse fluxes they will replace.
141  //! Once again, components of fluxes in each direction are stored
142  //! separately so that the boxes can be disjoint.
144 
145  // Index of the block containing each coarsened fine grid.
147 
148  //! No default constructor.
150  { };
151 };
152 #include "NamespaceFooter.H"
153 #endif
Definition: RemoteCopier.H:18
MultiBlockCoordSys * m_coordSysFine
Multi-block coordinate system at finer level.
Definition: MultiBlockFluxRegister.H:127
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
LayoutData< int > m_blockNum
Definition: MultiBlockFluxRegister.H:146
void reflux(LevelData< FArrayBox > &a_uCoarse, const Interval &a_coarseVectorIntv, Real a_scale)
void incrementFineAveraged(const FArrayBox &a_fineFlux, const FArrayBox &a_fineFlux2, Real a_scale, const DataIndex &a_fineDataIndex, const Interval &a_vectorFluxIntv, const Interval &a_srcInterval, const Interval &a_dstInterval, int a_dir, Side::LoHiSide a_sd)
RemoteCopier m_remoteCopiers[SpaceDim]
Definition: MultiBlockFluxRegister.H:132
const int SpaceDim
Definition: SPACE.H:38
void define(const DisjointBoxLayout &a_dbl, const DisjointBoxLayout &a_dblCoarse, const ProblemDomain &a_dProblem, int a_nRefine, int a_nComp, bool a_scaleFineFluxes, int a_unrefinedDirection=-1)
LevelData< FArrayBox > m_multiblockFineFluxes[SpaceDim]
Definition: MultiBlockFluxRegister.H:137
MultiBlockFluxRegister()
No default constructor.
Definition: MultiBlockFluxRegister.H:149
Structure for passing component ranges in code.
Definition: Interval.H:23
LevelData< FArrayBox > m_neighborFineFluxes[SpaceDim]
Definition: MultiBlockFluxRegister.H:143
double Real
Definition: REAL.H:33
~MultiBlockFluxRegister()
Destructor.
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
LoHiSide
Definition: LoHiSide.H:27
void incrementFineCentered(const FArrayBox &a_fineFlux, Real a_scale, const DataIndex &a_fineDataIndex, const Interval &a_vectorFluxIntv, const Interval &a_srcInterval, const Interval &a_dstInterval, int a_dir, Side::LoHiSide a_sd)
MultiBlockCoordSys * m_coordSysCoarse
Multi-block coordinate system at coarser level.
Definition: MultiBlockFluxRegister.H:124
virtual interface class encapsulating multi-block mapping API
Definition: MultiBlockCoordSys.H:34
LevelFluxRegister-A class to encapsulate a levels worth of flux registers.
Definition: LevelFluxRegister.H:29
Definition: MultiBlockFluxRegister.H:22
Definition: DataIndex.H:114
Definition: FArrayBox.H:45