dune-pdelab  2.4.1
gridfunctionspace/tags.hh
Go to the documentation of this file.
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 
12 
13 #include <numeric>
14 
15 namespace Dune {
16  namespace PDELab {
17 
21 
22  struct FunctionSpaceTag {};
23 
25 
27 
29 
31 
33 
34  template<typename ProxiedGFSTag>
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 
125 
128 
134  struct
135  DUNE_DEPRECATED_MSG("Deprecated in DUNE-PDELab 2.4. Please use Permuted<> instead!")
137  {
138 
140  PermutationOrderingTag(std::vector<std::size_t> perm)
141  : _perm(perm)
142  {
143  }
144 
146  const std::vector<std::size_t>& permutation() const
147  {
148  return _perm;
149  }
150 
152  void updatePermutation(const std::vector<std::size_t>& perm)
153  {
154  assert(perm.size() == _perm.size());
155  _perm = perm;
156  }
157 
158  private:
159 
160  std::vector<std::size_t> _perm;
161  };
162 
164  template<bool v>
166  {
167  static const bool no_const_ordering_size = v;
168  };
169 
170  namespace {
171 
172  // Use this compile-time bridge to shup up GCC warnings
173 
174  template<int i>
175  struct shift_if_nonnegative
176  {
177  static const unsigned int value = 1 << i;
178  };
179 
180  template<>
181  struct shift_if_nonnegative<-1>
182  {
183  static const unsigned int value = 0;
184  };
185 
186  }
187 
189 
193  template<int p0 = -1, int p1 = -1, int p2 = -1, int p3 = -1, int p4 = -1>
195  {
196 
197  static const unsigned int partition_mask =
203 
204  };
205 
206  struct EmptyParams
207  {};
208 
210 
220  template<typename Params>
222  : public Params
223  {};
224 
226 
229  struct SingleCodimMapper {};
230 
233 
236 
239 
243 
247 
251 
254  struct SimpleLFSCacheTag {};
255 
256 
257  template<typename GFS, typename Tag>
259  {
261  };
262 
263  template<typename GFS>
265  {
267  };
268 
269 
270  template<typename GFS>
272  {
274  };
275 
276 
277 #ifndef DOXYGEN
278 
280 
295  template<typename GFS>
296  struct gfs_to_lfs {
297 
299  //typedef Dune::PDELab::MultiIndex<std::size_t,TypeTree::TreeInfo<GFS>::depth> MultiIndex;
300  typedef typename build_dof_index_type<GFS>::type DOFIndex;
301 
302  };
303 
304 #endif // DOXYGEN
305 
307  } // namespace PDELab
308 } // namespace Dune
309 
310 #endif // DUNE_PDELAB_GRIDFUNCTIONSPACE_TAGS_HH
Tag denoting a PowerLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:232
Definition: gridfunctionspace/tags.hh:206
Indicate permuted ordering of the unknowns of non-leaf grid function spaces according to a given perm...
Definition: gridfunctionspace/tags.hh:134
Definition: gridfunctionspace/tags.hh:35
const std::vector< std::size_t > & permutation() const
Returns the permutation.
Definition: gridfunctionspace/tags.hh:146
InterleavedOrderingTag(std::vector< std::size_t > sizes)
Constructs an InterleavedOrderingTag with a block structure given by the std::vector sizes...
Definition: gridfunctionspace/tags.hh:108
Tag indicating a standard ordering for a leaf GridfunctionSpace.
Definition: gridfunctionspace/tags.hh:221
static const unsigned int value
Definition: gridfunctionspace/tags.hh:177
Dune::PDELab::DOFIndex< std::size_t, TypeTree::TreeInfo< GFS >::depth, 2 > type
Definition: gridfunctionspace/tags.hh:260
PermutationOrderingTag(std::vector< std::size_t > perm)
Constructs n PermutationOrderingTag using the permutation given by std::vector perm.
Definition: gridfunctionspace/tags.hh:140
void updatePermutation(const std::vector< std::size_t > &perm)
Replaces the existing permutation by a new one.
Definition: gridfunctionspace/tags.hh:152
InterleavedOrderingTag(std::initializer_list< std::size_t > sizes)
Constructs an InterleavedOrderingTag with a block structure given by the initializer list sizes...
Definition: gridfunctionspace/tags.hh:101
Definition: gridfunctionspace/tags.hh:250
Definition: adaptivity.hh:27
Definition: gridfunctionspace/tags.hh:229
_build_dof_index_type< GFS, typename GFS::OrderingTag >::type type
Definition: gridfunctionspace/tags.hh:273
Definition: gridfunctionspace/tags.hh:246
Indicate blocking of the unknowns by grid entity.
Definition: gridfunctionspace/tags.hh:53
Definition: gridfunctionspace/tags.hh:28
Definition: gridfunctionspace/tags.hh:30
Definition: gridfunctionspace/tags.hh:26
Definition: gridfunctionspace/tags.hh:258
Indicate interleaved ordering of the unknowns of non-leaf grid function spaces according to a given b...
Definition: gridfunctionspace/tags.hh:78
const std::vector< std::size_t > & offsets() const
Returns a list of offsets for the child blocks.
Definition: gridfunctionspace/tags.hh:115
Definition: gridfunctionspace/tags.hh:271
Mixin indicating whether a leaf GridFunctionSpace should never assume a const ordering size...
Definition: gridfunctionspace/tags.hh:165
Helper for building the bitmask describing the grid partitions contained in a GFS.
Definition: gridfunctionspace/tags.hh:194
Definition: gridfunctionspace/tags.hh:32
Tag for the intermediate base class of the CompositeGridFunctionSpace.
Definition: gridfunctionspace/tags.hh:40
Definition: gridfunctionspace/tags.hh:22
SimpleDOFIndex< typename GFS::Traits::SizeType > type
Definition: gridfunctionspace/tags.hh:266
Tag denoting a LeafLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:238
Definition: gridfunctionspace/tags.hh:24
Tag denoting a CompositeLocalFunctionSpace.
Definition: gridfunctionspace/tags.hh:235
Definition: gridfunctionspace/tags.hh:254
Definition: simpledofindex.hh:14
Definition: gridfunctionspace/tags.hh:242
A multi-index representing a degree of freedom in a GridFunctionSpace.
Definition: dofindex.hh:146
Indicate lexicographic ordering of the unknowns of non-leaf grid function spaces. ...
Definition: gridfunctionspace/tags.hh:63