Chombo + EB + MF  3.2
Correct1D2D.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 _CORRECT1D2D_H_
12 #define _CORRECT1D2D_H_
13 
14 #include "DisjointBoxLayout.H"
15 #include "EBCellFAB.H"
16 #include "EBFaceFAB.H"
17 #include "LevelData.H"
18 #include "EBLevelGrid.H"
19 
20 #include "NamespaceHeader.H"
21 
22 ///
23 /**
24  Given an EB application that uses one algorithm for fluxes on some
25  boxes and another on other boxes, this will make the solution's fluxes
26  match at box-box boundaries. In all this class, the winning algorithm
27  at the boundary is denoted by 2D, the losing by 1D but this would work
28  for whatever polyalgorithm you choose.
29  */
31 {
32 public:
33  static void
34  makeIntMap(LevelData< BaseFab<int> >& a_intmap,
35  const LayoutData<bool>& a_is1D,
36  const DisjointBoxLayout& a_dbl);
37 
38  Correct1D2D(const EBLevelGrid& a_eblg,
39  const LayoutData<bool>& a_is1D,
40  int a_nvar);
41 
43  {;}
44 
45 
46  ///
47  /**
48  sets buffers to zero
49  */
50  void setToZero();
51 
52  ///
53  /**
54  increments the 1D (losing) buffer by -flux*scale*sign(side)
55  (side is which side of the changed cell we are talking about)
56  typically scale = 1/dx[idir]
57  */
58  void increment1D(const EBFaceFAB& a_1DFlux,
59  const Real& a_scale,
60  const DataIndex& a_dit);
61 
62 
63  ///
64  /**
65  increments the 2D (winning) buffer by flux*scale*sign(side)
66  (side is which side of the changed cell we are talking about)
67  typically scale = 1/dx[idir]
68  */
69  void increment2D(const EBFaceFAB& a_2DFlux,
70  const Real& a_scale,
71  const DataIndex& a_dit);
72 
73 
74  ///
75  /**
76  subtracts off change in solution due to losing flux
77  and adds in change in solution due to winning flux.
78  */
80 
81 protected:
82 
86  int m_nvar;
88 
89  //which VoFs actually get changed
92 
93  //change in solution due to 1d (losing) flux
95 
96  //change in solution due to 2d (winning) flux
98 
99  int index(int a_dir, Side::LoHiSide a_sd)
100  {
101  int retval = a_dir + a_sd*SpaceDim;
102  return retval;
103  }
104 private:
106  {
107  MayDay::Error("weak construction disallowed");
108  }
109 
111  {
112  MayDay::Error("copy construction disallowed");
113  }
114 
115  void operator=(const Correct1D2D& a_in)
116  {
117  MayDay::Error("assignment disallowed");
118  }
119 };
120 #include "NamespaceFooter.H"
121 #endif
void increment1D(const EBFaceFAB &a_1DFlux, const Real &a_scale, const DataIndex &a_dit)
LayoutData< Vector< VolIndex > > m_sets2d[2 *SpaceDim]
Definition: Correct1D2D.H:91
void operator=(const Correct1D2D &a_in)
Definition: Correct1D2D.H:115
LevelData< EBCellFAB > m_deltaU2d[2 *SpaceDim]
Definition: Correct1D2D.H:97
Data that maintains a one-to-one mapping of T to the boxes in a BoxLayout.
Definition: BoxLayout.H:26
void correctSolution(LevelData< EBCellFAB > &a_U)
LevelData< EBCellFAB > m_deltaU1d[2 *SpaceDim]
Definition: Correct1D2D.H:94
Definition: EBLevelGrid.H:30
int index(int a_dir, Side::LoHiSide a_sd)
Definition: Correct1D2D.H:99
Definition: EBFaceFAB.H:28
void increment2D(const EBFaceFAB &a_2DFlux, const Real &a_scale, const DataIndex &a_dit)
Correct1D2D(const Correct1D2D &a_in)
Definition: Correct1D2D.H:110
const int SpaceDim
Definition: SPACE.H:38
LayoutData< Vector< VolIndex > > m_sets1d[2 *SpaceDim]
Definition: Correct1D2D.H:90
LevelData< BaseFab< int > > m_1d2d
Definition: Correct1D2D.H:83
new code
Definition: BoxLayoutData.H:170
int m_nvar
Definition: Correct1D2D.H:86
double Real
Definition: REAL.H:33
EBLevelGrid m_eblg
Definition: Correct1D2D.H:87
DisjointBoxLayout m_dbl2d[2 *SpaceDim]
Definition: Correct1D2D.H:85
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
LoHiSide
Definition: LoHiSide.H:27
Definition: Correct1D2D.H:30
Correct1D2D()
Definition: Correct1D2D.H:105
static void Error(const char *const a_msg=m_nullString, int m_exitCode=CH_DEFAULT_ERROR_CODE)
Print out message to cerr and exit with the specified exit code.
Definition: DataIndex.H:114
void setToZero()
~Correct1D2D()
Definition: Correct1D2D.H:42
DisjointBoxLayout m_dbl1d[2 *SpaceDim]
Definition: Correct1D2D.H:84
static void makeIntMap(LevelData< BaseFab< int > > &a_intmap, const LayoutData< bool > &a_is1D, const DisjointBoxLayout &a_dbl)