Make more explicit the very specific constructors used for `GlobalMatrix` and `GlobalVector` in `SnesInterface`
While working on #1895, I had a doubt whether the GlobalVector
and GlobalMatrix
used in SnesInterface
were really the one intended - as we provide a very thin wrapper over Mat
and Vec
objects provided by PETSc, we do not own them and should not call destruction upon these objects.
I have therefore introduced a new construction with an explicit argument, e.g.:
GlobalVector residual(row_numbering_subset, Internal::WrapPetscVec(petsc_residual));
The WrapPetscVec
class is just there to ensure it isn't another constructor that is being called (a free function WrapPetscVec
would have been even better but it was not possible as GlobalVector
is not copyable/movable).
It should be noticed that this doesn't fix #1895 issue itself.