Re: [petsc-users] Block matrix vector products?

2019-07-15 Thread Smith, Barry F. via petsc-users
> On Jul 15, 2019, at 11:54 PM, Jed Brown via petsc-users > wrote: > > You can use MatCreateMAIJ(A,2,&M) and a single MatMult(A,xy) where xy > contains the vectors x and y interlaced [x_0, y_0, x_1, y_1, ...]. > > There is also MatMatMult(A,X,...,&Y) where X is a MATDENSE with two > columns,

Re: [petsc-users] Block matrix vector products?

2019-07-15 Thread Jed Brown via petsc-users
You can use MatCreateMAIJ(A,2,&M) and a single MatMult(A,xy) where xy contains the vectors x and y interlaced [x_0, y_0, x_1, y_1, ...]. There is also MatMatMult(A,X,...,&Y) where X is a MATDENSE with two columns, but I would prefer the MAIJ variant above in most cases. Tyler Chen via petsc-users

[petsc-users] Block matrix vector products?

2019-07-15 Thread Tyler Chen via petsc-users
Hello, I am looking for a way to compute two matrix vector products simultaneously, where the matrix is the same for both products (i.e. Ax and Ay). I know some numerical libraries have the concept of "block vectors" or "basis vectors" and was wondering if there is anything similar in PETSc. Right