Class documentation of Concepts

Loading...
Searching...
No Matches
coordinateChange.hh
Go to the documentation of this file.
1#ifndef COORDINATECHANGE_HH
2#define COORDINATECHANGE_HH
3
4#include <array>
5#include <unordered_map>
6#include <utility>
7
8#include "basics.hh"
9
10namespace concepts {
11
12// ******************************* Coordinate Transformation Isomorphisms **
13
38 template<uint pdim>
40
42 template<uint pdim>
44
45
46 // ***************************************** Boundary elements of Hexahedron **
47
49 template<>
51 public:
64 static std::pair<uint,uint> TopToGeo(uint faceIndex, std::pair<Z2,Z4> topologicalOrientation) {
65 return TopToGeo_[faceIndex].at(topologicalOrientation);
66 }
79 static std::pair<uint,uint> TopToCon(uint faceIndex, std::pair<Z2,Z4> topologicalOrientation) {
80 return TopToCon_[faceIndex].at(topologicalOrientation);
81 }
91 static std::pair<uint,uint> GeoToCon(uint faceIndex) {
92 return GeoToCon_[faceIndex];
93 }
94
95
96 private:
97
99 struct QuadHash {
100 std::size_t operator()(const std::pair<Z2,Z4>& key) const {
101 return key.first*4+key.second;
102 }
103 };
104
106 const static std::array< std::unordered_map< std::pair<Z2,Z4>, std::pair<uint,uint>, QuadHash >,6 > TopToGeo_;
108 const static std::array< std::unordered_map< std::pair<Z2,Z4>, std::pair<uint,uint>, QuadHash >,6 > TopToCon_ ;
110 const static std::array< std::pair<uint,uint>,6 > GeoToCon_;
111
112 };
113
115 template<>
117 public:
127 static uint GeoToCon(uint edgeIndex) {
128 return GeoToCon_[edgeIndex];
129 }
130
131 private:
133 const static std::array<uint,12> GeoToCon_;
134 };
135
136
137 // ***************************************** Boundary elements of Quad **
138
139 template<>
141 public:
155 return TopToGeo_[edgeIndex].at(topologicalOrientation);
156 }
170 return TopToCon_[edgeIndex].at(topologicalOrientation);
171 }
181 static uint GeoToCon(uint edgeIndex) {
182 return GeoToCon_[edgeIndex];
183 }
184
185 private:
186
188 struct EdgeHash {
189 std::size_t operator()(const Z2& key) const {
190 return key;
191 }
192 };
193
195 const static std::array< std::unordered_map< Z2, uint, EdgeHash >, 4 > TopToGeo_;
197 const static std::array< std::unordered_map< Z2, uint, EdgeHash >, 4 > TopToCon_;
199 const static std::array<uint,4> GeoToCon_;
200 };
201
202}
203
204#endif // COORDINATECHANGE_HH
static uint GeoToCon(uint edgeIndex)
static uint TopToCon(uint edgeIndex, Z2 topologicalOrientation)
static uint TopToGeo(uint edgeIndex, Z2 topologicalOrientation)
static uint GeoToCon(uint edgeIndex)
Coordinate changes for edge elements.
static std::pair< uint, uint > TopToCon(uint faceIndex, std::pair< Z2, Z4 > topologicalOrientation)
static std::pair< uint, uint > TopToGeo(uint faceIndex, std::pair< Z2, Z4 > topologicalOrientation)
static std::pair< uint, uint > GeoToCon(uint faceIndex)
Coordinate changes for quadrilateral elements.
Set< F > makeSet(uint n, const F &first,...)
Definition set.hh:320