mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
changed: move the PreconditionerOrder parameter to Opm::Parameters
This commit is contained in:
parent
0e06d6491b
commit
5cab2e668a
@ -127,8 +127,6 @@ struct LinearSolverWrapper<TypeTag, TTag::WaterAirBaseProblem>
|
||||
template<class TypeTag>
|
||||
struct PreconditionerWrapper<TypeTag, TTag::WaterAirBaseProblem>
|
||||
{ using type = Opm::Linear::PreconditionerWrapperILU<TypeTag>; };
|
||||
template<class TypeTag>
|
||||
struct PreconditionerOrder<TypeTag, TTag::WaterAirBaseProblem> { static constexpr int value = 2; };
|
||||
|
||||
} // namespace Opm::Properties
|
||||
|
||||
@ -165,11 +163,6 @@ template<class TypeTag>
|
||||
struct NewtonWriteConvergence<TypeTag, Properties::TTag::WaterAirBaseProblem>
|
||||
{ static constexpr bool value = false; };
|
||||
|
||||
// Use forward differences instead of central differences
|
||||
template<class TypeTag>
|
||||
struct NumericDifferenceMethod<TypeTag, Properties::TTag::WaterAirBaseProblem>
|
||||
{ static constexpr int value = +1; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
namespace Opm {
|
||||
|
@ -44,14 +44,17 @@
|
||||
#ifndef EWOMS_ISTL_PRECONDITIONER_WRAPPERS_HH
|
||||
#define EWOMS_ISTL_PRECONDITIONER_WRAPPERS_HH
|
||||
|
||||
#include <dune/common/version.hh>
|
||||
|
||||
#include <opm/models/utils/propertysystem.hh>
|
||||
#include <opm/models/utils/parametersystem.hh>
|
||||
|
||||
#include <opm/simulators/linalg/linalgparameters.hh>
|
||||
#include <opm/simulators/linalg/linalgproperties.hh>
|
||||
|
||||
#include <opm/simulators/linalg/ilufirstelement.hh> // definitions needed in next header
|
||||
#include <dune/istl/preconditioners.hh>
|
||||
|
||||
#include <dune/common/version.hh>
|
||||
|
||||
namespace Opm {
|
||||
namespace Linear {
|
||||
#define EWOMS_WRAP_ISTL_PRECONDITIONER(PREC_NAME, ISTL_PREC_TYPE) \
|
||||
@ -72,7 +75,7 @@ namespace Linear {
|
||||
\
|
||||
static void registerParameters() \
|
||||
{ \
|
||||
Parameters::registerParam<TypeTag, Properties::PreconditionerOrder> \
|
||||
Parameters::registerParam<TypeTag, Parameters::PreconditionerOrder> \
|
||||
("The order of the preconditioner"); \
|
||||
Parameters::registerParam<TypeTag, Properties::PreconditionerRelaxation> \
|
||||
("The relaxation factor of the preconditioner"); \
|
||||
@ -80,7 +83,7 @@ namespace Linear {
|
||||
\
|
||||
void prepare(IstlMatrix& matrix) \
|
||||
{ \
|
||||
int order = Parameters::get<TypeTag, Properties::PreconditionerOrder>(); \
|
||||
int order = Parameters::get<TypeTag, Parameters::PreconditionerOrder>(); \
|
||||
Scalar relaxationFactor = Parameters::get<TypeTag, Properties::PreconditionerRelaxation>(); \
|
||||
seqPreCond_ = new SequentialPreconditioner(matrix, order, \
|
||||
relaxationFactor); \
|
||||
@ -152,7 +155,7 @@ class PreconditionerWrapperILU
|
||||
using OverlappingMatrix = GetPropType<TypeTag, Properties::OverlappingMatrix>;
|
||||
using OverlappingVector = GetPropType<TypeTag, Properties::OverlappingVector>;
|
||||
|
||||
static constexpr int order = getPropValue<TypeTag, Properties::PreconditionerOrder>();
|
||||
static constexpr int order = getPropValue<TypeTag, Parameters::PreconditionerOrder>();
|
||||
|
||||
public:
|
||||
using SequentialPreconditioner = Dune::SeqILU<OverlappingMatrix, OverlappingVector, OverlappingVector, order>;
|
||||
|
@ -69,6 +69,10 @@ struct LinearSolverTolerance { using type = Properties::UndefinedProperty; };
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverVerbosity { using type = Properties::UndefinedProperty; };
|
||||
|
||||
//! The order of the sequential preconditioner
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct PreconditionerOrder { using type = Properties::UndefinedProperty; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
#endif
|
||||
|
@ -45,10 +45,6 @@ struct PreconditionerWrapper { using type = UndefinedProperty; };
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct LinearSolverScalar { using type = UndefinedProperty; };
|
||||
|
||||
//! The order of the sequential preconditioner
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct PreconditionerOrder { using type = UndefinedProperty; };
|
||||
|
||||
//! The relaxation factor of the preconditioner
|
||||
template<class TypeTag, class MyTypeTag>
|
||||
struct PreconditionerRelaxation { using type = UndefinedProperty; };
|
||||
|
@ -396,10 +396,6 @@ struct PreconditionerRelaxation<TypeTag, TTag::ParallelBaseLinearSolver>
|
||||
static constexpr type value = 1.0;
|
||||
};
|
||||
|
||||
//! set the preconditioner order to 0 by default
|
||||
template<class TypeTag>
|
||||
struct PreconditionerOrder<TypeTag, TTag::ParallelBaseLinearSolver> { static constexpr int value = 0; };
|
||||
|
||||
//! by default use the same kind of floating point values for the linearization and for
|
||||
//! the linear solve
|
||||
template<class TypeTag>
|
||||
@ -473,6 +469,11 @@ template<class TypeTag>
|
||||
struct LinearSolverVerbosity<TypeTag, Properties::TTag::ParallelBaseLinearSolver>
|
||||
{ static constexpr int value = 0; };
|
||||
|
||||
//! set the preconditioner order to 0 by default
|
||||
template<class TypeTag>
|
||||
struct PreconditionerOrder<TypeTag, Properties::TTag::ParallelBaseLinearSolver>
|
||||
{ static constexpr int value = 0; };
|
||||
|
||||
} // namespace Opm::Parameters
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user