What's the best way to assemble a form?

This is not a full answer, but I’ll mention that you actually don’t expect N to be diagonal, except in special situations, e.g., if u and v are in a degree-0 DG space, or if they are in a degree-1 CG space and the form is integrated with a vertex quadrature rule.

1 Like