From fe929f17e98b577171f58ca520b5145be41730ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20Gr=C3=BCninger?= Date: Thu, 16 Mar 2023 19:48:40 +0100 Subject: [PATCH] Adjust sequential and both parallel cases in istl-solver-playground Do same thing, independent of paralellel, distributed, or sequential. This fixes the test in the sequential case. --- src/istl-solver-playground.hh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/istl-solver-playground.hh b/src/istl-solver-playground.hh index 0ff3abd5..11693cf5 100644 --- a/src/istl-solver-playground.hh +++ b/src/istl-solver-playground.hh @@ -66,7 +66,11 @@ std::shared_ptr loadSystem(std::shared_ptr& m, std::shared_ptr oocomm; if(distributed){ oocomm = std::make_shared(MPI_COMM_WORLD); - loadMatrixMarket(*m, matrixfilename, *oocomm); + if(matrixfilename != "laplacian"){ + loadMatrixMarket(*m, matrixfilename, *oocomm); + }else{ + setupLaplacian(*m, config.get("N", 20)); + } if(config.get("random_rhs", false)){ rhs->resize(m->N()); srand(42); @@ -98,16 +102,22 @@ template void loadSystem(std::shared_ptr& m, std::shared_ptr& rhs, const Dune::ParameterTree& config){ - std::string matrixfilename = config.get("matrix"); + // generate Laplacian or load matrix + std::string matrixfilename = config.get("matrix", "laplacian"); + if(matrixfilename == "laplacian"){ + setupLaplacian(*m, config.get("N", 20)); + }else{ + loadMatrixMarket(*m, matrixfilename); + } + // use random values or load right-hand side std::string rhsfilename; - if(!config.get("random_rhs", false)) - rhsfilename = config.get("rhs"); - loadMatrixMarket(*m, matrixfilename); if(config.get("random_rhs", false)){ rhs->resize(m->N()); fillRandom(*rhs); - }else + }else{ + rhsfilename = config.get("rhs"); loadMatrixMarket(*rhs, rhsfilename); + } } #endif -- 2.39.2 class='nohover'>AgeCommit message (Expand)Author 2015-07-19AUTHORS: Remove the hand-made list of people....* AUTHORS: Remove the list of people, and add a note saying that this file is meant to be generated. Ludovic Courtès 2015-07-04Clean up 'THANKS' and 'AUTHORS'....* THANKS: Add Konrad Hinsen, Cyprien Nicolas, Yakkala Yagnesh Raghava and Alexander Shendi. Remove Federico Beffa, Marek Benc, John Darrington, rekado, Cyrill Schenkel and Andy Wingo because they are placed in AUTHORS. Move Amirouche Boubekki and Alex Kost to ... * AUTHORS: ... here. Add Arne Babenhauserheide, Ian Denhardt, Kevin Lemonnier, Mathieu Lirzin, Pierre-Antoine Rault and Ben Woodcroft. Fix some names and emails. Alex Kost 2015-06-27Add Claes Wallin to 'AUTHORS'.Alex Kost 2015-04-26gnu: Add guile-minikanren....* gnu/packages/guile.scm (guile-minikanren): New variable. Christopher Allan Webber 2015-04-05Add Andy to 'AUTHORS'.Ludovic Courtès