dune-mmesh (unstable)

twistutility.hh
1#ifndef DUNE_MMESH_MISC_TWISTUTILITY_HH
2#define DUNE_MMESH_MISC_TWISTUTILITY_HH
3
4#include <dune/geometry/type.hh>
5
6namespace Dune {
7
8template <class Grid>
9class MMeshInterfaceGrid;
10
11namespace MMeshTwist {
12template <class LeafIntersection>
13static inline int twistInSelf(const LeafIntersection& intersection) {
14 return 0;
15}
16
17template <class LeafIntersection>
18static inline int twistInNeighbor(const LeafIntersection& intersection) {
19 return 0;
20}
21} // namespace MMeshTwist
22
23namespace MMeshInterfaceTwist {
24template <class LeafIntersection>
25static inline int twistInSelf(const LeafIntersection& intersection) {
26 return 0;
27}
28
29template <class LeafIntersection>
30static inline int twistInNeighbor(const LeafIntersection& intersection) {
31 return 0;
32}
33} // namespace MMeshInterfaceTwist
34
35namespace Fem {
36
37template <class Grid>
38struct TwistUtility;
39
42template <class HostGrid, int dim>
43struct TwistUtility<MMesh<HostGrid, dim> > {
45 typedef typename GridType::Traits::LeafIntersectionIterator
46 LeafIntersectionIterator;
47 typedef typename LeafIntersectionIterator::Intersection LeafIntersection;
48 typedef typename GridType::Traits::LevelIntersectionIterator
49 LevelIntersectionIterator;
50 typedef typename LevelIntersectionIterator::Intersection LevelIntersection;
51
52 public:
54 static inline int twistInSelf(const GridType& grid,
55 const LeafIntersection& intersection) {
56 return MMeshTwist::twistInSelf(intersection);
57 }
58
60 static inline int twistInNeighbor(const GridType& grid,
61 const LeafIntersection& intersection) {
62 return MMeshTwist::twistInNeighbor(intersection);
63 }
64
66 template <class Intersection>
67 static inline GeometryType elementGeometry(const Intersection& intersection,
68 const bool inside) {
69 return Dune::GeometryTypes::simplex(dim);
70 }
71
72 private:
73 TwistUtility(const TwistUtility&);
74 TwistUtility& operator=(const TwistUtility&);
75};
76
79template <class MMesh>
80struct TwistUtility<MMeshInterfaceGrid<MMesh> > {
82 static constexpr int dim = GridType::dimension;
83 typedef typename GridType::Traits::LeafIntersectionIterator
84 LeafIntersectionIterator;
85 typedef typename LeafIntersectionIterator::Intersection LeafIntersection;
86 typedef typename GridType::Traits::LevelIntersectionIterator
87 LevelIntersectionIterator;
88 typedef typename LevelIntersectionIterator::Intersection LevelIntersection;
89
90 public:
92 static inline int twistInSelf(const GridType& grid,
93 const LeafIntersection& intersection) {
94 return MMeshInterfaceTwist::twistInSelf(intersection);
95 }
96
98 static inline int twistInNeighbor(const GridType& grid,
99 const LeafIntersection& intersection) {
100 return MMeshInterfaceTwist::twistInNeighbor(intersection);
101 }
102
104 template <class Intersection>
105 static inline GeometryType elementGeometry(const Intersection& intersection,
106 const bool inside) {
107 return Dune::GeometryTypes::simplex(dim);
108 }
109
110 private:
111 TwistUtility(const TwistUtility&);
112 TwistUtility& operator=(const TwistUtility&);
113};
114
115} // namespace Fem
116
117} // namespace Dune
118
119#endif // #ifndef DUNE_MMESH_MISC_TWISTUTILITY_HH
Provides a DUNE grid interface class for the interface of a MMesh interface grid .
Definition: grid.hh:90
The MMesh class templatized by the CGAL host grid type and the dimension. .
Definition: mmesh.hh:158
static int twistInNeighbor(const GridType &grid, const LeafIntersection &intersection)
return twist for outer face
Definition: twistutility.hh:98
static GeometryType elementGeometry(const Intersection &intersection, const bool inside)
return element geometry type of inside or outside entity
Definition: twistutility.hh:105
static int twistInSelf(const GridType &grid, const LeafIntersection &intersection)
return twist for inner face
Definition: twistutility.hh:92
static int twistInNeighbor(const GridType &grid, const LeafIntersection &intersection)
return twist for outer face
Definition: twistutility.hh:60
static GeometryType elementGeometry(const Intersection &intersection, const bool inside)
return element geometry type of inside or outside entity
Definition: twistutility.hh:67
static int twistInSelf(const GridType &grid, const LeafIntersection &intersection)
return twist for inner face
Definition: twistutility.hh:54
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Sep 5, 22:35, 2025)