dune-pdelab  2.5-dev
powercompositegridfunctionspacebase.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_POWERCOMPOSITEGRIDFUNCTIONSPACEBASE_HH
4 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_POWERCOMPOSITEGRIDFUNCTIONSPACEBASE_HH
5 
6 #include <algorithm>
7 #include <cstddef>
8 #include <functional>
9 #include <vector>
10 
11 #include <dune/typetree/fixedcapacitystack.hh>
12 #include <dune/typetree/traversal.hh>
13 #include <dune/typetree/traversalutilities.hh>
14 #include <dune/typetree/utility.hh>
15 #include <dune/typetree/transformation.hh>
16 #include <dune/typetree/visitor.hh>
17 
24 
25 namespace Dune {
26  namespace PDELab {
27 
31 
33  template<typename G, typename B, typename O, std::size_t k>
35  {
36  enum{
41  };
42 
43  const static std::size_t CHILDREN = k;
44 
45  using EntitySet = G;
46 
47  using GridView = typename EntitySet::GridView;
48 
51 
53  typedef B BackendType;
54 
55  typedef B Backend;
56 
58  typedef O MapperType;
59 
60  typedef O OrderingTag;
61 
63  typedef typename B::size_type SizeType;
64  };
65 
67  template<typename GridFunctionSpace, typename GV, typename B, typename O, std::size_t k>
69  : public GridFunctionSpaceBase<
70  GridFunctionSpace,
71  PowerCompositeGridFunctionSpaceTraits<GV,B,O,k>
72  >
73  {
74 
75 #ifndef DOXYGEN
76 
77  const GridFunctionSpace& gfs() const
78  {
79  return static_cast<const GridFunctionSpace&>(*this);
80  }
81 
82  GridFunctionSpace& gfs()
83  {
84  return static_cast<GridFunctionSpace&>(*this);
85  }
86 
87 #endif // DOXYGEN
88 
89  public:
90 
93 
94  private:
95 
97 
98  public:
99 
100  typedef O OrderingTag;
101 
102  // TODO: Do not just use constraints from child 0!
104  template<typename E>
106  {
107  typedef typename std::conditional<
108  std::is_same<
109  typename GridFunctionSpace::template Child<0>::type::template ConstraintsContainer<E>::Type,
111  >::value,
114  typename GridFunctionSpace::Ordering::Traits::DOFIndex,
115  typename GridFunctionSpace::Ordering::Traits::ContainerIndex,
116  E
117  >
118  >::type Type;
119  };
120 
122  const typename Traits::GridView& gridView () const
123  {
124  return gfs().template child<0>().gridView();
125  }
126 
128  const typename Traits::EntitySet& entitySet () const
129  {
130  return gfs().template child<0>().entitySet();
131  }
132 
133  PowerCompositeGridFunctionSpaceBase(const B& backend, const OrderingTag& ordering_tag)
134  : BaseT(backend,ordering_tag)
135  {}
136 
137  };
138 
139  }
140 
141 }
143 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_POWERCOMPOSITEGRIDFUNCTIONSPACEBASE_HH
GridView GridViewType
the grid view where grid function is defined upon
Definition: powercompositegridfunctionspacebase.hh:50
number of child spaces
Definition: powercompositegridfunctionspacebase.hh:40
B::size_type SizeType
short cut for size type exported by Backend
Definition: powercompositegridfunctionspacebase.hh:63
a class holding transformation for constrained spaces
Definition: constraintstransformation.hh:18
A grid function space.
Definition: gridfunctionspace.hh:166
True if this grid function space is composed of others.
Definition: powercompositegridfunctionspacebase.hh:38
PowerCompositeGridFunctionSpaceBase(const B &backend, const OrderingTag &ordering_tag)
Definition: powercompositegridfunctionspacebase.hh:133
Definition: constraintstransformation.hh:111
Definition: gridfunctionspacebase.hh:134
O OrderingTag
Definition: powercompositegridfunctionspacebase.hh:60
Trait class for the multi component grid function spaces.
Definition: powercompositegridfunctionspacebase.hh:34
PowerCompositeGridFunctionSpaceTraits< GV, B, O, k > Traits
export traits class
Definition: powercompositegridfunctionspacebase.hh:92
B BackendType
vector backend
Definition: powercompositegridfunctionspacebase.hh:53
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139
extract type for storing constraints
Definition: powercompositegridfunctionspacebase.hh:105
B Backend
Definition: powercompositegridfunctionspacebase.hh:55
const Traits::GridView & gridView() const
get grid view
Definition: powercompositegridfunctionspacebase.hh:122
O MapperType
mapper
Definition: powercompositegridfunctionspacebase.hh:58
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
std::conditional< std::is_same< typename GridFunctionSpace::template Child< 0 >::type::template ConstraintsContainer< E >::Type, EmptyTransformation >::value, EmptyTransformation, ConstraintsTransformation< typename GridFunctionSpace::Ordering::Traits::DOFIndex, typename GridFunctionSpace::Ordering::Traits::ContainerIndex, E > >::type Type
Definition: powercompositegridfunctionspacebase.hh:118
typename EntitySet::GridView GridView
Definition: powercompositegridfunctionspacebase.hh:47
static const std::size_t CHILDREN
Definition: powercompositegridfunctionspacebase.hh:43
O OrderingTag
Definition: powercompositegridfunctionspacebase.hh:100
G EntitySet
Definition: powercompositegridfunctionspacebase.hh:45
const Traits::EntitySet & entitySet() const
get grid view partition
Definition: powercompositegridfunctionspacebase.hh:128
Mixin class providing common functionality of PowerGridFunctionSpace and CompositeGridFunctionSpace.
Definition: powercompositegridfunctionspacebase.hh:68