Closed yesint closed 3 years ago
Yes, the linear algebra solvers have changed interface lately. I'm trying to keep the demos up-to-date, so you should have a look at the 2D Poisson demo for an update. Basically, use
A = inner(grad(v), grad(u))
sol = la.SolverDiagonal(A)
u_hat = sol(-f_hat, u_hat, constraints=((0, 0),))
Alternatively you can do
from shenfun import get_simplified_tpmatrices
B = get_simplified_tpmatrices(A)[0]
u_hat = B.solve(-f_hat, u_hat)
Before we used to return simplified matrices from inner. Simplified extracts the diagonals of the Fourier matrices and places them in scale arrays in order to facilitate a fast inverse solve, which is then basically just f_hat/B.scale, taking care of wavenumber 0. But I guess you need to understand how shenfun uses 1D matrices and tensor product matrices (TPMatrix) in order to fully make sense of this:-)
Thanks a lot! It works.
I apologize for possible stupid question. I'm not familiar to the theory under shenfun at all and using it as a black box. Previously I was using the following script to solve 2D Poisson equation with periodic boundary conditions (data preparation part omitted):
it was working perfectly fine before, but with new version of Shenfun it fails:
How can I fix it?