Skip to content
Snippets Groups Projects
Commit 4fd24b63 authored by Oliver Sander's avatar Oliver Sander Committed by sander
Browse files

Use the ScaledIdentityMatrix class to implement, well, scaled identity matrices

[[Imported from SVN: r4871]]
parent 0af31f16
Branches
Tags
No related merge requests found
......@@ -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]);
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment