[petsc-users] Get DM used to create Vec

Carl-Johan Thore carljohanthore at gmail.com
Thu Nov 16 09:26:50 CST 2023


Perfect, Thanks!


On Thu, Nov 16, 2023 at 4:24 PM Barry Smith <bsmith at petsc.dev> wrote:

>
> https://petsc.org/release/manualpages/DM/VecGetDM/
>
> Note there is also
> https://petsc.org/release/manualpages/Sys/PetscObjectCompose/ which along
> with https://petsc.org/release/manualpages/Sys/PetscContainerCreate/ allows
> you to attach any data you like to a Vec for later access. This approach
> supports layering your own higher-level vector information on top of
> regular Vec (it is done this way to support C and old Fortran that don't
> support inheritance).
>
>
>
> On Nov 16, 2023, at 9:02 AM, Carl-Johan Thore <carljohanthore at gmail.com>
> wrote:
>
> Hi,
>
> Given a Vec (or Mat) created at some point with DMCreate...,
> is it possible to retrieve from this Vec a pointer to the DM used
> to create it?
>
> (I could perhaps build my own Vec-type on top of PETSc's
> which carried with it such a pointer but that doesn't seem like
> a good idea)
>
> Kind regards,
> Carl-Johan
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20231116/4f0b79af/attachment-0001.html>


More information about the petsc-users mailing list