No convergence for Laplace equation with constant boundary?
Hello,
I'm just beginning to use FEniCS, and I think I'm struggling with some basics. As a trivial test problem, I have tried to solve Laplace's equation in a sphere with constant boundary conditions:
$ cat test.py
#!/usr/bin/env python
from __future__ import division, print_function, absolute_import
import dolfin as df
ORDER=1
def u0_boundary(x, on_boundary):
return on_boundary
mesh = df.UnitSphere(30)
V = df.FunctionSpac
u = df.TrialFunction(V)
v = df.TestFunction(V)
bc = df.DirichletBC(V, df.Constant('42'), u0_boundary)
a = df.inner(
L = df.Constant(0) * v * df.dx
psi = df.Function(V)
df.set_
df.solve(a == L, psi, bc,
However, this fails with
$ python test.py
Solving linear variational problem.
Applying boundary conditions to linear system.
Solving linear system of size 29791 x 29791 (PETSc Krylov solver).
PETSc Krylov solver starting to solve 29791 x 29791 system.
Traceback (most recent call last):
File "test.py", line 21, in <module>
'preconditi
File "/usr/lib/
_solve_
File "/usr/lib/
solver.solve()
RuntimeError:
*** -------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
***
*** https:/
***
*** Remember to include the error message listed below and, if possible,
*** include a *minimal* running example to reproduce the error.
***
*** -------
*** Error: Unable to solve linear system using PETSc Krylov solver.
*** Reason: Solution failed to converge in 3 iterations (PETSc reason DIVERGED_
*** Where: This error was encountered inside PETScKrylovSolv
*** -------
However, if I replace the boundary condition with 0 instead of 42, things seem to work.
Am I doing something wrong? Why isn't FEniCS finding the trivial solution with psi=42 everywhere?
Thanks!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- DOLFIN Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask Nikolaus Rath for more information if necessary.