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

Matthew Knepley knepley at gmail.com
Fri Mar 16 15:03:49 CDT 2012


On Fri, Mar 16, 2012 at 2:50 PM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

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

They are all copied. That is how DMComplex works. I was probably not
careful with Composite.

   Matt

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20120316/01023012/attachment.html>


More information about the petsc-dev mailing list