Both ode/vanderpol.py and poisson2d/poisson2d.py use shell matrices via a mult(self,mat,X,Y) function defined in the python side. Another example is ex3.py in slepc4py.
Jose > El 13 mar 2023, a las 15:58, Eric Hester via petsc-users > <[email protected]> escribió: > > Hello everyone, > > Does petsc4py support matrix-free iterative solvers (as for Matrix-Free > matrices in petsc)? > > For context, I have a distributed matrix problem to solve. It comes from a > Fourier-Chebyshev Galerkin discretisation. The corresponding matrix is dense, > but it is fast to evaluate using fftw. It is also distributed in memory. > > While I’ve found some petsc4py tutorial examples in > "/petsc/src/binding/petsc4py/demo/“, they don’t seem to show a matrix free > example. And I don’t see a reference to a matrix shell create method in the > petsc4py api. > > If petsc4py does support matrix free iterative solvers, it would be really > helpful if someone could provide even a toy example of that. Serial would > work, though a parallelised one would be better. > > Thanks, > Eric > >
