JuAFEM difference between apply! and apply_zero!

In some examples for JuAFEM I often see people using either “apply!()” or “apply_zero!()” to apply the boundary conditions. Can someone explain me the difference:

        apply!(K, f, dbc)
        apply_zero!(K, f, dbc)

apply_zero! is for when you want to have zeros for the constrained degrees of freedom in the solution of K \ f. One example when this is required is when iterating on a solution for a nonlinear system of equations. The solution to K \ f is the increments to your trial solution and those should be zero for constrained dofs.

1 Like