<div dir="ltr"><div>Perfect, Thanks!</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 16, 2023 at 4:24 PM Barry Smith <<a href="mailto:bsmith@petsc.dev">bsmith@petsc.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><br></div><a href="https://petsc.org/release/manualpages/DM/VecGetDM/" target="_blank">https://petsc.org/release/manualpages/DM/VecGetDM/</a><div><br></div><div>Note there is also <a href="https://petsc.org/release/manualpages/Sys/PetscObjectCompose/" target="_blank">https://petsc.org/release/manualpages/Sys/PetscObjectCompose/</a> which along with <a href="https://petsc.org/release/manualpages/Sys/PetscContainerCreate/" target="_blank">https://petsc.org/release/manualpages/Sys/PetscContainerCreate/</a> 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).</div><div><br></div><div><br></div><div><div><br><blockquote type="cite"><div>On Nov 16, 2023, at 9:02 AM, Carl-Johan Thore <<a href="mailto:carljohanthore@gmail.com" target="_blank">carljohanthore@gmail.com</a>> wrote:</div><br><div><div dir="ltr"><div>Hi,</div><div><br></div><div>Given a Vec (or Mat) created at some point with DMCreate...,</div><div>is it possible to retrieve from this Vec a pointer to the DM used</div><div>to create it? </div><div><br></div><div>(I could perhaps build my own Vec-type on top of PETSc's</div><div>which carried with it such a pointer but that doesn't seem like</div><div>a good idea)<br></div><div><br></div><div>Kind regards,</div><div>Carl-Johan<br></div></div>
</div></blockquote></div><br></div></div></blockquote></div>