-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Adjust API to be more consistent #2650
Conversation
Now also contains a bugfix for MatrixCSR::finalize which was leading to random results |
std::vector<int> size_recv(src.size()); | ||
size_recv.reserve(1); | ||
std::vector<int> size_recv; | ||
size_recv.reserve(1); // ensure data is not a nullptr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The order of this line and the one below should be switched.
// ScatterMode types | ||
enum class PyScatterMode | ||
// InsertMode types | ||
enum class PyInsertMode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is clearer. What's being controlled is what happens during a scatter. Moreover, the previous naming had a consistency with PETSc, see https://petsc.org/release/manualpages/Vec/VecGhostUpdateBegin/.
The name change could be confused with switching between insert and set during assembly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was inconsistent with PETSc before, and is more inline now: PETSc has a scattermode (forward or reverse).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it was inconsistent with PETSc before, and is more inline now: PETSc has a scattermode (forward or reverse).
But the change in this PR is PyScatterMode
-> PyInsertMode
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes because PyScatterMode
was add
or insert
- it basically was the "Insert Mode" just wrongly named.
I still prefer |
Yes, I think so too. I can change it back, unless anyone has a better idea - I'd like to change |
Not crazy about |
In which case, the other alternative is some variant of |
Fixes related to FEniCS/dolfinx#2650
* ScatterMode->InsertMode, ref: FEniCS/dolfinx#2650 * Fix sp * fix notebook
* assemble()->finalize() for sparsity pattern * Fix demo, ref FEniCS/dolfinx#2650
squared_norm()
for bothVector
andMatrixCSR
InsertMode
notScatterMode
finalize
for bothMatrixCSR
andSparsityPattern
index_map()
notmap()
forVector
If any others seem obvious, we can add to this branch.