# PyFR Convergence History Output

**URL:** <https://pyfr.discourse.group/t/pyfr-convergence-history-output/38>\
**Category:** General\
**Created:** [10 July 2014 21:40 UTC](https://pyfr.discourse.group/t/pyfr-convergence-history-output/38 "2014-07-10T21:40:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zach\_Davis](https://avatars.discourse-cdn.com/v4/letter/z/ed655f/32.png) [@Zach\_Davis](https://pyfr.discourse.group/u/Zach_Davis)\
**Post date:** [10 July 2014 21:40 UTC](https://pyfr.discourse.group/t/pyfr-convergence-history-output/38/1 "2014-07-10T21:40:16Z")

</div>

Tuesday, 10 July 2014

Hi all,

I was curious whether writing L1 or L2 norm information for each equation in the system being solved along with any user-defined force/moment integration information could be output and/or collected for purposes of plotting rates of convergence once the simulation has completed running. I imagine this might incur a small performance hit, but is this something easily implemented and/or on the horizon? I’m working on a short write-up about running PyFR on Rescale, and it would be nice to have that sort of information available.

Best Regards,

Zach Davis

---

<div class="post-metadata">

**Author:** ![fdw](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@fdw](https://pyfr.discourse.group/u/fdw)\
**Post date:** [10 July 2014 22:24 UTC](https://pyfr.discourse.group/t/pyfr-convergence-history-output/38/2 "2014-07-10T22:24:06Z")

</div>

Hi Zach,

This is currently not possible with the current version of PyFR however  
it is on the roadmap. The functionality will build on top of the  
"completed step handler" mechanism that already exists within PyFR. An  
example of such a handler is the NaN checker:

```auto
def nansweep(intg):
    if intg.nsteps % args.nansweep == 0:
        if any(np.isnan(np.sum(s)) for s in intg.soln):
            raise RuntimeError(f'NaNs detected at t = {intg.tcurr}')
solver.completed_step_handlers.append(nansweep)

```

with the idea being that after each time step a set of user-defined  
functions can be invoked which can interrogate the solution without  
having to write it out to disk.

Regards, Freddie.
