Chombo + EB  3.0
FourthOrderInterpStencil.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 _FOURTHORDERINTERPSTENCIL_H_
12 #define _FOURTHORDERINTERPSTENCIL_H_
13 
14 #include "FArrayBox.H"
15 #include "IntVect.H"
16 #include "Vector.H"
17 #include "UsingNamespace.H"
18 
19 /// Time interpolator class using 4th-order Runge-Kutta
20 
21 /**
22  */
24 {
25 public:
26  /// Default constructor
27  /**
28  Object requires define() to be called before all other functions.
29  */
31 
32  /// Full constructor
33  FourthOrderInterpStencil(/// in range -(a_degree-1):(a_degree-1), specifies displacement to boundary in each dimension
34  const IntVect& a_bdryOffset,
35  /// refinement ratio
36  const int& a_refineCoarse,
37  /// max degree of polynomials
38  const int& a_degree = 3)
39  {
40  define(a_bdryOffset, a_refineCoarse, a_degree);
41  }
42 
43  /// Destructor
44  /**
45  Destroys all objects created by define(). Passed in data references
46  of define() are left alone.
47  */
49 
50  /// Actual constructor.
51  /**
52  Set up object.
53  */
54  void define(/// in range -(a_degree-1):(a_degree-1), specifies displacement to boundary in each dimension
55  const IntVect& a_bdryOffset,
56  /// refinement ratio
57  const int& a_refineCoarse,
58  /// max degree of polynomials
59  const int& a_degree = 3);
60 
61  /// Interpolate to all the fine cells within one coarse cell.
62  /**
63  Fill the fine cells inside a_coarseDataCell with interpolated data
64  from a_coarseFab.
65 
66  The fine cells to be filled in are at
67  m_baseFineBox + m_refineCoarse * (a_coarseDataCell + a_coarseToFineOffset).
68  The coarse cells from which we draw data are
69  (a_coarseDataCell + m_coarseBaseIndices[i*D+[0:2]]: 0 <= i < m_stencilSize).
70  */
71  void fillFine(/// to fill at m_baseFineBox + m_refineCoarse*(a_coarseBase + a_coarseToFineOffset)
72  FArrayBox& a_fineFab,
73  /// coarse data
74  const FArrayBox& a_coarseFab,
75  /// coarse cell with fine subcells to fill in
76  const IntVect& a_coarseDataCell,
77  /// offset from base coarse cell to coarsened fine cells
78  const IntVect& a_coarseToFineOffset = IntVect::Zero) const;
79 
80 protected:
81 
82  /// refinement ratio
84 
85  /// max degree of polynomials
86  int m_degree;
87 
88  /// displacement from domain boundary in each dimension, in range -(a_degree-1):(a_degree-1)
90 
91  /// 0:(m_refineCoarse-1) in every dimension
93 
94  /// number of coarse cells in the stencil
96 
97  /// length m_stencilSize*SpaceDim, lists indices of coarse cell corresponding to each component of m_coarseToFineFab
99 
100  /// m_stencilSize coefficients of coarse cells for each cell in m_baseFineBox
102 
103  /// whether define() has been called
104  bool m_defined;
105 
106 private:
107 
108  // Disallowed for all the usual reasons
109  void operator=(const FourthOrderInterpStencil& a_input)
110  {
111  MayDay::Error("invalid operator");
112  }
113 
114  // Disallowed for all the usual reasons
116  {
117  MayDay::Error("invalid operator");
118  }
119 };
120 
121 #endif
~FourthOrderInterpStencil()
Destructor.
Vector< int > m_coarseBaseIndices
length m_stencilSize*SpaceDim, lists indices of coarse cell corresponding to each component of m_coar...
Definition: FourthOrderInterpStencil.H:98
Box m_baseFineBox
0:(m_refineCoarse-1) in every dimension
Definition: FourthOrderInterpStencil.H:92
void fillFine(FArrayBox &a_fineFab, const FArrayBox &a_coarseFab, const IntVect &a_coarseDataCell, const IntVect &a_coarseToFineOffset=IntVect::Zero) const
Interpolate to all the fine cells within one coarse cell.
int m_degree
max degree of polynomials
Definition: FourthOrderInterpStencil.H:86
void operator=(const FourthOrderInterpStencil &a_input)
Definition: FourthOrderInterpStencil.H:109
void define(const IntVect &a_bdryOffset, const int &a_refineCoarse, const int &a_degree=3)
Actual constructor.
FourthOrderInterpStencil(const FourthOrderInterpStencil &a_input)
Definition: FourthOrderInterpStencil.H:115
Time interpolator class using 4th-order Runge-Kutta.
Definition: FourthOrderInterpStencil.H:23
int m_refineCoarse
refinement ratio
Definition: FourthOrderInterpStencil.H:83
FourthOrderInterpStencil(const IntVect &a_bdryOffset, const int &a_refineCoarse, const int &a_degree=3)
Full constructor.
Definition: FourthOrderInterpStencil.H:33
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.
static const IntVect Zero
Definition: IntVect.H:627
IntVect m_bdryOffset
displacement from domain boundary in each dimension, in range -(a_degree-1):(a_degree-1) ...
Definition: FourthOrderInterpStencil.H:89
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
FArrayBox m_coarseToFineFab
m_stencilSize coefficients of coarse cells for each cell in m_baseFineBox
Definition: FourthOrderInterpStencil.H:101
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:44
int m_stencilSize
number of coarse cells in the stencil
Definition: FourthOrderInterpStencil.H:95
FourthOrderInterpStencil()
Default constructor.
bool m_defined
whether define() has been called
Definition: FourthOrderInterpStencil.H:104