Chombo + EB + MF
3.2
src
AMRTools
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
*/
28
class
TensorFineStencilSet
29
{
30
public
:
31
/// constructors, destructors, defines
32
33
/// default constructor -- leaves class in undefined state
34
TensorFineStencilSet
();
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
42
~TensorFineStencilSet
();
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
///
80
bool
m_isDefined
;
81
82
///
83
bool
m_isEmpty
;
84
85
///
86
int
m_normalDir
;
87
88
#if CH_SPACEDIM == 1
89
///
90
int
m_tangentialDirections
[
SpaceDim
];
91
#else
92
///
93
int
m_tangentialDirections[
SpaceDim
-1];
94
#endif
95
96
/// cells which will use centered diffs
97
#if CH_SPACEDIM == 1
98
IntVectSet
m_centeredSet
[
SpaceDim
];
99
#else
100
IntVectSet
m_centeredSet[
SpaceDim
-1];
101
#endif
102
103
#if CH_SPACEDIM == 1
104
/// cells which will use forward diffs
105
IntVectSet
m_forwardSet
[
SpaceDim
];
106
#else
107
IntVectSet
m_forwardSet[
SpaceDim
-1];
108
#endif
109
110
/// cells which will use backward diffs
111
#if CH_SPACEDIM == 1
112
IntVectSet
m_backwardSet
[
SpaceDim
];
113
#else
114
IntVectSet
m_backwardSet[
SpaceDim
-1];
115
#endif
116
117
};
118
119
#include "NamespaceFooter.H"
120
#endif
121
TensorFineStencilSet::define
void define(const IntVectSet &a_fineIVS, const ProblemDomain &a_domain, int a_dir)
define function
IntVectSet
An irregular domain on an integer lattice.
Definition:
IntVectSet.H:44
ProblemDomain
A class to facilitate interaction with physical boundary conditions.
Definition:
ProblemDomain.H:141
TensorFineStencilSet::isEmpty
bool isEmpty() const
does this contain any non-empty IntVectSets?
TensorFineStencilSet::getForwardStencilSet
const IntVectSet & getForwardStencilSet(int a_tanDir) const
accessor
TensorFineStencilSet::m_centeredSet
IntVectSet m_centeredSet[SpaceDim-1]
cells which will use centered diffs
Definition:
TensorFineStencilSet.H:100
TensorFineStencilSet::m_tangentialDirections
int m_tangentialDirections[SpaceDim-1]
Definition:
TensorFineStencilSet.H:93
SpaceDim
const int SpaceDim
Definition:
SPACE.H:38
SPACE.H
ProblemDomain.H
TensorFineStencilSet
Class to encapsulate fine-level tangential gradient stencil computation.
Definition:
TensorFineStencilSet.H:28
TensorFineStencilSet::m_normalDir
int m_normalDir
Definition:
TensorFineStencilSet.H:86
TensorFineStencilSet::m_isEmpty
bool m_isEmpty
Definition:
TensorFineStencilSet.H:83
TensorFineStencilSet::~TensorFineStencilSet
~TensorFineStencilSet()
destructor
TensorFineStencilSet::getCenteredStencilSet
const IntVectSet & getCenteredStencilSet(int a_tanDir) const
accessor
TensorFineStencilSet::m_backwardSet
IntVectSet m_backwardSet[SpaceDim-1]
cells which will use backward diffs
Definition:
TensorFineStencilSet.H:114
TensorFineStencilSet::getBackwardStencilSet
const IntVectSet & getBackwardStencilSet(int a_tanDir) const
accessor
QuadCFStencil.H
TensorFineStencilSet::m_isDefined
bool m_isDefined
Definition:
TensorFineStencilSet.H:80
TensorFineStencilSet::m_forwardSet
IntVectSet m_forwardSet[SpaceDim-1]
Definition:
TensorFineStencilSet.H:107
TensorFineStencilSet::isDefined
bool isDefined() const
has this object been defined?
IntVectSet.H
TensorFineStencilSet::TensorFineStencilSet
TensorFineStencilSet()
constructors, destructors, defines
Generated by
1.8.13