DUNE-FEM (unstable)

intersectionside.hh
1#ifndef DUNE_FEM_COMMON_INTERSECTIONSIDE_HH
2#define DUNE_FEM_COMMON_INTERSECTIONSIDE_HH
3
4#include <dune/common/typelist.hh>
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
Dune namespace.
Definition: alignedallocator.hh:13
Utilities for type computations, constraining overloads, ...
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 13, 23:29, 2024)