From aa3e7315314b69ec52a39b816e8a8bc404bce9da Mon Sep 17 00:00:00 2001 From: Oliver Sander <sander@igpm.rwth-aachen.de> Date: Tue, 27 May 2014 14:51:04 +0000 Subject: [PATCH] [bugfix] Assemble Laplace matrix for the h1 seminorm using the correct space Previously, the matrix was always assembled using a P1-basis, even if we used it to measure errors of vectors pertaining to P2 or other spaces. Nobody noticed this, because the h1SemiNorm routine would not fail if the vector was larger than the matrix. Sigh... [[Imported from SVN: r9770]] --- dune/gfe/riemanniantrsolver.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dune/gfe/riemanniantrsolver.cc b/dune/gfe/riemanniantrsolver.cc index d86301ba..e6223d01 100644 --- a/dune/gfe/riemanniantrsolver.cc +++ b/dune/gfe/riemanniantrsolver.cc @@ -112,11 +112,11 @@ setup(const GridType& grid, // ////////////////////////////////////////////////////////////////////////////////////// // Assemble a Laplace matrix to create a norm that's equivalent to the H1-norm // ////////////////////////////////////////////////////////////////////////////////////// - typedef P1NodalBasis<typename GridType::LeafGridView,double> P1Basis; - P1Basis p1Basis(grid.leafGridView()); - OperatorAssembler<P1Basis,P1Basis> operatorAssembler(p1Basis, p1Basis); - LaplaceAssembler<GridType, typename P1Basis::LocalFiniteElement, typename P1Basis::LocalFiniteElement> laplaceStiffness; + BasisType basis(grid.leafGridView()); + OperatorAssembler<BasisType,BasisType> operatorAssembler(basis, basis); + + LaplaceAssembler<GridType, typename BasisType::LocalFiniteElement, typename BasisType::LocalFiniteElement> laplaceStiffness; typedef Dune::BCRSMatrix<Dune::FieldMatrix<double,1,1> > ScalarMatrixType; ScalarMatrixType* A = new ScalarMatrixType; @@ -151,8 +151,6 @@ setup(const GridType& grid, // Create the transfer operators // //////////////////////////////////// - BasisType basis(grid_->leafGridView()); - for (size_t k=0; k<mmgStep->mgTransfer_.size(); k++) delete(mmgStep->mgTransfer_[k]); -- GitLab