[petsc-users] Composite preconditioners in petsc4py

2023-01-30 Thread Adolfo Rodriguez
Hi, how do you use composite preconditioners in petsc4py. I used to have a script that worked but it does not work anymore. Something has changed. Any simple examples? Regards, Adolfo

Re: [petsc-users] Kronecker Product

2023-01-30 Thread Jose E. Roman
The matrix can be a shell matrix, only the matrix-vector product operation is required. Jose > El 30 ene 2023, a las 22:23, Guglielmo, Tyler Hardy via petsc-users > escribió: > > I have an implementation of the slepc MFN matrix exponential which is > implicitly using ExpoKit. You have to

Re: [petsc-users] Kronecker Product

2023-01-30 Thread Guglielmo, Tyler Hardy via petsc-users
I have an implementation of the slepc MFN matrix exponential which is implicitly using ExpoKit. You have to supply a matrix into the Slepc MFN operator to set the problem up as far as I know. Tyler From: Matthew Knepley Date: Monday, January 30, 2023 at 12:24 PM To: Guglielmo, Tyler Hardy

Re: [petsc-users] Kronecker Product

2023-01-30 Thread Matthew Knepley
On Mon, Jan 30, 2023 at 3:08 PM Guglielmo, Tyler Hardy via petsc-users < petsc-users@mcs.anl.gov> wrote: > I would need the Kronecker product to be explicitly available to perform > matrix exponentials. A and B are of order 5000, so not too large. I will > give storing them on all ranks a shot.

Re: [petsc-users] Kronecker Product

2023-01-30 Thread Guglielmo, Tyler Hardy via petsc-users
I would need the Kronecker product to be explicitly available to perform matrix exponentials. A and B are of order 5000, so not too large. I will give storing them on all ranks a shot. Thanks for the tips! Best, Tyler From: Barry Smith Date: Monday, January 30, 2023 at 12:01 PM To:

Re: [petsc-users] Kronecker Product

2023-01-30 Thread Barry Smith
What is large? If A and B have dimensions of 1000, then the Kronecker product is of size 1,000,000. Do you want the Kronecker product to be explicitly formed or just available as matrix vector products? If just explicitly available then I think you can just store sparse A (for example)

Re: [petsc-users] Kronecker Product

2023-01-30 Thread Guglielmo, Tyler Hardy via petsc-users
Both matrices (A and B) would be approximately the same size and large. The use case (for me at least) is to create several large sparse matrices which will be combined in various ways through Kronecker products. The combination happens at every time step in an evolution, so it really needs

Re: [petsc-users] Kronecker Product

2023-01-30 Thread Matthew Knepley
On Mon, Jan 30, 2023 at 2:24 PM Guglielmo, Tyler Hardy via petsc-users < petsc-users@mcs.anl.gov> wrote: > Thanks Barry, > > > > I saw that function, but wasn’t sure how to apply it since the > documentation says that S and T are dense matrices, but in my case all > matrices involved are sparse.

Re: [petsc-users] Kronecker Product

2023-01-30 Thread Guglielmo, Tyler Hardy via petsc-users
Thanks Barry, I saw that function, but wasn’t sure how to apply it since the documentation says that S and T are dense matrices, but in my case all matrices involved are sparse. Is there a way to work around the dense requirement? Best, Tyler From: Barry Smith Date: Monday, January 30, 2023

Re: [petsc-users] Kronecker Product

2023-01-30 Thread Barry Smith
Do you need the explicit sparse representation of the Kronecker product? Or do you want to apply it as an operator or solve systems with it? If the latter you can use https://petsc.org/release/docs/manualpages/Mat/MatCreateKAIJ/#matcreatekaij Barry > On Jan 30, 2023, at 12:53 PM,

[petsc-users] Kronecker Product

2023-01-30 Thread Guglielmo, Tyler Hardy via petsc-users
Hi all, I am wondering if there is any functionality for taking Kronecker products of large sparse matrices that are parallel? MatSeqAIJKron is as close as I have found, but it seems like this does not work for parallel matrices. Any ideas here? An option could be to make A and B

Re: [petsc-users] global indices of a vector in each process

2023-01-30 Thread Barry Smith
VecGetOwnershipRange() works with any vector, including DM created vectors. You could not have the global ownership you provide below. Perhaps you are thinking about the Natural ownership values? For those if you using DMDA take a look at DMDAGetAO() and DMDACreateNaturalVector() Barry

[petsc-users] global indices of a vector in each process

2023-01-30 Thread Venugopal, Vysakh (venugovh) via petsc-users
Hello, I am using a DMCreateGlobalVector to create a vector V. If V is divided into m processes, is there a way to get the global indices of V assigned to each process? For example: V = [10, 20, 30, 40, 50, 60, 70, 80]. If MPI process 0 has [10, 40, 50, 60] and process 1 has [20, 30, 70, 80],