dolfinx
dolfinx copied to clipboard
Let dlx.la.Vector manage the scope of the petsc4py wrapper (#1)
This PR allows for a dlx.la.Vector (rather than a dlx.fem.Function) to manage the memory and the scope of the petsc4py.PETSc.vec object that wraps the underlying data.
The implementation of the property dlx.fem.Function.vector was also modified to delegate the creation of the wrapper to the underlying dlx.la.Vector.
All changes are backward compatible.
See also Issue #3061 @jorgensd @garth-wells @jhale