-
-
Notifications
You must be signed in to change notification settings - Fork 221
Add matrix free demo using PETSc #3938
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
base: main
Are you sure you want to change the base?
Conversation
- Requires: #3937
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 like that you go for a mixed problem and in addition try to solve it with two approaches. It obscures the core of matrix-free demo.
Also, why bother with BCs for projection problem?
Because it is non-trivial to set up, as seen in the demo. It already exposed a bug in DOLFINx (the bc one). It also serves as a general matrixfree solver, rather than one that is specialised for projections. I can move this demo to my own web page if that is more suitable. |
I think that PETSc's
I think that PETSc' matrix free solver and diagonal assembly should be demoed. But why not keep it as concise, readable and simple as possible now, and then maybe add some form of |
|
I like the idea, much better than https://github.com/FEniCS/dolfinx/tree/main/cpp/demo/poisson_matrix_free. |
Adding it later means that I need to keep on maintaining it somewhere (as later might be a year from now). I additionally thought that we wanted more advanced demos in DOLFINx, not just simple setups. |
Co-authored-by: Michal Habera <[email protected]>
Co-authored-by: Michal Habera <[email protected]>
Co-authored-by: Michal Habera <[email protected]>
How about moving the general interface of the |
Moving it to the tests just makes it tricky for people to find it (and keep track of changes). That’s how we ended up with many poor copies of the SNES interface before finally adding it to the «core» PETSC interface |
|
The right approach for the demo depends on what you want to achieve:
On the second point, some lower-level functions like https://github.com/FEniCS/dolfinx/blob/main/python/dolfinx/fem/petsc.py#L1032 might be a better way to expose some of the routines for assembling actions/diagonals - these could then be placed into a context within the user's scope. |
The main complication is that setting bcs in the diagonalized mat-vec (mult) case for PETSc does not fit our current application of BCs in I would argue that a 150 Line class ( I struggle to understand where we want to draw the line on "more complicated"/"too complicated" for our demos. |
|
Well, I would leave the complication of handling mixed or block spaces to the library version. |
Requires: #3937
A demo showcasing how to use PETSc's Python type matrix to create a matrix-free operator.
Would partially resolve: #3779
A separate question is where one should put the
MatrixFreeOperator, as it doesn't change with the bi-linear form.