-
Notifications
You must be signed in to change notification settings - Fork 4
Encapsulate MUMPS solver class #182
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
Open
julianlitz
wants to merge
15
commits into
main
Choose a base branch
from
litz_mumps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ff125ae
extract
julianlitz 8bb865c
...
julianlitz 83f0815
Reorder MUMPS solver structure declaration
julianlitz 489375c
Reorganize MUMPS solver structure declaration
julianlitz ff96285
Implement CooMumpsSolver for sparse matrix solving
julianlitz f2b8165
Refactor CooMumpsSolver class interface
julianlitz a47f84b
Add linear algebra sources to CMakeLists
julianlitz 88eb792
Expand COO_MUMPS_Solver
julianlitz 697740a
Formatting
julianlitz 7421a1e
Fix mumps solver test
julianlitz d93ccaf
Update coo_mumps_solver.cpp
julianlitz 8f88e53
Update smootherGive.cpp
julianlitz 6dcf5d0
Update smootherTake.cpp
julianlitz 7f62372
Update extrapolatedSmootherGive.cpp
julianlitz fdc909f
Update extrapolatedSmootherTake.cpp
julianlitz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| #pragma once | ||
|
|
||
| #ifdef GMGPOLAR_USE_MUMPS | ||
|
|
||
| #include "dmumps_c.h" | ||
| #include "../../LinearAlgebra/Matrix/coo_matrix.h" | ||
| #include "../../LinearAlgebra/Vector/vector.h" | ||
|
|
||
| /* | ||
| * Wraps MUMPS for solving sparse linear systems given in COO format. | ||
| * For general matrices, all non-zero entries must be provided. | ||
| * For symmetric matrices (is_symmetric = true), only the upper or lower | ||
| * triangular entries should be provided, and the matrix is assumed to be | ||
| * positive definite. In GMGPolar this holds true since the domain mapping is invertible. | ||
| */ | ||
| class CooMumpsSolver | ||
| { | ||
| public: | ||
| explicit CooMumpsSolver(SparseMatrixCOO<double> matrix); | ||
| ~CooMumpsSolver(); | ||
|
|
||
| // rhs is overwritten in-place with the solution on return. | ||
| void solve(Vector<double>& rhs); | ||
|
|
||
| private: | ||
| void initialize(); | ||
| void finalize(); | ||
| void configureICNTL(); | ||
| void configureCNTL(); | ||
|
|
||
| /* ------------------------------------------------ */ | ||
| /* MUMPS uses 1-based indexing in the documentation */ | ||
| /* ------------------------------------------------ */ | ||
| int& ICNTL(int i) | ||
| { | ||
| return mumps_solver_.icntl[i - 1]; | ||
| } | ||
| double& CNTL(int i) | ||
| { | ||
| return mumps_solver_.cntl[i - 1]; | ||
| } | ||
| int& INFOG(int i) | ||
| { | ||
| return mumps_solver_.infog[i - 1]; | ||
| } | ||
|
|
||
| /* ----------------------------------- */ | ||
| /* MUMPS jobs and constant definitions */ | ||
| /* ----------------------------------- */ | ||
| static constexpr int USE_COMM_WORLD = -987654; | ||
| static constexpr int PAR_NOT_PARALLEL = 0; | ||
| static constexpr int PAR_PARALLEL = 1; | ||
|
|
||
| static constexpr int JOB_INIT = -1; | ||
| static constexpr int JOB_END = -2; | ||
| static constexpr int JOB_REMOVE_SAVED_DATA = -3; | ||
| static constexpr int JOB_FREE_INTERNAL_DATA = -4; | ||
| static constexpr int JOB_SUPPRESS_OOC_FILES = -200; | ||
|
|
||
| static constexpr int JOB_ANALYSIS_PHASE = 1; | ||
| static constexpr int JOB_FACTORIZATION_PHASE = 2; | ||
| static constexpr int JOB_COMPUTE_SOLUTION = 3; | ||
| static constexpr int JOB_ANALYSIS_AND_FACTORIZATION = 4; | ||
| static constexpr int JOB_FACTORIZATION_AND_SOLUTION = 5; | ||
| static constexpr int JOB_ANALYSIS_FACTORIZATION_SOLUTION = 6; | ||
| static constexpr int JOB_SAVE_INTERNAL_DATA = 7; | ||
| static constexpr int JOB_RESTORE_INTERNAL_DATA = 8; | ||
| static constexpr int JOB_DISTRIBUTE_RHS = 9; | ||
|
|
||
| static constexpr int SYM_UNSYMMETRIC = 0; | ||
| static constexpr int SYM_POSITIVE_DEFINITE = 1; | ||
| static constexpr int SYM_GENERAL_SYMMETRIC = 2; | ||
|
|
||
| SparseMatrixCOO<double> matrix_; | ||
| DMUMPS_STRUC_C mumps_solver_ = {}; | ||
| }; | ||
|
|
||
| #endif // GMGPOLAR_USE_MUMPS |
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.