diff --git a/dumux/io/vtkoutputmodule.hh b/dumux/io/vtkoutputmodule.hh index 083deb6cf302f5162bb204bf04484fa7c408e2d9..034e8fc293263de186e01ed44f17910828a7a052 100644 --- a/dumux/io/vtkoutputmodule.hh +++ b/dumux/io/vtkoutputmodule.hh @@ -86,8 +86,6 @@ class VtkOutputModule struct PriVarVectorDataInfo { std::vector<unsigned int> pvIdx; std::string name; }; struct SecondVarScalarDataInfo { std::function<Scalar(const VolumeVariables&)> get; std::string name; }; - const std::string modelParamGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); - public: VtkOutputModule(const Problem& problem, @@ -222,6 +220,7 @@ public: // maybe allocate space for the process rank std::vector<Scalar> rank; + static const std::string modelParamGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); static bool addProcessRank = getParamFromGroup<bool>(modelParamGroup, "Vtk.AddProcessRank"); if (addProcessRank) rank.resize(numCells); diff --git a/dumux/linear/amgbackend.hh b/dumux/linear/amgbackend.hh index 01cf1e44cfeecac72270e7f667be137409605158..7a605961380826d7b5e128984fc0173fb99c5f60 100644 --- a/dumux/linear/amgbackend.hh +++ b/dumux/linear/amgbackend.hh @@ -86,9 +86,6 @@ class AMGBackend using AMGType = Dune::Amg::AMG<typename AmgTraits::LinearOperator, VType, Smoother,Comm>; using BCRSMat = typename AmgTraits::LinearOperator::matrix_type; using DofMapper = typename AmgTraits::DofMapper; - - const std::string modelParamGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); - public: /*! * \brief Construct the backend. @@ -112,9 +109,10 @@ public: template<class Matrix, class Vector> bool solve(Matrix& A, Vector& x, Vector& b) { - const int verbosity = getParamFromGroup<int>(modelParamGroup, "LinearSolver.Verbosity"); - const int maxIter = getParamFromGroup<int>(modelParamGroup, "LinearSolver.MaxIterations"); - const double residReduction = getParamFromGroup<double>(modelParamGroup, "LinearSolver.ResidualReduction"); + static const auto modelParamGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); + static const int verbosity = getParamFromGroup<int>(modelParamGroup, "LinearSolver.Verbosity"); + static const int maxIter = getParamFromGroup<int>(modelParamGroup, "LinearSolver.MaxIterations"); + static const double residReduction = getParamFromGroup<double>(modelParamGroup, "LinearSolver.ResidualReduction"); int rank = 0; std::shared_ptr<Comm> comm; diff --git a/dumux/linear/seqsolverbackend.hh b/dumux/linear/seqsolverbackend.hh index e024a4d9f3a5d03fb90afc1caccaeb4774894f0e..1ada67218fff0a76cb3444fd2d8699c5ee673532 100644 --- a/dumux/linear/seqsolverbackend.hh +++ b/dumux/linear/seqsolverbackend.hh @@ -189,12 +189,12 @@ public: template <class TypeTag> class ILUnBiCGSTABBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqILUn<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::BiCGSTABSolver<Vector>; @@ -228,12 +228,12 @@ public: template <class TypeTag> class SORBiCGSTABBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqSOR<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::BiCGSTABSolver<Vector>; @@ -267,12 +267,12 @@ public: template <class TypeTag> class SSORBiCGSTABBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqSSOR<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::BiCGSTABSolver<Vector>; @@ -306,12 +306,12 @@ public: template <class TypeTag> class GSBiCGSTABBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqGS<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::BiCGSTABSolver<Vector>; @@ -344,12 +344,12 @@ public: template <class TypeTag> class JacBiCGSTABBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqJac<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::BiCGSTABSolver<Vector>; @@ -382,12 +382,12 @@ public: template <class TypeTag> class ILUnCGBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqILUn<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::CGSolver<Vector>; @@ -420,12 +420,12 @@ public: template <class TypeTag> class SORCGBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqSOR<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::CGSolver<Vector>; @@ -458,12 +458,12 @@ public: template <class TypeTag> class SSORCGBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqSSOR<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::CGSolver<Vector>; @@ -496,12 +496,12 @@ public: template <class TypeTag> class GSCGBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqGS<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::CGSolver<Vector>; @@ -533,12 +533,12 @@ public: template <class TypeTag> class JacCGBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqJac<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::CGSolver<Vector>; @@ -572,12 +572,12 @@ public: template <class TypeTag> class SSORRestartedGMResBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqSSOR<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::RestartedGMResSolver<Vector>; @@ -610,12 +610,12 @@ public: template <class TypeTag> class ILU0BiCGSTABBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqILU0<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::BiCGSTABSolver<Vector>; @@ -647,12 +647,12 @@ public: template <class TypeTag> class ILU0CGBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqILU0<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::CGSolver<Vector>; @@ -685,12 +685,12 @@ public: template <class TypeTag> class ILU0RestartedGMResBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqILU0<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::RestartedGMResSolver<Vector>; @@ -724,13 +724,13 @@ public: template <class TypeTag> class ILUnRestartedGMResBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); - enum { blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel) }; public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); + constexpr auto blockLevel = GET_PROP_VALUE(TypeTag, LinearSolverPreconditionerBlockLevel); using Preconditioner = Dune::SeqILUn<Matrix, Vector, Vector, blockLevel>; using Solver = Dune::RestartedGMResSolver<Vector>; @@ -750,13 +750,13 @@ public: template <class TypeTag> class SuperLUBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); - enum { blockSize = GET_PROP_VALUE(TypeTag, LinearSolverBlockSize) }; public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); + constexpr auto blockSize = GET_PROP_VALUE(TypeTag, LinearSolverBlockSize); using MatrixBlock = typename Dune::FieldMatrix<double, blockSize, blockSize>; using ISTLMatrix = typename Dune::BCRSMatrix<MatrixBlock>; static_assert(std::is_same<Matrix, ISTLMatrix>::value, "SuperLU only works with BCRS matrices!"); @@ -812,13 +812,13 @@ private: template <class TypeTag> class UMFPackBackend { - const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); - enum { blockSize = GET_PROP_VALUE(TypeTag, LinearSolverBlockSize) }; public: template<class Matrix, class Vector> bool solve(const Matrix& A, Vector& x, const Vector& b) { + static const std::string paramGroup = GET_PROP_VALUE(TypeTag, ModelParameterGroup); + constexpr auto blockSize = GET_PROP_VALUE(TypeTag, LinearSolverBlockSize); using MatrixBlock = typename Dune::FieldMatrix<double, blockSize, blockSize>; using ISTLMatrix = typename Dune::BCRSMatrix<MatrixBlock>; static_assert(std::is_same<Matrix, ISTLMatrix>::value, "UMFPack only works with BCRS matrices!");