Skip to content

CoupledPathologies

Jonathan Guyer edited this page Sep 26, 2014 · 1 revision

In the course of using the new coupled equation scheme, I've come across a few situations that at least seem like they might cause problems. Namely, different orders of solution might give a zero diagonal in some orders but non-zero in others, e.g.

has finite diagonals, but swapping the 2nd and 3rd equations

has zero diagonals.

Also, different equations might have different diagonal signs, e.g., electron and hole drift-diffusion in steady state $0 = \frac{1}{q}\nabla\cdot\vec{J}_n + G - U$ and $0 = -\frac{1}{q}\nabla\cdot\vec{J}_p + G - U$. Solving separately is not a problem, but solving together gives a coupled diagonal of mixed sign.

The attached script mocks up these to scenari.

With PySparse:

With Trilinos:

So, it looks OK. `LinearPCGSolver` fails in all cases (except the last?!), but it should since the matrix is asymmetric. `LinearGMRESSolver` fails with PySparse for the zero diagonal, but PySparse' `LinearGMRESSolver` is generally broken anyway.

Note: PySparse' `LinearGMRESSolver` fails in `precon.jacobi`, which makes sense because it's trying to normalize by the (zero) diagonal. Switching to `LinearGMRESSolver(precon=None)` allows this case to pass, too.

* The number of PyTrilinos iterations is unaffected by the matrix ordering. It's 1 in all cases? * PySparse' `LinearGMRESSolver` takes one more iteration in the zero-diagonal case, but that's likely because we removed the preconditioner. * PySparse' `LinearCGSSolver` takes one more iteration in the mixed-sign-diagonal case.

Clone this wiki locally