[Dune] Returning Geometries As Objects

Carsten Gräser graeser at math.fu-berlin.de
Wed Jan 25 12:15:27 CET 2012


Hi,
first of all thank you for your effort, Martin!

Am 25.01.2012 11:04, schrieb Jö Fahlke:
> Am Wed, 25. Jan 2012, 09:49:01 +0100 schrieb Martin Nolte:
>> Dear all,
>>
>> as announced in December, there is now an implementation returning
>> the geometry as an object and all grid implementations in dune-grid
>> have been adapted accordingly. Therefore, I think time has come for
>> discussion of the outcome.
> 
> Nice!
> 
>> The changes try to be as uninvasive as possible. However, due to
>> code evolution, there are some unnecessary changes left. The
>> greatest benefit for a developer is the possibility to create a new
>> geometry object whenever the geometry is requested. This gives us
>> essentially two types of geometry implementations:
>> (a) actually returned geometry implementations,
>> (b) references to the actual geometry (as was previously enforced).
> 
> So, in essence, Dune::Geometry may (a) store the actual geometry or may (b) be
> a wrapper class holding a reference/pointer to the actual geometry?
> 
> In case be (b), how long is a geometry object guaranteed to be valid?  Until
> the entity/intersection object it was obtained from changes it's value or is
> destroyed?
In my opinion it would be counterintuitive if the object is only
valid as long as the reference was before.

Wouldn't it be even simpler and more flexible to always store the
geometry implementation geo_ in the Geometry object? One could still
use geo_ to redirect the actual work to an object stored somewhere
else. If one would, e.g., like to implement reference counting
for those to ensure a proper livetime, it seems that one anyway
cannot use (b) although one does conceptually store a reference.

Best regards,
Carsten

-- 
----------------------------------------------------------------------
Dr. Carsten Gräser       | phone: +49-30 / 838-75349
Freie Universität Berlin | fax  : +49-30 / 838-54977
Institut für Mathematik  | email: graeser at math.fu-berlin.de
Arnimallee 6             |
14195 Berlin, Germany    | URL  : http://page.mi.fu-berlin.de/graeser
----------------------------------------------------------------------




More information about the Dune mailing list