Chombo + EB + MF  3.2
TensorFineStencilSet.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 _TENSORFINESTENCILSET_H_
12 #define _TENSORFINESTENCILSET_H_
13 
14 #include "SPACE.H"
15 #include <stdlib.h>
16 #include "IntVectSet.H"
17 #include "ProblemDomain.H"
18 #include "QuadCFStencil.H"
19 #include "NamespaceHeader.H"
20 
21 /// Class to encapsulate fine-level tangential gradient stencil computation
22 /** This is a helper class which essentially wraps three IntVectSets which
23  define which type of stencil to use in computing fine-level tangential
24  gradients. This is only relevant in the presence of a physical boundary
25  (since the only place where the fine-level stencil is shifted is at a
26  physical boundary; in a periodic world, all differences are centered.)
27 */
29 {
30 public:
31  /// constructors, destructors, defines
32 
33  /// default constructor -- leaves class in undefined state
35 
36  /// full constructor -- defines stencil IntVectSets
37  TensorFineStencilSet(const IntVectSet& a_fineIVS,
38  const ProblemDomain& a_domain,
39  int a_normalDir);
40 
41  /// destructor
43 
44  /// define function
45  void define(const IntVectSet& a_fineIVS,
46  const ProblemDomain& a_domain,
47  int a_dir);
48 
49  /// accessor
50  /** accessor -- returns cells where fine-level tangential gradient
51  in a_tanDir direction will use a centered-difference stencil. If
52  a_tanDir is normal to the face (i.e, isn't a tangential direction
53  after all), will return an empty IntVectSet.
54  */
55  const IntVectSet& getCenteredStencilSet(int a_tanDir) const;
56 
57  /// accessor
58  /** accessor -- returns cells where fine-level tangential gradient
59  in a_tanDir will use a forward-difference stencil. If a_tanDir
60  is normal to the face (i.e. it isn't a tangential direction
61  after all), will return an empty IntVectSet.
62  */
63  const IntVectSet& getForwardStencilSet(int a_tanDir) const;
64 
65  /// accessor
66  /** accessor -- returns cells where fine-level tangential gradient
67  in a_tanDir will use a backward-difference stencil. If a_tanDir
68  is normal to the face, will return an empty IntVectSet.
69  */
70  const IntVectSet& getBackwardStencilSet(int a_tanDir) const;
71 
72  /// has this object been defined?
73  bool isDefined() const;
74 
75  /// does this contain any non-empty IntVectSets?
76  bool isEmpty() const;
77 
78 protected:
79  ///
81 
82  ///
83  bool m_isEmpty;
84 
85  ///
87 
88 #if CH_SPACEDIM == 1
89  ///
91 #else
92  ///
93  int m_tangentialDirections[SpaceDim-1];
94 #endif
95 
96  /// cells which will use centered diffs
97 #if CH_SPACEDIM == 1
99 #else
100  IntVectSet m_centeredSet[SpaceDim-1];
101 #endif
102 
103 #if CH_SPACEDIM == 1
104  /// cells which will use forward diffs
106 #else
107  IntVectSet m_forwardSet[SpaceDim-1];
108 #endif
109 
110  /// cells which will use backward diffs
111 #if CH_SPACEDIM == 1
113 #else
114  IntVectSet m_backwardSet[SpaceDim-1];
115 #endif
116 
117 };
118 
119 #include "NamespaceFooter.H"
120 #endif
121 
void define(const IntVectSet &a_fineIVS, const ProblemDomain &a_domain, int a_dir)
define function
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
bool isEmpty() const
does this contain any non-empty IntVectSets?
const IntVectSet & getForwardStencilSet(int a_tanDir) const
accessor
IntVectSet m_centeredSet[SpaceDim-1]
cells which will use centered diffs
Definition: TensorFineStencilSet.H:100
int m_tangentialDirections[SpaceDim-1]
Definition: TensorFineStencilSet.H:93
const int SpaceDim
Definition: SPACE.H:38
Class to encapsulate fine-level tangential gradient stencil computation.
Definition: TensorFineStencilSet.H:28
int m_normalDir
Definition: TensorFineStencilSet.H:86
bool m_isEmpty
Definition: TensorFineStencilSet.H:83
~TensorFineStencilSet()
destructor
const IntVectSet & getCenteredStencilSet(int a_tanDir) const
accessor
IntVectSet m_backwardSet[SpaceDim-1]
cells which will use backward diffs
Definition: TensorFineStencilSet.H:114
const IntVectSet & getBackwardStencilSet(int a_tanDir) const
accessor
bool m_isDefined
Definition: TensorFineStencilSet.H:80
IntVectSet m_forwardSet[SpaceDim-1]
Definition: TensorFineStencilSet.H:107
bool isDefined() const
has this object been defined?
TensorFineStencilSet()
constructors, destructors, defines