hp-FEM
Adaptive hp-FEM suite for nano-optics
Loading...
Searching...
No Matches
simplex_topology.hpp
Go to the documentation of this file.
1#pragma once
18
19#include <array>
20
21#include "hpfem/core/types.hpp"
22
23namespace hpfem::mesh {
24
26template <int Dim>
28
30template <>
31struct SimplexTopology<2> {
32 static constexpr int kDim = 2;
33 static constexpr LocalIndex kNumVertices = 3;
34 static constexpr LocalIndex kNumEdges = 3;
35 static constexpr LocalIndex kNumFacets = 3;
36 static constexpr LocalIndex kVerticesPerFacet = 2;
37
39 static constexpr std::array<std::array<LocalIndex, 2>, 3> kEdgeVertices{{{0, 1}, {1, 2}, {2, 0}}};
41 static constexpr std::array<std::array<LocalIndex, 2>, 3> kFacetVertices = kEdgeVertices;
42};
43
45template <>
46struct SimplexTopology<3> {
47 static constexpr int kDim = 3;
48 static constexpr LocalIndex kNumVertices = 4;
49 static constexpr LocalIndex kNumEdges = 6;
50 static constexpr LocalIndex kNumFaces = 4;
51 static constexpr LocalIndex kNumFacets = 4;
52 static constexpr LocalIndex kVerticesPerFacet = 3;
53
55 static constexpr std::array<std::array<LocalIndex, 2>, 6> kEdgeVertices{
56 {{0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3}}};
58 static constexpr std::array<std::array<LocalIndex, 3>, 4> kFaceVertices{
59 {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}}};
61 static constexpr std::array<std::array<LocalIndex, 3>, 4> kFacetVertices = kFaceVertices;
63 static constexpr std::array<std::array<LocalIndex, 3>, 4> kFaceEdges{
64 {{3, 5, 4}, {1, 5, 2}, {0, 4, 2}, {0, 3, 1}}};
65};
66
71inline constexpr std::array<std::array<LocalIndex, 3>, 6> kFacePermutations{
72 {{0, 1, 2}, {0, 2, 1}, {1, 0, 2}, {1, 2, 0}, {2, 0, 1}, {2, 1, 0}}};
73
74} // namespace hpfem::mesh
Definition adaptive_mesh.hpp:19
constexpr std::array< std::array< LocalIndex, 3 >, 6 > kFacePermutations
Definition simplex_topology.hpp:71
std::int32_t LocalIndex
element-local indices
Definition types.hpp:18
Local topology tables of the reference simplex in Dim dimensions.
Definition simplex_topology.hpp:27