Chombo + EB  3.0
FourthOrderPatchInterp.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 _FOURTHORDERPATCHINTERP_H_
12 #define _FOURTHORDERPATCHINTERP_H_
13 
14 #include "FArrayBox.H"
15 #include "ProblemDomain.H"
17 #include "IntVectSet.H"
18 #include "UsingNamespace.H"
19 
20 /// Fourth-order interpolation in space on a single patch
21 
22 /**
23  */
25 {
26 public:
27  /// Default constructor
28  /**
29  Object requires define() to be called before all other functions.
30  */
32 
33  /// Destructor
34  /**
35  Destroys all objects created by define(). Passed in data references
36  of define() are left alone.
37  */
38  virtual ~FourthOrderPatchInterp();
39 
40  /// Actual constructor.
41  /**
42  Set up object.
43  */
44  virtual void define(
45  /// problem domain on this level
46  const ProblemDomain& a_domain,
47  /// refinement ratio between this level and next coarser level
48  const int& a_refineCoarse,
49  /// maximum distance of stencil from domain boundary
50  const int& a_maxStencilDist);
51 
52  /// Set the coarse box before calling setStencil or interpToFine.
53  /**
54  */
55  virtual void setCoarseBox(const Box& a_coarseBox);
56 
57  /// Set stencil for current coarse box and domain
58  /**
59  Set a_stencil for m_coarseBox.
60  */
61  virtual void setStencil(BaseFab<IntVect>& a_stencil);
62 
63  /// Interpolate in space.
64  /**
65  Interpolate in space to a_fine from a_coarse.
66  */
67  virtual void interpToFine(/// interpolated solution on this level
68  FArrayBox& a_fine,
69  /// coarse solution
70  const FArrayBox& a_coarse,
71  /// stencils
72  const BaseFab<IntVect>& a_stencils);
73 
74  /// Interpolate in space.
75  /**
76  Interpolate in space to a_fine from a_coarse at
77  fine cells within the coarse cells listed in a_ivs.
78  */
79  virtual void interpToFine(/// interpolated solution on this level
80  FArrayBox& a_fine,
81  /// coarse solution
82  const FArrayBox& a_coarse,
83  /// stencils
84  const BaseFab<IntVect>& a_stencils,
85  /// we fill in fine cells within these coarse cells
86  const IntVectSet& a_ivs);
87 
88 protected:
89 
90  /// all possible stencils, on (-m_maxStencilDist:+m_maxStencilDist)^SpaceDim
92 
93  /// Problem domain - index space for this level
95 
96  // m_domain coarsened by m_refineCoarse
98 
99  /// Refinement ratio between this level and the next coarser
101 
102  /// maximum distance of stencil from domain boundary
104 
105  /// max degree of approximations
106  int m_degree;
107 
108  /// define() has been called
109  bool m_defined;
110 
111  /// current coarse box
113 
114  /// m_coarseBox is set
116 
117 private:
118 
119  // Disallowed for all the usual reasons
120  void operator=(const FourthOrderPatchInterp& a_input)
121  {
122  MayDay::Error("invalid operator");
123  }
124 
125  // Disallowed for all the usual reasons
127  {
128  MayDay::Error("invalid operator");
129  }
130 };
131 
132 #endif
virtual void interpToFine(FArrayBox &a_fine, const FArrayBox &a_coarse, const BaseFab< IntVect > &a_stencils)
Interpolate in space.
virtual ~FourthOrderPatchInterp()
Destructor.
ProblemDomain m_coarseDomain
Definition: FourthOrderPatchInterp.H:97
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:130
virtual void define(const ProblemDomain &a_domain, const int &a_refineCoarse, const int &a_maxStencilDist)
Actual constructor.
int m_degree
max degree of approximations
Definition: FourthOrderPatchInterp.H:106
bool m_isCoarseBoxSet
m_coarseBox is set
Definition: FourthOrderPatchInterp.H:115
BaseFab< FourthOrderInterpStencil * > m_stencils
all possible stencils, on (-m_maxStencilDist:+m_maxStencilDist)^SpaceDim
Definition: FourthOrderPatchInterp.H:91
int m_refineCoarse
Refinement ratio between this level and the next coarser.
Definition: FourthOrderPatchInterp.H:100
FourthOrderPatchInterp()
Default constructor.
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: BaseFab.H:76
virtual void setStencil(BaseFab< IntVect > &a_stencil)
Set stencil for current coarse box and domain.
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
Box m_coarseBox
current coarse box
Definition: FourthOrderPatchInterp.H:112
Definition: FArrayBox.H:44
ProblemDomain m_domain
Problem domain - index space for this level.
Definition: FourthOrderPatchInterp.H:94
Fourth-order interpolation in space on a single patch.
Definition: FourthOrderPatchInterp.H:24
virtual void setCoarseBox(const Box &a_coarseBox)
Set the coarse box before calling setStencil or interpToFine.
void operator=(const FourthOrderPatchInterp &a_input)
Definition: FourthOrderPatchInterp.H:120
int m_maxStencilDist
maximum distance of stencil from domain boundary
Definition: FourthOrderPatchInterp.H:103
FourthOrderPatchInterp(const FourthOrderPatchInterp &a_input)
Definition: FourthOrderPatchInterp.H:126
bool m_defined
define() has been called
Definition: FourthOrderPatchInterp.H:109