How to get output at each iteration

Hi all,

I’m trying to get output at each iteration of the dc solver. In the documentation it says to check testing/umfpack_shim.py but I can’t find the file here. Any suggestions as to how to do this or where to find it?

Many thanks,
Marc

If you are interested in getting the iterations of a solve, please see
https://devsim.net/solver.html#diagnostics

devsim.solve(info=True . . . 

which will tell you if convergence was achieved, and what the iteration information was.

For example:

{'converged': True, 'iterations': ({'circuit': {'absolute_error': 0.0, 'relative_error': 0.0}, 'devices': (), 'iteration': 0},), 'number_of_equations': 3}

If you are interested in implementing your own solver, then please look at the umfpack directory of the source code:
https://github.com/devsim/devsim/tree/main/umfpack
When installed, the devsim.umfpack module is located in the site packages of your virtual environment:

$VIRTUAL_ENV/lib/python3.9/site-packages/devsim/umfpack

thanks @Juan
I was interested in actually saving the vtu file at each iteration so that I can see what’s happening. I’m guessing this would be possible if I implement the solver?

Another issue is that after some modifications, the solver gets stuck at the 0 iteration. i.e., devsim outputs the convergence numbers for iteration 0, the CPU continues at 100% but nothing happens. Why could that be?

If you set a really high relative error and absolute error, then the simulation will run only 1 iteration with success. You can then save the data.

One thing to note is that each time you do this, you will get a new preconditioner. By default, the preconditioner is reused after the first iteration, unless you change the setting.
https://devsim.net/solver.html#symbolic-factorization-reuse

If you register a custom callback, you also issue the save command at the end of the matrix assembly:
https://devsim.net/models.html#custom-matrix-assembly

1 Like

If you attach a debugger to the process, you may be able to see where it is occurring.

Without more information, it is hard to tell.

1 Like