dune-fem  2.4.1-rc
combinedspace/combinedspace.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_COMBINEDSPACE_COMBINEDSPACE_HH
2 #define DUNE_FEM_SPACE_COMBINEDSPACE_COMBINEDSPACE_HH
3 
4 #include <map>
5 #include <type_traits>
6 #include <vector>
7 
8 #include <dune/fem/version.hh>
9 
14 
15 
16 namespace Dune
17 {
18 
19  namespace Fem
20  {
21 
31  template< class DiscreteFunctionSpace, int N, DofStoragePolicy policy >
33 
38  template< class DiscreteFunctionSpace, int N >
40  : public DiscreteFunctionSpace::template ToNewDimRange< DiscreteFunctionSpace::dimRange *N >::Type
41  {
43  typedef typename DiscreteFunctionSpace::template ToNewDimRange< DiscreteFunctionSpace::dimRange *N >::Type BaseType;
44 
45  static const DofStoragePolicy policy = PointBased;
46 
47  public:
48  typedef typename BaseType::GridPartType GridPartType;
50 
51  CombinedSpace ( GridPartType &gridPart,
52  const InterfaceType commInterface = InteriorBorder_All_Interface,
53  const CommunicationDirection commDirection = ForwardCommunication )
54  : BaseType( gridPart, commInterface, commDirection ),
55  containedSpace_( gridPart, commInterface, commDirection )
56  {}
57 
58  // prohibit copy constructor and copy assignment opertor
59  CombinedSpace ( const ThisType & ) = delete;
60  ThisType &operator= ( const ThisType & ) = delete;
61 
62  //- Additional methods
64  int numComponents () const { return N; }
65 
68  {
69  return policy;
70  }
71 
73  const ContainedDiscreteFunctionSpaceType &containedSpace () const
74  {
75  return containedSpace_;
76  }
77 
78  private:
79  ContainedDiscreteFunctionSpaceType containedSpace_;
80  };
81 
82 
83  template< class DiscreteFunctionSpace, int N >
85  : public PowerDiscreteFunctionSpace< DiscreteFunctionSpace, N >
86  {
89 
90  static const DofStoragePolicy policy = VariableBased;
91 
92  public:
95 
96  CombinedSpace ( GridPartType &gridPart,
97  const InterfaceType commInterface = InteriorBorder_All_Interface,
98  const CommunicationDirection commDirection = ForwardCommunication )
99  : BaseType( gridPart, commInterface, commDirection )
100  {}
101 
102  // prohibit copy constructor and copy assignment opertor
103  CombinedSpace ( const ThisType & ) = delete;
104  ThisType &operator= ( const ThisType & ) = delete;
105 
106  //- Additional methods
108  int numComponents () const { return N; }
109 
112  {
113  return policy;
114  }
115 
117  const ContainedDiscreteFunctionSpaceType &containedSpace () const
118  {
119  return BaseType::containedSpace();
120  }
121  };
122 
123 
124 
125  // specialization of DifferentDiscreteFunctionSpace for this CombinedSapce
126  template< class ContainedSpace, int N, DofStoragePolicy policy, class NewFunctionSpace >
127  struct DifferentDiscreteFunctionSpace< CombinedSpace< ContainedSpace, N, policy >, NewFunctionSpace >
128  {
130  };
131 
132 
133  // DefaultLocalRestrictProlong ( specialization for CombinedSpace< DiscreteFunctionSpace, N, VariableBased > )
134  template< class DiscreteFunctionSpace, int N >
136  : public DefaultLocalRestrictProlong< typename DiscreteFunctionSpace::template ToNewDimRange< DiscreteFunctionSpace::dimRange *N >::Type >
137  {
140 
141  public:
143  : BaseType( space )
144  {}
145  };
146 
147 
148  // DefaultLocalRestrictProlong ( specialization for CombinedSpace< DiscreteFunctionSpace, N, VariableBased > )
149  template< class DiscreteFunctionSpace, int N >
151  : public PowerLocalRestrictProlong< DiscreteFunctionSpace, N >
152  {
155 
156  public:
158  : BaseType( space.containedSpace() )
159  {}
160  };
161 
164  } // namespace Fem
165 
166 } // namespace Dune
167 
168 #endif // #ifndef DUNE_FEM_SPACE_COMBINEDSPACE_COMBINEDSPACE_HH
Definition: powerlocalrestrictprolong.hh:25
int numComponents() const
number of components
Definition: combinedspace/combinedspace.hh:108
BaseType::ContainedDiscreteFunctionSpaceType ContainedDiscreteFunctionSpaceType
Definition: combinedspace/combinedspace.hh:94
Definition: dofstorage.hh:16
CombinedSpace(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: combinedspace/combinedspace.hh:51
DofStoragePolicy myPolicy() const
policy of this space
Definition: combinedspace/combinedspace.hh:111
BaseType::GridPartType GridPartType
Definition: combinedspace/combinedspace.hh:93
const ContainedDiscreteFunctionSpaceType & containedSpace() const
contained space
Definition: combinedspace/combinedspace.hh:117
DefaultLocalRestrictProlong(const CombinedSpace< DiscreteFunctionSpace, N, PointBased > &space)
Definition: combinedspace/combinedspace.hh:142
Definition: discretefunctionspace.hh:126
Combined Space Function Space.
Definition: combinedspace/combinedspace.hh:39
const ContainedDiscreteFunctionSpaceType & containedSpace() const
contained space
Definition: combinedspace/combinedspace.hh:73
CombinedSpace(GridPartType &gridPart, const InterfaceType commInterface=InteriorBorder_All_Interface, const CommunicationDirection commDirection=ForwardCommunication)
Definition: combinedspace/combinedspace.hh:96
Definition: coordinate.hh:4
DefaultLocalRestrictProlong(const CombinedSpace< DiscreteFunctionSpace, N, VariableBased > &space)
Definition: combinedspace/combinedspace.hh:157
DiscreteFunctionSpace ContainedDiscreteFunctionSpaceType
Definition: combinedspace/combinedspace.hh:49
Definition: combinedspace/combinedspace.hh:32
Definition: dofstorage.hh:16
int numComponents() const
number of components
Definition: combinedspace/combinedspace.hh:64
DofStoragePolicy myPolicy() const
policy of this space
Definition: combinedspace/combinedspace.hh:67
Definition: powerspace.hh:29
Traits::GridPartType GridPartType
Definition: powerspace.hh:177
discrete function space
Definition: common/localrestrictprolong.hh:16
BaseType::GridPartType GridPartType
Definition: combinedspace/combinedspace.hh:48
DofStoragePolicy
Definition: dofstorage.hh:16
CombinedSpace< ContainedSpace, NewFunctionSpace::dimRange, policy > Type
Definition: combinedspace/combinedspace.hh:129
Definition: combinedspace/combinedspace.hh:84