Convergence issues in Magneto-quasistatic solver (for TMS applications)

It sometimes happens that MQS simulations fail to converge, especially in some transcranial magnetic stimulation applications. The error message looks like:

Solver returns: 'diverged (indefinite matrix)'.
ERROR: Linear system solver could not determine the solution.

In several cases, the issue comes from the numerical method which is used by default. This method was selected for its efficiency, but in this particular example it can lead to this kind of convergence error. To make the simulation converge, one has to use a different method (actually a different preconditioner) than the default.

In Sim4Life v3.4.3 and greater, there is a Solver Option called Additional Solver Options, which allows the user to change the solver settings. In this example, we want to use the GMRES preconditioner.

In this field, type: "-ksp_type gmres" (without the double quotes).