libCEED
libCEED copied to clipboard
Python PETSc Example BP1
Hello!
This is a Python implementation of bpsraw.c for BP1 and was initially discussed in #1774 . I'm aiming to recreate the benchmark behavior using libceed and petsc4py. I appreciate any feedback or indications I'm headed in the right direction!
It does run, but this is a work in progress. Remaining tasks:
- [ ] fix the matrix operations to work like the MatShell C implementation
- [ ] get PETSc Vec scatter working
- [ ] QFunction
- [ ] Error function
- [ ] add meaningful comments
- [x] improve the printed output metrics
- [ ] create a test
@tylercollins5737 , thank you for your work. Are you able to address the reviewer's comments?
@valeriabarra I was able to get it working using the "python" matrix type, MatAIJ was not the best. I believe the "python" type and MatCreateShell can achieve the same thing.
Hey @tylercollins5737 , how are you? I was wondering if you intended to complete this PR or if there were any impeding issues that you encountered.
There are a couple of other potential contributors that are eyeing this project and I was wondering if there was a missing interface for which this BP could not be completed or if it was just for personal reasons. Thank you!
Hey @tylercollins5737 , how are you? I was wondering if you intended to complete this PR or if there were any impeding issues that you encountered.
There are a couple of other potential contributors that are eyeing this project and I was wondering if there was a missing interface for which this BP could not be completed or if it was just for personal reasons. Thank you!
Hey @valeriabarra hope you are doing well! In short, progress didn't stop because of any major limitations in the libceed or petsc libraries. But the qfunction for building the RHS "SetupMassRHS" and "Error" I believe aren't available so a workaround would have to be implemented which could be very slow, or an addition to the gallery of qfunctions, or someway to use the qfunctions used by the BPs, or a way to define a custom one in python. If there are interested contributors they're more than welcome to work on it. If no one picks it up, I'll start on it again and get the development environment setup on a computer I actually own. Cheers!
Yeah, since there are QFunctions that are not available via the gallery, you'd have to use the technique shown in this folder for ex3_volume.py (and associated files) to use a QFunction written in C.
@jeremylt Cool, yeah that should do the trick.