[petsc-users] A compilation error about VecGetValues

2022-05-21 Thread wang yuqi
从 Windows 版邮件发送 Hi, Dear developer: I had compilation problems when using VecGetValues. My procedure is as follows: program main #include use petscvec Vec x PetscInt N,i,ione PetscErrorCode ierr PetscMPIInt rank

Re: [petsc-users] Solving a linear system with sparse matrices

2022-05-21 Thread Stefano Zampini
MatMatSolve with sparse rhs works with MUMPS On Sat, May 21, 2022, 19:41 Mateo José Moinelo wrote: > Hi. I am working on a Petsc program, and I have a problem. I have two > sparse matrices A and B, and I want to compute inv(A)*B. I understand that > computing the inverse of a matrix directly

Re: [petsc-users] Solving a linear system with sparse matrices

2022-05-21 Thread Jed Brown
You can MatConvert your sparse matrix to dense, but there's almost always a better way. Why do you want this product (which is dense) represented explicitly rather than via the sequence (multiply by B, then solve with A)? What will you use it for? Mateo José Moinelo writes: > Hi. I am

Re: [petsc-users] Solving a linear system with sparse matrices

2022-05-21 Thread Jose E. Roman
The matrix inv(A)*B can be represented with a shell matrix that calls MatMult() followed by KSPSolve(), if you only need to apply this operator to a vector. It depends on what you are trying to do. Jose > El 21 may 2022, a las 18:41, Mateo José Moinelo > escribió: > > Hi. I am working on a

[petsc-users] Solving a linear system with sparse matrices

2022-05-21 Thread Mateo José Moinelo
Hi. I am working on a Petsc program, and I have a problem. I have two sparse matrices A and B, and I want to compute inv(A)*B. I understand that computing the inverse of a matrix directly is not effective, and that in this case, the best way to do the operation is instead solving the system A*X =

Re: [petsc-users] PetscSF Object on Distributed DMPlex for Halo Data Exchange

2022-05-21 Thread Matthew Knepley
On Fri, May 20, 2022 at 4:45 PM Mike Michell wrote: > Thanks for the reply. > > > "What I want to do is to exchange data (probably just MPI_Reduce)" which > confuses me, because halo exchange is a point-to-point exchange and not a > reduction. Can you clarify? > PetscSFReduceBegin/End seems to