Loading [MathJax]/extensions/tex2jax.js

dune-mmesh (1.4)

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