Commit 4d0c95d0 authored by Steffen Müthing's avatar Steffen Müthing Committed by Carsten Gräser

[Rangegenerators][Release] The default entities() method should not enforce Partitions::all

When I originally wrote the range generator functions, I implemented the
entities() function that does not specify a parallel partition as a
forward to the function with a parallel partition and hardcoded the
partition to Partitions::all. This turned out to be a *really* bad idea
because it makes it breaks custom GridView-like objects over smaller
partitions in generic code that does not want to care about the

I know this commit is late, but is absolutely crucial for PDELab's
nonoverlapping parallel support. Carsten, would you please consider
taking this one for the release?

(cherry picked from commit 51ed967e)
parent 76dae981
......@@ -788,18 +788,23 @@ namespace Dune
* Entity range implementation without PartitionSet parameter. The default implementation forwards
* this by adding Dune::Partitions::all, but if you have a GridView-like object that cannot handle
* parallel partitions correctly, you can provide an overload for this function.
* Entity range implementation without PartitionSet parameter. The default implementation obtains the
* standard iterators by calling begin() and end() without specifying a partition type. This makes it
* possible to have user-defined GridView-like objects with a different default partition.
* All other functions without PartitionSet parameter forward to this function.
template<typename GV, int codim>
inline auto entities(const GV& gv, Codim<codim> cd)
-> decltype(entities(gv,cd,Partitions::all))
inline IteratorRange<
typename GV::template Codim<codim>::Iterator
entities(const GV& gv, Codim<codim>)
static_assert(0 <= codim && codim <= GV::dimension, "invalid codimension for given GridView");
return entities(gv,cd,Partitions::all);
typedef IteratorRange<
typename GV::template Codim<codim>::Iterator
> return_type;
return return_type(gv.template begin<codim>(),gv.template end<codim>());
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment