[Dune-devel] [Dune-Commit] dune-grid r8762 - trunk/dune/grid

Christian Engwer christian.engwer at uni-muenster.de
Sun Jan 20 13:05:35 CET 2013


Hi Oli,

> Take the type from the method argument from the GridTraits class, rather than stating it directly.
> 
> This gives the same type, but it makes the template argument deduction fail.
> Therefore, change the template parameter of method 'entityPointer' from
> 'int codim' to 'typename Seed'

just as a comment... it might lead to stranger errors if the users
accidentially passes a non-matching seed


Christian

> Modified: trunk/dune/grid/onedgrid.hh
> ===================================================================
> --- trunk/dune/grid/onedgrid.hh	2013-01-19 15:09:31 UTC (rev 8761)
> +++ trunk/dune/grid/onedgrid.hh	2013-01-19 15:55:38 UTC (rev 8762)
> @@ -184,11 +184,12 @@
>      typename Traits::template Codim<codim>::template Partition<PiType>::LeafIterator leafend() const;
>  
>      /** \brief Create an EntityPointer from an EntitySeed */
> -    template <int codim>
> -    static typename Traits::template Codim<codim>::EntityPointer
> -    entityPointer(const OneDGridEntitySeed<codim, const OneDGrid>& seed)
> +    template <typename Seed>
> +    static typename Traits::template Codim<Seed::codimension>::EntityPointer
> +    entityPointer(const Seed& seed)
>      {
> -        return typename Traits::template Codim<codim>::EntityPointer(seed.target());
> +        enum {codim = Seed::codimension};
> +        return typename Traits::template Codim<codim>::EntityPointer(OneDGridEntityPointer<codim,const OneDGrid>(seed.target()));
>      }
>  
>  
> 
> Modified: trunk/dune/grid/uggrid.hh
> ===================================================================
> --- trunk/dune/grid/uggrid.hh	2013-01-19 15:09:31 UTC (rev 8761)
> +++ trunk/dune/grid/uggrid.hh	2013-01-19 15:55:38 UTC (rev 8762)
> @@ -309,10 +309,11 @@
>      }
>  
>      /** \brief Create an EntityPointer from an EntitySeed */
> -    template <int codim>
> -    typename Traits::template Codim<codim>::EntityPointer
> -    entityPointer(const UGGridEntitySeed<codim, const UGGrid<dim> >& seed) const
> +    template <typename Seed>
> +    typename Traits::template Codim<Seed::codimension>::EntityPointer
> +    entityPointer(const Seed& seed) const
>      {
> +        enum {codim = Seed::codimension};
>          return typename Traits::template Codim<codim>::EntityPointer(UGGridEntityPointer<codim,const UGGrid<dim> >(seed.target(),this));
>      }
>  
> 
> 
> _______________________________________________
> Dune-Commit mailing list
> Dune-Commit at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune-commit
> 

-- 
Prof. Dr. Christian Engwer 
Institut für Numerische und Angewandte Mathematik
Fachbereich Mathematik und Informatik der Universität Münster
Einsteinstrasse 62
48149 Münster

E-Mail	christian.engwer at uni-muenster.de
Telefon	+49 251 83-35067
FAX		+49 251 83-32729




More information about the Dune-devel mailing list