[Dune] Entity vs EntityPointer

Christoph_Gersbacher gersbach at mathematik.uni-freiburg.de
Thu Apr 16 12:09:33 CEST 2015


Hi,

the best thing I could come up with for dune-fem is to use a 
compatibility method that always returns an entity:

    template< class Grid, class Implementation >
    typename Dune::EntityPointer< Grid, Implementation >::Entity
    make_entity ( const Dune::EntityPointer< Grid, Implementation >
    &entityPointer )
    {
       return *entityPointer;
    }

    template< int codim, int dim, class Grid, template< int, int, class
     > class Implementation >
    typename Dune::Entity< codim, dim, Grid, Implementation >
    make_entity ( Dune::Entity< codim, dim, Grid, Implementation > entity )
    {
       return std::move( entity );
    }

Then, the statement

    Intersection::Entity entity = make_entity( intersection.outside() );

will not give raise to compiler warnings no matter which grid is used. 
After the 2.4 release you can easily deprecate the compatibility method 
and find and remove all its occurrences.

Best
Christoph

On 04/16/2015 11:45 AM, Christian Engwer wrote:
> Dear all,
>
> I wanted to get rid of deprecation warning in PDELab and observed and
> replace things like
>    intersectionIterator->outside()->type()
> by
>    intersectionIterator->outside().type()
>
> Now the problem occures, that for most of the code I have a working
> version without deprecation warnings, but when using ALUgrid, the code
> breaks, as ALUGrid is not updated yet. This is a general issue,
> because it blocks the upgrade path. How shall we proceed? One option
> would be to extend the EntityPointer-wrapper such that we can call all
> methods of the entity by forwarding the call internally. Are there
> alternatives? Or is there an alternative upgrade path?
>
> Ciao
> Christian
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune


-- 
Christoph Gersbacher<christoph.gersbacher at mathematik.uni-freiburg.de> 
<mailto:christoph.gersbacher at mathematik.uni-freiburg.de>
Abteilung für Angewandte Mathematik
Albert-Ludwigs-Universität Freiburg
Hermann-Herder-Str. 10
D-79104 Freiburg im Breisgau
Tel.: +49 (0)761 / 203 5645
Fax: +49 (0)761 / 203 5632
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20150416/703b45de/attachment.htm>


More information about the Dune mailing list