Chombo + EB  3.2
NodeCFIVS.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 // NodeCFIVS.H
12 // petermc, 1 May 2001
13 #ifndef _NODECFIVS_H_
14 #define _NODECFIVS_H_
15 
16 #include <iostream>
17 #include <cmath>
18 #include "SPACE.H"
19 #include <cstdlib>
20 #include "REAL.H"
21 #include "IntVect.H"
22 #include "Box.H"
23 #include "LoHiSide.H"
24 #include "DisjointBoxLayout.H"
25 #include "IntVectSet.H"
26 #include "NamespaceHeader.H"
27 
28 /// Class to get fine IntVectSet at coarse/fine interface
29 /**
30  Class to get IntVectSet of nodes (of a particular face of a
31  particular box) that lie on interface with next coarser level.
32 
33  This class should be considered internal to AMRNodeSolver and should
34  not be considered part of the Chombo API.
35 */
36 class NodeCFIVS
37 {
38 
39 public:
40 
41  /**
42  \name Constructors, destructor and defines
43  */
44  /*@{*/
45 
46  ///
47  /** Default constructor. User must subsequently call define().
48  */
49  NodeCFIVS();
50 
51  ///
52  /** Destructor.
53  */
54  ~NodeCFIVS();
55 
56  ///
57  /** Constructor calls setDefaultValues() and then
58  calls define() with the same arguments.
59  */
60  NodeCFIVS(const Box& a_domain,
61  const Box& a_box,
62  const DisjointBoxLayout& a_levelBoxes,
63  int a_idir,
64  Side::LoHiSide a_hiorlo);
65 
66  ///
67  /** Constructor calls setDefaultValues() and then
68  calls define() with the same arguments.
69  */
70  NodeCFIVS(const ProblemDomain& a_domain,
71  const Box& a_box,
72  const DisjointBoxLayout& a_levelBoxes,
73  int a_idir,
74  Side::LoHiSide a_hiorlo);
75 
76  ///
77  /** Full define function. The current level is taken to be the fine level.
78  */
79  void define(/// CELL-centered physical domain at this level
80  const ProblemDomain& a_domain,
81  /// the CELL-centered box at this level
82  const Box& a_box,
83  /// the set of all CELL-centered boxes at this level
84  const DisjointBoxLayout& a_levelBoxes,
85  /// direction (0 to SpaceDim-1) of face of box on which we find interface nodes
86  int a_idir,
87  /// high or low side of box
88  Side::LoHiSide a_hiorlo);
89 
90  ///
91  /** Full define function. The current level is taken to be the fine level.
92  */
93  void define(/// CELL-centered physical domain at this level
94  const Box& a_domain,
95  /// the CELL-centered box at this level
96  const Box& a_box,
97  /// the set of all CELL-centered boxes at this level
98  const DisjointBoxLayout& a_levelBoxes,
99  /// direction (0 to SpaceDim-1) of face of box on which we find interface nodes
100  int a_idir,
101  /// high or low side of box
102  Side::LoHiSide a_hiorlo);
103 
104  /*@}*/
105 
106  /**
107  \name Access functions
108  */
109  /*@{*/
110 
111  ///
112  bool isDefined() const;
113 
114  ///
115  /** Returns <tt>true</tt> if this coarse-fine IntVectSet is empty.
116  */
117  bool isEmpty() const;
118 
119  ///
120  /** Returns <tt>true</tt> if this coarse-fine IntVectSet can be represented
121  as just a Box, i.e., a user can perform a dense computation instead of
122  a pointwise calculation using IVSIterator.
123 
124  If isPacked() then you can use packedBox() instead of getFineIVS().
125  */
126  bool isPacked() const;
127 
128  ///
129  /** If isPacked() returns <tt>true</tt>,
130  then the box returned by this function
131  is a suitable substitute for this IntVectSet returned by getFineIVS().
132  */
133  const Box& packedBox() const;
134 
135  ///
136  /** Returns indices of fine nodes, on the face of the box,
137  that lie on the interface with the coarser level and where
138  data need to be interpolated.
139 
140  This will be empty if isEmpty() returns <tt>true</tt>.
141  If isPacked() then you can use packedBox() instead of getFineIVS().
142  */
143  const IntVectSet& getFineIVS() const ;
144 
145  /*@}*/
146 
147  static long long m_packCount, m_sparseCount;
148 
149 protected:
150 
151  //for internal use
152  void setDefaultValues();
153 
154  /** indices of fine nodes that need to be interpolated
155  */
157 
158  bool m_packed;
159 
160  bool m_empty;
161 
163 
165 
166 private:
167  void operator= (const NodeCFIVS& levcfs_in)
168  {
169  }
170 
171  NodeCFIVS(const NodeCFIVS& levcfs_in)
172  {
173  }
174 };
175 
176 
177 inline
178 bool NodeCFIVS::isEmpty() const
179 {
180  return m_empty;
181 }
182 
183 
184 inline
186 {
187  return m_packed;
188 }
189 
190 
191 inline
192 const Box& NodeCFIVS::packedBox() const
193 {
194  return m_packedBox;
195 }
196 
197 #include "NamespaceFooter.H"
198 #endif
bool isPacked() const
Definition: NodeCFIVS.H:185
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
static long long m_packCount
Definition: NodeCFIVS.H:147
bool m_empty
Definition: NodeCFIVS.H:160
bool isEmpty() const
Definition: NodeCFIVS.H:178
bool m_isdefined
Definition: NodeCFIVS.H:164
Class to get fine IntVectSet at coarse/fine interface.
Definition: NodeCFIVS.H:36
const IntVectSet & getFineIVS() const
void define(const ProblemDomain &a_domain, const Box &a_box, const DisjointBoxLayout &a_levelBoxes, int a_idir, Side::LoHiSide a_hiorlo)
static long long m_sparseCount
Definition: NodeCFIVS.H:147
const Box & packedBox() const
Definition: NodeCFIVS.H:192
void setDefaultValues()
A BoxLayout that has a concept of disjointedness.
Definition: DisjointBoxLayout.H:30
LoHiSide
Definition: LoHiSide.H:27
Box m_packedBox
Definition: NodeCFIVS.H:162
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
bool m_packed
Definition: NodeCFIVS.H:158
void operator=(const NodeCFIVS &levcfs_in)
Definition: NodeCFIVS.H:167
NodeCFIVS(const NodeCFIVS &levcfs_in)
Definition: NodeCFIVS.H:171
bool isDefined() const
IntVectSet m_fineInterpIVS
Definition: NodeCFIVS.H:156