libmesh icon indicating copy to clipboard operation
libmesh copied to clipboard

Mark PETSC Vector `restore_array` function as `const`

Open dschwen opened this issue 10 months ago • 0 comments

All that function does is update a mutable member and call another const function. This would resolve the conundrum of being able to call get_array_read on a const reference to a PetscVector, but being unable to call the mandatory restore_array after the read. Certain MOOSE apps circumvent this by casting const away, but the elegant solution here is to just mark restore_array as const.

dschwen avatar Apr 25 '25 18:04 dschwen