From c5c14c8150b3436a79d3e38b8553aee2d71f570e Mon Sep 17 00:00:00 2001
From: Thomas Fischer <thomas.fischer@ufz.de>
Date: Thu, 30 Nov 2017 14:58:48 +0100
Subject: [PATCH] [Mat] PETScVec: Return a ref. instead of a copy.

---
 MathLib/LinAlg/PETSc/PETScVector.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MathLib/LinAlg/PETSc/PETScVector.h b/MathLib/LinAlg/PETSc/PETScVector.h
index 1a15ba71f76..f194f818fdd 100644
--- a/MathLib/LinAlg/PETSc/PETScVector.h
+++ b/MathLib/LinAlg/PETSc/PETScVector.h
@@ -168,14 +168,14 @@ public:
     PetscScalar get(const PetscInt idx) const;
 
     //! Exposes the underlying PETSc vector.
-    PETSc_Vec getRawVector() { return _v; }
+    PETSc_Vec& getRawVector() { return _v; }
     /*! Exposes the underlying PETSc vector.
      *
      * \warning
      * This method is dangerous insofar as you can do arbitrary things also
      * with a const PETSc vector!
      */
-    PETSc_Vec getRawVector() const { return _v; }
+    PETSc_Vec const&  getRawVector() const { return _v; }
     /*!
        Copy local entries including ghost ones to an array
        \param u Preallocated vector for the values of local entries.
-- 
GitLab