From 4fd24b636723356f7fb4f17892a89aef014cb34c Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Wed, 16 Nov 2011 18:04:52 +0000 Subject: [PATCH] Use the ScaledIdentityMatrix class to implement, well, scaled identity matrices [[Imported from SVN: r4871]] --- .../transferoperators/genericmultigridtransfer.hh | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/dune/solvers/transferoperators/genericmultigridtransfer.hh b/dune/solvers/transferoperators/genericmultigridtransfer.hh index 8e7a2a30..98897663 100644 --- a/dune/solvers/transferoperators/genericmultigridtransfer.hh +++ b/dune/solvers/transferoperators/genericmultigridtransfer.hh @@ -78,11 +78,6 @@ public: int rows = grid.size(fL, dim); int cols = grid.size(cL, dim); - // Make identity matrix - TransferMatrixBlock identity(0); - for (size_t i=0; i<identity.N(); i++) - identity[i][i] = 1; - // A factory for the shape functions typedef typename Dune::PQkLocalFiniteElementCache<ctype, field_type, dim, 1> P1FECache; typedef typename P1FECache::FiniteElementType FEType; @@ -217,9 +212,7 @@ public: const Dune::LocalKey& iLocalKey = coarseBaseSet.localCoefficients().localKey(i); int globalCoarse = coarseIndexSet.subIndex(*cIt, iLocalKey.subEntity(), iLocalKey.codim()); - TransferMatrixBlock matValue = identity; - matValue *= values[i]; - matrix[globalFine][globalCoarse] = matValue; + matrix[globalFine][globalCoarse] = Dune::ScaledIdentityMatrix<ctype,TransferMatrixBlock::rows>(values[i]); } } } -- GitLab