DUNE PDELab (git)

intersectiontype.hh
1#ifndef DUNE_PDELAB_COMMON_INTERSECTIONTYPE_HH
2#define DUNE_PDELAB_COMMON_INTERSECTIONTYPE_HH
3
4#include <utility>
5#include <tuple>
6
8#include <dune/grid/common/partitionset.hh>
9
10namespace Dune {
11 namespace PDELab {
12
14 enum class IntersectionType
15 {
16
17 processor = 0,
18 skeleton = 1,
19 boundary = 2,
20 periodic = 3
21
22 };
23
25
36 template<typename EntitySet, typename Intersection>
37 std::tuple<IntersectionType,typename EntitySet::Element> classifyIntersection(const EntitySet& entity_set, const Intersection& is)
38 {
39 auto type = static_cast<IntersectionType>(1* is.neighbor() + 2*is.boundary());
40 if (type == IntersectionType::skeleton || type == IntersectionType::periodic)
41 if (entity_set.partitions() == Partitions::all)
42 return std::make_tuple(type,is.outside());
43 else
44 {
45 auto outside_entity = is.outside();
46 if (entity_set.partitions().contains(outside_entity.partitionType()))
47 return std::make_tuple(type,outside_entity);
48 else
49 return std::make_tuple(IntersectionType::processor,std::move(outside_entity));
50 }
51 else
52 return std::make_tuple(type,decltype(is.outside()){});
53 }
54
55
56 } // namespace PDELab
57} // namespace Dune
58
59#endif // DUNE_PDELAB_COMMON_INTERSECTIONTYPE_HH
auto periodic(RawPreBasisIndicator &&rawPreBasisIndicator, PIS &&periodicIndexSet)
Create a pre-basis factory that can create a periodic pre-basis.
Definition: periodicbasis.hh:203
constexpr All all
PartitionSet for all partitions.
Definition: partitionset.hh:295
Dune namespace.
Definition: alignedallocator.hh:13
Various macros to work with Dune module version numbers.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 12, 23:30, 2024)