Skip to content

Correction to the computation of the norm of the damage correction in the phase-field demo

The magnitude of the damage correction between two iterations is computed error as follows:

        # Solve damage d-problem
        dval_old = d.vector().get_local()
        problem_d.solve(d.vector())
        # Residual on damage increment
        dval = d.vector().get_local()
        res = np.max(dval - dval_old)

In my understanding, it should be:

        res = np.max(np.abs(dval - dval_old))