Chombo + EB + MF
3.2
src
AMRTools
CFStencil.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 _CFSTENCIL_H_
12
#define _CFSTENCIL_H_
13
14
#include <iostream>
15
#include <math.h>
16
#include "
SPACE.H
"
17
#include <stdlib.h>
18
#include "
DisjointBoxLayout.H
"
19
#include "
Box.H
"
20
#include "
LoHiSide.H
"
21
#include "
IntVectSet.H
"
22
#include "NamespaceHeader.H"
23
24
/// Class to encapsulate coarse-fine information for AMR operations.
25
/**
26
CFStencil is a wrapper around a bunch of things
27
that allow one to do coarse-fine interpolation.
28
This class should be considered internal to QuadCFInterp
29
and should not be considered part of the Chombo API.
30
*/
31
class
CFStencil
32
{
33
34
private
:
35
36
protected
:
37
//for internal use
38
void
setDefaultValues
();
39
40
//the following variables are mainly for self-identification
41
42
// direction normal to interface
43
int
m_direction
;
44
45
// interface is on high or low side of grid
46
Side::LoHiSide
m_hiorlo
;
47
48
//
49
DataIndex
m_dataIndex
;
50
51
//the following variables are to be used by others
52
53
/* fine intvects which need to be interpolated */
54
IntVectSet
m_fineIVS
;
55
56
/* coar intvects where slopes can be computed
57
== coarsened version of fiinterp ivs*/
58
IntVectSet
m_coarIVS
;
59
60
bool
m_isDefined
;
61
62
bool
m_isPacked
;
63
64
Box
m_packedBox
;
65
66
public
:
67
/// {\bf Access functions}
68
69
///
70
/** returns true if CFStencil is defined */
71
bool
isDefined
()
const
;
72
73
///
74
/**
75
are there any interpolation points? \\
76
returns false if so.*/
77
bool
isEmpty
()
const
;
78
79
///
80
bool
isPacked
()
const
81
{
82
return
m_isPacked
;
83
}
84
///
85
const
Box
&
packedBox
()
const
86
87
{
88
return
m_packedBox
;
89
}
90
91
///
92
/** get fine intvects which need to be interpolated \\
93
This will be empty if isEmpty() returns true*/
94
const
IntVectSet
&
getFineIVS
()
const
;
95
96
///
97
/** get coarse intvects that underly fiinterpivs.
98
This will be empty if isEmpty() returns true
99
this is the same as getCoarInterpIVS
100
*/
101
const
IntVectSet
&
getCoarIVS
()
const
;
102
103
///
104
CFStencil
&
operator=
(
const
CFStencil
& cfs_in);
105
106
///
107
CFStencil
(
const
CFStencil
& cfs_in);
108
109
/*dummy constructor so i can use this with
110
LocalBoxLayoutData
111
*/
112
CFStencil
(
const
Box
& a_b,
int
a_nComp);
113
114
void
define
(
const
Box
& a_b,
int
a_nComp);
115
116
///
117
CFStencil
();
118
119
///
120
~CFStencil
();
121
122
///
123
CFStencil
(
124
const
Box
& FineDomain,
125
const
Box
& grid,
126
const
DisjointBoxLayout
& Levboxes,
127
const
DisjointBoxLayout
& LevCBoxes,
128
int
RefRatio,
129
int
Direction,
130
Side::LoHiSide
hiorlo);
131
132
///
133
CFStencil
(
134
const
ProblemDomain
& FineDomain,
135
const
Box
& grid,
136
const
DisjointBoxLayout
& Levboxes,
137
const
DisjointBoxLayout
& LevCBoxes,
138
int
RefRatio,
139
int
Direction,
140
Side::LoHiSide
hiorlo);
141
142
///
143
void
define
(
144
const
Box
& FineDomain,
145
const
Box
& grid,
146
const
DisjointBoxLayout
& fine_boxes,
147
const
DisjointBoxLayout
& coar_boxes,
148
int
Refratio,
149
int
Direction,
150
Side::LoHiSide
hiorlo);
151
152
///
153
void
define
(
154
const
ProblemDomain
& FineDomain,
155
const
Box
& grid,
156
const
DisjointBoxLayout
& fine_boxes,
157
const
DisjointBoxLayout
& coar_boxes,
158
int
Refratio,
159
int
Direction,
160
Side::LoHiSide
hiorlo);
161
162
/// faster define function that uses a sorted periodic vector
163
/** user calls the helper function "buildPeriodicVector", then
164
uses that returned Vector<Box> in the subsequent calls to this define.
165
*/
166
void
define
(
167
const
ProblemDomain
& a_fineDomain,
168
const
Box
& a_grid,
169
const
Vector<Box>
& a_periodicVector,
170
int
a_refRatio,
171
int
a_direction,
172
Side::LoHiSide
a_hiorlo);
173
///
174
void
clear
();
175
176
177
static
void
buildPeriodicVector
(
Vector<Box>
& a_periodicVector,
178
const
ProblemDomain
& a_fineDomain,
179
const
DisjointBoxLayout
& a_fineBoxes);
180
181
};
182
#include "NamespaceFooter.H"
183
#endif
CFStencil::m_isPacked
bool m_isPacked
Definition:
CFStencil.H:62
CFStencil::m_dataIndex
DataIndex m_dataIndex
Definition:
CFStencil.H:49
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
CFStencil::m_isDefined
bool m_isDefined
Definition:
CFStencil.H:60
Vector< Box >
CFStencil::setDefaultValues
void setDefaultValues()
DisjointBoxLayout.H
CFStencil::clear
void clear()
CFStencil::isEmpty
bool isEmpty() const
SPACE.H
CFStencil::m_fineIVS
IntVectSet m_fineIVS
Definition:
CFStencil.H:54
CFStencil::CFStencil
CFStencil()
CFStencil
Class to encapsulate coarse-fine information for AMR operations.
Definition:
CFStencil.H:31
CFStencil::operator=
CFStencil & operator=(const CFStencil &cfs_in)
CFStencil::getFineIVS
const IntVectSet & getFineIVS() const
DisjointBoxLayout
A BoxLayout that has a concept of disjointedness.
Definition:
DisjointBoxLayout.H:30
Side::LoHiSide
LoHiSide
Definition:
LoHiSide.H:27
CFStencil::isDefined
bool isDefined() const
{ Access functions}
Box
A Rectangular Domain on an Integer Lattice.
Definition:
Box.H:469
CFStencil::packedBox
const Box & packedBox() const
Definition:
CFStencil.H:85
DataIndex
Definition:
DataIndex.H:114
CFStencil::buildPeriodicVector
static void buildPeriodicVector(Vector< Box > &a_periodicVector, const ProblemDomain &a_fineDomain, const DisjointBoxLayout &a_fineBoxes)
LoHiSide.H
CFStencil::m_hiorlo
Side::LoHiSide m_hiorlo
Definition:
CFStencil.H:46
CFStencil::isPacked
bool isPacked() const
Definition:
CFStencil.H:80
Box.H
CFStencil::define
void define(const Box &a_b, int a_nComp)
CFStencil::~CFStencil
~CFStencil()
CFStencil::m_coarIVS
IntVectSet m_coarIVS
Definition:
CFStencil.H:58
IntVectSet.H
CFStencil::m_packedBox
Box m_packedBox
Definition:
CFStencil.H:64
CFStencil::m_direction
int m_direction
Definition:
CFStencil.H:43
CFStencil::getCoarIVS
const IntVectSet & getCoarIVS() const
Generated by
1.8.13