[Dune] How to obtain an EntityPointer from an Entity ?

Jö Fahlke jorrit at jorrit.de
Tue Jan 25 20:35:15 CET 2011


Am Tue, 25. Jan 2011, 15:39:35 +0100 schrieb Benedikt Oswald:
> probably a silly question, but how do I create an EntityPointer from an Entity  ?
> 
> 
> defining
> 
> typedef typename Grid::template Codim<Grid::dimension-3>::EntityPointer EntityPointerElement;
> 
> 
> and then doing something like:
> 
> EntityPointerElement entityPointer(entity);
> 
> where entity is of type Entity, as in the Dune::CommDataHandleIF gather and scatter functions
> won't work ?

AFAICT that should work.  The Entity must be of the same codimension as the
EntityPointer, of course (Grid::dimension-3 in your case).

I'm not sure what CommDataHandleIF has got to do with it.  If you're trying to
write a CommDataHandle, be aware that gather() and scatter() are instanciated
for all codimensions supported by the grid.  Returning false from contains()
will inhibit the call to gather() and scatter(), but not their instantiation,
since the returned boolean value is not static.

Bye,
Jö.

-- 
Sie können die Unversität jetzt ausschalten.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110125/5187b745/attachment.sig>


More information about the Dune mailing list