Chombo + EB + MF  3.2
FaceIterator.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 // ANAG, LBNL
12 
13 #ifndef _FACEITERATOR_H_
14 #define _FACEITERATOR_H_
15 
16 #include "IntVect.H"
17 #include "FaceIndex.H"
18 #include "IntVectSet.H"
19 #include "Vector.H"
20 #include "NamespaceHeader.H"
21 class EBGraph;
22 
23 ///
24 /**
25  Ennumeration class to distinguish where FaceIterator will stop.
26 */
27 class FaceStop
28 {
29 public:
30  ///
31  /**
32  SurroundingWithBoundary means stop at all faces on the high and
33  low sides of IVS cells. \ \
34  SurroundingNoBoundary means stop at all faces on the high and
35  low sides of IVS cells, excluding faces on the domain boundary.\ \
36  LoWithBoundary means stop at all faces on the
37  low side of IVS cells.\\
38  LoNoBoundary means stop at all faces on the
39  low side of IVS cells, excluding faces on the domain boundary.\ \
40  HiWithBoundary means stop at all faces on the
41  high side of IVS cells.\\
42  HiNoBoundary means stop at all faces on the
43  high side of IVS cells, excluding faces on the domain boundary.\ \
44  */
46  {
47  Invalid=-1,
58  };
59 };
60 
61 
62 /// Iterator over faces within an IntVectSet and an Ebgraph
63 /**
64  Iterator over within an IntVectSet and an Ebgraph.
65  The enumeration tells which faces on which to stop.
66  */
68 {
69 public:
70 
71  /// general construction
72  FaceIterator(const IntVectSet& a_ivs, const EBGraph& a_ebgraph,
73  int a_direction, const FaceStop::WhichFaces& a_location);
74 
75  ///
76  FaceIterator();
77 
78  /// Going with the default...
79  // FaceIterator( const FaceIterator & that);
80 
81  /// Going with the default...
82  // FaceIterator & operator=( const FaceIterator & that);
83 
84  ///
85  ~FaceIterator();
86 
87 
88  ///
89  void define(const IntVectSet& a_ivs, const EBGraph& a_ebgraph,
90  int a_direction, const FaceStop::WhichFaces& a_location);
91 
92  ///
93  void reset();
94 
95  ///
96  void operator++();
97 
98  ///
99  const FaceIndex& operator() () const;
100 
101  ///
102  bool ok() const;
103 
104  ///
105  bool isDefined() const;
106 
107  ///
108  const Vector<FaceIndex>& getVector() const;
109 
110 private:
111  ///
112  /**
113  Does the real work. this->define() looks in the cache first.
114  */
115  void doDefine(const IntVectSet& a_ivs, const EBGraph& a_ebgraph,
116  int a_direction, const FaceStop::WhichFaces& a_location);
117 
120  int m_iface;
122 
123 
124 };
125 
126 #include "NamespaceFooter.H"
127 #endif
An irregular domain on an integer lattice.
Definition: IntVectSet.H:44
Definition: FaceIterator.H:47
Definition: FaceIterator.H:54
Definition: FaceIndex.H:28
Definition: FaceIterator.H:49
Iterator over faces within an IntVectSet and an Ebgraph.
Definition: FaceIterator.H:67
Definition: FaceIterator.H:48
int m_direction
Definition: FaceIterator.H:121
Definition: FaceIterator.H:53
Geometric description within a box.
Definition: EBGraph.H:427
bool m_isDefined
Definition: FaceIterator.H:118
Definition: FaceIterator.H:56
int m_iface
Definition: FaceIterator.H:120
Definition: FaceIterator.H:50
Vector< FaceIndex > m_faces
Definition: FaceIterator.H:119
Definition: FaceIterator.H:57
Definition: FaceIterator.H:51
Definition: FaceIterator.H:52
Definition: FaceIterator.H:27
WhichFaces
Definition: FaceIterator.H:45
Definition: FaceIterator.H:55