dune-fem 2.12-git
Loading...
Searching...
No Matches
intersectionside.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_COMMON_INTERSECTIONSIDE_HH
2#define DUNE_FEM_COMMON_INTERSECTIONSIDE_HH
3
6
7namespace Dune
8{
9 namespace Fem
10 {
11 enum class IntersectionSide : std::size_t { in = 0u, out = 1u };
12
13 template<class GF, class Intersection>
14 auto bindIntersection(GF& gf, const Intersection& intersection, IntersectionSide side, PriorityTag<2>)
15 -> decltype(gf.bind(intersection, side))
16 {
17 gf.bind(intersection, side);
18 }
19
20 template<class GF, class Intersection>
21 auto bindIntersection(GF& gf, const Intersection& intersection, IntersectionSide side, PriorityTag<1>)
22 -> decltype(gf.bind(intersection.impl().hostIntersection(), side))
23 {
24 gf.bind(intersection.impl().hostIntersection(), side);
25 }
26
27 template<class GF, class Intersection>
28 auto bindIntersection(GF& gf, const Intersection& intersection, IntersectionSide side, PriorityTag<0>)
29 -> decltype(gf.bind(intersection.inside()))
30 {
31 // store local copy to avoid problems with casting to temporary types
32 const auto entity = (side == IntersectionSide::in) ? intersection.inside() : intersection.outside();
33 gf.bind(entity);
34 }
35
36
37 template<class GF, class Intersection>
38 void defaultIntersectionBind(GF &gf, const Intersection &intersection, IntersectionSide side)
39 {
40 bindIntersection(gf, intersection, side, PriorityTag<2>{});
41 }
42 }
43}
44
45#endif // DUNE_FEM_COMMON_INTERSECTIONSIDE_HH
void defaultIntersectionBind(GF &gf, const Intersection &intersection, IntersectionSide side)
Definition intersectionside.hh:38
auto bindIntersection(GF &gf, const Intersection &intersection, IntersectionSide side, PriorityTag< 2 >) -> decltype(gf.bind(intersection, side))
Definition intersectionside.hh:14
IntersectionSide
Definition intersectionside.hh:11