[petsc-users] Checking if a vector is a localvector of a given DMDA

Matthew Knepley knepley at gmail.com
Tue Sep 25 05:55:07 CDT 2018


On Tue, Sep 25, 2018 at 6:49 AM Phil Tooley <phil.tooley at sheffield.ac.uk>
wrote:

> Hi all,
>
> Given a vector I know I can get an associated DM (if there is one) by
> calling VecGetDM, but I need to also be able to check that
>
> a) the vector is the localvector of that DM rather than the global
>

Get a local vector from the DM and check the sizes.


> b) the DM is a DMDA rather than some other subclass
>

You can do this (PetscObjectTypeCompare), but it is not recommended. Why
would
you want to do that?

  Thanks,

     Matt


> I can't immediately see routines that do what I need, but I am likely
> missing something obvious. Is there a way to achieve the above?
>
> Thanks
>
> Phil
>
> --
> Phil Tooley
> Research Software Engineering
> University of Sheffield
>
>

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

https://www.cse.buffalo.edu/~knepley/ <http://www.cse.buffalo.edu/~knepley/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180925/1e8f5879/attachment.html>


More information about the petsc-users mailing list