diff --git a/dune/istl/bcrsmatrix.hh b/dune/istl/bcrsmatrix.hh index e11fb5690b7d82ac8fb79ea265cba5c12da4f86f..fedb8c74ec8f157f935c6a9f2b2c9db2517974a7 100644 --- a/dune/istl/bcrsmatrix.hh +++ b/dune/istl/bcrsmatrix.hh @@ -21,7 +21,6 @@ #include <dune/common/iteratorfacades.hh> #include <dune/common/typetraits.hh> #include <dune/common/ftraits.hh> -#include <dune/common/static_assert.hh> /*! \file * \brief Implementation of the BCRSMatrix class diff --git a/dune/istl/bvector.hh b/dune/istl/bvector.hh index 088db02e8719c74b8614b81ac94e2fe126d1044a..468b29fb217449e4daf091c82dd8406bf042180a 100644 --- a/dune/istl/bvector.hh +++ b/dune/istl/bvector.hh @@ -9,7 +9,6 @@ #include <memory> #include <limits> -#include <dune/common/static_assert.hh> #include <dune/common/promotiontraits.hh> #include <dune/common/dotproduct.hh> #include <dune/common/ftraits.hh> @@ -318,7 +317,7 @@ namespace Dune { template<typename S> BlockVector (size_type _n, S _capacity) { - dune_static_assert( (std::numeric_limits<S>::is_integer), + static_assert(std::numeric_limits<S>::is_integer, "capacity must be an unsigned integral type (be aware, that this constructor does not set the default value!)" ); size_type capacity = _capacity; this->n = _n; diff --git a/dune/istl/matrixutils.hh b/dune/istl/matrixutils.hh index c08c8dc24cad8204c6967b7777e0593823b687f7..8a64d747a42b73f486684220f06ad19779090945 100644 --- a/dune/istl/matrixutils.hh +++ b/dune/istl/matrixutils.hh @@ -7,7 +7,6 @@ #include <vector> #include <limits> #include <dune/common/typetraits.hh> -#include <dune/common/static_assert.hh> #include <dune/common/fmatrix.hh> #include <dune/common/diagonalmatrix.hh> #include <dune/common/unused.hh> diff --git a/dune/istl/paamg/amg.hh b/dune/istl/paamg/amg.hh index 66b334d4dcf480add458ed9af082f6fa893c8749..3daaa21f913aff41f14810b3c69c2629dbb639e6 100644 --- a/dune/istl/paamg/amg.hh +++ b/dune/istl/paamg/amg.hh @@ -411,10 +411,10 @@ namespace Dune additive(additive_), coarsesolverconverged(true), coarseSmoother_(), verbosity_(criterion.debugLevel()) { - dune_static_assert(static_cast<int>(M::category)==static_cast<int>(S::category), - "Matrix and Solver must match in terms of category!"); + static_assert(static_cast<int>(M::category)==static_cast<int>(S::category), + "Matrix and Solver must match in terms of category!"); // TODO: reestablish compile time checks. - //dune_static_assert(static_cast<int>(PI::category)==static_cast<int>(S::category), + //static_assert(static_cast<int>(PI::category)==static_cast<int>(S::category), // "Matrix and Solver must match in terms of category!"); createHierarchies(criterion, const_cast<Operator&>(matrix), pinfo); } @@ -433,10 +433,10 @@ namespace Dune additive(criterion.getAdditive()), coarsesolverconverged(true), coarseSmoother_(), verbosity_(criterion.debugLevel()) { - dune_static_assert(static_cast<int>(M::category)==static_cast<int>(S::category), + static_assert(static_cast<int>(M::category)==static_cast<int>(S::category), "Matrix and Solver must match in terms of category!"); // TODO: reestablish compile time checks. - //dune_static_assert(static_cast<int>(PI::category)==static_cast<int>(S::category), + //static_assert(static_cast<int>(PI::category)==static_cast<int>(S::category), // "Matrix and Solver must match in terms of category!"); createHierarchies(criterion, const_cast<Operator&>(matrix), pinfo); } diff --git a/dune/istl/paamg/fastamg.hh b/dune/istl/paamg/fastamg.hh index 5f58ed77975def0b5141d694d57f61dea8ee18ab..4f3d761c4e109392f42053e7c6ebcb847471403c 100644 --- a/dune/istl/paamg/fastamg.hh +++ b/dune/istl/paamg/fastamg.hh @@ -319,7 +319,8 @@ namespace Dune preSteps_=postSteps_=0; } assert(matrices_->isBuilt()); - dune_static_assert((is_same<PI,SequentialInformation>::value), "Currently only sequential runs are supported"); + static_assert(is_same<PI,SequentialInformation>::value, + "Currently only sequential runs are supported"); } template<class M, class X, class PI, class A> template<class C> @@ -339,9 +340,10 @@ namespace Dune std::cerr<<"WARNING only one step of smoothing is supported!"<<std::endl; preSteps_=postSteps_=1; } - dune_static_assert((is_same<PI,SequentialInformation>::value), "Currently only sequential runs are supported"); + static_assert(is_same<PI,SequentialInformation>::value, + "Currently only sequential runs are supported"); // TODO: reestablish compile time checks. - //dune_static_assert(static_cast<int>(PI::category)==static_cast<int>(S::category), + //static_assert(static_cast<int>(PI::category)==static_cast<int>(S::category), // "Matrix and Solver must match in terms of category!"); createHierarchies(criterion, const_cast<Operator&>(matrix), pinfo); } diff --git a/dune/istl/paamg/hierarchy.hh b/dune/istl/paamg/hierarchy.hh index 2ba34ef42d5b894b5d7805fd84b70f3648798fcb..e437a3d7971369898213f0c6e379707585002824 100644 --- a/dune/istl/paamg/hierarchy.hh +++ b/dune/istl/paamg/hierarchy.hh @@ -663,13 +663,13 @@ namespace Dune : matrices_(const_cast<MatrixOperator&>(fineOperator)), parallelInformation_(const_cast<ParallelInformation&>(pinfo)) { - dune_static_assert((static_cast<int>(MatrixOperator::category) == - static_cast<int>(SolverCategory::sequential) || - static_cast<int>(MatrixOperator::category) == - static_cast<int>(SolverCategory::overlapping) || - static_cast<int>(MatrixOperator::category) == - static_cast<int>(SolverCategory::nonoverlapping)), - "MatrixOperator must be of category sequential or overlapping or nonoverlapping"); + static_assert((static_cast<int>(MatrixOperator::category) == + static_cast<int>(SolverCategory::sequential) + || static_cast<int>(MatrixOperator::category) == + static_cast<int>(SolverCategory::overlapping) + || static_cast<int>(MatrixOperator::category) == + static_cast<int>(SolverCategory::nonoverlapping)), + "MatrixOperator must be of category sequential or overlapping or nonoverlapping"); if (static_cast<int>(MatrixOperator::category) != static_cast<int>(pinfo.getSolverCategory())) DUNE_THROW(ISTLError, "MatrixOperator and ParallelInformation must belong to the same category!"); diff --git a/dune/istl/solvers.hh b/dune/istl/solvers.hh index 1bc9935f3277055a2cacfc262c16b17eac9604e1..125149c33ae28440c7808b6e725fa44f017f1fc5 100644 --- a/dune/istl/solvers.hh +++ b/dune/istl/solvers.hh @@ -19,7 +19,6 @@ #include <dune/common/timer.hh> #include <dune/common/ftraits.hh> #include <dune/common/shared_ptr.hh> -#include <dune/common/static_assert.hh> namespace Dune { /** @defgroup ISTL_Solvers Iterative Solvers @@ -85,10 +84,10 @@ namespace Dune { double reduction, int maxit, int verbose) : ssp(), _op(op), _prec(prec), _sp(ssp), _reduction(reduction), _maxit(maxit), _verbose(verbose) { - dune_static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P have to have the same category!"); - dune_static_assert(static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), - "L has to be sequential!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P have to have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), + "L has to be sequential!"); } /** @@ -116,10 +115,10 @@ namespace Dune { double reduction, int maxit, int verbose) : _op(op), _prec(prec), _sp(sp), _reduction(reduction), _maxit(maxit), _verbose(verbose) { - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P must have the same category!"); - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(S::category), - "L and S must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(S::category), + "L and S must have the same category!"); } @@ -242,10 +241,10 @@ namespace Dune { double reduction, int maxit, int verbose) : ssp(), _op(op), _prec(prec), _sp(ssp), _reduction(reduction), _maxit(maxit), _verbose(verbose) { - dune_static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P have to have the same category!"); - dune_static_assert(static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), - "L has to be sequential!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P have to have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), + "L has to be sequential!"); } /*! \brief Set up solver. @@ -257,10 +256,10 @@ namespace Dune { double reduction, int maxit, int verbose) : _op(op), _prec(prec), _sp(sp), _reduction(reduction), _maxit(maxit), _verbose(verbose) { - dune_static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P have to have the same category!"); - dune_static_assert(static_cast<int>(L::category) == static_cast<int>(S::category), - "L and S have to have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P have to have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(S::category), + "L and S have to have the same category!"); } /*! @@ -375,10 +374,10 @@ namespace Dune { CGSolver (L& op, P& prec, double reduction, int maxit, int verbose) : ssp(), _op(op), _prec(prec), _sp(ssp), _reduction(reduction), _maxit(maxit), _verbose(verbose) { - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P must have the same category!"); - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), - "L must be sequential!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), + "L must be sequential!"); } /*! \brief Set up conjugate gradient solver. @@ -389,10 +388,10 @@ namespace Dune { CGSolver (L& op, S& sp, P& prec, double reduction, int maxit, int verbose) : _op(op), _prec(prec), _sp(sp), _reduction(reduction), _maxit(maxit), _verbose(verbose) { - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P must have the same category!"); - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(S::category), - "L and S must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(S::category), + "L and S must have the same category!"); } /*! @@ -546,8 +545,10 @@ namespace Dune { double reduction, int maxit, int verbose) : ssp(), _op(op), _prec(prec), _sp(ssp), _reduction(reduction), _maxit(maxit), _verbose(verbose) { - dune_static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), "L and P must be of the same category!"); - dune_static_assert(static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), "L must be sequential!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P must be of the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), + "L must be sequential!"); } /*! \brief Set up solver. @@ -559,10 +560,10 @@ namespace Dune { double reduction, int maxit, int verbose) : _op(op), _prec(prec), _sp(sp), _reduction(reduction), _maxit(maxit), _verbose(verbose) { - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P must have the same category!"); - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(S::category), - "L and S must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(S::category), + "L and S must have the same category!"); } /*! @@ -813,10 +814,10 @@ namespace Dune { MINRESSolver (L& op, P& prec, double reduction, int maxit, int verbose) : ssp(), _op(op), _prec(prec), _sp(ssp), _reduction(reduction), _maxit(maxit), _verbose(verbose) { - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P must have the same category!"); - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), - "L must be sequential!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), + "L must be sequential!"); } /*! \brief Set up MINRES solver. @@ -827,10 +828,10 @@ namespace Dune { MINRESSolver (L& op, S& sp, P& prec, double reduction, int maxit, int verbose) : _op(op), _prec(prec), _sp(sp), _reduction(reduction), _maxit(maxit), _verbose(verbose) { - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P must have the same category!"); - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(S::category), - "L and S must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(S::category), + "L and S must have the same category!"); } /*! @@ -1079,10 +1080,10 @@ namespace Dune { _reduction(reduction), _maxit(maxit), _verbose(verbose), _recalc_defect(recalc_defect) { - dune_static_assert(static_cast<int>(P::category) == static_cast<int>(L::category), - "P and L must be the same category!"); - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), - "L must be sequential!"); + static_assert(static_cast<int>(P::category) == static_cast<int>(L::category), + "P and L must be the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(SolverCategory::sequential), + "L must be sequential!"); } /*! @@ -1099,10 +1100,10 @@ namespace Dune { _reduction(reduction), _maxit(maxit), _verbose(verbose), _recalc_defect(recalc_defect) { - dune_static_assert(static_cast<int>(P::category) == static_cast<int>(L::category), - "P and L must have the same category!"); - dune_static_assert(static_cast<int>(P::category) == static_cast<int>(S::category), - "P and S must have the same category!"); + static_assert(static_cast<int>(P::category) == static_cast<int>(L::category), + "P and L must have the same category!"); + static_assert(static_cast<int>(P::category) == static_cast<int>(S::category), + "P and S must have the same category!"); } //! \copydoc InverseOperator::apply(X&,Y&,InverseOperatorResult&) @@ -1384,11 +1385,11 @@ namespace Dune { ssp(), _op(op), _prec(prec), _sp(ssp), _reduction(reduction), _maxit(maxit), _verbose(verbose), _restart(std::min(maxit,restart)) { - dune_static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P have to have the same category!"); - dune_static_assert(static_cast<int>(L::category) == - static_cast<int>(SolverCategory::sequential), - "L has to be sequential!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P have to have the same category!"); + static_assert(static_cast<int>(L::category) == + static_cast<int>(SolverCategory::sequential), + "L has to be sequential!"); } /*! \brief Set up nonlinear preconditioned conjugate gradient solver. @@ -1403,10 +1404,10 @@ namespace Dune { _op(op), _prec(prec), _sp(sp), _reduction(reduction), _maxit(maxit), _verbose(verbose), _restart(std::min(maxit,restart)) { - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(P::category), - "L and P must have the same category!"); - dune_static_assert( static_cast<int>(L::category) == static_cast<int>(S::category), - "L and S must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(P::category), + "L and P must have the same category!"); + static_assert(static_cast<int>(L::category) == static_cast<int>(S::category), + "L and S must have the same category!"); } /*! \brief Apply inverse operator. diff --git a/dune/istl/test/complexrhstest.cc b/dune/istl/test/complexrhstest.cc index d1a9ee073e530c9afed72a7842a7985123b934cd..57b1156d8964581f8f7da6069e549b325b32774c 100644 --- a/dune/istl/test/complexrhstest.cc +++ b/dune/istl/test/complexrhstest.cc @@ -33,9 +33,8 @@ #include "laplacian.hh" #if HAVE_SUPERLU -#include <dune/common/static_assert.hh> #include <dune/istl/superlu.hh> -dune_static_assert(SUPERLU_NTYPE==3,"If SuperLU is selected for complex rhs test, then SUPERLU_NTYPE must be set to 3 (std::complex<double>)!"); +static_assert(SUPERLU_NTYPE==3, "If SuperLU is selected for complex rhs test, then SUPERLU_NTYPE must be set to 3 (std::complex<double>)!"); #endif diff --git a/dune/istl/test/dotproducttest.cc b/dune/istl/test/dotproducttest.cc index b097a37789ceffc907be710bdfd67d7d15ab5c6d..556d8987032d4d9ce1cb2c2cbe54a9d467464e74 100644 --- a/dune/istl/test/dotproducttest.cc +++ b/dune/istl/test/dotproducttest.cc @@ -13,10 +13,8 @@ int DotProductTest(const size_t numBlocks,const size_t blockSizeOrCapacity) { typedef typename ComplexBlockVector::field_type ct; const rt myEps((rt)1e-6); - dune_static_assert( - ( Dune::is_same< typename Dune::FieldTraits<rt>::real_type, rt>::value ), - "DotProductTest requires real data type for first block vector!" - ); + static_assert(Dune::is_same< typename Dune::FieldTraits<rt>::real_type, rt>::value, + "DotProductTest requires real data type for first block vector!"); const bool secondBlockIsComplex = !Dune::is_same< typename Dune::FieldTraits<ct>::real_type, ct>::value;