[petsc-dev] checking if a vector is ghosted

mspieg mspieg at ldeo.columbia.edu
Tue Nov 8 13:06:04 CST 2011


Hi All,
   is there a clean way to test if a vector is ghosted (i.e created with VecCreateGhost…) without trying to call VecGhostGetLocalForm and throwing an exception?

In 3.1 I got around this using  PetscExceptonTry1  but apparently in 3.2 and dev  PetscException… is "too cool for school" ;^)

One possible  simple fix would be something like

PetscError VecGhostIsGhosted(Vec g, PetscBool isghosted)

and just return the results of  the logical tests in VecGhostGetLocalForm without throwing an error. 

(alternatively, I suppose I could mess with the ErrorHandlers but that seems like overkill for this).
Let me know what might work.  
cheers
marc




 
----------------------------------------------------
Marc Spiegelman
Lamont-Doherty Earth Observatory
Dept. of Applied Physics/Applied Math
Columbia University
http://www.ldeo.columbia.edu/~mspieg
tel: 845 704 2323 (SkypeIn)
----------------------------------------------------




More information about the petsc-dev mailing list