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 
10 namespace concepts {
11 
12 // ******************************* Coordinate Transformation Isomorphisms **
13 
37  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:
154  static uint TopToGeo(uint edgeIndex, Z2 topologicalOrientation) {
155  return TopToGeo_[edgeIndex].at(topologicalOrientation);
156  }
169  static uint TopToCon(uint edgeIndex, Z2 topologicalOrientation) {
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 TopToCon(uint edgeIndex, Z2 topologicalOrientation)
Find transformation required to realign the edge that is oriented (w.r.t.
static const std::array< uint, 12 > GeoToCon_
Orientation transformations: geometric -> Concepts.
static uint GeoToCon(uint edgeIndex)
Find transformation required to realign the edge that is oriented according to the geometric orientat...
static const std::array< std::pair< uint, uint >, 6 > GeoToCon_
Orientation transformations: geometric -> Concepts.
static const std::array< std::unordered_map< std::pair< Z2, Z4 >, std::pair< uint, uint >, QuadHash >, 6 > TopToCon_
Orientation transformations: topological -> Concepts.
static uint TopToGeo(uint edgeIndex, Z2 topologicalOrientation)
Find transformation required to realign the edge that is oriented (w.r.t.
static std::pair< uint, uint > TopToCon(uint faceIndex, std::pair< Z2, Z4 > topologicalOrientation)
Find transformation required to realign the quadrilateral that is oriented (w.r.t.
static uint GeoToCon(uint edgeIndex)
Find transformation required to realign the edge that is oriented according to the geometric orientat...
static const std::array< std::unordered_map< Z2, uint, EdgeHash >, 4 > TopToCon_
Orientation transformations: topological -> Concepts.
std::size_t operator()(const Z2 &key) const
static std::pair< uint, uint > GeoToCon(uint faceIndex)
Find transformation required to realign the quadrilateral that is oriented according to the geometric...
std::size_t operator()(const std::pair< Z2, Z4 > &key) const
Coordinate changes for edge elements.
static const std::array< uint, 4 > GeoToCon_
Orientation transformations: geometric -> Concepts.
static std::pair< uint, uint > TopToGeo(uint faceIndex, std::pair< Z2, Z4 > topologicalOrientation)
Find transformation required to realign the quadrilateral that is oriented (w.r.t.
Coordinate changes for quadrilateral elements.
Binary group (algebraic): only the values 0 and 1 are represented.
Definition: Zm.hh:16
static const std::array< std::unordered_map< Z2, uint, EdgeHash >, 4 > TopToGeo_
Orientation transformations: topological -> geometric.
Basic namespace for Concepts-2.
Definition: pml_formula.h:16
static const std::array< std::unordered_map< std::pair< Z2, Z4 >, std::pair< uint, uint >, QuadHash >, 6 > TopToGeo_
Orientation transformations: topological -> geometric.
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich