dune-pdelab  2.0.0
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_POWERCOMPOSITEGRIDFUNCTIONSPACEBASE_HH
4 #define DUNE_PDELAB_POWERCOMPOSITEGRIDFUNCTIONSPACEBASE_HH
5 
6 #include <cstddef>
7 #include <functional>
8 #include <vector>
9 
10 #include <dune/typetree/fixedcapacitystack.hh>
11 #include <dune/typetree/traversal.hh>
12 #include <dune/typetree/traversalutilities.hh>
13 #include <dune/typetree/utility.hh>
14 #include <dune/typetree/transformation.hh>
15 #include <dune/typetree/visitor.hh>
16 
23 
24 namespace Dune {
25  namespace PDELab {
26 
30 
32  template<typename G, typename B, typename O, std::size_t k>
34  {
35  enum{
40  };
41 
42  const static std::size_t CHILDREN = k;
43 
45  typedef G GridViewType;
46 
47  typedef G GridView;
48 
50  typedef B BackendType;
51 
52  typedef B Backend;
53 
55  typedef O MapperType;
56 
57  typedef O OrderingTag;
58 
60  typedef typename B::size_type SizeType;
61  };
62 
64  template<typename GridFunctionSpace, typename GV, typename B, typename O, std::size_t k>
66  : public GridFunctionSpaceBase<
67  GridFunctionSpace,
68  PowerCompositeGridFunctionSpaceTraits<GV,B,O,k>
69  >
70  {
71 
72 #ifndef DOXYGEN
73 
74  const GridFunctionSpace& gfs() const
75  {
76  return static_cast<const GridFunctionSpace&>(*this);
77  }
78 
79  GridFunctionSpace& gfs()
80  {
81  return static_cast<GridFunctionSpace&>(*this);
82  }
83 
84 #endif // DOXYGEN
85 
86  public:
87 
90 
91  private:
92 
94 
95  public:
96 
97  typedef O OrderingTag;
98 
99  // TODO: Do not just use constraints from child 0!
101  template<typename E>
103  {
104  typedef typename conditional<
105  is_same<
106  typename GridFunctionSpace::template Child<0>::type::template ConstraintsContainer<E>::Type,
108  >::value,
111  typename GridFunctionSpace::Ordering::Traits::DOFIndex,
112  typename GridFunctionSpace::Ordering::Traits::ContainerIndex,
113  E
114  >
115  >::type Type;
116  };
117 
119  const typename Traits::GridViewType& gridView () const
120  {
121  return gfs().template child<0>().gridView();
122  }
123 
125  : BaseT(backend,ordering_tag)
126  {}
127 
128  };
129 
130  }
131 
132 }
134 #endif // DUNE_PDELAB_POWERCOMPOSITEGRIDFUNCTIONSPACEBASE_HH
conditional< 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:115
B BackendType
vector backend
Definition: powercompositegridfunctionspacebase.hh:50
extract type for storing constraints
Definition: powercompositegridfunctionspacebase.hh:102
B::size_type SizeType
short cut for size type exported by Backend
Definition: powercompositegridfunctionspacebase.hh:60
G GridView
Definition: powercompositegridfunctionspacebase.hh:47
PowerCompositeGridFunctionSpaceTraits< GV, B, O, k > Traits
export traits class
Definition: powercompositegridfunctionspacebase.hh:89
Definition: common/constraintstransformation.hh:127
a class holding transformation for constrained spaces
Definition: common/constraintstransformation.hh:18
static const std::size_t CHILDREN
Definition: powercompositegridfunctionspacebase.hh:42
Definition: gridfunctionspacebase.hh:137
O MapperType
mapper
Definition: powercompositegridfunctionspacebase.hh:55
True if this grid function space is composed of others.
Definition: powercompositegridfunctionspacebase.hh:37
B Backend
Definition: powercompositegridfunctionspacebase.hh:52
O OrderingTag
Definition: powercompositegridfunctionspacebase.hh:97
number of child spaces
Definition: powercompositegridfunctionspacebase.hh:39
const Traits::GridViewType & gridView() const
get grid view
Definition: powercompositegridfunctionspacebase.hh:119
PowerCompositeGridFunctionSpaceBase(const B &backend, const OrderingTag &ordering_tag)
Definition: powercompositegridfunctionspacebase.hh:124
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
G GridViewType
the grid view where grid function is defined upon
Definition: powercompositegridfunctionspacebase.hh:45
Mixin class providing common functionality of PowerGridFunctionSpace and CompositeGridFunctionSpace.
Definition: powercompositegridfunctionspacebase.hh:65
A grid function space.
Definition: gridfunctionspace.hh:109
Trait class for the multi component grid function spaces.
Definition: powercompositegridfunctionspacebase.hh:33
O OrderingTag
Definition: powercompositegridfunctionspacebase.hh:57