dune-pdelab  2.4-dev
singlecodimleafordering.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_ORDERING_SINGLECODIMLEAFORDERING_HH
5 #define DUNE_PDELAB_ORDERING_SINGLECODIMLEAFORDERING_HH
6 
7 #include <dune/typetree/leafnode.hh>
8 
11 
12 namespace Dune {
13  namespace PDELab {
14 
17 
18  template<typename GV, typename DI, typename CI>
20  : public TypeTree::LeafNode
21  {
22 
23  public:
24 
26 
28 
29 
31 
32  typename Traits::ContainerIndex mapIndex(const typename Traits::DOFIndex& di) const
33  {
34  return di[0];
35  }
36 
37  void mapIndex(typename Traits::DOFIndex di, typename Traits::ContainerIndex& ci) const
38  {
39  ci = di[0];
40  }
41 
42  typename Traits::SizeType size() const
43  {
44  return _gv.size(0);
45  }
46 
47  typename Traits::SizeType blockCount() const
48  {
49  return size();
50  }
51 
52  typename Traits::SizeType maxLocalSize() const
53  {
54  return 1;
55  }
56 
57  void update()
58  {
59  }
60 
62  : _gv(gv)
63  {
64  }
65 
66  bool container_blocked() const
67  {
68  return false;
69  }
70 
71  private:
72 
73  GV _gv;
74 
75  };
76 
77 
78  template<typename GFS, typename Transformation>
79  struct leaf_gfs_to_ordering_descriptor<GFS,Transformation,SingleCodimMapper>
80  {
81 
82  static const bool recursive = false;
83 
85  typename GFS::Traits::GridView,
89 
90  typedef std::shared_ptr<transformed_type> transformed_storage_type;
91 
92  static transformed_type transform(const GFS& gfs, const Transformation& t)
93  {
94  return transformed_type(gfs.gridView());
95  }
96 
97  static transformed_storage_type transform_storage(std::shared_ptr<const GFS> gfs, const Transformation& t)
98  {
99  return std::make_shared<transformed_type>(gfs->gridView());
100  }
101 
102  };
103 
105 
106  } // namespace PDELab
107 } // namespace Dune
108 
109 #endif // DUNE_PDELAB_ORDERING_SINGLECODIMLEAFORDERING_HH
Definition: ordering/utility.hh:155
std::size_t SizeType
Definition: ordering/utility.hh:162
static transformed_storage_type transform_storage(std::shared_ptr< const GFS > gfs, const Transformation &t)
Definition: singlecodimleafordering.hh:97
Traits::SizeType maxLocalSize() const
Definition: singlecodimleafordering.hh:52
void mapIndex(typename Traits::DOFIndex di, typename Traits::ContainerIndex &ci) const
Definition: singlecodimleafordering.hh:37
Definition: gridfunctionspace/tags.hh:284
CI ContainerIndex
Definition: ordering/utility.hh:160
static transformed_type transform(const GFS &gfs, const Transformation &t)
Definition: singlecodimleafordering.hh:92
FlatContainerAllocationTag ContainerAllocationTag
Definition: singlecodimleafordering.hh:25
SimpleOrderingTraits< DI, CI > Traits
Definition: singlecodimleafordering.hh:30
std::shared_ptr< transformed_type > transformed_storage_type
Definition: singlecodimleafordering.hh:90
Definition: gridfunctionspace/tags.hh:267
Definition: simpledofindex.hh:14
Traits::ContainerIndex mapIndex(const typename Traits::DOFIndex &di) const
Definition: singlecodimleafordering.hh:32
SingleCodimLeafOrdering(const GV &gv)
Definition: singlecodimleafordering.hh:61
Definition: adaptivity.hh:27
DI DOFIndex
Definition: ordering/utility.hh:158
Definition: singlecodimleafordering.hh:19
void update()
Definition: singlecodimleafordering.hh:57
Definition: simpledofindex.hh:39
bool container_blocked() const
Definition: singlecodimleafordering.hh:66
Traits::SizeType size() const
Definition: singlecodimleafordering.hh:42
SimpleLFSCacheTag CacheTag
Definition: singlecodimleafordering.hh:27
Traits::SizeType blockCount() const
Definition: singlecodimleafordering.hh:47
SingleCodimLeafOrdering< typename GFS::Traits::GridView, SimpleDOFIndex< typename GFS::Traits::SizeType >, SimpleContainerIndex< typename GFS::Traits::SizeType > > transformed_type
Definition: singlecodimleafordering.hh:88
Definition: gridfunctionspace/tags.hh:292