When PETSc vectors are created initially they always have 0 everywhere. So if 
you use DMCreateLocalVector() it will have zero in all those ghost places (as 
well as everywhere else). 

   But if you use DMGetLocalVector() it returns vectors that maybe dirty so you 
need to fill in any locations you want to have a known value with that known 
value. Or call VecSet() to clear the entire vector.

  Barry

> On Apr 14, 2015, at 5:52 PM, Gideon Simpson <gideon.simp...@gmail.com> wrote:
> 
> If i use the DM_BOUNDARY_GHOSTED flag in the creation of a DMDA array, are 
> the ghosted values automatically set to zero, or should they be manually set 
> to zero if that’s the desired ghost value?
> 
> -gideon
> 

Reply via email to