Chombo + EB  3.2
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"
16 #include "IntVectSet.H"
18 #include "NamespaceHeader.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  /// dimensions that are fixed, not interpolated
52  Interval a_fixedDims = Interval() );
53 
54  /// Set the coarse box before calling setStencil or interpToFine.
55  /**
56  */
57  virtual void setCoarseBox(const Box& a_coarseBox);
58 
59  /// Set stencil for current coarse box and domain
60  /**
61  Set a_stencil for m_coarseBox.
62  */
63  virtual void setStencil(BaseFab<IntVect>& a_stencil);
64 
65  /// Interpolate in space.
66  /**
67  Interpolate in space to a_fine from a_coarse.
68  */
69  virtual void interpToFine(/// interpolated solution on this level
70  FArrayBox& a_fine,
71  /// coarse solution
72  const FArrayBox& a_coarse,
73  /// stencils
74  const BaseFab<IntVect>& a_stencils);
75 
76  /// Interpolate in space.
77  /**
78  Interpolate in space to a_fine from a_coarse at
79  fine cells within the coarse cells listed in a_ivs.
80  */
81  virtual void interpToFine(/// interpolated solution on this level
82  FArrayBox& a_fine,
83  /// coarse solution
84  const FArrayBox& a_coarse,
85  /// stencils
86  const BaseFab<IntVect>& a_stencils,
87  /// we fill in fine cells within these coarse cells
88  const IntVectSet& a_ivs);
89 
90 protected:
91 
92  /// all possible stencils, on (-m_maxStencilDist:+m_maxStencilDist)^SpaceDim
94 
95  /// Problem domain - index space for this level
97 
98  // m_domain coarsened by m_refineCoarse
100 
101  /// Refinement ratio between this level and the next coarser
103 
104  /// maximum distance of stencil from domain boundary
106 
107  /// max degree of approximations
108  int m_degree;
109 
110  /// dimensions that are fixed, not interpolated
112 
113  /// 1 in m_fixedDims, m_refineCoarse in other dimensions
115 
116  /// define() has been called
117  bool m_defined;
118 
119  /// current coarse box
121 
122  /// m_coarseBox is set
124 
125 private:
126 
127  // Disallowed for all the usual reasons
128  void operator=(const FourthOrderPatchInterp& a_input)
129  {
130  MayDay::Error("invalid operator");
131  }
132 
133  // Disallowed for all the usual reasons
135  {
136  MayDay::Error("invalid operator");
137  }
138 };
139 
140 #include "NamespaceFooter.H"
141 #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:99
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
int m_degree
max degree of approximations
Definition: FourthOrderPatchInterp.H:108
bool m_isCoarseBoxSet
m_coarseBox is set
Definition: FourthOrderPatchInterp.H:123
BaseFab< FourthOrderInterpStencil * > m_stencils
all possible stencils, on (-m_maxStencilDist:+m_maxStencilDist)^SpaceDim
Definition: FourthOrderPatchInterp.H:93
virtual void define(const ProblemDomain &a_domain, const int &a_refineCoarse, const int &a_maxStencilDist, Interval a_fixedDims=Interval())
Actual constructor.
int m_refineCoarse
Refinement ratio between this level and the next coarser.
Definition: FourthOrderPatchInterp.H:102
FourthOrderPatchInterp()
Default constructor.
Structure for passing component ranges in code.
Definition: Interval.H:23
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:77
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:120
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:45
ProblemDomain m_domain
Problem domain - index space for this level.
Definition: FourthOrderPatchInterp.H:96
Fourth-order interpolation in space on a single patch.
Definition: FourthOrderPatchInterp.H:24
IntVect m_refineVect
1 in m_fixedDims, m_refineCoarse in other dimensions
Definition: FourthOrderPatchInterp.H:114
virtual void setCoarseBox(const Box &a_coarseBox)
Set the coarse box before calling setStencil or interpToFine.
Interval m_fixedDims
dimensions that are fixed, not interpolated
Definition: FourthOrderPatchInterp.H:111
void operator=(const FourthOrderPatchInterp &a_input)
Definition: FourthOrderPatchInterp.H:128
int m_maxStencilDist
maximum distance of stencil from domain boundary
Definition: FourthOrderPatchInterp.H:105
FourthOrderPatchInterp(const FourthOrderPatchInterp &a_input)
Definition: FourthOrderPatchInterp.H:134
bool m_defined
define() has been called
Definition: FourthOrderPatchInterp.H:117