Re: [petsc-users] MatCreateTranspose

2024-04-12 Thread Pierre Jolivet
> On 12 Apr 2024, at 11:51 AM, Carl-Johan Thore > wrote: > > On Fri, Apr 12, 2024 at 11:16 AM Pierre Jolivet > wrote: >> >> >>> On 12 Apr 2024, at 11:10 AM, Carl-Johan Thore >> > wrote: >>> >>> Pierre, I see that you've already done

Re: [petsc-users] MatCreateTranspose

2024-04-12 Thread Carl-Johan Thore
On Fri, Apr 12, 2024 at 11:16 AM Pierre Jolivet wrote: > > > On 12 Apr 2024, at 11:10 AM, Carl-Johan Thore > wrote: > > Pierre, I see that you've already done a merge request for this. Thanks! > I have tested this and it works nicely in my application > > > I guess your matrix is symmetric in

Re: [petsc-users] MatCreateTranspose

2024-04-12 Thread Pierre Jolivet
> On 12 Apr 2024, at 11:10 AM, Carl-Johan Thore > wrote: > > Pierre, I see that you've already done a merge request for this. Thanks! > I have tested this and it works nicely in my application I guess your matrix is symmetric in pattern? Because otherwise, I don’t think this should work. But

Re: [petsc-users] MatCreateTranspose

2024-04-12 Thread Carl-Johan Thore
Pierre, I see that you've already done a merge request for this. Thanks! I have tested this and it works nicely in my application /Carl-Johan On Wed, Apr 10, 2024 at 8:24 AM Carl-Johan Thore wrote: > > > On Tue, Apr 9, 2024 at 5:31 PM Pierre Jolivet wrote: > >> >> On 9 Apr 2024, at 4:19 PM,

Re: [petsc-users] MatCreateTranspose

2024-04-10 Thread Carl-Johan Thore
On Tue, Apr 9, 2024 at 5:31 PM Pierre Jolivet wrote: > > On 9 Apr 2024, at 4:19 PM, Carl-Johan Thore > wrote: > > This Message Is From an External Sender > This message came from outside your organization. > Thanks for the suggestion. I don't have a factored matrix (and can't > really use

Re: [petsc-users] MatCreateTranspose

2024-04-09 Thread Pierre Jolivet
> On 9 Apr 2024, at 4:19 PM, Carl-Johan Thore wrote: > > This Message Is From an External Sender > This message came from outside your organization. > Thanks for the suggestion. I don't have a factored matrix (and can't really > use direct linear solvers) so MatSolveTranspose doesn't seem to

Re: [petsc-users] MatCreateTranspose

2024-04-09 Thread Carl-Johan Thore
Thanks for the suggestion. I don't have a factored matrix (and can't really use direct linear solvers) so MatSolveTranspose doesn't seem to be an option. I should have mentioned that I've also tried KSPSolveTranspose but that doesn't work with pcredistribute /Carl-Johan On Tue, Apr 9, 2024 at

Re: [petsc-users] MatCreateTranspose

2024-04-09 Thread Zhang, Hong via petsc-users
Carl-Johan, You can use MatSolveTranspose() to solve A'*x = b. See petsc/src/ksp/ksp/tutorials/ex79.c `MatCreateTranspose()` is used if you only need a matrix that behaves like the transpose, but don't need the storage to be changed, i.e., A and A' share same matrix storage, thus MatGetRow()