Hi Matt, Thanks for the rapid response. The reason I want to ensure I have a DMDA is that this is a custom gradient function, the results of which are meaningless for anything but a regular grid. I would rather raise an exception upfront with the user than allow the program to continue with garbage data.
Phil On 25/09/18 11:55, Matthew Knepley wrote: > On Tue, Sep 25, 2018 at 6:49 AM Phil Tooley > <[email protected] <mailto:[email protected]>> 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/%7Eknepley/> -- Phil Tooley Research Software Engineering University of Sheffield
