diff --git a/dune/istl/basearray.hh b/dune/istl/basearray.hh index fd99d1aa7b5aaf89e9b7e9f489dd4c3147b8f75a..ffa8dc963181d5b493b906865923a2f5f5e45be4 100644 --- a/dune/istl/basearray.hh +++ b/dune/istl/basearray.hh @@ -5,7 +5,7 @@ #ifndef DUNE_ISTL_BASEARRAY_HH #define DUNE_ISTL_BASEARRAY_HH -#include "assert.h" +#include <cassert> #include <cmath> #include <cstddef> #include <memory> diff --git a/dune/istl/novlpschwarz.hh b/dune/istl/novlpschwarz.hh index bf2f2ce2d235e99f7ec3fd11c7b0bdd6d5e8fa4c..61d9755212618324e062e282d58cf5b001689f35 100644 --- a/dune/istl/novlpschwarz.hh +++ b/dune/istl/novlpschwarz.hh @@ -132,7 +132,7 @@ namespace Dune { // at the beginning make a multimap "bordercontribution". // process has i and j as border dofs but is not the owner // => only contribute to Ax if i,j is in bordercontribution - if (buildcomm == true) { + if (buildcomm) { // set up mask vector if (mask.size()!=static_cast<typename std::vector<double>::size_type>(x.size())) { @@ -188,7 +188,7 @@ namespace Dune { flag = false; continue; } - if (flag == false) + if (!flag) continue; } // don´t contribute to Ax if @@ -198,7 +198,7 @@ namespace Dune { // as interor/border dofs // if the owner of j does not have i as interior/border dof, // it will not be taken into account - if (flag==true) + if (flag) bordercontribution.insert(std::pair<int,int>(i.index(),j.index())); } } diff --git a/dune/istl/overlappingschwarz.hh b/dune/istl/overlappingschwarz.hh index ce4f615f041aae1934cd106d8a5c292172f75699..2c2d4a862c3ae97e8aa47714fdd96d20ce6f640a 100644 --- a/dune/istl/overlappingschwarz.hh +++ b/dune/istl/overlappingschwarz.hh @@ -186,11 +186,11 @@ namespace Dune size_t sz = rowset.size(); A.resize(sz*n,sz*n); typedef typename S::const_iterator SIter; - size_t r = 0, c = 0; + size_t r = 0; for(SIter rowIdx = rowset.begin(), rowEnd=rowset.end(); rowIdx!= rowEnd; ++rowIdx, r++) { - c = 0; + size_t c = 0; for(SIter colIdx = rowset.begin(), colEnd=rowset.end(); colIdx!= colEnd; ++colIdx, c++) { diff --git a/dune/istl/owneroverlapcopy.hh b/dune/istl/owneroverlapcopy.hh index 8cebc0e8bfb9a8e5b6bfd3fb63e1e8e913b004b5..ebd27450210fe87f6559a1237a06aea6a09ae2a8 100644 --- a/dune/istl/owneroverlapcopy.hh +++ b/dune/istl/owneroverlapcopy.hh @@ -13,7 +13,7 @@ #include <set> #include <tuple> -#include "cmath" +#include <cmath> // MPI header #if HAVE_MPI @@ -656,19 +656,17 @@ namespace Dune { if (OwnerCopyToOwnerCopyInterfaceBuilt) OwnerCopyToOwnerCopyInterface.free(); if (CopyToAllInterfaceBuilt) CopyToAllInterface.free(); if (globalLookup_) delete globalLookup_; - if (freecomm==true) - if(comm!=MPI_COMM_NULL) - { -#ifdef MPI_2 - // If it is possible to query whether MPI_Finalize - // was called, only free the communicator before - // calling MPI_Finalize. - int wasFinalized = 0; - MPI_Finalized( &wasFinalized ); - if(!wasFinalized) -#endif + if (freecomm && (comm != MPI_COMM_NULL)) + { + // If it is possible to query whether MPI_Finalize + // was called, only free the communicator before + // calling MPI_Finalize. + int wasFinalized = 0; + MPI_Finalized(&wasFinalized); + if (!wasFinalized) { MPI_Comm_free(&comm); } + } } private: diff --git a/dune/istl/paamg/matrixhierarchy.hh b/dune/istl/paamg/matrixhierarchy.hh index ec21cf86ca0e941339936fc47aabd1e30609fbab..6f62666c2e2abde1053879b950ef0200755f3df0 100644 --- a/dune/istl/paamg/matrixhierarchy.hh +++ b/dune/istl/paamg/matrixhierarchy.hh @@ -683,8 +683,8 @@ namespace Dune if(level==criterion.maxLevel()) { BIGINT unknownsLevel = mlevel->getmat().N(); unknownsLevel = infoLevel->communicator().sum(unknownsLevel); - double dunknownsLevel = unknownsLevel.todouble(); if(rank==0 && criterion.debugLevel()>1) { + double dunknownsLevel = unknownsLevel.todouble(); std::cout<<"Level "<<level<<" has "<<dunknownsLevel<<" unknowns, "<<dunknownsLevel/infoLevel->communicator().size() <<" unknowns per proc (procs="<<infoLevel->communicator().size()<<")"<<std::endl; } diff --git a/dune/istl/paamg/test/anisotropic.hh b/dune/istl/paamg/test/anisotropic.hh index 958077aea9c409240ea64a35d6a7293f982bbfaf..7efdad9309c025408facafea8808f5007c7ed083 100644 --- a/dune/istl/paamg/test/anisotropic.hh +++ b/dune/istl/paamg/test/anisotropic.hh @@ -35,19 +35,16 @@ void setupPattern(int N, M& mat, Dune::ParallelIndexSet<G,L,s>& indices, int ove for(int j=0; j < N; j++) for(int i=overlapStart; i < overlapEnd; i++, ++iter) { - int global = j*N+i; GridFlag flag = GridAttributes::owner; - bool isPublic = false; if((i<start && i > 0) || (i>= end && i < N-1)) flag=GridAttributes::copy; if(i<start+1 || i>= end-1) { - isPublic = true; - indices.add(global, LocalIndex(iter.index(), flag, isPublic)); + int global = j*N+i; + indices.add(global, LocalIndex(iter.index(), flag, true)); } - iter.insert(iter.index()); // i direction diff --git a/dune/istl/paamg/test/fastamg.cc b/dune/istl/paamg/test/fastamg.cc index 861e9f1b10c4118b6ca0ed0f00f2e2ae64a15244..952919a00aa2d717107a2dd1515143bf85641044 100644 --- a/dune/istl/paamg/test/fastamg.cc +++ b/dune/istl/paamg/test/fastamg.cc @@ -88,7 +88,6 @@ void testAMG(int N, int coarsenTarget, int ml) criterion.setMaxLevel(ml); criterion.setSkipIsolated(false); - Dune::SeqScalarProduct<Vector> sp; typedef Dune::Amg::FastAMG<Operator,Vector> AMG; Dune::Amg::Parameters params; diff --git a/dune/istl/superlufunctions.hh b/dune/istl/superlufunctions.hh index 12d31039e7b3c09d7bffad82d264502293971aed..cc2406fc6dc9581351b375f9136681432593d1b9 100644 --- a/dune/istl/superlufunctions.hh +++ b/dune/istl/superlufunctions.hh @@ -8,8 +8,8 @@ #define int_t SUPERLU_INT_TYPE -#include "supermatrix.h" -#include "slu_util.h" +#include <supermatrix.h> +#include <slu_util.h> #undef int_t #if __has_include("slu_sdefs.h") diff --git a/dune/istl/test/solverfactorytest.cc.in b/dune/istl/test/solverfactorytest.cc.in index 39ecf3cdae0aebd2acba00b6b3bb09ff8efd85ea..c5a519ff7d0a7ac5140069bbe033d1d538a5eae8 100644 --- a/dune/istl/test/solverfactorytest.cc.in +++ b/dune/istl/test/solverfactorytest.cc.in @@ -60,7 +60,7 @@ void testSeq(const Dune::ParameterTree& config, Comm c){ using Operator = Dune::MatrixAdapter<Matrix, Vector, Vector>; std::shared_ptr<Operator> op = std::make_shared<Operator>(mat); - for(std::string test : config.getSubKeys()){ + for(const std::string& test : config.getSubKeys()){ Dune::ParameterTree solverConfig = config.sub(test); std::cout << " ============== " << test << " ============== " << std::endl; try{ @@ -96,7 +96,7 @@ void testOverlapping(const Dune::ParameterTree& config, Comm c){ std::shared_ptr<Operator> op = std::make_shared<Operator>(mat, comm); - for(std::string test : config.getSubKeys()){ + for(const std::string& test : config.getSubKeys()){ Dune::ParameterTree solverConfig = config.sub(test); std::cout << " ============== " << test << " ============== " << std::endl; try{ @@ -131,7 +131,7 @@ void testNonoverlapping(const Dune::ParameterTree& config, Comm c){ std::shared_ptr<Operator> op = std::make_shared<Operator>(mat, comm); - for(std::string test : config.getSubKeys()){ + for(const std::string& test : config.getSubKeys()){ Dune::ParameterTree solverConfig = config.sub(test); std::cout << " ============== " << test << " ============== " << std::endl; try{