[petsc-users] VecStrideScatter question

Jed Brown jedbrown at mcs.anl.gov
Wed May 15 11:59:28 CDT 2013


Tabrez Ali <stali at geology.wisc.edu> writes:

> The error message (with stride of 2) is
>
> [1]PETSC ERROR: --------------------- Error Message 
> ------------------------------------
> [1]PETSC ERROR: Argument out of range!
> [1]PETSC ERROR: Start of stride subvector (2) is too large for stride
>   Have you set the vector blocksize (1) correctly with VecSetBlockSize()?!
> [1]PETSC ERROR: 
> ------------------------------------------------------------------------
>
> Do I have to use VecSetBlockSize as done in 
> http://www.mcs.anl.gov/petsc/petsc-current/src/vec/vec/examples/tutorials/ex12.c.html

Yes, you must set the block size to use the VecStride functions.

> Actually my V1 (12 entries) and V2 (3 entries) are like
>
> V1=[u1 v1 w1 u2 v2 w2 u3 v3 w3 a b c]' and
>
> V2=[      x1       x2       x3      ]' what I eventually want is
>
> V1=[u1 v1 w1+x1 u2 v2 w2+x2 u3 v3 w3+x3 a b c]
>
> Would the [a b c] at the end of V1 cause problems?

Yeah, the dimensions have to match exactly.  Just pad it however you
need.


More information about the petsc-users mailing list