Chombo + EB + MF  3.2
NewMultiBlockFluxRegister.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 _NEWMULTIBLOCKFLUXREGISTER_H_
12 #define _NEWMULTIBLOCKFLUXREGISTER_H_
13 
14 #include "LevelFluxRegister.H"
15 #include "BlockRegister.H"
16 #include "NamespaceHeader.H"
17 //NewMultiBlockFluxRegister-Derived from LevelFluxRegister to support multiblock grids.
18 /**
19  A LevelFluxRegister handles all the data choreography
20  necessary to create a levels worth of flux registers.
21 */
22 ///
23  /**
24  Full constructor. Calls the define function which creates
25  a levels worth of flux registers. a_domain is is coarse-level
26  domain.
27 
28  If a_scaleFineFluxes is true (default then all fine fluxes are
29  scaled by 1/a_nRefine^(SpaceDim-1). Otherwise, no scaling is done.
30  */
32 {
33  public:
34  ///
35  /**
36  domainCoar --coordinate system at coarser level
37  */
40  const DisjointBoxLayout& a_dblFine,
41  const DisjointBoxLayout& a_dblCoar,
42  int a_nRefine,
43  int a_nComp,
44  bool a_scaleFineFluxes=false,
45  int a_unrefinedDirection=-1)
46  {
47  define(a_domCoar,
48  a_dblFine,
49  a_dblCoar,
50  a_nRefine,
51  a_nComp,
52  a_scaleFineFluxes,
53  a_unrefinedDirection);
54  }
55 
56  static int index(int a_dir, Side::LoHiSide a_side);
57 
59 
61  { };
62 
64 
65  ///
66  /**
67  domainCoar --coordinate system at coarser level
68  */
69  virtual void define(RefCountedPtr<MultiBlockCoordSys> a_domainCoar,
70  const DisjointBoxLayout& a_dbl,
71  const DisjointBoxLayout& a_dblCoarse,
72  int a_nRefine,
73  int a_nComp,
74  bool a_scaleFineFluxes=false,
75  int a_unrefinedDirection=-1);
76 
77  virtual void reflux(
78  LevelData<FArrayBox>& a_uCoarse,
79  Real a_scale);
80 
81  virtual void reflux(LevelData<FArrayBox>& a_uCoarse,
82  const Interval& a_coarseVectorIntv,
83  Real a_scale);
84 
85  virtual void reflux(LevelData<FArrayBox>& a_uCoarse,
86  const Interval& a_coarseVectorIntv,
87  const Interval& a_fluxInterval,
88  Real a_scale);
89 
90  virtual void reflux(LevelData<FArrayBox>& a_uCoarse,
91  const Interval& a_coarse_interval,
92  const Interval& a_coarseVectorIntv,
93  const Interval& a_flux_interval,
94  Real a_scale);
95 
96  virtual void setToZero();
97 
98  virtual void incrementFine(
99  const FArrayBox& a_fineFlux,
100  Real a_scale,
101  const DataIndex& a_fineDataIndex,
102  const Interval& a_srcInterval,
103  const Interval& a_dstInterval,
104  int a_dir,
105  Side::LoHiSide a_sd);
106 
107  virtual void incrementCoarse(
108  const FArrayBox& a_coarseFlux,
109  Real a_scale,
110  const DataIndex& a_coarseDataIndex,
111  const Interval& a_srcInterval,
112  const Interval& a_dstInterval,
113  int a_dir,
114  Side::LoHiSide a_sd);
115 
116 private:
122  int m_nComp;
123 
124  // internal function to make define less monolithic
126  const DisjointBoxLayout& a_dblFine,
127  const DisjointBoxLayout& a_dblCoar);
128 
129  // internal function to make define less monolithic
130  void getCoFiBoxBlockList(std::list<Box> & a_blockBoxesCoFi,
132  const DisjointBoxLayout & a_dblFine);
133 
134  // internal function to make define less monolithic
136  const DisjointBoxLayout& a_dblFine);
137 
138 
139 };
140 #include "NamespaceFooter.H"
141 
142 #endif // include guard
Vector< RefCountedPtr< BlockRegister > > m_coarRegisters
Definition: NewMultiBlockFluxRegister.H:117
void getCoFiBoxBlockList(std::list< Box > &a_blockBoxesCoFi, RefCountedPtr< MultiBlockCoordSys > &a_domCoar, const DisjointBoxLayout &a_dblFine)
NewMultiBlockFluxRegister()
Definition: NewMultiBlockFluxRegister.H:60
Vector< RefCountedPtr< BlockRegister > > m_blockCFLocations
Definition: NewMultiBlockFluxRegister.H:120
void defineBlockBoundaries(RefCountedPtr< MultiBlockCoordSys > a_domain, const DisjointBoxLayout &a_dblFine)
LevelData< FluxBox > m_fluxCoFi
Definition: NewMultiBlockFluxRegister.H:119
A reference-counting handle class.
Definition: RefCountedPtr.H:173
virtual void incrementCoarse(const FArrayBox &a_coarseFlux, Real a_scale, const DataIndex &a_coarseDataIndex, const Interval &a_srcInterval, const Interval &a_dstInterval, int a_dir, Side::LoHiSide a_sd)
int m_nComp
Definition: NewMultiBlockFluxRegister.H:122
virtual void incrementFine(const FArrayBox &a_fineFlux, Real a_scale, const DataIndex &a_fineDataIndex, const Interval &a_srcInterval, const Interval &a_dstInterval, int a_dir, Side::LoHiSide a_sd)
one dimensional dynamic array
Definition: Vector.H:53
Data that maintains a one-to-one mapping of T to the boxes in a BoxLayout.
Definition: BoxLayout.H:26
NewMultiBlockFluxRegister(RefCountedPtr< MultiBlockCoordSys > a_domCoar, const DisjointBoxLayout &a_dblFine, const DisjointBoxLayout &a_dblCoar, int a_nRefine, int a_nComp, bool a_scaleFineFluxes=false, int a_unrefinedDirection=-1)
Definition: NewMultiBlockFluxRegister.H:38
LayoutData< Vector< Box > > m_fineBlockBoundaries
Definition: NewMultiBlockFluxRegister.H:121
virtual void reflux(LevelData< FArrayBox > &a_uCoarse, Real a_scale)
Structure for passing component ranges in code.
Definition: Interval.H:23
double Real
Definition: REAL.H:33
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
LoHiSide
Definition: LoHiSide.H:27
Definition: NewMultiBlockFluxRegister.H:31
LevelFluxRegister-A class to encapsulate a levels worth of flux registers.
Definition: LevelFluxRegister.H:29
Definition: DataIndex.H:114
Definition: FArrayBox.H:45
void defineBlockCFLocations(RefCountedPtr< MultiBlockCoordSys > a_domain, const DisjointBoxLayout &a_dblFine, const DisjointBoxLayout &a_dblCoar)
Vector< RefCountedPtr< BlockRegister > > m_cofiRegisters
Definition: NewMultiBlockFluxRegister.H:118
virtual void define(RefCountedPtr< MultiBlockCoordSys > a_domainCoar, const DisjointBoxLayout &a_dbl, const DisjointBoxLayout &a_dblCoarse, int a_nRefine, int a_nComp, bool a_scaleFineFluxes=false, int a_unrefinedDirection=-1)
static int index(int a_dir, Side::LoHiSide a_side)
virtual void setToZero()