Chombo + EB + MF  3.2
IFData.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 _IFDATA_H_
12 #define _IFDATA_H_
13 
14 #if defined(CH_Darwin) && defined(__GNUC__) && ( __GNUC__ == 3 )
15 // deal with the broken isnan()/isinf() in GCC on MacOS
16 #include <unistd.h>
17 #define _GLIBCPP_USE_C99 1
18 #endif
19 
20 
21 #include <map>
22 using std::map;
23 #include "Vector.H"
24 #include "REAL.H"
25 #include "IndexTM.H"
26 
27 #include "Notation.H"
28 #include "IFSlicer.H"
29 #include "CoordinateSystem.H"
30 
31 using std::endl;
32 using std::cerr;
33 #include "NamespaceHeader.H"
34 
36 {
37 public:
38  //only turn on for convergence tests
40 };
41 
42 template <int dim> class IFData
43 {
44 public:
45  // data types to record vertex signs and edge intersections
47  typedef map<EdgeIndex,Real > EdgeIntersections;
48 
50  typedef map<Vertex,int > CornerSigns;
51 
54 
55  typedef map<IvDim,RvDim > NormalDerivatives;
56 
57  // member data
58  CornerSigns m_cornerSigns;
59  EdgeIntersections m_intersections;
61 
66 
68  NormalDerivatives m_normalDerivatives;
70 
74 
75  // empty constructor
76  IFData();
77 
78  // copy constructor
79  IFData(const IFData<dim>& a_IFData);
80 
81  // makes an initial IFData from a BaseIF
82  IFData(const BaseIF & a_function,
83  const RvDim & a_dx,
84  const RvDim & a_origin,
85  const int & a_maxOrder);
86 
87  // makes an lower dimensional IFData from a IFSlicer; used for refinement (or it used to be)
88  IFData(IFSlicer<dim> * a_function,
89  const RvDim & a_dx,
90  const RvDim & a_origin,
91  const int & a_maxOrder);
92 
93 
94 
95  // makes a reduced IFData
96  IFData(const IFData<dim+1> & a_hInfo,
97  const int & a_maxOrder,
98  const int & a_idir,
99  const int & a_hilo);
100 
101  // destructor
102  ~IFData();
103 
104  void setNormalDerivatives();
105  void makeCornerSigns();
106  void findIntersectionPts();
107  void defineLocalCoords();
108 
109  // used by the constructor
110  bool isConnected(int & a_edgeDir,
111  const Vertex & a_vertex1,
112  const Vertex & a_vertex2);
113 
114  void makeEdgeKey(const int & a_edgeDir,
115  const Vertex & a_vertex1,
116  const Vertex & a_vertex2);
117 
118  //this function calls the midPtRootFinder
119  Real rootFinder(const EdgeIndex & a_thisEdge);
120 
121  Real BrentRootFinder(const RvDim & a_loPt,
122  const RvDim & a_hiPt,
123  const int & a_edgeDir) const;
124 // const Real & a_smallestRoot,
125 // const Real & a_biggestRoot) const;
126 
127  void checkIntersection(bool & a_hiOn,
128  bool & a_loOn,
129  const Real & a_pt) const;
130 
131  void remakeCornerSigns();
132 
133  // output functions
134  void print(ostream& out) const;
135 
136  // operators
137  void operator=(const IFData & a_ifData);
138 
139  // this function sets the changing direction given the normal direction
140  void setChangingDirection();
141 
142  bool searchNormalDir(const int i) const;
143 };
144 
145 template<> class IFData<1>
146 {
147 public:
148  // true is in the fluid
150 
151  typedef int Vertex;
152  typedef map<Vertex,int> CornerSigns;
153 
154  typedef int IvDim;
155  typedef Real RvDim;
156 
157  // member data
158  CornerSigns m_cornerSigns;
159  EdgeIntersection m_intersection;
160 
164 
169 
170  IFData();
171 
172  IFData(const IFData<1> & a_ifData);
173 
174  IFData(const IFData<2> & a_hIFData,
175  const int & a_maxOrder,
176  const int & a_idir,
177  const int & a_hilo);
178 
179  ~IFData();
180 
181  void print(ostream& a_out) const;
182 
183  void operator=(const IFData<1> & a_ifData);
184 };
185 
186 #include "NamespaceFooter.H"
187 
188 #include "IFDataImplem.H"
189 
190 #endif
NormalDerivatives m_normalDerivatives
Definition: IFData.H:68
CoordinateSystem< 1 > m_cellCenterCoord
Definition: IFData.H:162
Definition: CoordinateSystem.H:34
CoordinateSystem< 1 > m_globalCoord
Definition: IFData.H:161
map< Vertex, int > CornerSigns
Definition: IFData.H:152
CornerSigns m_cornerSigns
Definition: IFData.H:158
Definition: IFData.H:35
EdgeIntersection m_intersection
Definition: IFData.H:159
bool m_badNormal
Definition: IFData.H:168
Definition: IFData.H:145
int IvDim
Definition: IFData.H:154
CoordinateSystem< dim > m_parentCoord
Definition: IFData.H:64
Real EdgeIntersection
Definition: IFData.H:149
map< Vertex, int > CornerSigns
Definition: IFData.H:50
IndexTM< int, dim > Vertex
Definition: IFData.H:49
IFSlicer< dim > * m_function
Definition: IFData.H:60
Definition: IndexTM.H:36
CoordinateSystem< dim > m_localCoord
Definition: IFData.H:65
Real RvDim
Definition: IFData.H:155
bool m_allVerticesIn
Definition: IFData.H:165
Definition: BaseIF.H:32
IndexTM< int, dim > EdgeIndex
Definition: IFData.H:46
CoordinateSystem< 1 > m_parentCoord
Definition: IFData.H:163
Definition: IFData.H:42
IndexTM< Real, dim > RvDim
Definition: IFData.H:53
CoordinateSystem< dim > m_globalCoord
Definition: IFData.H:62
bool m_allVerticesOn
Definition: IFData.H:73
bool m_allVerticesOn
Definition: IFData.H:167
double Real
Definition: REAL.H:33
bool m_allVerticesIn
Definition: IFData.H:71
CoordinateSystem< dim > m_cellCenterCoord
Definition: IFData.H:63
map< EdgeIndex, Real > EdgeIntersections
Definition: IFData.H:47
static bool s_turnOffMoveLocalCoords
Definition: IFData.H:39
IndexTM< int, dim > IvDim
Definition: IFData.H:52
Definition: IFSlicer.H:27
bool m_allVerticesOut
Definition: IFData.H:72
CornerSigns m_cornerSigns
Definition: IFData.H:58
int Vertex
Definition: IFData.H:151
map< IvDim, RvDim > NormalDerivatives
Definition: IFData.H:55
int m_maxOrder
Definition: IFData.H:67
EdgeIntersections m_intersections
Definition: IFData.H:59
bool m_allVerticesOut
Definition: IFData.H:166
bool m_badNormal
Definition: IFData.H:69