Re: [petsc-dev] is VecGetValuesSection correct?

2019-06-21 Thread Hapla Vaclav via petsc-dev
On 21 Jun 2019, at 13:58, Lawrence Mitchell mailto:we...@gmx.li>> wrote: Hi Vaclav, On 21 Jun 2019, at 12:14, Hapla Vaclav via petsc-dev mailto:petsc-dev@mcs.anl.gov>> wrote: VecGetValuesSection() returns pointer values obtained as follows: VecGetArray(v, &baseArray); *values = &baseArray[s

Re: [petsc-dev] is VecGetValuesSection correct?

2019-06-21 Thread Lawrence Mitchell via petsc-dev
Hi Vaclav, > On 21 Jun 2019, at 12:14, Hapla Vaclav via petsc-dev > wrote: > > VecGetValuesSection() returns pointer values obtained as follows: > > VecGetArray(v, &baseArray); > *values = &baseArray[s->atlasOff[p]]; > VecRestoreArray(v, &baseArray); > > It looks to me scary. > VecGetArray ma

[petsc-dev] is VecGetValuesSection correct?

2019-06-21 Thread Hapla Vaclav via petsc-dev
VecGetValuesSection() returns pointer values obtained as follows: VecGetArray(v, &baseArray); *values = &baseArray[s->atlasOff[p]]; VecRestoreArray(v, &baseArray); It looks to me scary. VecGetArray manpage says: If the underlying vector data is not stored in a contiguous array this routine will