1#ifndef DUNE_MULTIDOMAINGRID_UTILITY_HH 
    2#define DUNE_MULTIDOMAINGRID_UTILITY_HH 
    6#include <dune/geometry/type.hh> 
    7#include <dune/common/iteratorfacades.hh> 
   15struct GeometryTypeHash {
 
   17  std::size_t operator()(GeometryType gt)
 const {
 
   18    std::size_t hash = gt.dim() * 509;
 
   19    return gt.dim() < 2 ? hash : hash + 
static_cast<std::size_t
>(gt.id());
 
   24template<
typename T, 
typename binary_function>
 
   25struct collect_elementwise_struct {
 
   30  collect_elementwise_struct(T& r, binary_function f = binary_function()) :
 
   35  void operator()(T& val) {
 
   36    std::transform(val.begin(),val.end(),result.begin(),result.begin(),func);
 
   40template<
typename binary_function, 
typename T>
 
   41collect_elementwise_struct<T,binary_function> collect_elementwise(T& result, binary_function f = binary_function()) {
 
   42  return collect_elementwise_struct<T,binary_function>(result,f);