Commit 8be40771 authored by Timo Koch's avatar Timo Koch Committed by Dennis Gläser
Browse files

[next] Adapt linear solver constructors and parameters

parent 7765f79c
......@@ -223,7 +223,7 @@ public:
{
// try to pass first argument as parameter file
parameterFileName = argv[1];
break;
continue;
}
if (argv[i][0] != '-')
......@@ -331,7 +331,7 @@ private:
params["LinearSolver.MaxIterations"] = "250";
params["LinearSolver.PreconditionerIterations"] = "1";
params["LinearSolver.PreconditionerRelaxation"] = "1.0";
params["LinearSolver.ResidualReduction"] = "1e-6";
params["LinearSolver.ResidualReduction"] = "1e-13";
params["LinearSolver.Verbosity"] = "0";
// parameters in the problem group
......@@ -341,7 +341,7 @@ private:
params["Newton.TargetSteps"] = "16";
// parameters in the time loop group
params["TimeLoop.MaxTimeStepSize"] = std::to_string(std::numeric_limits<double>::max());
params["TimeLoop.MaxTimeStepSize"] = "1e300";
params["TimeLoop.MaxTimeStepDivisions"] = "10";
// parameters in the vtk group
......
......@@ -148,7 +148,7 @@ struct InstationaryNonLinearSimulationImpl<TypeTag, DiscretizationMethods::CCTpf
// the linear solver
using LinearSolver = typename GET_PROP_TYPE(TypeTag, LinearSolver);
auto linearSolver = std::make_shared<LinearSolver>();
auto linearSolver = std::make_shared<LinearSolver>(leafGridView, fvGridGeometry->elementMapper());
// the non-linear solver
using NewtonController = Dumux::NewtonController<TypeTag>;
......@@ -293,7 +293,7 @@ struct InstationaryNonLinearSimulationImpl<TypeTag, DiscretizationMethods::Box,
// the linear solver
using LinearSolver = typename GET_PROP_TYPE(TypeTag, LinearSolver);
auto linearSolver = std::make_shared<LinearSolver>();
auto linearSolver = std::make_shared<LinearSolver>(leafGridView, fvGridGeometry->vertexMapper());
// the non-linear solver
using NewtonController = Dumux::NewtonController<TypeTag>;
......@@ -366,6 +366,6 @@ template <class TypeTag, DiffMethod diffMeth, bool isImplicit>
struct InstationaryNonLinearSimulationImpl<TypeTag, DiscretizationMethods::CCMpfa, diffMeth, isImplicit>
: public InstationaryNonLinearSimulationImpl<TypeTag, DiscretizationMethods::CCTpfa, diffMeth, isImplicit> {};
} // end namespace
} // end namespace Dumux
#endif
This diff is collapsed.
......@@ -200,16 +200,6 @@ public:
//! use the AMGBackend solver by default
SET_TYPE_PROP(ImplicitBase, LinearSolver, Dumux::AMGBackend<TypeTag> );
// if the deflection of the newton method is large, we do not
// need to solve the linear approximation accurately. Assuming
// that the initial value for the delta vector u is quite
// close to the final value, a reduction of 6 orders of
// magnitude in the defect should be sufficient...
SET_SCALAR_PROP(ImplicitBase, LinearSolverResidualReduction, 1e-6);
//! set the default number of maximum iterations for the linear solver
SET_INT_PROP(ImplicitBase, LinearSolverMaxIterations, 250);
//! set number of equations of the mathematical model as default
SET_INT_PROP(ImplicitBase, LinearSolverBlockSize, GET_PROP_VALUE(TypeTag, NumEq));
......
......@@ -31,6 +31,7 @@
#include <dune/istl/paamg/pinfo.hh>
#include <dune/istl/solvers.hh>
#include <dumux/linear/solver.hh>
#include <dumux/linear/linearsolverproperties.hh>
#include <dumux/linear/amgproperties.hh>
#include <dumux/linear/amgparallelhelpers.hh>
......@@ -71,21 +72,23 @@ void scaleLinearSystem(Matrix& matrix, Vector& rhs)
* \brief Provides a linear solver using the ISTL AMG.
*/
template <class TypeTag>
class AMGBackend
class AMGBackend : public LinearSolver<TypeTag>
{
typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
typedef typename GET_PROP_TYPE(TypeTag, Problem) Problem;
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef typename GET_PROP(TypeTag, AmgTraits) AmgTraits;
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using AmgTraits = typename GET_PROP(TypeTag, AmgTraits);
enum { numEq = AmgTraits::numEq };
typedef typename AmgTraits::LinearOperator LinearOperator;
typedef typename AmgTraits::VType VType;
typedef typename AmgTraits::Comm Comm;
typedef typename AmgTraits::Smoother Smoother;
typedef Dune::Amg::AMG<typename AmgTraits::LinearOperator, VType,
Smoother,Comm> AMGType;
typedef typename AmgTraits::LinearOperator::matrix_type BCRSMat;
using LinearOperator = typename AmgTraits::LinearOperator;
using ScalarProduct = typename AmgTraits::ScalarProduct;
using VType = typename AmgTraits::VType;
using Comm = typename AmgTraits::Comm;
using Smoother = typename AmgTraits::Smoother;
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:
/*!
......@@ -93,10 +96,11 @@ public:
*
* \param problem the problem at hand
*/
AMGBackend(const Problem& problem)
: problem_(problem), phelper_(problem_), firstCall_(true)
{
}
AMGBackend(const GridView& gridView, const DofMapper& mapper)
: LinearSolver<TypeTag>(gridView, mapper)
, phelper_(gridView, mapper)
, firstCall_(true)
{}
/*!
* \brief Solve a linear system.
......@@ -108,26 +112,24 @@ public:
template<class Matrix, class Vector>
bool solve(Matrix& A, Vector& x, Vector& b)
{
int maxIt = GET_PARAM_FROM_GROUP(TypeTag, double, LinearSolver, MaxIterations);
int verbosity = GET_PARAM_FROM_GROUP(TypeTag, int, LinearSolver, Verbosity);
static const double residReduction = GET_PARAM_FROM_GROUP(TypeTag, double, LinearSolver, ResidualReduction);
const int verbosity = getParamFromGroup<int>(modelParamGroup, "LinearSolver.Verbosity");
const int maxIter = getParamFromGroup<int>(modelParamGroup, "LinearSolver.MaxIterations");
const double residReduction = getParamFromGroup<double>(modelParamGroup, "LinearSolver.ResidualReduction");
int rank = 0;
std::shared_ptr<typename AmgTraits::Comm> comm;
std::shared_ptr<typename AmgTraits::LinearOperator> fop;
std::shared_ptr<typename AmgTraits::ScalarProduct> sp;
std::shared_ptr<Comm> comm;
std::shared_ptr<LinearOperator> fop;
std::shared_ptr<ScalarProduct> sp;
static const int dofCodim = AmgTraits::dofCodim;
static const bool isParallel = Dune::Capabilities::canCommunicate<Grid, dofCodim>::v;
prepareLinearAlgebra_<Matrix, Vector, isParallel>(A, b, rank, comm, fop, sp);
typedef typename Dune::Amg::SmootherTraits<Smoother>::Arguments
SmootherArgs;
typedef Dune::Amg::CoarsenCriterion<Dune::Amg::SymmetricCriterion<BCRSMat,
Dune::Amg::FirstDiagonal> >
Criterion;
using SmootherArgs = typename Dune::Amg::SmootherTraits<Smoother>::Arguments;
using Criterion = Dune::Amg::CoarsenCriterion<Dune::Amg::SymmetricCriterion<BCRSMat, Dune::Amg::FirstDiagonal>>;
//! \todo Check whether the default accumulation mode atOnceAccu is needed.
Dune::Amg::Parameters params(15,2000,1.2,1.6,Dune::Amg::atOnceAccu);
params.setDefaultValuesIsotropic(GET_PROP_TYPE(TypeTag, GridView)::Traits::Grid::dimension);
params.setDefaultValuesIsotropic(Grid::dimension);
params.setDebugLevel(verbosity);
Criterion criterion(params);
SmootherArgs smootherArgs;
......@@ -135,14 +137,19 @@ public:
smootherArgs.relaxationFactor = 1;
AMGType amg(*fop, criterion, smootherArgs, *comm);
Dune::BiCGSTABSolver<typename AmgTraits::VType> solver(*fop, *sp, amg, residReduction, maxIt,
rank == 0 ? verbosity : 0);
Dune::BiCGSTABSolver<VType> solver(*fop, *sp, amg, residReduction, maxIter,
rank == 0 ? verbosity : 0);
solver.apply(x, b, result_);
firstCall_ = false;
return result_.converged;
}
std::string name() const
{
return "AMG preconditioned BiCGSTAB solver";
}
/*!
* \brief The result containing the convergence history.
*/
......@@ -151,11 +158,6 @@ public:
return result_;
}
const Problem& problem() const
{
return problem_;
}
private:
/*!
......@@ -175,16 +177,15 @@ private:
*/
template<class Matrix, class Vector, bool isParallel>
void prepareLinearAlgebra_(Matrix& A, Vector& b, int& rank,
std::shared_ptr<typename AmgTraits::Comm>& comm,
std::shared_ptr<typename AmgTraits::LinearOperator>& fop,
std::shared_ptr<typename AmgTraits::ScalarProduct>& sp)
std::shared_ptr<Comm>& comm,
std::shared_ptr<LinearOperator>& fop,
std::shared_ptr<ScalarProduct>& sp)
{
LinearAlgebraPreparator<TypeTag, isParallel>
::prepareLinearAlgebra(A, b, rank, comm, fop, sp,
problem_, phelper_, firstCall_);
this->gridView(), this->dofMapper(), phelper_, firstCall_);
}
const Problem& problem_;
ParallelISTLHelper<TypeTag> phelper_;
Dune::InverseOperatorResult result_;
bool firstCall_;
......
This diff is collapsed.
......@@ -26,7 +26,6 @@
#ifndef DUMUXAMGPROPERTIES_HH
#define DUMUXAMGPROPERTIES_HH
#include <dune/istl/schwarz.hh>
#include <dune/istl/novlpschwarz.hh>
#include <dune/istl/owneroverlapcopy.hh>
......@@ -56,10 +55,10 @@ template <class MType, class VType, bool isParallel>
class NonoverlappingSolverTraits
{
public:
typedef Dune::Amg::SequentialInformation Comm;
typedef Dune::MatrixAdapter<MType,VType,VType> LinearOperator;
typedef Dune::SeqScalarProduct<VType> ScalarProduct;
typedef Dune::SeqSSOR<MType,VType, VType> Smoother;
using Comm = Dune::Amg::SequentialInformation;
using LinearOperator = Dune::MatrixAdapter<MType,VType,VType>;
using ScalarProduct = Dune::SeqScalarProduct<VType>;
using Smoother = Dune::SeqSSOR<MType,VType, VType>;
};
#if HAVE_MPI
......@@ -67,10 +66,10 @@ template <class MType, class VType>
class NonoverlappingSolverTraits<MType, VType, true>
{
public:
typedef Dune::OwnerOverlapCopyCommunication<Dune::bigunsignedint<96>,int> Comm;
typedef Dune::NonoverlappingSchwarzOperator<MType,VType, VType,Comm> LinearOperator;
typedef Dune::NonoverlappingSchwarzScalarProduct<VType,Comm> ScalarProduct;
typedef Dune::NonoverlappingBlockPreconditioner<Comm,Dune::SeqSSOR<MType,VType, VType> > Smoother;
using Comm = Dune::OwnerOverlapCopyCommunication<Dune::bigunsignedint<96>,int>;
using LinearOperator = Dune::NonoverlappingSchwarzOperator<MType,VType, VType,Comm>;
using ScalarProduct = Dune::NonoverlappingSchwarzScalarProduct<VType,Comm>;
using Smoother = Dune::NonoverlappingBlockPreconditioner<Comm,Dune::SeqSSOR<MType,VType, VType> >;
};
#endif
......@@ -78,32 +77,34 @@ public:
SET_PROP(BoxModel, AmgTraits)
{
public:
typedef typename GET_PROP_TYPE(TypeTag, JacobianMatrix) JacobianMatrix;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix);
using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
enum {
numEq = JacobianMatrix::block_type::rows,
dofCodim = Grid::dimension,
isNonOverlapping = true,
isParallel = Dune::Capabilities::canCommunicate<Grid, dofCodim>::v
};
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef Dune::BCRSMatrix<Dune::FieldMatrix<Scalar,numEq,numEq> > MType;
typedef Dune::BlockVector<Dune::FieldVector<Scalar,numEq> > VType;
typedef NonoverlappingSolverTraits<MType, VType, isParallel> SolverTraits;
typedef typename SolverTraits::Comm Comm;
typedef typename SolverTraits::LinearOperator LinearOperator;
typedef typename SolverTraits::ScalarProduct ScalarProduct;
typedef typename SolverTraits::Smoother Smoother;
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using MType = Dune::BCRSMatrix<Dune::FieldMatrix<Scalar,numEq,numEq> >;
using VType = Dune::BlockVector<Dune::FieldVector<Scalar,numEq> >;
using SolverTraits = NonoverlappingSolverTraits<MType, VType, isParallel>;
using Comm = typename SolverTraits::Comm;
using LinearOperator = typename SolverTraits::LinearOperator;
using ScalarProduct = typename SolverTraits::ScalarProduct;
using Smoother = typename SolverTraits::Smoother;
using DofMapper = typename GET_PROP_TYPE(TypeTag, VertexMapper);
};
template <class MType, class VType, bool isParallel>
class OverlappingSolverTraits
{
public:
typedef Dune::Amg::SequentialInformation Comm;
typedef Dune::MatrixAdapter<MType,VType,VType> LinearOperator;
typedef Dune::SeqScalarProduct<VType> ScalarProduct;
typedef Dune::SeqSSOR<MType,VType, VType> Smoother;
using Comm = Dune::Amg::SequentialInformation;
using LinearOperator = Dune::MatrixAdapter<MType,VType,VType>;
using ScalarProduct = Dune::SeqScalarProduct<VType>;
using Smoother = Dune::SeqSSOR<MType,VType, VType>;
};
#if HAVE_MPI
......@@ -111,10 +112,10 @@ template <class MType, class VType>
class OverlappingSolverTraits<MType, VType, true>
{
public:
typedef Dune::OwnerOverlapCopyCommunication<Dune::bigunsignedint<96>,int> Comm;
typedef Dune::OverlappingSchwarzOperator<MType,VType, VType,Comm> LinearOperator;
typedef Dune::OverlappingSchwarzScalarProduct<VType,Comm> ScalarProduct;
typedef Dune::BlockPreconditioner<VType,VType,Comm,Dune::SeqSSOR<MType,VType, VType> > Smoother;
using Comm = Dune::OwnerOverlapCopyCommunication<Dune::bigunsignedint<96>,int>;
using LinearOperator = Dune::OverlappingSchwarzOperator<MType,VType, VType,Comm>;
using ScalarProduct = Dune::OverlappingSchwarzScalarProduct<VType,Comm>;
using Smoother = Dune::BlockPreconditioner<VType,VType,Comm,Dune::SeqSSOR<MType,VType, VType> >;
};
#endif
......@@ -122,44 +123,48 @@ public:
SET_PROP(CCModel, AmgTraits)
{
public:
typedef typename GET_PROP_TYPE(TypeTag, JacobianMatrix) JacobianMatrix;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix);
using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
enum {
numEq = JacobianMatrix::block_type::rows,
dofCodim = 0,
isNonOverlapping = false,
isParallel = Dune::Capabilities::canCommunicate<Grid, dofCodim>::v
};
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef Dune::BCRSMatrix<Dune::FieldMatrix<Scalar,numEq,numEq> > MType;
typedef Dune::BlockVector<Dune::FieldVector<Scalar,numEq> > VType;
typedef OverlappingSolverTraits<MType, VType, isParallel> SolverTraits;
typedef typename SolverTraits::Comm Comm;
typedef typename SolverTraits::LinearOperator LinearOperator;
typedef typename SolverTraits::ScalarProduct ScalarProduct;
typedef typename SolverTraits::Smoother Smoother;
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using MType = Dune::BCRSMatrix<Dune::FieldMatrix<Scalar,numEq,numEq> >;
using VType = Dune::BlockVector<Dune::FieldVector<Scalar,numEq> >;
using SolverTraits = OverlappingSolverTraits<MType, VType, isParallel>;
using Comm = typename SolverTraits::Comm;
using LinearOperator = typename SolverTraits::LinearOperator;
using ScalarProduct = typename SolverTraits::ScalarProduct;
using Smoother = typename SolverTraits::Smoother;
using DofMapper = typename GET_PROP_TYPE(TypeTag, ElementMapper);
};
//! Sequential model: use the overlapping AMG
SET_PROP(SequentialModel, AmgTraits)
{
public:
typedef typename GET_PROP_TYPE(TypeTag, PressureCoefficientMatrix) JacobianMatrix;
typedef typename GET_PROP_TYPE(TypeTag, Grid) Grid;
using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, PressureCoefficientMatrix);
using Grid = typename GET_PROP_TYPE(TypeTag, Grid);
enum {
numEq = JacobianMatrix::block_type::rows,
dofCodim = 0,
isNonOverlapping = false,
isParallel = Dune::Capabilities::canCommunicate<Grid, dofCodim>::v
};
typedef typename GET_PROP_TYPE(TypeTag, Scalar) Scalar;
typedef Dune::BCRSMatrix<Dune::FieldMatrix<Scalar,numEq,numEq> > MType;
typedef Dune::BlockVector<Dune::FieldVector<Scalar,numEq> > VType;
typedef OverlappingSolverTraits<MType, VType, isParallel> SolverTraits;
typedef typename SolverTraits::Comm Comm;
typedef typename SolverTraits::LinearOperator LinearOperator;
typedef typename SolverTraits::ScalarProduct ScalarProduct;
typedef typename SolverTraits::Smoother Smoother;
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using MType = Dune::BCRSMatrix<Dune::FieldMatrix<Scalar,numEq,numEq> >;
using VType = Dune::BlockVector<Dune::FieldVector<Scalar,numEq> >;
using SolverTraits = OverlappingSolverTraits<MType, VType, isParallel>;
using Comm = typename SolverTraits::Comm;
using LinearOperator = typename SolverTraits::LinearOperator;
using ScalarProduct = typename SolverTraits::ScalarProduct;
using Smoother = typename SolverTraits::Smoother;
using DofMapper = typename GET_PROP_TYPE(TypeTag, ElementMapper);
};
} // namespace Properties
......
......@@ -39,30 +39,11 @@ NEW_TYPE_TAG(LinearSolverTypeTag);
//! The type of the linear solver to be used
NEW_PROP_TAG(LinearSolver);
//! target reduction of the initial residual
// TODO: remove this once the sequential models don't use the tag anymore
NEW_PROP_TAG(LinearSolverResidualReduction);
//! maximum number of iterations of solver
// TODO: remove this once the sequential models don't use the tag anymore
NEW_PROP_TAG(LinearSolverMaxIterations);
//! relaxation parameter for the preconditioner
// TODO: remove this once the sequential models don't use the tag anymore
NEW_PROP_TAG(LinearSolverPreconditionerRelaxation);
//! number of preconditioner iterations per solver iteration
// TODO: remove this once the sequential models don't use the tag anymore
NEW_PROP_TAG(LinearSolverPreconditionerIterations);
//! Block level depth for the preconditioner
// Set this to more than one if the matrix to solve is nested multiple times
// e.g. for Dune::MultiTypeBlockMatrix'es.
NEW_PROP_TAG(LinearSolverPreconditionerBlockLevel);
//! restart parameter for GMRes
NEW_PROP_TAG(LinearSolverGMResRestart);
//! Size of the matrix/vector blocks
/*!
* The number of different types of equations which build the system of equations to solve
......@@ -72,20 +53,11 @@ NEW_PROP_TAG(LinearSolverGMResRestart);
*/
NEW_PROP_TAG(LinearSolverBlockSize);
//! set the preconditioner relaxation parameter to 1.0 by default
// TODO: remove this once the sequential models don't use the tag anymore
SET_SCALAR_PROP(LinearSolverTypeTag, LinearSolverPreconditionerRelaxation, 1.0);
//! set the preconditioner iterations to 1 by default
// TODO: remove this once the sequential models don't use the tag anymore
SET_INT_PROP(LinearSolverTypeTag, LinearSolverPreconditionerIterations, 1);
//! set the block level to 1, suitable for e.g. a simple Dune::BCRSMatrix.
SET_INT_PROP(LinearSolverTypeTag, LinearSolverPreconditionerBlockLevel, 1);
//! set the GMRes restart parameter to 10 by default
// TODO: remove this once the sequential models don't use the tag anymore
SET_INT_PROP(LinearSolverTypeTag, LinearSolverGMResRestart, 10);
//! set the block size to 1 as default
SET_INT_PROP(LinearSolverTypeTag, LinearSolverBlockSize, 1);
} // namespace Properties
} // namespace Dumux
......
This diff is collapsed.
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
* \brief Dumux linear solver backend
*/
#ifndef DUMUX_SOLVER_BACKEND_HH
#define DUMUX_SOLVER_BACKEND_HH
namespace Dumux
{
namespace Properties
{
NEW_PROP_TAG(GridView);
NEW_PROP_TAG(ImplicitIsBox);
NEW_PROP_TAG(VertexMapper);
NEW_PROP_TAG(ElementMapper);
}
/*!
* \ingroup Linear
* \brief Base class for linear solvers
*/
template<class TypeTag>
class LinearSolver
{
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using DofMapper = std::conditional_t<GET_PROP_VALUE(TypeTag, ImplicitIsBox),
typename GET_PROP_TYPE(TypeTag, VertexMapper),
typename GET_PROP_TYPE(TypeTag, ElementMapper)>;
public:
LinearSolver (const GridView& gridView, const DofMapper& mapper)
: gridView_(gridView)
, mapper_(mapper)
{}
//! solve the linear system Ax = b
template<class Matrix, class Vector>
bool solve(const Matrix& A, Vector& x, const Vector& b)
{ return false; };
//! the name of the linear solver
std::string name() const
{ return "undefined solver"; }
protected:
//! the grid view for communication in parallel
const GridView& gridView() const
{ return gridView_; }
//! the dof mapper for communication in parallel
const DofMapper& dofMapper() const
{ return mapper_; }
private:
const GridView gridView_;
const DofMapper mapper_;
};
} // end namespace Dumux
#endif
......@@ -34,7 +34,7 @@ namespace Dumux
template<class TypeTag>
class OnePIncompressibleLocalResidual : public ImmiscibleLocalResidual<TypeTag>
{
using ParentType = typename GET_PROP_TYPE(TypeTag, BaseLocalResidual);
using ParentType = ImmiscibleLocalResidual<TypeTag>;
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
......
......@@ -99,15 +99,6 @@ SET_TYPE_PROP(Pressure, PressureSolutionVector, typename GET_PROP(TypeTag, Solut
// use the stabilized BiCG solver preconditioned by the ILU-0 by default
SET_TYPE_PROP(Pressure, LinearSolver, ILU0BiCGSTABBackend<TypeTag> );
//! set the default for the reduction of the initial residual
SET_SCALAR_PROP(Pressure, LinearSolverResidualReduction, 1e-13);
//! set the default number of maximum iterations for the linear solver
SET_INT_PROP(Pressure, LinearSolverMaxIterations, 500);
//! set the default number of maximum iterations for the linear solver
SET_INT_PROP(Pressure, LinearSolverBlockSize, 1);
SET_TYPE_PROP( Pressure, Velocity, FVVelocityDefault<TypeTag>);
}
......
......@@ -59,6 +59,9 @@ SET_TYPE_PROP(OnePIncompressible, SpatialParams, OnePTestSpatialParams<TypeTag>)
// use the incompressible local residual (provides analytic jacobian)
SET_TYPE_PROP(OnePIncompressible, LocalResidual, OnePIncompressibleLocalResidual<TypeTag>);
// set the linear solver
SET_TYPE_PROP(OnePIncompressible, LinearSolver, SSORCGBackend<TypeTag>);
// the fluid system
SET_PROP(OnePIncompressible, Fluid)
{
......@@ -69,9 +72,9 @@ public:
};
// Enable caching
SET_BOOL_PROP(OnePIncompressible, EnableGlobalVolumeVariablesCache, true);
SET_BOOL_PROP(OnePIncompressible, EnableGlobalFluxVariablesCache, true);
SET_BOOL_PROP(OnePIncompressible, EnableFVGridGeometryCache, true);
SET_BOOL_PROP(OnePIncompressible, EnableGlobalVolumeVariablesCache, false);
SET_BOOL_PROP(OnePIncompressible, EnableGlobalFluxVariablesCache, false);
SET_BOOL_PROP(OnePIncompressible, EnableFVGridGeometryCache, false);
} // end namespace Properties
......
......@@ -50,8 +50,8 @@ public:
permeability_ = getParam<Scalar>("SpatialParams.Permeability");
permeabilityLens_ = getParam<Scalar>("SpatialParams.PermeabilityLens");
lensLowerLeft_ = getParam<GlobalPosition>("SpatialParams.LensLowerLeft");
lensUpperRight_ = getParam<GlobalPosition>("SpatialParams.LensUpperRight");
lensLowerLeft_ = getParam<GlobalPosition>("SpatialParams.LensLowerLeft");