Chombo + EB  3.2
StdSetIVS.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 _STDSETIVS_H_
12 #define _STDSETIVS_H_
13 
14 #include "Box.H"
15 #include "ProblemDomain.H"
16 #include <set>
17 #include "NamespaceHeader.H"
18 using namespace std;
19 class StdSetIVSIterator;
20 
22 {
23  bool operator() (const IntVect& lhs, const IntVect& rhs) const
24  {
25  return lhs.lexLT(rhs);
26  }
27 };
28 /// IntVectSet implementation based std::set
29 /**
30  */
31 class StdSetIVS
32 {
33 public:
34  friend class StdSetIVSIterator;
35 
36  ///
37  StdSetIVS(){;}
38 
39  ///
40  StdSetIVS(const Box& a_box);
41 
42  ///
43  StdSetIVS(const StdSetIVS& a_sivs);
44 
45  ///
47 
48  ///
49  void define(const Box&);
50 
51  ///
52  void define(const StdSetIVS& a_sivs);
53 
54  ///
55  StdSetIVS& operator=(const StdSetIVS& a_sivs);
56 
57  ///or
58  StdSetIVS& operator|=(const StdSetIVS& a_sivs);
59 
60  ///
61  StdSetIVS& operator|=(const IntVect& a_iv);
62 
63  ///
64  StdSetIVS& operator|=(const Box& a_box);
65 
66  ///and
67  StdSetIVS& operator&=(const StdSetIVS& s_sivs);
68 
69  ///and
70  StdSetIVS& operator&=(const Box& a_box);
71 
72  ///and
73  StdSetIVS& operator&=(const ProblemDomain& a_domain);
74 
75  ///not
76  StdSetIVS& operator-=(const StdSetIVS& a_sivs);
77 
78  ///not
79  StdSetIVS& operator-=(const IntVect& a_iv);
80 
81  ///not
82  StdSetIVS& operator-=(const Box& a_box);
83 
84  ///returns true if
85  bool operator==(const StdSetIVS& lhs) const;
86 
87  ///
88  bool contains(const IntVect& iv) const;
89 
90  ///
91  bool contains(const Box& box) const;
92 
93  ///
94  void grow(int igrow);
95 
96  ///
97  void grow(int idir, int igrow);
98 
99  ///
100  void growHi();
101 
102  ///
103  void growHi(int a_dir);
104 
105  ///
106  void refine(int iref = 2);
107 
108  ///
109  void coarsen(int iref = 2);
110 
111  ///
112  void shift(const IntVect& iv);
113 
114  ///
115  void clear();
116 
117  ///
118  Box minBox() const;
119 
120  ///
121  bool isEmpty() const;
122 
123  ///
124  void makeEmpty() ;
125 
126  ///
127  int numPts() const;
128 
129  ///
130  int linearSize() const;
131 
132  ///
133  void linearIn(const void* const inBuf);
134 
135  ///
136  void linearOut(void* const a_outBuf) const;
137 
138  void define(const Vector<IntVect>& a_vect);
139 private:
140 
141  void getVectorIV(Vector<IntVect>& a_vect) const;
142  std::set<IntVect, lex_compare_iv> m_stdSet;
143 };
144 
145 ///
147 {
148 public:
149  ///
151 
152  ///
153  StdSetIVSIterator(const StdSetIVS& ivs);
154 
155  ///
156  void define(const StdSetIVS& ivs);
157 
158  ///
159  const IntVect& operator()() const ;
160 
161  ///
162  bool ok() const;
163 
164  ///
165  void operator++();
166 
167  ///
168  void begin();
169 
170  ///
171  void end();
172 
173  ///
174  void clear();
175 private:
176  const StdSetIVS* m_ivs;
177  std::set<IntVect, lex_compare_iv>::iterator m_iter;
178 };
179 
180 #include "NamespaceFooter.H"
181 #endif // STDSETIVS_H
void define(const StdSetIVS &ivs)
Box refine(const Box &b, const IntVect &refinement_ratio)
A class to facilitate interaction with physical boundary conditions.
Definition: ProblemDomain.H:141
~StdSetIVS()
Definition: StdSetIVS.H:46
std::set< IntVect, lex_compare_iv >::iterator m_iter
Definition: StdSetIVS.H:177
Definition: StdSetIVS.H:21
Definition: IntVect.H:700
int isEmpty(const box2d *)
IntVectSet implementation based std::set.
Definition: StdSetIVS.H:31
Definition: EBInterface.H:45
Box minBox(const Box &b1, const Box &b2)
IndexTM< T, N > coarsen(const IndexTM< T, N > &a_p, T a_s)
Definition: IndexTMI.H:430
Definition: StdSetIVS.H:146
void linearOut(void *const a_outBuf, const T &inputT)
Definition: SPMDI.H:33
std::set< IntVect, lex_compare_iv > m_stdSet
Definition: StdSetIVS.H:142
Box grow(const Box &b, int i)
Definition: Box.H:2261
int linearSize(const T &inputT)
Definition: SPMDI.H:21
const StdSetIVS * m_ivs
Definition: StdSetIVS.H:176
A Rectangular Domain on an Integer Lattice.
Definition: Box.H:465
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
void linearIn(T &a_outputT, const void *const inBuf)
Definition: SPMDI.H:27
StdSetIVS()
Definition: StdSetIVS.H:37
bool lexLT(const IntVect &s) const
Definition: IntVect.H:898