[petsc-dev] Copy *SNES-struct deeply

Matthew Knepley knepley at gmail.com
Thu Feb 28 06:41:42 CST 2013


On Thu, Feb 28, 2013 at 7:10 AM, Jed Brown <jedbrown at mcs.anl.gov> wrote:

>
> On Thu, Feb 28, 2013 at 6:50 AM, Matthew Knepley <knepley at gmail.com>wrote:
>
>> Ah, its specialized:
>>
>>
>> https://bitbucket.org/petsc/petsc-dev/src/923de80728797e2783dffed96365fada710347b8/include/petscdmplex.h?at=default#cl-23
>>
>> Is there an objection to me promoting this?
>>
>
> Matt, your current implementation is sort of a mix of shallow (with
> respect to private DM_Plex stuff) clone and deep/rebuilt (with respect to
> DM stuff like defaultSection). I think it's worth making consistent, but
> safe sharing semantics are tricky to specify. I think DMDA will be somewhat
> involved regardless of the desired semantics.
>

I think that was justified when PetscSection was just considered data like
PetscLayout. However, now that it
is an object, we should reconsider.

Unfortunately, I think sharing the default section between clone could be
very error prone. I am currently using
Clone() to share the large mesh data structures in the back end, but do not
want any sharing of the sections. I
think this would be the common use case.

    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/20130228/5a3c5cc8/attachment.html>


More information about the petsc-dev mailing list