Skip to content
Snippets Groups Projects
Commit d474b99b authored by Lisa Julia Nebel's avatar Lisa Julia Nebel
Browse files

Test to use a 1x1 matrix with the DuneFunctionsOperatorAssembler and PoweBases

parent f750db35
No related branches found
No related tags found
No related merge requests found
Pipeline #11203 failed
......@@ -121,7 +121,7 @@ setup(const typename BasisType::GridView::Grid& grid,
// //////////////////////////////////////////////////////////////////////////////////////
MatrixType localA;
ScalarMatrixType localA;
Dune::Fufem::DuneFunctionsOperatorAssembler operatorAssembler(basis,basis);
......@@ -129,24 +129,24 @@ setup(const typename BasisType::GridView::Grid& grid,
operatorAssembler.assembleBulk(Dune::Fufem::istlMatrixBackend(localA), laplaceStiffness);
MatrixType* A = new MatrixType(localA);
ScalarMatrixType* A = new ScalarMatrixType(localA);
h1SemiNorm_ = std::make_shared<EnergyNorm<MatrixType, CorrectionType> >(*A);
h1SemiNorm_ = std::make_shared<EnergyNorm<ScalarMatrixType, CorrectionType> >(*A);
// //////////////////////////////////////////////////////////////////////////////////////
// Assemble a mass matrix to create a norm that's equivalent to the L2-norm
// This will be used to monitor the gradient
// //////////////////////////////////////////////////////////////////////////////////////
MatrixType localMassMatrix;
ScalarMatrixType localMassMatrix;
Dune::Fufem::MassAssembler massStiffness;
operatorAssembler.assembleBulk(Dune::Fufem::istlMatrixBackend(localMassMatrix), massStiffness);
MatrixType* massMatrix = new MatrixType(localMassMatrix);
ScalarMatrixType* massMatrix = new ScalarMatrixType(localMassMatrix);
l2Norm_ = std::make_shared<EnergyNorm<MatrixType, CorrectionType> >(*massMatrix);
l2Norm_ = std::make_shared<EnergyNorm<ScalarMatrixType, CorrectionType> >(*massMatrix);
// ////////////////////////////////////////////////////////////
// Create Hessian matrix and its occupation structure
......
......@@ -62,6 +62,7 @@ class TrustRegionSolver
// Some types that I need
typedef Dune::BCRSMatrix<Dune::FieldMatrix<field_type, blocksize, blocksize> > MatrixType;
typedef Dune::BCRSMatrix<Dune::FieldMatrix<field_type,1,1> > ScalarMatrixType;
typedef Dune::BlockVector<Dune::FieldVector<field_type, blocksize> > CorrectionType;
typedef VectorType SolutionType;
......@@ -164,10 +165,10 @@ protected:
std::shared_ptr<const Dune::BitSetVector<blocksize> > ignoreNodes_;
/** \brief The norm used to measure multigrid convergence */
std::shared_ptr<EnergyNorm<MatrixType,CorrectionType> > h1SemiNorm_;
std::shared_ptr<EnergyNorm<ScalarMatrixType,CorrectionType> > h1SemiNorm_;
/** \brief An L2-norm, really. The H1SemiNorm class is badly named */
std::shared_ptr<EnergyNorm<MatrixType,CorrectionType> > l2Norm_;
std::shared_ptr<EnergyNorm<ScalarMatrixType,CorrectionType> > l2Norm_;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment