dune-pdelab  2.4-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_POWERCOMPOSITEGRIDFUNCTIONSPACEBASE_HH
4 #define DUNE_PDELAB_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 
46  typedef G GridViewType;
47 
48  typedef G GridView;
49 
51  typedef B BackendType;
52 
53  typedef B Backend;
54 
56  typedef O MapperType;
57 
58  typedef O OrderingTag;
59 
61  typedef typename B::size_type SizeType;
62  };
63 
65  template<typename GridFunctionSpace, typename GV, typename B, typename O, std::size_t k>
67  : public GridFunctionSpaceBase<
68  GridFunctionSpace,
69  PowerCompositeGridFunctionSpaceTraits<GV,B,O,k>
70  >
71  {
72 
73 #ifndef DOXYGEN
74 
75  const GridFunctionSpace& gfs() const
76  {
77  return static_cast<const GridFunctionSpace&>(*this);
78  }
79 
80  GridFunctionSpace& gfs()
81  {
82  return static_cast<GridFunctionSpace&>(*this);
83  }
84 
85 #endif // DOXYGEN
86 
87  public:
88 
91 
92  private:
93 
95 
96  public:
97 
98  typedef O OrderingTag;
99 
100  // TODO: Do not just use constraints from child 0!
102  template<typename E>
104  {
105  typedef typename conditional<
106  is_same<
107  typename GridFunctionSpace::template Child<0>::type::template ConstraintsContainer<E>::Type,
109  >::value,
112  typename GridFunctionSpace::Ordering::Traits::DOFIndex,
113  typename GridFunctionSpace::Ordering::Traits::ContainerIndex,
114  E
115  >
116  >::type Type;
117  };
118 
120  const typename Traits::GridViewType& gridView () const
121  {
122  return gfs().template child<0>().gridView();
123  }
124 
125  PowerCompositeGridFunctionSpaceBase(const B& backend, const OrderingTag& ordering_tag)
126  : BaseT(backend,ordering_tag)
127  {}
128 
129  };
130 
131  }
132 
133 }
135 #endif // DUNE_PDELAB_POWERCOMPOSITEGRIDFUNCTIONSPACEBASE_HH
const Traits::GridViewType & gridView() const
get grid view
Definition: powercompositegridfunctionspacebase.hh:120
PowerCompositeGridFunctionSpaceBase(const B &backend, const OrderingTag &ordering_tag)
Definition: powercompositegridfunctionspacebase.hh:125
B Backend
Definition: powercompositegridfunctionspacebase.hh:53
Definition: gridfunctionspacebase.hh:137
Mixin class providing common functionality of PowerGridFunctionSpace and CompositeGridFunctionSpace.
Definition: powercompositegridfunctionspacebase.hh:66
number of child spaces
Definition: powercompositegridfunctionspacebase.hh:40
O OrderingTag
Definition: powercompositegridfunctionspacebase.hh:98
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:116
Trait class for the multi component grid function spaces.
Definition: powercompositegridfunctionspacebase.hh:34
static const unsigned int value
Definition: gridfunctionspace/tags.hh:175
O OrderingTag
Definition: powercompositegridfunctionspacebase.hh:58
PowerCompositeGridFunctionSpaceTraits< GV, B, O, k > Traits
export traits class
Definition: powercompositegridfunctionspacebase.hh:90
Definition: adaptivity.hh:27
static const std::size_t CHILDREN
Definition: powercompositegridfunctionspacebase.hh:43
Definition: constraintstransformation.hh:111
extract type for storing constraints
Definition: powercompositegridfunctionspacebase.hh:103
B::size_type SizeType
short cut for size type exported by Backend
Definition: powercompositegridfunctionspacebase.hh:61
True if this grid function space is composed of others.
Definition: powercompositegridfunctionspacebase.hh:38
B BackendType
vector backend
Definition: powercompositegridfunctionspacebase.hh:51
A grid function space.
Definition: gridfunctionspace.hh:108
a class holding transformation for constrained spaces
Definition: constraintstransformation.hh:18
G GridViewType
the grid view where grid function is defined upon
Definition: powercompositegridfunctionspacebase.hh:46
G GridView
Definition: powercompositegridfunctionspacebase.hh:48
O MapperType
mapper
Definition: powercompositegridfunctionspacebase.hh:56