From 3d396738d2fca358990c681ddaef45fbf2592c8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= <graeser@dune-project.org>
Date: Wed, 22 Sep 2021 21:15:52 +0200
Subject: [PATCH] Extend ISTLMatrixBackend

* Provide const and mutable access to wrapped matrix.
* Provide `assign(v)` method to assign value to wrapped matrix.
---
 dune/fufem/assemblers/istlbackend.hh | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/dune/fufem/assemblers/istlbackend.hh b/dune/fufem/assemblers/istlbackend.hh
index bffe79f0..2c7eb714 100644
--- a/dune/fufem/assemblers/istlbackend.hh
+++ b/dune/fufem/assemblers/istlbackend.hh
@@ -311,6 +311,31 @@ public:
     return i(*matrix_);
   }
 
+  /**
+   * \brief Const access to wrapped matrix
+   */
+  const Matrix& matrix() const
+  {
+    return *matrix_;
+  }
+
+  /**
+   * \brief Mutable access to wrapped matrix
+   */
+  Matrix& matrix()
+  {
+    return *matrix_;
+  }
+
+  /**
+   * \brief Assign value to wrapped matrix
+   */
+  template<class Value>
+  void assign(const Value& value)
+  {
+    matrix() = value;
+  }
+
 protected:
 
   Matrix* matrix_;
-- 
GitLab