### Problem with iterative solver for mixed FEM problem

146

views

0

I'm trying to solve electromagnetic scattering problem using fenics v2017.2.0

Problem is formulated as mixed problem because of real and imaginary part of solution (electromagnetic field in frequency domain).

While using standard solver everything seems fine but iterative solver refuse to converge. I'm using gmres because system is not symmetric and ilu preconditioner.

Problem is formulated as mixed problem because of real and imaginary part of solution (electromagnetic field in frequency domain).

While using standard solver everything seems fine but iterative solver refuse to converge. I'm using gmres because system is not symmetric and ilu preconditioner.

```
solver = KrylovSolver('gmres', 'ilu')
prm = solver.parameters
prm.absolute_tolerance = 1E-7
prm.relative_tolerance = 1E-4
prm.maximum_iterations = 100000
```

After a couple of iterations (6, 7) process is killed. It works normally on non-mixed problems.

Using other combinations result in maximal number of iterations without convergence. Relative error is always around 10^-1. Which combination can be used for iterative solving of the linear system arising in mixed problems?

Community: FEniCS Project

Thank you for your suggestion but unfortunately id doesn't work. I still have the same problem. Process stops after a couple of iterations.

```
0 KSP preconditioned resid norm 2.203843150895e+21 true resid norm 6.344424217850e+01 ||r(i)||/||b|| 1.000000000000e+00
1 KSP preconditioned resid norm 2.147918826067e+21 true resid norm 6.502540732248e+01 ||r(i)||/||b|| 1.024922122003e+00
2 KSP preconditioned resid norm 4.409982909751e+20 true resid norm 8.858279393945e+01 ||r(i)||/||b|| 1.396230625471e+00
3 KSP preconditioned resid norm 3.723639691027e+20 true resid norm 1.911306359088e+02 ||r(i)||/||b|| 3.012576545103e+00
4 KSP preconditioned resid norm 3.138016515872e+17 true resid norm 3.333662147596e+02 ||r(i)||/||b|| 5.254475478195e+00
5 KSP preconditioned resid norm 3.106440335095e+17 true resid norm 3.311719471117e+02 ||r(i)||/||b|| 5.219889713237e+00
6 KSP preconditioned resid norm 7.985116971263e+14 true resid norm 2.861284794643e+02 ||r(i)||/||b|| 4.509920359034e+00
```

written
10 weeks ago by
Dario

There are some hints by the PETSc team here: https://www.mcs.anl.gov/petsc/documentation/faq.html#kspdiverged or here: https://scicomp.stackexchange.com/questions/513/why-is-my-iterative-linear-solver-not-converging?noredirect=1&lq=1

Does it work with LU? I'd guess that your problem is not well posed. Note how your true and relative residuals increase while the (huge!!) preconditioned residual drops some orders of magnitude.

You should probably post more info about your problem and the matrix (e.g. block structure).

Does it work with LU? I'd guess that your problem is not well posed. Note how your true and relative residuals increase while the (huge!!) preconditioned residual drops some orders of magnitude.

You should probably post more info about your problem and the matrix (e.g. block structure).

written
10 weeks ago by
David Nolte

it works normally with direct solver and solution is OK. I'll look through your links. Thnx

written
10 weeks ago by
Dario

Please login to add an answer/comment or follow this question.

https://scicomp.stackexchange.com/questions/513/why-is-my-iterative-linear-solver-not-converging

Note that if you use a PETScKrylovSolver, e.g.,

(although I believe the PC 'ilu' will not work in parallel) you can access most of the PETSc API for the underlying KSP,

through petsc4py, documented here:

http://www.mcs.anl.gov/petsc/petsc4py-current/docs/apiref/index.html