From 0a08f5e39f404fb0c7e8dd10411447ee4e15cdf3 Mon Sep 17 00:00:00 2001 From: Timo Koch <timokoch@math.uio.no> Date: Thu, 30 Mar 2023 15:50:42 +0200 Subject: [PATCH] [cleanup] Use new solvers, no setPreviousSolution, initialize --- exercises/exercise-biomineralization/main.cc | 41 +++------- .../exercise-coupling-ff-pm/interface/main.cc | 31 +++----- .../exercise-coupling-ff-pm/models/main.cc | 34 +++------ .../turbulence/main.cc | 35 +++------ exercises/exercise-fluidsystem/main.cc | 52 ++++--------- exercises/exercise-fractures/main.cc | 27 +++---- exercises/exercise-grids/main.cc | 36 +++------ exercises/exercise-mainfile/README.md | 3 - .../exercise-mainfile/exercise1pamain.cc | 30 +++----- .../exercise-mainfile/exercise1pbmain.cc | 30 +++----- .../exercise-mainfile/exercise1pcmain.cc | 35 +++------ exercises/exercise-properties/main.cc | 72 +++--------------- exercises/exercise-runtimeparams/main.cc | 42 +++-------- .../exercise-biomineralization/main.cc | 41 +++------- .../exercise-coupling-ff-pm/interface/main.cc | 31 +++----- .../exercise-coupling-ff-pm/models/main.cc | 31 +++----- .../turbulence/main.cc | 35 +++------ .../solution/exercise-fluidsystem/main.cc | 51 ++++--------- exercises/solution/exercise-fractures/main.cc | 27 +++---- exercises/solution/exercise-grids/main.cc | 36 +++------ .../exercise1pa_solution_main.cc | 33 +++----- .../solution/exercise-properties/main.cc | 75 +++---------------- .../solution/exercise-runtimeparams/main.cc | 42 +++-------- 23 files changed, 244 insertions(+), 626 deletions(-) diff --git a/exercises/exercise-biomineralization/main.cc b/exercises/exercise-biomineralization/main.cc index bc59832c..8a8c0570 100644 --- a/exercises/exercise-biomineralization/main.cc +++ b/exercises/exercise-biomineralization/main.cc @@ -25,27 +25,20 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> -#include <dune/istl/io.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/amgbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> #include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> -#include <dumux/discretization/method.hh> - #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include "properties.hh" @@ -59,10 +52,8 @@ int main(int argc, char** argv) // define the type tag for this problem using TypeTag = Properties::TTag::ExerciseBioMinCCTpfa; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -71,10 +62,6 @@ int main(int argc, char** argv) GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); - //////////////////////////////////////////////////////////// - // run instationary non-linear problem on this grid - //////////////////////////////////////////////////////////// - // we compute on the leaf grid view const auto& leafGridView = gridManager.grid().leafGridView(); @@ -128,8 +115,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, gridGeometry->dofMapper()); + using LinearSolver = AMGBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the non-linear solver using NewtonSolver = NewtonSolver<Assembler, LinearSolver>; @@ -138,9 +125,6 @@ int main(int argc, char** argv) // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - // solve the non-linear system with time step control nonLinearSolver.solve(x, *timeLoop); @@ -175,15 +159,8 @@ int main(int argc, char** argv) timeLoop->finalize(leafGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { + if (leafGridView.comm().rank() == 0) Parameters::print(); - } return 0; } // end main diff --git a/exercises/exercise-coupling-ff-pm/interface/main.cc b/exercises/exercise-coupling-ff-pm/interface/main.cc index e707fd91..5cba8d6b 100644 --- a/exercises/exercise-coupling-ff-pm/interface/main.cc +++ b/exercises/exercise-coupling-ff-pm/interface/main.cc @@ -25,19 +25,22 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/istl/io.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> + #include <dumux/common/partial.hh> -#include <dumux/linear/seqsolverbackend.hh> + +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> + #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> #include <dumux/discretization/method.hh> #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include <dumux/multidomain/staggeredtraits.hh> #include <dumux/multidomain/fvassembler.hh> @@ -51,10 +54,8 @@ int main(int argc, char** argv) { using namespace Dumux; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -206,7 +207,7 @@ int main(int argc, char** argv) couplingManager); // the linear solver - using LinearSolver = UMFPackBackend; + using LinearSolver = UMFPackIstlSolver<SeqLinearSolverTraits, LinearAlgebraTraitsFromAssembler<Assembler>>; auto linearSolver = std::make_shared<LinearSolver>(); // the non-linear solver @@ -220,15 +221,7 @@ int main(int argc, char** argv) stokesVtkWriter.write(1.0); darcyVtkWriter.write(1.0); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { - Parameters::print(); - } + Parameters::print(); return 0; } // end main diff --git a/exercises/exercise-coupling-ff-pm/models/main.cc b/exercises/exercise-coupling-ff-pm/models/main.cc index 8fb74126..2fe38c8e 100644 --- a/exercises/exercise-coupling-ff-pm/models/main.cc +++ b/exercises/exercise-coupling-ff-pm/models/main.cc @@ -26,20 +26,21 @@ #include <iostream> #include <fstream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/istl/io.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> #include <dumux/common/partial.hh> -#include <dumux/linear/seqsolverbackend.hh> + +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> + #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> #include <dumux/discretization/method.hh> #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include <dumux/multidomain/staggeredtraits.hh> #include <dumux/multidomain/fvassembler.hh> @@ -53,10 +54,8 @@ int main(int argc, char** argv) { using namespace Dumux; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -170,7 +169,7 @@ int main(int argc, char** argv) timeLoop, solOld); // the linear solver - using LinearSolver = UMFPackBackend; + using LinearSolver = UMFPackIstlSolver<SeqLinearSolverTraits, LinearAlgebraTraitsFromAssembler<Assembler>>; auto linearSolver = std::make_shared<LinearSolver>(); using NewtonSolver = MultiDomainNewtonSolver<Assembler, LinearSolver, CouplingManager>; @@ -182,9 +181,6 @@ int main(int argc, char** argv) timeLoop->setPeriodicCheckPoint(episodeLength); timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(solOld); - // solve the non-linear system with time step control nonLinearSolver.solve(sol, *timeLoop); @@ -217,15 +213,7 @@ int main(int argc, char** argv) timeLoop->finalize(stokesGridView.comm()); timeLoop->finalize(darcyGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { - Parameters::print(); - } + Parameters::print(); return 0; } // end main diff --git a/exercises/exercise-coupling-ff-pm/turbulence/main.cc b/exercises/exercise-coupling-ff-pm/turbulence/main.cc index aa127622..769e1f4f 100644 --- a/exercises/exercise-coupling-ff-pm/turbulence/main.cc +++ b/exercises/exercise-coupling-ff-pm/turbulence/main.cc @@ -26,20 +26,22 @@ #include <iostream> #include <fstream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/istl/io.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> + #include <dumux/common/partial.hh> -#include <dumux/linear/seqsolverbackend.hh> + +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> + #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> #include <dumux/discretization/method.hh> #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include <dumux/multidomain/staggeredtraits.hh> #include <dumux/multidomain/fvassembler.hh> @@ -53,10 +55,8 @@ int main(int argc, char** argv) { using namespace Dumux; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -175,7 +175,7 @@ int main(int argc, char** argv) timeLoop, solOld); // the linear solver - using LinearSolver = UMFPackBackend; + using LinearSolver = UMFPackIstlSolver<SeqLinearSolverTraits, LinearAlgebraTraitsFromAssembler<Assembler>>; auto linearSolver = std::make_shared<LinearSolver>(); // the non-linear solver @@ -185,9 +185,6 @@ int main(int argc, char** argv) // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(solOld); - // solve the non-linear system with time step control nonLinearSolver.solve(sol, *timeLoop); @@ -222,15 +219,7 @@ int main(int argc, char** argv) timeLoop->finalize(stokesGridView.comm()); timeLoop->finalize(darcyGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { - Parameters::print(); - } + Parameters::print(); return 0; } // end main diff --git a/exercises/exercise-fluidsystem/main.cc b/exercises/exercise-fluidsystem/main.cc index 33e43381..2a543b88 100644 --- a/exercises/exercise-fluidsystem/main.cc +++ b/exercises/exercise-fluidsystem/main.cc @@ -25,35 +25,26 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> -#include <dune/istl/io.hh> - -#include "2pproperties.hh" -#include "2p2cproperties.hh" - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/amgbackend.hh> +#include <dumux/common/partial.hh> + +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> #include <dumux/linear/linearsolvertraits.hh> -#include <dumux/nonlinear/newtonsolver.hh> +#include "2pproperties.hh" +#include "2p2cproperties.hh" + +#include <dumux/nonlinear/newtonsolver.hh> #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> -#include <dumux/discretization/method.hh> - #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> - -//////////////////////// -// the main function -//////////////////////// int main(int argc, char** argv) { using namespace Dumux; @@ -65,10 +56,8 @@ int main(int argc, char** argv) // and recompile the executable using TypeTag = Properties::TTag::TYPETAG; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -126,19 +115,16 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, gridGeometry->dofMapper()); + using LinearSolver = AMGBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); - // the non-linear solver + // the non-linear solver using NewtonSolver = NewtonSolver<Assembler, LinearSolver>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - // solve the non-linear system with time step control nonLinearSolver.solve(x, *timeLoop); @@ -160,16 +146,10 @@ int main(int argc, char** argv) } while (!timeLoop->finished()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// timeLoop->finalize(leafGridView.comm()); - // print dumux end message - if (mpiHelper.rank() == 0) - { + if (leafGridView.comm().rank() == 0) Parameters::print(); - } return 0; } // end main diff --git a/exercises/exercise-fractures/main.cc b/exercises/exercise-fractures/main.cc index 6a2520c0..12ecadca 100644 --- a/exercises/exercise-fractures/main.cc +++ b/exercises/exercise-fractures/main.cc @@ -23,18 +23,19 @@ #include <config.h> #include <iostream> -#include <dune/common/parallel/mpihelper.hh> - // include the properties header #include "properties.hh" +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> #include <dumux/common/timeloop.hh> #include <dumux/assembly/diffmethod.hh> -#include <dumux/linear/seqsolverbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> #include <dumux/multidomain/newtonsolver.hh> #include <dumux/multidomain/fvassembler.hh> #include <dumux/multidomain/traits.hh> @@ -56,8 +57,7 @@ using TheCouplingMapper = Dumux::FacetCouplingMapper<MatrixGridGeometry, Fractur using TheCouplingManager = Dumux::FacetCouplingManager<TheMultiDomainTraits, TheCouplingMapper>; // set the coupling manager property in the sub-problems -namespace Dumux { -namespace Properties { +namespace Dumux::Properties { template<class TypeTag> struct CouplingManager<TypeTag, TTag::MatrixProblem> { using type = TheCouplingManager; }; @@ -65,18 +65,15 @@ struct CouplingManager<TypeTag, TTag::MatrixProblem> { using type = TheCouplingM template<class TypeTag> struct CouplingManager<TypeTag, TTag::FractureProblem> { using type = TheCouplingManager; }; -} // end namespace Properties -} // end namespace Dumux +} // end namespace Dumux::Properties // main program int main(int argc, char** argv) { using namespace Dumux; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // initialize parameter tree Parameters::init(argc, argv); @@ -218,7 +215,7 @@ int main(int argc, char** argv) timeLoop, xOld); // the linear solver - using LinearSolver = ILU0BiCGSTABBackend; + using LinearSolver = ILUBiCGSTABIstlSolver<SeqLinearSolverTraits, LinearAlgebraTraitsFromAssembler<Assembler>>; auto linearSolver = std::make_shared<LinearSolver>(); // the non-linear solver @@ -228,9 +225,6 @@ int main(int argc, char** argv) // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - // solve the non-linear system with time step control newtonSolver->solve(x, *timeLoop); @@ -260,8 +254,7 @@ int main(int argc, char** argv) // report time loop statistics timeLoop->finalize(); - // print dumux message to say goodbye - if (mpiHelper.rank() == 0) + Parameters::print(); return 0; }// end main diff --git a/exercises/exercise-grids/main.cc b/exercises/exercise-grids/main.cc index 2c142851..d24be0dd 100644 --- a/exercises/exercise-grids/main.cc +++ b/exercises/exercise-grids/main.cc @@ -24,24 +24,18 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/amgbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> #include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> -#include <dumux/discretization/method.hh> - #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/grid/gridmanager.hh> @@ -58,10 +52,8 @@ int main(int argc, char** argv) // define the type tag for this problem using TypeTag = Properties::TTag::Injection2pCC; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -121,8 +113,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, gridGeometry->dofMapper()); + using LinearSolver = AMGBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the non-linear solver using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; @@ -132,10 +124,7 @@ int main(int argc, char** argv) timeLoop->start(); while (!timeLoop->finished()) { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - - //set time in problem (is used in time-dependent Neumann boundary condition) + // set time in problem (is used in time-dependent Neumann boundary condition) problem->setTime(timeLoop->time()+timeLoop->timeStepSize()); // solve the non-linear system with time step control @@ -160,15 +149,8 @@ int main(int argc, char** argv) timeLoop->finalize(leafGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { + if (leafGridView.comm().rank() == 0) Parameters::print(); - } return 0; } // end main diff --git a/exercises/exercise-mainfile/README.md b/exercises/exercise-mainfile/README.md index c172212d..de832386 100644 --- a/exercises/exercise-mainfile/README.md +++ b/exercises/exercise-mainfile/README.md @@ -124,9 +124,6 @@ timeLoop->setPeriodicCheckPoint(tEnd/10.0); // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - // linearize & solve nonLinearSolver.solve(x, *timeLoop); diff --git a/exercises/exercise-mainfile/exercise1pamain.cc b/exercises/exercise-mainfile/exercise1pamain.cc index 844356ca..608418fc 100644 --- a/exercises/exercise-mainfile/exercise1pamain.cc +++ b/exercises/exercise-mainfile/exercise1pamain.cc @@ -27,22 +27,20 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> #include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> -#include <dune/istl/io.hh> +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/seqsolverbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> int main(int argc, char** argv) { @@ -54,10 +52,8 @@ int main(int argc, char** argv) //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // initialize parameter tree Parameters::init(argc, argv); @@ -111,8 +107,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables); // the linear solver - using LinearSolver = ILU0BiCGSTABBackend; - auto linearSolver = std::make_shared<LinearSolver>(); + using LinearSolver = ILUBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the discretization matrices for stationary linear problems using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; @@ -138,12 +134,8 @@ int main(int argc, char** argv) << comm.size() << " processes.\n" << "The cumulative CPU time was " << timer.elapsed()*comm.size() << " seconds.\n"; - //////////////////////////////////////////////////////////// - // print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) + if (leafGridView.comm().rank() == 0) + Parameters::print(); return 0; diff --git a/exercises/exercise-mainfile/exercise1pbmain.cc b/exercises/exercise-mainfile/exercise1pbmain.cc index 13018fef..22bcb314 100644 --- a/exercises/exercise-mainfile/exercise1pbmain.cc +++ b/exercises/exercise-mainfile/exercise1pbmain.cc @@ -27,23 +27,21 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> #include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> -#include <dune/istl/io.hh> +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include <dumux/linear/seqsolverbackend.hh> #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> int main(int argc, char** argv) { @@ -55,10 +53,8 @@ int main(int argc, char** argv) //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // initialize parameter tree Parameters::init(argc, argv); @@ -108,8 +104,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables); // the linear solver - using LinearSolver = ILU0BiCGSTABBackend; - auto linearSolver = std::make_shared<LinearSolver>(); + using LinearSolver = ILUBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the non-linear solver using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; @@ -128,12 +124,8 @@ int main(int argc, char** argv) << comm.size() << " processes.\n" << "The cumulative CPU time was " << timer.elapsed()*comm.size() << " seconds.\n"; - //////////////////////////////////////////////////////////// - // print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) + if (leafGridView.comm().rank() == 0) + Parameters::print(); return 0; diff --git a/exercises/exercise-mainfile/exercise1pcmain.cc b/exercises/exercise-mainfile/exercise1pcmain.cc index 63c1aa77..97d840e4 100644 --- a/exercises/exercise-mainfile/exercise1pcmain.cc +++ b/exercises/exercise-mainfile/exercise1pcmain.cc @@ -27,23 +27,19 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> -#include <dune/istl/io.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> -#include <dumux/linear/seqsolverbackend.hh> #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> int main(int argc, char** argv) { @@ -55,10 +51,8 @@ int main(int argc, char** argv) //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // initialize parameter tree Parameters::init(argc, argv); @@ -119,8 +113,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = ILU0BiCGSTABBackend; - auto linearSolver = std::make_shared<LinearSolver>(); + using LinearSolver = ILUBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the non-linear solver using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; @@ -132,9 +126,6 @@ int main(int argc, char** argv) // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - // linearize & solve nonLinearSolver.solve(x, *timeLoop); @@ -159,12 +150,8 @@ int main(int argc, char** argv) timeLoop->finalize(leafGridView.comm()); - //////////////////////////////////////////////////////////// - // print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) + if (leafGridView.comm().rank() == 0) + Parameters::print(); return 0; diff --git a/exercises/exercise-properties/main.cc b/exercises/exercise-properties/main.cc index 8e84117f..caa9afbd 100644 --- a/exercises/exercise-properties/main.cc +++ b/exercises/exercise-properties/main.cc @@ -25,62 +25,22 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> -#include <dune/istl/io.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/amgbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> #include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> #include <dumux/assembly/fvassembler.hh> -#include <dumux/assembly/diffmethod.hh> - -#include <dumux/discretization/method.hh> #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include "properties.hh" -/*! - * \brief Provides an interface for customizing error messages associated with - * reading in parameters. - * - * \param progName The name of the program, that was tried to be started. - * \param errorMsg The error message that was issued by the start function. - * Comprises the thing that went wrong and a general help message. - */ -void usage(const char *progName, const std::string &errorMsg) -{ - if (errorMsg.size() > 0) { - std::string errorMessageOut = "\nUsage: "; - errorMessageOut += progName; - errorMessageOut += " [options]\n"; - errorMessageOut += errorMsg; - errorMessageOut += "\n\nThe list of mandatory arguments for this program is:\n" - "\t-TimeManager.TEnd End of the simulation [s] \n" - "\t-TimeManager.DtInitial Initial timestep size [s] \n" - "\t-Grid.LowerLeft Lower left corner coordinates\n" - "\t-Grid.UpperRight Upper right corner coordinates\n" - "\t-Grid.Cells Number of cells in respective coordinate directions\n" - "\t definition in DGF format\n" - "\t-SpatialParams.LensLowerLeft coordinates of the lower left corner of the lens [m] \n" - "\t-SpatialParams.LensUpperRight coordinates of the upper right corner of the lens [m] \n" - "\t-SpatialParams.Permeability Permeability of the domain [m^2] \n" - "\t-SpatialParams.PermeabilityLens Permeability of the lens [m^2] \n"; - - std::cout << errorMessageOut - << "\n"; - } -} - int main(int argc, char** argv) { using namespace Dumux; @@ -88,13 +48,11 @@ int main(int argc, char** argv) // define the type tag for this problem using TypeTag = Properties::TTag::TwoPIncompressibleTpfa; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file - Parameters::init(argc, argv, usage); + Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; @@ -149,8 +107,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, gridGeometry->dofMapper()); + using LinearSolver = AMGBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the non-linear solver using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; @@ -159,9 +117,6 @@ int main(int argc, char** argv) // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - // solve the non-linear system with time step control nonLinearSolver.solve(x, *timeLoop); @@ -188,15 +143,8 @@ int main(int argc, char** argv) timeLoop->finalize(leafGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { + if (leafGridView.comm().rank() == 0) Parameters::print(); - } return 0; } // end main diff --git a/exercises/exercise-runtimeparams/main.cc b/exercises/exercise-runtimeparams/main.cc index 0a3bf24f..25300dd3 100644 --- a/exercises/exercise-runtimeparams/main.cc +++ b/exercises/exercise-runtimeparams/main.cc @@ -24,33 +24,23 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/amgbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> #include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> #include <dumux/assembly/fvassembler.hh> -#include <dumux/assembly/diffmethod.hh> - -#include <dumux/discretization/method.hh> #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> // The properties file, where compile time definitions are made #include "properties.hh" -//////////////////////// -// the main function -//////////////////////// int main(int argc, char** argv) { using namespace Dumux; @@ -58,10 +48,8 @@ int main(int argc, char** argv) // define the type tag for this problem using TypeTag = Properties::TTag::Injection2pCC; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -121,8 +109,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, gridGeometry->dofMapper()); + using LinearSolver = AMGBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the non-linear solver using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; @@ -132,10 +120,7 @@ int main(int argc, char** argv) timeLoop->start(); while (!timeLoop->finished()) { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - - //set time in problem (is used in time-dependent Neumann boundary condition) + // set time in problem (is used in time-dependent Neumann boundary condition) problem->setTime(timeLoop->time()+timeLoop->timeStepSize()); // solve the non-linear system with time step control @@ -160,15 +145,8 @@ int main(int argc, char** argv) timeLoop->finalize(leafGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { + if (leafGridView.comm().rank() == 0) Parameters::print(); - } return 0; } // end main diff --git a/exercises/solution/exercise-biomineralization/main.cc b/exercises/solution/exercise-biomineralization/main.cc index bc59832c..8a8c0570 100644 --- a/exercises/solution/exercise-biomineralization/main.cc +++ b/exercises/solution/exercise-biomineralization/main.cc @@ -25,27 +25,20 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> -#include <dune/istl/io.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/amgbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> #include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> -#include <dumux/discretization/method.hh> - #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include "properties.hh" @@ -59,10 +52,8 @@ int main(int argc, char** argv) // define the type tag for this problem using TypeTag = Properties::TTag::ExerciseBioMinCCTpfa; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -71,10 +62,6 @@ int main(int argc, char** argv) GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; gridManager.init(); - //////////////////////////////////////////////////////////// - // run instationary non-linear problem on this grid - //////////////////////////////////////////////////////////// - // we compute on the leaf grid view const auto& leafGridView = gridManager.grid().leafGridView(); @@ -128,8 +115,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, gridGeometry->dofMapper()); + using LinearSolver = AMGBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the non-linear solver using NewtonSolver = NewtonSolver<Assembler, LinearSolver>; @@ -138,9 +125,6 @@ int main(int argc, char** argv) // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - // solve the non-linear system with time step control nonLinearSolver.solve(x, *timeLoop); @@ -175,15 +159,8 @@ int main(int argc, char** argv) timeLoop->finalize(leafGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { + if (leafGridView.comm().rank() == 0) Parameters::print(); - } return 0; } // end main diff --git a/exercises/solution/exercise-coupling-ff-pm/interface/main.cc b/exercises/solution/exercise-coupling-ff-pm/interface/main.cc index 0e645169..73426d92 100644 --- a/exercises/solution/exercise-coupling-ff-pm/interface/main.cc +++ b/exercises/solution/exercise-coupling-ff-pm/interface/main.cc @@ -25,20 +25,21 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/istl/io.hh> -#include <dune/grid/yaspgrid.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> #include <dumux/common/partial.hh> -#include <dumux/linear/seqsolverbackend.hh> + +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> + #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> #include <dumux/discretization/method.hh> #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include <dumux/multidomain/staggeredtraits.hh> #include <dumux/multidomain/fvassembler.hh> @@ -52,10 +53,8 @@ int main(int argc, char** argv) { using namespace Dumux; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -199,7 +198,7 @@ int main(int argc, char** argv) couplingManager); // the linear solver - using LinearSolver = UMFPackBackend; + using LinearSolver = UMFPackIstlSolver<SeqLinearSolverTraits, LinearAlgebraTraitsFromAssembler<Assembler>>; auto linearSolver = std::make_shared<LinearSolver>(); // the non-linear solver @@ -213,15 +212,7 @@ int main(int argc, char** argv) stokesVtkWriter.write(1.0); darcyVtkWriter.write(1.0); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { - Parameters::print(); - } + Parameters::print(); return 0; } // end main diff --git a/exercises/solution/exercise-coupling-ff-pm/models/main.cc b/exercises/solution/exercise-coupling-ff-pm/models/main.cc index 9a31e7b0..f1d4b67a 100644 --- a/exercises/solution/exercise-coupling-ff-pm/models/main.cc +++ b/exercises/solution/exercise-coupling-ff-pm/models/main.cc @@ -26,20 +26,21 @@ #include <iostream> #include <fstream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/istl/io.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> #include <dumux/common/partial.hh> -#include <dumux/linear/seqsolverbackend.hh> + +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> + #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> #include <dumux/discretization/method.hh> #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include <dumux/multidomain/staggeredtraits.hh> #include <dumux/multidomain/fvassembler.hh> @@ -56,7 +57,8 @@ int main(int argc, char** argv) // initialize MPI, finalize is done automatically on exit const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -176,7 +178,7 @@ int main(int argc, char** argv) timeLoop, solOld); // the linear solver - using LinearSolver = UMFPackBackend; + using LinearSolver = UMFPackIstlSolver<SeqLinearSolverTraits, LinearAlgebraTraitsFromAssembler<Assembler>>; auto linearSolver = std::make_shared<LinearSolver>(); using NewtonSolver = MultiDomainNewtonSolver<Assembler, LinearSolver, CouplingManager>; @@ -188,9 +190,6 @@ int main(int argc, char** argv) timeLoop->setPeriodicCheckPoint(episodeLength); timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(solOld); - // solve the non-linear system with time step control nonLinearSolver.solve(sol, *timeLoop); @@ -223,15 +222,7 @@ int main(int argc, char** argv) timeLoop->finalize(stokesGridView.comm()); timeLoop->finalize(darcyGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { - Parameters::print(); - } + Parameters::print(); return 0; } // end main diff --git a/exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc b/exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc index 95b6a18e..c8974ad8 100644 --- a/exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc +++ b/exercises/solution/exercise-coupling-ff-pm/turbulence/main.cc @@ -26,20 +26,22 @@ #include <iostream> #include <fstream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/istl/io.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> + #include <dumux/common/partial.hh> -#include <dumux/linear/seqsolverbackend.hh> + +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> + #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> #include <dumux/discretization/method.hh> #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/staggeredvtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include <dumux/multidomain/staggeredtraits.hh> #include <dumux/multidomain/fvassembler.hh> @@ -53,10 +55,8 @@ int main(int argc, char** argv) { using namespace Dumux; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -175,7 +175,7 @@ int main(int argc, char** argv) timeLoop, solOld); // the linear solver - using LinearSolver = UMFPackBackend; + using LinearSolver = UMFPackIstlSolver<SeqLinearSolverTraits, LinearAlgebraTraitsFromAssembler<Assembler>>; auto linearSolver = std::make_shared<LinearSolver>(); // the non-linear solver @@ -185,9 +185,6 @@ int main(int argc, char** argv) // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(solOld); - // solve the non-linear system with time step control nonLinearSolver.solve(sol, *timeLoop); @@ -224,15 +221,7 @@ int main(int argc, char** argv) timeLoop->finalize(stokesGridView.comm()); timeLoop->finalize(darcyGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { - Parameters::print(); - } + Parameters::print(); return 0; } // end main diff --git a/exercises/solution/exercise-fluidsystem/main.cc b/exercises/solution/exercise-fluidsystem/main.cc index b4819eac..a9351abb 100644 --- a/exercises/solution/exercise-fluidsystem/main.cc +++ b/exercises/solution/exercise-fluidsystem/main.cc @@ -25,34 +25,26 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> -#include <dune/istl/io.hh> - -#include "2pproperties.hh" -#include "2p2cproperties.hh" - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/amgbackend.hh> +#include <dumux/common/partial.hh> + +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> #include <dumux/linear/linearsolvertraits.hh> -#include <dumux/nonlinear/newtonsolver.hh> +#include "2pproperties.hh" +#include "2p2cproperties.hh" + +#include <dumux/nonlinear/newtonsolver.hh> #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> -#include <dumux/discretization/method.hh> - #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> -//////////////////////// -// the main function -//////////////////////// int main(int argc, char** argv) { using namespace Dumux; @@ -64,10 +56,8 @@ int main(int argc, char** argv) // and recompile the executable using TypeTag = Properties::TTag::TYPETAG; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -123,19 +113,16 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, gridGeometry->dofMapper()); + using LinearSolver = AMGBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); - // the non-linear solver + // the non-linear solver using NewtonSolver = NewtonSolver<Assembler, LinearSolver>; NewtonSolver nonLinearSolver(assembler, linearSolver); // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - // solve the non-linear system with time step control nonLinearSolver.solve(x, *timeLoop); @@ -157,16 +144,10 @@ int main(int argc, char** argv) } while (!timeLoop->finished()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// timeLoop->finalize(leafGridView.comm()); - // print dumux end message - if (mpiHelper.rank() == 0) - { + if (leafGridView.comm().rank() == 0) Parameters::print(); - } return 0; } // end main diff --git a/exercises/solution/exercise-fractures/main.cc b/exercises/solution/exercise-fractures/main.cc index 74f86d0c..3abc40bd 100644 --- a/exercises/solution/exercise-fractures/main.cc +++ b/exercises/solution/exercise-fractures/main.cc @@ -23,18 +23,19 @@ #include <config.h> #include <iostream> -#include <dune/common/parallel/mpihelper.hh> - // include the properties header #include "properties.hh" +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> #include <dumux/common/timeloop.hh> #include <dumux/assembly/diffmethod.hh> -#include <dumux/linear/seqsolverbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> #include <dumux/multidomain/newtonsolver.hh> #include <dumux/multidomain/fvassembler.hh> #include <dumux/multidomain/traits.hh> @@ -56,8 +57,7 @@ using TheCouplingMapper = Dumux::FacetCouplingMapper<MatrixGridGeometry, Fractur using TheCouplingManager = Dumux::FacetCouplingManager<TheMultiDomainTraits, TheCouplingMapper>; // set the coupling manager property in the sub-problems -namespace Dumux { -namespace Properties { +namespace Dumux::Properties { template<class TypeTag> struct CouplingManager<TypeTag, TTag::MatrixProblem> { using type = TheCouplingManager; }; @@ -65,18 +65,15 @@ struct CouplingManager<TypeTag, TTag::MatrixProblem> { using type = TheCouplingM template<class TypeTag> struct CouplingManager<TypeTag, TTag::FractureProblem> { using type = TheCouplingManager; }; -} // end namespace Properties -} // end namespace Dumux +} // end namespace Dumux::Properties // main program int main(int argc, char** argv) { using namespace Dumux; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // initialize parameter tree Parameters::init(argc, argv); @@ -218,7 +215,7 @@ int main(int argc, char** argv) timeLoop, xOld); // the linear solver - using LinearSolver = ILU0BiCGSTABBackend; + using LinearSolver = ILUBiCGSTABIstlSolver<SeqLinearSolverTraits, LinearAlgebraTraitsFromAssembler<Assembler>>; auto linearSolver = std::make_shared<LinearSolver>(); // the non-linear solver @@ -228,9 +225,6 @@ int main(int argc, char** argv) // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - // solve the non-linear system with time step control newtonSolver->solve(x, *timeLoop); @@ -260,8 +254,7 @@ int main(int argc, char** argv) // report time loop statistics timeLoop->finalize(); - // print dumux message to say goodbye - if (mpiHelper.rank() == 0) + Parameters::print(); return 0; diff --git a/exercises/solution/exercise-grids/main.cc b/exercises/solution/exercise-grids/main.cc index b03fbd15..9e6cef99 100644 --- a/exercises/solution/exercise-grids/main.cc +++ b/exercises/solution/exercise-grids/main.cc @@ -24,24 +24,18 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/amgbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> #include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> #include <dumux/assembly/fvassembler.hh> #include <dumux/assembly/diffmethod.hh> -#include <dumux/discretization/method.hh> - #include <dumux/io/vtkoutputmodule.hh> #include <dumux/io/grid/gridmanager.hh> @@ -58,10 +52,8 @@ int main(int argc, char** argv) // define the type tag for this problem using TypeTag = Properties::TTag::Injection2pCC; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -121,8 +113,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, gridGeometry->dofMapper()); + using LinearSolver = AMGBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the non-linear solver using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; @@ -132,10 +124,7 @@ int main(int argc, char** argv) timeLoop->start(); while (!timeLoop->finished()) { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - - //set time in problem (is used in time-dependent Neumann boundary condition) + // set time in problem (is used in time-dependent Neumann boundary condition) problem->setTime(timeLoop->time()+timeLoop->timeStepSize()); // solve the non-linear system with time step control @@ -160,15 +149,8 @@ int main(int argc, char** argv) timeLoop->finalize(leafGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { + if (leafGridView.comm().rank() == 0) Parameters::print(); - } return 0; } // end main diff --git a/exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc b/exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc index 0437193c..22d8495b 100644 --- a/exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc +++ b/exercises/solution/exercise-mainfile/exercise1pa_solution_main.cc @@ -24,27 +24,24 @@ #include <config.h> #include "1pproblem.hh" +#include "properties.hh" #include <iostream> -#include <dune/common/parallel/mpihelper.hh> #include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> -#include <dune/istl/io.hh> +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/seqsolverbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> +#include <dumux/linear/linearsolvertraits.hh> #include <dumux/assembly/fvassembler.hh> #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> - -#include "properties.hh" +#include <dumux/io/grid/gridmanager_yasp.hh> int main(int argc, char** argv) { @@ -56,10 +53,8 @@ int main(int argc, char** argv) //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // initialize parameter tree Parameters::init(argc, argv); @@ -113,8 +108,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables); // the linear solver - using LinearSolver = ILU0BiCGSTABBackend; - auto linearSolver = std::make_shared<LinearSolver>(); + using LinearSolver = ILUBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the discretization matrices for stationary linear problems using JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>; @@ -140,12 +135,8 @@ int main(int argc, char** argv) << comm.size() << " processes.\n" << "The cumulative CPU time was " << timer.elapsed()*comm.size() << " seconds.\n"; - //////////////////////////////////////////////////////////// - // print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) + if (leafGridView.comm().rank() == 0) + Parameters::print(); return 0; diff --git a/exercises/solution/exercise-properties/main.cc b/exercises/solution/exercise-properties/main.cc index 322bd434..d3836244 100644 --- a/exercises/solution/exercise-properties/main.cc +++ b/exercises/solution/exercise-properties/main.cc @@ -23,65 +23,26 @@ */ #include <config.h> -#include <iostream> +#include <config.h> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> -#include <dune/istl/io.hh> +#include <iostream> +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/amgbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> #include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> #include <dumux/assembly/fvassembler.hh> -#include <dumux/assembly/diffmethod.hh> - -#include <dumux/discretization/method.hh> #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> -#include <dumux/io/loadsolution.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> #include "properties.hh" -/*! - * \brief Provides an interface for customizing error messages associated with - * reading in parameters. - * - * \param progName The name of the program, that was tried to be started. - * \param errorMsg The error message that was issued by the start function. - * Comprises the thing that went wrong and a general help message. - */ -void usage(const char *progName, const std::string &errorMsg) -{ - if (errorMsg.size() > 0) { - std::string errorMessageOut = "\nUsage: "; - errorMessageOut += progName; - errorMessageOut += " [options]\n"; - errorMessageOut += errorMsg; - errorMessageOut += "\n\nThe list of mandatory arguments for this program is:\n" - "\t-TimeManager.TEnd End of the simulation [s] \n" - "\t-TimeManager.DtInitial Initial timestep size [s] \n" - "\t-Grid.LowerLeft Lower left corner coordinates\n" - "\t-Grid.UpperRight Upper right corner coordinates\n" - "\t-Grid.Cells Number of cells in respective coordinate directions\n" - "\t definition in DGF format\n" - "\t-SpatialParams.LensLowerLeft coordinates of the lower left corner of the lens [m] \n" - "\t-SpatialParams.LensUpperRight coordinates of the upper right corner of the lens [m] \n" - "\t-SpatialParams.Permeability Permeability of the domain [m^2] \n" - "\t-SpatialParams.PermeabilityLens Permeability of the lens [m^2] \n"; - - std::cout << errorMessageOut - << "\n"; - } -} - int main(int argc, char** argv) { using namespace Dumux; @@ -89,13 +50,11 @@ int main(int argc, char** argv) // define the type tag for this problem using TypeTag = Properties::TTag::TwoPIncompressibleTpfa; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file - Parameters::init(argc, argv, usage); + Parameters::init(argc, argv); // try to create a grid (from the given grid file or the input file) GridManager<GetPropType<TypeTag, Properties::Grid>> gridManager; @@ -150,8 +109,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, gridGeometry->dofMapper()); + using LinearSolver = AMGBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the non-linear solver using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; @@ -160,9 +119,6 @@ int main(int argc, char** argv) // time loop timeLoop->start(); do { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - // solve the non-linear system with time step control nonLinearSolver.solve(x, *timeLoop); @@ -189,15 +145,8 @@ int main(int argc, char** argv) timeLoop->finalize(leafGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { + if (leafGridView.comm().rank() == 0) Parameters::print(); - } return 0; } // end main diff --git a/exercises/solution/exercise-runtimeparams/main.cc b/exercises/solution/exercise-runtimeparams/main.cc index 0a3bf24f..25300dd3 100644 --- a/exercises/solution/exercise-runtimeparams/main.cc +++ b/exercises/solution/exercise-runtimeparams/main.cc @@ -24,33 +24,23 @@ #include <iostream> -#include <dune/common/parallel/mpihelper.hh> -#include <dune/common/timer.hh> -#include <dune/grid/io/file/dgfparser/dgfexception.hh> -#include <dune/grid/io/file/vtk.hh> - +#include <dumux/common/initialize.hh> #include <dumux/common/properties.hh> #include <dumux/common/parameters.hh> -#include <dumux/common/defaultusagemessage.hh> -#include <dumux/linear/amgbackend.hh> +#include <dumux/linear/istlsolvers.hh> +#include <dumux/linear/linearalgebratraits.hh> #include <dumux/linear/linearsolvertraits.hh> #include <dumux/nonlinear/newtonsolver.hh> #include <dumux/assembly/fvassembler.hh> -#include <dumux/assembly/diffmethod.hh> - -#include <dumux/discretization/method.hh> #include <dumux/io/vtkoutputmodule.hh> -#include <dumux/io/grid/gridmanager.hh> +#include <dumux/io/grid/gridmanager_yasp.hh> // The properties file, where compile time definitions are made #include "properties.hh" -//////////////////////// -// the main function -//////////////////////// int main(int argc, char** argv) { using namespace Dumux; @@ -58,10 +48,8 @@ int main(int argc, char** argv) // define the type tag for this problem using TypeTag = Properties::TTag::Injection2pCC; - // initialize MPI, finalize is done automatically on exit - const auto& mpiHelper = Dune::MPIHelper::instance(argc, argv); - - // print dumux start message + // initialize MPI+x, finalize is done automatically on exit + Dumux::initialize(argc, argv); // parse command line arguments and input file Parameters::init(argc, argv); @@ -121,8 +109,8 @@ int main(int argc, char** argv) auto assembler = std::make_shared<Assembler>(problem, gridGeometry, gridVariables, timeLoop, xOld); // the linear solver - using LinearSolver = AMGBiCGSTABBackend<LinearSolverTraits<GridGeometry>>; - auto linearSolver = std::make_shared<LinearSolver>(leafGridView, gridGeometry->dofMapper()); + using LinearSolver = AMGBiCGSTABIstlSolver<LinearSolverTraits<GridGeometry>, LinearAlgebraTraitsFromAssembler<Assembler>>; + auto linearSolver = std::make_shared<LinearSolver>(gridGeometry->gridView(), gridGeometry->dofMapper()); // the non-linear solver using NewtonSolver = Dumux::NewtonSolver<Assembler, LinearSolver>; @@ -132,10 +120,7 @@ int main(int argc, char** argv) timeLoop->start(); while (!timeLoop->finished()) { - // set previous solution for storage evaluations - assembler->setPreviousSolution(xOld); - - //set time in problem (is used in time-dependent Neumann boundary condition) + // set time in problem (is used in time-dependent Neumann boundary condition) problem->setTime(timeLoop->time()+timeLoop->timeStepSize()); // solve the non-linear system with time step control @@ -160,15 +145,8 @@ int main(int argc, char** argv) timeLoop->finalize(leafGridView.comm()); - //////////////////////////////////////////////////////////// - // finalize, print dumux message to say goodbye - //////////////////////////////////////////////////////////// - - // print dumux end message - if (mpiHelper.rank() == 0) - { + if (leafGridView.comm().rank() == 0) Parameters::print(); - } return 0; } // end main -- GitLab