WIP: Calculate Jacobian coloring using PetscOperator matrices#3350
Open
bendudson wants to merge 5 commits intopetsc-operatorsfrom
Open
WIP: Calculate Jacobian coloring using PetscOperator matrices#3350bendudson wants to merge 5 commits intopetsc-operatorsfrom
bendudson wants to merge 5 commits intopetsc-operatorsfrom
Conversation
This function should create an index set of the evolving cells. It will be used to extract the part of the PetscOperator that represents coupling between evolving cells. Implementation to follow.
Creates an index set of global PETSc rows that correspond to evolving cells. Passes unit tests.
Method that will extract the part of a PetscCellOperator that couples evolving cells to other evolving cells. Dummy implementation with failing tests.
Passes unit tests
| // Collect global PETSc indices in mapOwnedInteriorCells order. | ||
| // Reserve the known count up front to avoid reallocation. | ||
| std::vector<PetscInt> indices; | ||
| indices.reserve(static_cast<std::size_t>(evolving_region.size())); |
Contributor
There was a problem hiding this comment.
warning: no header providing "std::size_t" is directly included [misc-include-cleaner]
src/mesh/petsc_operators.cxx:1:
+ #include <cstddef>| mapOwnedInteriorCells( | ||
| [&](PetscInt row, const Ind3D& /*i*/, int /*stored*/) { indices.push_back(row); }); | ||
|
|
||
| IS is; |
Contributor
There was a problem hiding this comment.
warning: variable 'is' is not initialized [cppcoreguidelines-init-variables]
Suggested change
| IS is; | |
| IS is = nullptr; |
| const PetscOperator<CellSpaceTag, CellSpaceTag>& op) const { | ||
| IS is = makeEvolvingIS(); | ||
|
|
||
| Mat sub; |
Contributor
There was a problem hiding this comment.
warning: variable 'sub' is not initialized [cppcoreguidelines-init-variables]
Suggested change
| Mat sub; | |
| Mat sub = nullptr; |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Builds on #3330 , using
PetscOperatormatrices to infer connectivity between cells.The aim is to accelerate transport simulations with FCI by inferring the sparsity pattern of the Jacobian in
SNESSolverandPetscSolver. This will enable coloring to efficiently calculate finite difference Jacobian approximations for LU-like preconditioners. This is the method used for structured grid (e.g. Tokamak) simulations, that so far has not been possible with FCI.