jorgensd / jorgensd/dolfinx_mpc
Suggestion: swap argument ordering of dolfinx_mpc.assemble_vector to coincide with the ordering of dolfinx.fem.petsc.assemble_vector
- Dominant language
- Python
- Stars
- 62
- Forks
- 22
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 4
Description
Title basically says my suggestion. I was writing some code using a periodic boundary constraint and wanted to test something without the constraint. I copied and pasted the code, modified the boundary conditions and removed references to the mpc. Doing this the code ran but every solution was going to zero after a single solve. It took me entirely too long to realize that this was because the places where I was assembling the rhs vectors were using `assemble_vector(, )`, and this was (at least for me) leading to `dolfinx.fem.petsc.assemble_vector` returning a vector of nans, since that function normally anticipates the order `assemble_vector(,)`.
If there is a specific reason for the ordering of arguments in `dolfinx_mpc.assemble_vector` then it is what it is, but it might be a good quality of life change to swap the order to be `dolfinx_mpc.assemble_vector(, , )`, just so that it has the same ordering of the vector and form arguments as the fem.petsc version, and it would hopefully prevent future unfortunate souls like myself from getting it mixed up.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.