DUNE PDELab (2.7)

tags.hh
1 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=8 sw=2 sts=2:
3 
4 #ifndef DUNE_PDELAB_GRIDFUNCTIONSPACE_TAGS_HH
5 #define DUNE_PDELAB_GRIDFUNCTIONSPACE_TAGS_HH
6 
7 #include <dune/grid/common/gridenums.hh>
8 #include <dune/typetree/utility.hh>
9 
10 #include <dune/pdelab/common/dofindex.hh>
11 #include <dune/pdelab/common/simpledofindex.hh>
12 
13 #include <numeric>
14 
15 namespace Dune {
16  namespace PDELab {
17 
21 
22  struct FunctionSpaceTag {};
23 
24  struct GridFunctionSpaceTag : public FunctionSpaceTag {};
25 
26  struct PowerGridFunctionSpaceTag : public GridFunctionSpaceTag {};
27 
28  struct VectorGridFunctionSpaceTag : public PowerGridFunctionSpaceTag {};
29 
30  struct CompositeGridFunctionSpaceTag : public GridFunctionSpaceTag {};
31 
32  struct LeafGridFunctionSpaceTag : public GridFunctionSpaceTag {};
33 
34  template<typename ProxiedGFSTag>
35  struct GridFunctionSubSpaceTag
36  : public ProxiedGFSTag
37  {};
38 
41 
43 
54 
57 
64 
67 
79  {
80 
82 
101  InterleavedOrderingTag(std::initializer_list<std::size_t> sizes)
102  : _offsets(sizes.size() + 1,0)
103  {
104  std::partial_sum(sizes.begin(),sizes.end(),_offsets.begin() + 1);
105  }
106 
108  InterleavedOrderingTag(std::vector<std::size_t> sizes)
109  : _offsets(sizes.size() + 1,0)
110  {
111  std::partial_sum(sizes.begin(),sizes.end(),_offsets.begin() + 1);
112  }
113 
115  const std::vector<std::size_t>& offsets() const
116  {
117  return _offsets;
118  }
119 
120  private:
121 
122  std::vector<std::size_t> _offsets;
123  };
124 
126  template<bool v>
128  {
129  static const bool no_const_ordering_size = v;
130  };
131 
132  namespace {
133 
134  // Use this compile-time bridge to shup up GCC warnings
135 
136  template<int i>
137  struct shift_if_nonnegative
138  {
139  static const unsigned int value = 1 << i;
140  };
141 
142  template<>
143  struct shift_if_nonnegative<-1>
144  {
145  static const unsigned int value = 0;
146  };
147 
148  }
149 
151 
155  template<int p0 = -1, int p1 = -1, int p2 = -1, int p3 = -1, int p4 = -1>
157  {
158 
159  static const unsigned int partition_mask =
160  shift_if_nonnegative<p0>::value |
161  shift_if_nonnegative<p1>::value |
162  shift_if_nonnegative<p2>::value |
163  shift_if_nonnegative<p3>::value |
164  shift_if_nonnegative<p4>::value;
165 
166  };
167 
168  struct EmptyParams
169  {};
170 
172 
182  template<typename Params>
184  : public Params
185  {};
186 
188 
191  struct SingleCodimMapper {};
192 
195 
198 
201 
205 
209 
213 
216  struct SimpleLFSCacheTag {};
217 
218  namespace Experimental {
219 
220  struct DuneFunctionsCacheTag {};
221 
222  }
223 
224  template<typename GFS, typename Tag>
225  struct _build_dof_index_type
226  {
228  };
229 
230  template<typename GFS>
231  struct _build_dof_index_type<GFS,SingleCodimMapper>
232  {
233  typedef SimpleDOFIndex<typename GFS::Traits::SizeType> type;
234  };
235 
236 
237  template<typename GFS>
238  struct build_dof_index_type
239  {
240  typedef typename _build_dof_index_type<GFS,typename GFS::OrderingTag>::type type;
241  };
242 
243 
244 #ifndef DOXYGEN
245 
247 
262  template<typename GFS>
263  struct gfs_to_lfs {
264 
266  //typedef Dune::PDELab::MultiIndex<std::size_t,TypeTree::TreeInfo<GFS>::depth> MultiIndex;
267  typedef typename build_dof_index_type<GFS>::type DOFIndex;
268 
269  };
270 
271 #endif // DOXYGEN
272 
274  } // namespace PDELab
275 } // namespace Dune
276 
277 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_TAGS_HH
A multi-index representing a degree of freedom in a GridFunctionSpace.
Definition: dofindex.hh:148
Dune namespace.
Definition: alignedallocator.hh:14
Tag for the intermediate base class of the CompositeGridFunctionSpace.
Definition: tags.hh:40
Tag denoting a CompositeLocalFunctionSpace.
Definition: tags.hh:197
Definition: tags.hh:212
Indicate blocking of the unknowns by grid entity.
Definition: tags.hh:53
Indicate interleaved ordering of the unknowns of non-leaf grid function spaces according to a given b...
Definition: tags.hh:79
InterleavedOrderingTag(std::vector< std::size_t > sizes)
Constructs an InterleavedOrderingTag with a block structure given by the std::vector sizes.
Definition: tags.hh:108
InterleavedOrderingTag(std::initializer_list< std::size_t > sizes)
Constructs an InterleavedOrderingTag with a block structure given by the initializer list sizes.
Definition: tags.hh:101
const std::vector< std::size_t > & offsets() const
Returns a list of offsets for the child blocks.
Definition: tags.hh:115
Tag denoting a LeafLocalFunctionSpace.
Definition: tags.hh:200
Tag indicating a standard ordering for a leaf GridfunctionSpace.
Definition: tags.hh:185
Indicate lexicographic ordering of the unknowns of non-leaf grid function spaces.
Definition: tags.hh:63
Mixin indicating whether a leaf GridFunctionSpace should never assume a const ordering size.
Definition: tags.hh:128
Helper for building the bitmask describing the grid partitions contained in a GFS.
Definition: tags.hh:157
Tag denoting a PowerLocalFunctionSpace.
Definition: tags.hh:194
Definition: tags.hh:216
Definition: tags.hh:191
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 13, 22:30, 2024)