Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Condense sparsity pattern: don't check if entries already exist (#550)
After #436 the condensation of the pattern is done by creating a new matrix which is added to the original matrix. Before this patch there is still a check for whether each new entry already exist in the original matrix before adding it to the new matrix. With the new approach implemented in #436 this seems unnecessary and this patch removes the check. This also removes some extra complexity from the code. A datapoint, which support this, is the Stoke's flow example in the documentation. In that problem, the condensation adds 32k new entries, of which 30k are new, and 2k exist in the original matrix. Checking whether the 32k elements exist is much more expensive than simply including the extra 2k entries in the new matrix. The new approach reduces the time for creating the combined matrix from 4ms to 3.2ms. Matrix creation isn't a bottleneck by any means, but it is nice to see that we with simpler code also get better performance.
- Loading branch information