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.
All that function does is update a
mutablemember and call anotherconstfunction. This would resolve the conundrum of being able to callget_array_readon a const reference to aPetscVector, but being unable to call the mandatoryrestore_arrayafter the read. Certain MOOSE apps circumvent this by castingconstaway, but the elegant solution here is to just markrestore_arrayasconst.