Commit 1b9c2722 authored by Timo Koch's avatar Timo Koch Committed by Dennis Gläser
Browse files

[seqsolver] Fix compiler issue with gcc 5.4

parent c2870005
......@@ -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);
......
......@@ -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;
......
......@@ -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!");
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment