From ff42b7bfbc63b0777573559ea76ac3c1aaaf755e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carsten=20Gr=C3=A4ser?= <graeser@mi.fu-berlin.de> Date: Tue, 11 Jul 2023 16:46:50 +0200 Subject: [PATCH] Update --- dune.module | 2 +- src/05-poisson-problem.cc | 6 +++--- src/06-interpolation.cc | 15 ++++----------- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/dune.module b/dune.module index 2d6a4c2..638b842 100644 --- a/dune.module +++ b/dune.module @@ -4,7 +4,7 @@ #Name of the module Module: dune-fu-tutorial -Version: 0.1 +Version: 1.0 Maintainer: graeser@mi.fu-berlin.de #depending on Depends: dune-common dune-geometry dune-grid dune-localfunctions dune-istl dune-typetree dune-functions dune-uggrid diff --git a/src/05-poisson-problem.cc b/src/05-poisson-problem.cc index 519f95a..f15f326 100644 --- a/src/05-poisson-problem.cc +++ b/src/05-poisson-problem.cc @@ -100,7 +100,8 @@ int main(int argc, char** argv) }; assemblePoissonProblemPQ1(gridView, A, rhs, rhsFunction); - x.resize(rhs.size(), 0); + x.resize(rhs.size()); + x = 0; std::vector<bool> isBoundary; isBoundary.resize(rhs.size(), false); @@ -118,8 +119,7 @@ int main(int argc, char** argv) } Dune::MatrixAdapter<Matrix,Vector,Vector> op(A); - Dune::SeqILU0<Matrix,Vector,Vector> ilu0(A,1.0); - Dune::SeqSSOR<Matrix,Vector,Vector> preconditioner(A,1,1.0); + Dune::SeqILDL<Matrix,Vector,Vector> preconditioner(A,1.0); Dune::CGSolver<Vector> cg(op, preconditioner, // preconditione 1e-4, // desired residual reduction factor diff --git a/src/06-interpolation.cc b/src/06-interpolation.cc index 6cd7cce..86f9dc9 100644 --- a/src/06-interpolation.cc +++ b/src/06-interpolation.cc @@ -38,9 +38,6 @@ // included dune-localfunctions headers #include <dune/localfunctions/lagrange/pqkfactory.hh> -// included dune-functions headers -#include <dune/functions/common/functionfromcallable.hh> - // included dune-fu-tutorial headers #include <dune/fu-tutorial/referenceelementutility.hh> @@ -79,11 +76,7 @@ void interpolateFunction(const GridView& gridView, Vector& v, const F& f) std::vector<Range> localV; -// localFiniteElement.localInterpolation().interpolate(localF, localV); - - using FunctionFromCallable = typename Dune::Functions::FunctionFromCallable<Range(LocalDomain), decltype(localF)>; - auto localFWithEvaluate = FunctionFromCallable(localF); - localFiniteElement.localInterpolation().interpolate(localFWithEvaluate, localV); + localFiniteElement.localInterpolation().interpolate(localF, localV); for(std::size_t i=0; i<localSize; ++i) { @@ -148,7 +141,8 @@ int main(int argc, char** argv) }; assemblePoissonProblemPQ1(gridView, A, rhs, rhsFunction); - x.resize(rhs.size(), 0); + x.resize(rhs.size()); + x = 0; auto dirichletFunction = [](auto x) { return sin(x[0] * 2.0*M_PI)*.1; @@ -171,8 +165,7 @@ int main(int argc, char** argv) } Dune::MatrixAdapter<Matrix,Vector,Vector> op(A); - Dune::SeqILU0<Matrix,Vector,Vector> ilu0(A,1.0); - Dune::SeqSSOR<Matrix,Vector,Vector> preconditioner(A,1,1.0); + Dune::SeqILDL<Matrix,Vector,Vector> preconditioner(A,1.0); Dune::CGSolver<Vector> cg(op, preconditioner, // preconditione 1e-4, // desired residual reduction factor -- GitLab