dune-pdelab 2.10-git
Loading...
Searching...
No Matches
identity.hh
Go to the documentation of this file.
1#ifndef DUNE_PDELAB_COMMON_PARTITION_IDENTITY_HH
2#define DUNE_PDELAB_COMMON_PARTITION_IDENTITY_HH
3
5
6#include <dune/grid/concepts/gridview.hh>
9
11
12#include <type_traits>
13#include <array>
14#include <memory>
15
17
25template<Dune::Concept::GridView ES>
26class Identity {
27public:
29 using EntitySet = ES;
31 using Element = typename EntitySet::template Codim<0>::Entity;
38
40 explicit Identity(const EntitySet& entity_set)
41 : _entity_set{entity_set}
42 {
43 update(entity_set);
44 }
45
47 [[nodiscard]] constexpr static auto haloRegion(const Dune::Concept::Entity auto& entity) {
49 }
50
52 [[nodiscard]] EntitySet entitySet() const noexcept { return _entity_set; }
53
55 [[nodiscard]] auto begin() const { return _partition_set.begin(); }
56
58 [[nodiscard]] auto end() const { return _partition_set.end(); }
59
61 void update(EntitySet entity_set) {
62 _entity_set = entity_set;
63 _partition_set = PartitionSet{LabelSet{PatchSet{entity_set.template begin<0>(), entity_set.template end<0>()}}};
64 }
65
66private:
67 EntitySet _entity_set;
68 PartitionSet _partition_set;
69};
70
71} // namespace Dune::PDELab::EntitySetPartition
72
73#endif // DUNE_PDELAB_COMMON_PARTITION_IDENTITY_HH
Definition colored.hh:16
static constexpr std::integral_constant< HaloRegion, HaloRegion::Interior > interior_halo_region
Constant for interior halo region.
Definition region.hh:15
Entity set partition with all entities assigned to one patch (i.e. no partitioning)
Definition identity.hh:26
void update(EntitySet entity_set)
Update the partition with a new entity set.
Definition identity.hh:61
ES EntitySet
Uderlying entity set.
Definition identity.hh:29
auto end() const
end of the partition set range
Definition identity.hh:58
auto begin() const
begin of the partition set range
Definition identity.hh:55
EntitySet entitySet() const noexcept
Underlying entity set.
Definition identity.hh:52
Identity(const EntitySet &entity_set)
Construct Identity partition from a entity set.
Definition identity.hh:40
typename EntitySet::template Codim< 0 >::Entity Element
Entity being partitioned.
Definition identity.hh:31
static constexpr auto haloRegion(const Dune::Concept::Entity auto &entity)
Halo region of the partition for an entity.
Definition identity.hh:47
T begin(T... args)
T end(T... args)