From 301903834efe8d3ae40bbfc8176e0d665616ac30 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Tue, 24 Sep 2024 17:20:03 +0000
Subject: [PATCH] [umfpack] Add support for Dune::Matrix

---
 dune/istl/umfpack.hh | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dune/istl/umfpack.hh b/dune/istl/umfpack.hh
index 416d7af52..6e96dc1e8 100644
--- a/dune/istl/umfpack.hh
+++ b/dune/istl/umfpack.hh
@@ -17,6 +17,7 @@
 #include<dune/common/fvector.hh>
 #include<dune/istl/bccsmatrixinitializer.hh>
 #include<dune/istl/bcrsmatrix.hh>
+#include<dune/istl/matrix.hh>
 #include<dune/istl/foreach.hh>
 #include<dune/istl/multitypeblockmatrix.hh>
 #include<dune/istl/multitypeblockvector.hh>
@@ -211,6 +212,12 @@ namespace Dune {
       using range_type  = BlockVector<UMFPackRangeType<T>, typename std::allocator_traits<A>::template rebind_alloc<UMFPackRangeType<T>>>;
     };
 
+    template<typename T, typename A>
+    struct UMFPackVectorChooser<Matrix<T,A>,
+      std::void_t<UMFPackDomainType<T>, UMFPackRangeType<T>>>
+    : public UMFPackVectorChooser<BCRSMatrix<T,A>, std::void_t<UMFPackDomainType<T>, UMFPackRangeType<T>>>
+    {};
+
     // to make the `UMFPackVectorChooser` work with `MultiTypeBlockMatrix`, we need to add an intermediate step for the rows, which are typically `MultiTypeBlockVector`
     template<typename FirstBlock, typename... Blocks>
     struct UMFPackVectorChooser<MultiTypeBlockVector<FirstBlock, Blocks...>,
-- 
GitLab