On 2 August 2010 18:21, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> On Aug 2, 2010, at 9:38 AM, Lisandro Dalcin wrote:
>
>> DAGet[Ghosted]Coordinates return a new reference to the coordinate
>> vector. However, this is not the usual pattern of other XXXGetYYY
>> calls...
>
> ? ? ?What do you suggest? (1) ?Provide a DARestoreCoordinates() that does the 
> dereference? ?(2) remove the reference from the calls (3) change the name 
> from get?
>
> ? ? ?I like (1) but it is kind of artificial.
>
> ? Barry

Barry, the DA structure holds references for coordinates,
ghosted_coordinates, and da_coordinates, these object are dereferenced
at DADestroy():
http://petsc.cs.iit.edu/petsc/petsc-dev/file/e89611ec33d6/src/dm/da/src/dadestroy.c#l147

So I think that we should just return borrowed references, if needed,
they can be manually incref'ed (I would need that in petsc4py). Am I
missing something?


-- 
Lisandro Dalcin
---------------
CIMEC (INTEC/CONICET-UNL)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
Tel: +54-342-4511594 (ext 1011)
Tel/Fax: +54-342-4511169

Reply via email to