[Dune] Extract host entity from GeometryGrid entity

Andreas Dedner a.s.dedner at warwick.ac.uk
Tue Dec 6 17:30:39 CET 2016


Alternative:
const auto& hostEntity = Dune::Fem::gridEntity( geoEntity );
But you will still need the experimental grid extensions...

On 06/12/16 16:10, Martin Nolte wrote:
> Hi Marco,
> 
> that's one of my favorite issues with DUNE: The entity you get is an
> instance of the facade class Dune::Entity which only forwards the
> interface methods to the actual implementation. If you want to access an
> implementation detail of a grid (like the hostEntity in a GeometryGrid),
> you need to call the method impl() on the entity to obtain the actual
> implementation. In your case, the correct statement is:
> 
> entity.impl().hostEntity()
> 
> Note: This method is only public, if you enable *experimental grid
> extensions*.
> 
> Best,
> 
> Martin
> 
> 
> On 12/06/2016 04:25 PM, Agnese, Marco wrote:
>> Hi,
>>
>> I need to obtain the host entity of an entity contained in a
>> GeometryGrid.
>>
>> I was trying to do something like this
>>
>>
>> for( const auto& entity : elements( geogrid.leafGridView() ) )
>>
>> {
>>   const auto hostEntity = entity.hostEntity() ;
>>   // ...
>> }
>>
>> but I have the following error
>>
>> error: ‘const class Dune::Entity<0, 2, const
>> Dune::GeometryGrid<Dune::YaspGrid<2>,
>> Dune::IdenticalCoordFunction<double, 2u>
>>> , Dune::GeoGrid::Entity>’ has no member named ‘hostEntity’
>>
>> But in dune/grid/geometrygrid/entity.hh the hostEntity() method is
>> defined.
>>
>> Any idea of what am I doing wrong?
>>
>> Cheers,
>> Marco
>>
>>
>>
>>
>>
>> _______________________________________________
>> Dune mailing list
>> Dune at dune-project.org
>> http://lists.dune-project.org/mailman/listinfo/dune
>>
> 




More information about the Dune mailing list