Thanks Matt, I use the "natural scaling" of the Laplacian Lapl * x = b. The grid is *still* uniform.
I give you a couple of results: 1 ) This is e.g. gmres + gamg + 4 levels. As you can see it converges after 2 iterations which is totally strange. The solution is incorrect. 2 ) This is mg + galerkin matrices + levels. Result is incorrect 3 ) Default: works fine 4) LU: works fine I remove the constant nullspace as usual. I use the usual setcomputeoperator business and compute rhs. Instead, if I scale to Lapl * dx * dy * x = b * dx * dy (things work fine also with MG). This is fine with uniform grid but I do not know how to do that properly on nonuniform. Let me know if you need code pieces or other details. 1) 0 KSP Residual norm 1.793027353791e-05 2) 0 KSP Residual norm 1.010294060491e-05 0 KSP Residual norm 2.990548680394e-08 Linear solve converged due to CONVERGED_ITS iterations 1 On Tuesday 01 September 2015 03:40:14 Matthew Knepley wrote: > On Tue, Sep 1, 2015 at 2:22 AM, Filippo Leonardi < > > [email protected]> wrote: > > Dear PETSc Users, > > > > > > > > I want to use multigrid to solve uniform (just Laplace) poisson in 2D/3D > > on cartesian, non-uniform meshes with a standard 5 (7)-points stencil FD. > > > > > > > > I always scaled my Poisson matrix like in the doc examples, i.e. > > multiplying by dx*dy (so that in ComputeRHS I need to scale b, in A*x = b, > > as well). This always worked properly with both MG/GAMG and with galerkin > > matrices. > > > > > > > > Now I'd like to use non-uniform meshes, therefore the scaling is > > non-uniform. However I cannot get my matrices to scale properly with any > > sort of multigrid. > > > > > > > > One would think that without scaling, i.e. solving the original system, at > > least MG+galerkin or GAMG should work anyways provided the matrix A and b > > are consistent. > > > > > > > > I tried without boundaries (i.e. torus), so this is not the problem. > > The point of that scaling is to make the boundary values the same size as > the residuals. If you have > no boundary values, the problem is scale invariant since its linear. It > would be nice to scale it so everything > is about size 1. > > When asking about convergence always run with -ksp_view > -ksp_monitor_true_residual -ksp_converged_reason > > Thanks, > > Matt > > > Anyone did/knows how to do this properly? > > > > > > > > Thanks, > > > > F
