Dear Simone, aha, this is an easier one.
On 25 Jun 2019, at 15:44, Simone Puel <spuel@utexas.edu> wrote:
Dear Lawrence,
Thanks, I really appreciate it. Hope it is the last one. The solver doesn't converge. If I run same mesh and same script in FEniCS (with the changes you suggested, that is the boundary conditions), the linear solver converges immediately (0.13 s). In Firedrake I have the following error:
Traceback (most recent call last): File "Elasticity2D_Firedrake.py", line 163, in <module> solve(lhs_varf == rhs_varf, sol, bcs=[bc1,bc2]) File "/home/simone/firedrake/src/firedrake/firedrake/solving.py", line 125, in solve _solve_varproblem(*args, **kwargs) File "/home/simone/firedrake/src/firedrake/firedrake/solving.py", line 153, in _solve_varproblem solver.solve() File "/home/simone/firedrake/src/firedrake/firedrake/variational_solver.py", line 267, in solve solving_utils.check_snes_convergence(self.snes) File "/home/simone/firedrake/src/firedrake/firedrake/solving_utils.py", line 44, in check_snes_convergence %s""" % (snes.getIterationNumber(), msg)) firedrake.exceptions.ConvergenceError: Nonlinear solve failed to converge after 0 nonlinear iterations. Reason: Inner linear solve failed to converge after 10000 iterations with reason: DIVERGED_MAX_IT
By default, the FEniCS solver is a direct factorisation, whereas ours is not (and this mixed elliptic problem is rather hard for the default preconditioner). You can select a sparse LU factorisation with the following solver options: solve(lhs_varf == rhs_varf, sol, bcs=[bc1, bc2], solver_parameters={"ksp_type": "preonly", "pc_type": "lu", "pc_factor_mat_solver_type": "mumps"}) Aside (to the list), perhaps it is worth reconsidering our choice of defaults for these solver options. Thanks, Lawrence