[petsc-dev] Calls to DMCreateFieldIS missing from fieldsplit.c

Jed Brown jedbrown at mcs.anl.gov
Fri Mar 16 14:50:21 CDT 2012


On Fri, Mar 16, 2012 at 12:53, Jungho Lee <julee at mcs.anl.gov> wrote:

> On Fri, Mar 16, 2012 at 12:50 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:
> > Yes, this definitely worked when it was put in and most of the time
> since. I
> > can debug now if you like.
>
> Yes, please do, and keep us updated. Thanks.


The problem is that when Matt added DMCreateFieldIS() (replacing my earlier
implementation that only worked with DMComposite), he did not document how
the array was supposed to be freed and his two implementations do not
agree. In fact, one of the branches is definitely incorrect because it
returns a dangling pointer to an old stack frame.

Matt, should the string names all be copied (so the caller of this function
frees the array *and* every individual field name) or should those char*
just refer to the field names, the memory for which is managed by the DM?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120316/245a0248/attachment.html>


More information about the petsc-dev mailing list