From b82fbff7621d809ad844946165d6b3aa73df288f Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Wed, 16 Nov 2011 17:52:44 +0000
Subject: [PATCH] Use ScaledIdentityMatrix instead of hand-coding something
 similar

[[Imported from SVN: r8221]]
---
 dune/gfe/pktop1mgtransfer.hh | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/dune/gfe/pktop1mgtransfer.hh b/dune/gfe/pktop1mgtransfer.hh
index 51cb6a6b..62b700ec 100644
--- a/dune/gfe/pktop1mgtransfer.hh
+++ b/dune/gfe/pktop1mgtransfer.hh
@@ -53,10 +53,6 @@ public:
         int rows = fineBasis.size();
         int cols = p1Basis.size();
 
-        // Make identity matrix
-        TransferMatrixBlock identity(0);
-        for (int i=0; i<identity.N(); i++)
-            identity[i][i] = 1;
 #if 0
         // A factory for the shape functions
         typedef typename Dune::PQkLocalFiniteElementCache<ctype, field_type, dim, 1> P1FECache;
@@ -144,9 +140,7 @@ public:
                         size_t globalFine   = fineBasis.index(*it, j);
                         size_t globalCoarse = p1Basis.index(*it, i);
 
-                        TransferMatrixBlock matValue = identity;
-                        matValue *= values[i];
-                        (*this->matrix_)[globalFine][globalCoarse] = matValue;
+                        (*this->matrix_)[globalFine][globalCoarse] = Dune::ScaledIdentityMatrix<double,dim>(values[i]);
                     }
                     
                 }
-- 
GitLab