From f7b26beda71cf1567a12536d5b7934b09d7ef7fb Mon Sep 17 00:00:00 2001 From: Kilian <kilian.weishaupt@iws.uni-stuttgart.de> Date: Mon, 30 Mar 2020 15:38:21 +0200 Subject: [PATCH] [test][sincos] Use uzawa preconditioner --- .../navierstokes/sincos/CMakeLists.txt | 19 +++++++++++++++++++ test/freeflow/navierstokes/sincos/main.cc | 9 +++++++-- .../freeflow/navierstokes/sincos/params.input | 13 ++++++++++++- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/test/freeflow/navierstokes/sincos/CMakeLists.txt b/test/freeflow/navierstokes/sincos/CMakeLists.txt index b11ea22701..2be99bb669 100644 --- a/test/freeflow/navierstokes/sincos/CMakeLists.txt +++ b/test/freeflow/navierstokes/sincos/CMakeLists.txt @@ -6,6 +6,7 @@ dumux_add_test(NAME test_ff_navierstokes_sincos LABELS freeflow TIMEOUT 1000 CMAKE_GUARD HAVE_UMFPACK + COMPILE_DEFINITIONS LINEARSOLVER=UMFPackBackend COMMAND ./convergencetest.py CMD_ARGS test_ff_navierstokes_sincos params.input -Grid.UpperRight "6.28 6.28" @@ -18,6 +19,7 @@ dumux_add_test(NAME test_ff_navierstokes_sincos_instationary TARGET test_ff_navierstokes_sincos LABELS freeflow CMAKE_GUARD HAVE_UMFPACK + COMPILE_DEFINITIONS LINEARSOLVER=UMFPackBackend COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py CMD_ARGS --script fuzzy --files ${CMAKE_SOURCE_DIR}/test/references/test_ff_navierstokes_sincos_instationary-reference.vtu @@ -28,3 +30,20 @@ dumux_add_test(NAME test_ff_navierstokes_sincos_instationary -Problem.Name test_ff_navierstokes_sincos_instationary -Problem.IsStationary false -Component.LiquidKinematicViscosity 0.1") + +dumux_add_test(NAME test_ff_navierstokes_sincos_uzawapreconditioner_factory + SOURCES main.cc + LABELS freeflow + TIMEOUT 5000 + CMAKE_GUARD "( HAVE_UMFPACK AND DUNE_ISTL_VERSION GREATER_EQUAL 2.7 )" + COMPILE_DEFINITIONS LINEARSOLVER=IstlSolverFactoryBackend<LinearSolverTraits<GridGeometry>> + COMMAND ${CMAKE_SOURCE_DIR}/bin/testing/runtest.py + CMD_ARGS --script fuzzy + --files ${CMAKE_SOURCE_DIR}/test/references/test_ff_navierstokes_sincos_instationary-reference.vtu + ${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_sincos_uzawapreconditioner-00017.vtu + --command "${CMAKE_CURRENT_BINARY_DIR}/test_ff_navierstokes_sincos_uzawapreconditioner_factory params.input + -Grid.UpperRight '1 1' + -Grid.Cells '50 50' + -Problem.Name test_ff_navierstokes_sincos_uzawapreconditioner + -Problem.IsStationary false + -Component.LiquidKinematicViscosity 0.1") diff --git a/test/freeflow/navierstokes/sincos/main.cc b/test/freeflow/navierstokes/sincos/main.cc index 507ff765ca..12f0bc9fac 100644 --- a/test/freeflow/navierstokes/sincos/main.cc +++ b/test/freeflow/navierstokes/sincos/main.cc @@ -41,11 +41,16 @@ #include <dumux/common/parameters.hh> #include <dumux/common/properties.hh> #include <dumux/common/valgrind.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> #include <dumux/linear/seqsolverbackend.hh> #include <dumux/nonlinear/newtonsolver.hh> +#include <dune/common/version.hh> +#if DUNE_VERSION_NEWER_REV(DUNE_ISTL,2,7,1) +#include <dumux/linear/istlsolverfactorybackend.hh> +#endif + #include "problem.hh" /*! @@ -252,7 +257,7 @@ int main(int argc, char** argv) try : std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = Dumux::UMFPackBackend; + using LinearSolver = LINEARSOLVER; auto linearSolver = std::make_shared<LinearSolver>(); // the non-linear solver diff --git a/test/freeflow/navierstokes/sincos/params.input b/test/freeflow/navierstokes/sincos/params.input index 80f5d2beca..0da3caf350 100644 --- a/test/freeflow/navierstokes/sincos/params.input +++ b/test/freeflow/navierstokes/sincos/params.input @@ -4,7 +4,8 @@ TEnd = 1.0 # [s] [Grid] LowerLeft = 0 0 -UpperRight = 1 1 +UpperRight = 6.28 6.28 +Cells = 20 20 [Problem] Name = test_ff_sincos @@ -34,3 +35,13 @@ AddProcessRank = false [Flux] UpwindWeight = 0.5 + +[LinearSolver] +Type = restartedflexiblegmressolver +Verbosity = 1 +GMResRestart = 50 + +[LinearSolver.Preconditioner] +Type = uzawa +Verbosity = 1 +Iterations = 5 -- GitLab