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

Benedikt Oswald benedikt.oswald at psi.ch
Wed Jan 26 09:14:24 CET 2011


Hi Jö, thanks! The dimensions are the same, but...still the compiler won't accept it.
I will have one more look at it.

Have a great day! Benedikt


On Jan 25, 2011, at 8:35 PM, Jö Fahlke wrote:

> 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.

--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Benedikt Oswald, Dr. sc. techn., dipl. El. Ing. ETH, www.psi.ch, Computational Accelerator Scientist, http://amas.web.psi.ch
Paul Scherrer  Institute (PSI), CH-5232 Villigen, Suisse, benedikt.oswald at psi.ch, +41(0)56 310 32 12

"Passion is required for any great work, and for the revolution passion and audacity are required in big doses.",
 Ernesto 'Che' Guevara, Letter to his parents.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------





More information about the Dune mailing list