Chombo + EB  3.2
FourthOrderOneDStencil.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 _FOURTHORDERONEDSTENCIL_H_
12 #define _FOURTHORDERONEDSTENCIL_H_
13 
14 #include "FArrayBox.H"
15 #include "IntVect.H"
16 #include "Vector.H"
17 #include "LAPACKMatrix.H"
18 #include "NamespaceHeader.H"
19 
20 /// Class to manage coarse-to-fine spatial interpolation to all fine cells within a single particular coarse cell
21 
22 /**
23  */
25 {
26 public:
27  /// Default constructor
28  /**
29  Object requires define() to be called before all other functions.
30  */
32 
33 
34 
35  /// Destructor
36  /**
37  Destroys all objects created by define(). Passed in data references
38  of define() are left alone.
39  */
41  {
42  if (m_weights != NULL)
43  {
44  for (int iWeight = 0; iWeight <=3; ++ iWeight)
45  {
46  delete m_weights[iWeight];
47  }
48  delete m_weights;
49  }
50  }
51 
52  /// Actual constructor.
53  /**
54  Set up object.
55  */
56  void define(const int& a_refRatio,
57  const int& a_order );
58 
59  void makeMomentMatrix(LAPACKMatrix & a_matrix,
60  const Real & a_dx ,
61  const Real & a_vol );
62 
63  void calculateStencilWeights(LAPACKMatrix & a_weights ,
64  const LAPACKMatrix & a_matrix ,
65  const LAPACKMatrix & a_coarseData);
66 
67  void calculateMoments(Vector <Real> & a_oneDMomentMap,
68  const Real & a_dx ,
69  const Real & a_vol );
70 
71  void apply(FArrayBox & a_fineFab ,
72  const FArrayBox& a_coarseFab ,
73  const IntVect & a_coarseIv ,
74  const int & a_interpDir ,
75  const IntVect & a_coarseRefineVect);
76 
77 protected:
78 
79 public:
81  int m_order ;
82 
84 protected:
85 
86  /// whether define() has been called
87  bool m_defined;
88 
89 
90 private:
91 
92  // Disallowed for all the usual reasons
93  void operator=(const FourthOrderOneDStencil& a_input)
94  {
95  MayDay::Error("invalid operator");
96  }
97 
98  // Disallowed for all the usual reasons
100  {
101  MayDay::Error("invalid operator");
102  }
103 };
104 
105 #include "NamespaceFooter.H"
106 #endif
void makeMomentMatrix(LAPACKMatrix &a_matrix, const Real &a_dx, const Real &a_vol)
FourthOrderOneDStencil(const FourthOrderOneDStencil &a_input)
Definition: FourthOrderOneDStencil.H:99
Class to manage coarse-to-fine spatial interpolation to all fine cells within a single particular coa...
Definition: FourthOrderOneDStencil.H:24
bool m_defined
whether define() has been called
Definition: FourthOrderOneDStencil.H:87
void apply(FArrayBox &a_fineFab, const FArrayBox &a_coarseFab, const IntVect &a_coarseIv, const int &a_interpDir, const IntVect &a_coarseRefineVect)
~FourthOrderOneDStencil()
Destructor.
Definition: FourthOrderOneDStencil.H:40
void calculateMoments(Vector< Real > &a_oneDMomentMap, const Real &a_dx, const Real &a_vol)
void define(const int &a_refRatio, const int &a_order)
Actual constructor.
double Real
Definition: REAL.H:33
Definition: LAPACKMatrix.H:24
Real ** m_weights
Definition: FourthOrderOneDStencil.H:83
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.
FourthOrderOneDStencil()
Default constructor.
int m_refRatio
Definition: FourthOrderOneDStencil.H:80
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
Definition: FArrayBox.H:45
int m_order
Definition: FourthOrderOneDStencil.H:81
void operator=(const FourthOrderOneDStencil &a_input)
Definition: FourthOrderOneDStencil.H:93
void calculateStencilWeights(LAPACKMatrix &a_weights, const LAPACKMatrix &a_matrix, const LAPACKMatrix &a_coarseData)