Commit 97f291e4 authored by Gräser, Carsten's avatar Gräser, Carsten
Browse files

Make switch for GS as coarse solver work

Switch to truncated GS and euclidean norm
parent 27abd167
Pipeline #8803 passed with stage
in 4 minutes and 18 seconds
......@@ -2,6 +2,8 @@
// vi: set et ts=4 sw=2 sts=2:
#include <config.h>
//#define GAUSSSEIDEL
#include <fenv.h>
#include <dune/common/parametertree.hh>
......@@ -41,6 +43,7 @@
#include <dune/solvers/solvers/loopsolver.hh>
#include <dune/solvers/solvers/umfpacksolver.hh>
#include <dune/solvers/norms/energynorm.hh>
#include <dune/solvers/norms/twonorm.hh>
#include <dune/solvers/iterationsteps/multigridstep.hh>
#include <dune/solvers/iterationsteps/truncatedblockgsstep.hh>
#include <dune/solvers/transferoperators/compressedmultigridtransfer.hh>
......@@ -74,7 +77,6 @@
//#include <dune/matrix-vector/densematrixview.hh>
//#include <dune/matrix-vector/densevectorview.hh>
//#define GAUSSSEIDEL
using namespace Dune;
......@@ -594,7 +596,7 @@ int main (int argc, char *argv[]) try
#ifdef GAUSSSEIDEL
TruncatedBlockGSStep<Matrix,Vector> linearBaseSolverStep;
EnergyNorm<Matrix,Vector> baseEnergyNorm(linearBaseSolverStep);
TwoNorm<Vector> baseEnergyNorm;
Solvers::LoopSolver<Vector> linearBaseSolver(linearBaseSolverStep,
1000,
baseTolerance,
......@@ -610,13 +612,17 @@ int main (int argc, char *argv[]) try
if (linearCorrection == "geometricMultigrid")
{
#ifdef GAUSSSEIDEL
using LinearSmoother = TruncatedBlockGSStep<Matrix, Vector>;
auto linearSmoother = std::make_shared<LinearSmoother>(3);
#else
auto localLinearSolver = Dune::Solvers::BlockGS::LocalSolvers::direct();
using LinearSmoother = Dune::Solvers::BlockGSStep<std::decay_t<decltype(localLinearSolver)>,Matrix,Vector, BitVector>;
// using LinearSmoother = TruncatedBlockGSStep<Matrix, Vector>;
// Make pre and postsmoothers
auto linearSmoother = std::make_shared<LinearSmoother>(localLinearSolver);
#endif
auto multigridStep = std::make_shared<MultigridStep<Matrix, Vector> >();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment