facet wise SystemAssembler assumes sparsity of matrix is sufficient for macro element

Issue #58 resolved
Cian Wilson created an issue

When either the linear or bilinear forms contain interior facet integrals SystemAssembler uses facet wise assembly. This inserts the dofs from a macro element, consisting of the two elements on either side of a facet, into the matrix. This is done regardless of whether both those elements are in the sparsity of the matrix, which results in errors when using PETScMatrix for simple forms (such as dg mass matrices).

The attached simplified example illustrates this. The bilinear form is just a P0 mass matrix, with diagonal sparsity but SystemAssembler uses facet wise macro element based assembly because the linear form has interior facet integrals. This results in multiple errors of the form:

[0]PETSC ERROR: --------------------- Error Message ------------------------------------

[0]PETSC ERROR: Argument out of range!

[0]PETSC ERROR: New nonzero at (0,1) caused a malloc!

[0]PETSC ERROR: ------------------------------------------------------------------------

because the sparsity does not have any off-diagonal entries in it but the macro-element being inserted does.

Comments (3)

  1. Log in to comment