Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vectorized block diagonal mat inversion #1092

Merged
merged 8 commits into from
Jan 10, 2024

Conversation

OmarDuran
Copy link
Contributor

@OmarDuran OmarDuran commented Jan 10, 2024

Proposed changes

This PR refactor and introduce a vectorized solution for the function invert_diagonal_blocks_python in file matrix_operations.py. The function is 2x faster than numba function for a large block diagonal matrix with irregular block sizes.

Types of changes

What types of changes does this PR introduce to PorePy?
Put an x in the boxes that apply.

  • Minor change (e.g., dependency bumps, broken links).
  • Bugfix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Testing (contribution related to testing of existing or new functionality).
  • Documentation (contribution related to adding, improving, or fixing documentation).
  • Maintenance (e.g., improve logic and performance, remove obsolete code).
  • Other:

Checklist

Put an x in the boxes that apply or explain briefly why the box is not relevant.

  • The documentation is up-to-date.
  • Static typing is included in the update.
  • This PR does not duplicate existing functionality.
  • The update is covered by the test suite (including tests added in the PR).
  • If new skipped tests have been introduced in this PR, pytest was run with the --run-skipped flag.

@OmarDuran OmarDuran self-assigned this Jan 10, 2024
@OmarDuran OmarDuran added the enhancement New feature or request. label Jan 10, 2024
Copy link
Contributor

@keileg keileg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Control question: You have verified that the inverted matrices are correct?

Given the performance results, I think we should make this into the default inverter. This will require changing parameter values in mpfa, mpsa and biot. A repository-wide search for 'inverter' may be needed.

@OmarDuran OmarDuran merged commit 03fb99b into develop Jan 10, 2024
4 checks passed
@OmarDuran OmarDuran deleted the vectorized_block_diagonal_mat_inversion branch January 10, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants