AMDiS 2.11-git
The Adaptive Multi-Dimensional Simulation Toolbox
 
Loading...
Searching...
No Matches
FlatBasis.hpp
1#pragma once
2
3#include <type_traits>
4#include <utility>
5
6#include <dune/functions/functionspacebases/defaultglobalbasis.hh>
7#include <amdis/functions/FlatPreBasis.hpp>
8
9namespace AMDiS
10{
11 // forward declaration
12 template <class PB>
13 class GlobalBasis;
14
15 // define the type of the flat basis
16 template <class Basis>
17 struct FlatBasis;
18
19 template <class Basis>
20 using FlatBasis_t = typename FlatBasis<remove_cvref_t<Basis>>::type;
21
22 template <class PB>
23 struct FlatBasis<Dune::Functions::DefaultGlobalBasis<PB>>
24 {
25 using type = Dune::Functions::DefaultGlobalBasis<typename FlatPreBasis<PB>::type>;
26
27 template <class Basis>
28 static type create(Basis const& basis)
29 {
30 return type{flatPreBasis(basis.preBasis())};
31 }
32 };
33
34 template <class PB>
36 {
38
39 template <class Basis>
40 static type create(Basis const& basis)
41 {
42 return type{flatPreBasis(basis.preBasis())};
43 }
44 };
45
46
48 template <class Basis>
49 auto flatBasis(Basis const& basis)
50 {
51 return FlatBasis<Basis>::create(basis);
52 }
53
55 template <class Basis>
56 auto flatBasis(Basis&& basis)
57 {
58 return FlatBasis<remove_cvref_t<Basis>>::create(std::move(basis));
59 }
60
61} // end namespace AMDiS
Global basis defined on a pre-basis.
Definition GlobalBasis.hpp:47
constexpr bool GlobalBasis
A Dune::Functions::GlobalBasis type.
Definition Concepts.hpp:189
Definition FlatBasis.hpp:17