-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not assemble zero contributions from local to global matrix
With this patch, entries from the local matrix that are zero are ignored and never added to the global matrix. More importantly, it is now allowed to have missing stored entries in the global matrix if the contribution that would have been added there is zero. A concrete example where this is useful: Consider a two-field problem with unknowns (u, p) and test functions (v, q) where there is no coupling between, for example, p and q. In the global block matrix K = [A B; C D], D will be zero, and there is therefore no need to allocate entries in K corresponding to all couplings between p- and q-dofs. (Note though that currently it is not possible to create such a sparsity pattern because create_sparsity_pattern assumes full coupling between fields.) However, when assembling the local matrix k = [a b; c d] it is much easier to use a dense matrix, and simply initialize d to zero. After this patch it is perfectly fine to assemble the matrix k into K, even if the global entries for d are missing.
- Loading branch information
1 parent
defcbe7
commit 65e56ec
Showing
2 changed files
with
82 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters