mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-07-07 04:53:03 -05:00
changed: NewtonMaxIterations parameter moved to Opm::Parameters namespace
This commit is contained in:
parent
8def6b722b
commit
82cd3a2e01
|
@ -160,13 +160,6 @@ struct EclNewtonStrictIterations<TypeTag, TTag::FlowExpTypeTag> {
|
||||||
static constexpr int value = 100;
|
static constexpr int value = 100;
|
||||||
};
|
};
|
||||||
|
|
||||||
// set the maximum number of Newton iterations to 8 so that we fail quickly (albeit
|
|
||||||
// relatively often)
|
|
||||||
template<class TypeTag>
|
|
||||||
struct NewtonMaxIterations<TypeTag, TTag::FlowExpTypeTag> {
|
|
||||||
static constexpr int value = 8;
|
|
||||||
};
|
|
||||||
|
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct LinearSolverBackend<TypeTag, TTag::FlowExpTypeTag> {
|
struct LinearSolverBackend<TypeTag, TTag::FlowExpTypeTag> {
|
||||||
using type = ISTLSolver<TypeTag>;
|
using type = ISTLSolver<TypeTag>;
|
||||||
|
@ -198,6 +191,12 @@ struct NewtonTolerance<TypeTag, Properties::TTag::FlowExpTypeTag>
|
||||||
static constexpr type value = 1e-1;
|
static constexpr type value = 1e-1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// set the maximum number of Newton iterations to 8 so that we fail quickly (albeit
|
||||||
|
// relatively often)
|
||||||
|
template<class TypeTag>
|
||||||
|
struct NewtonMaxIterations<TypeTag, Properties::TTag::FlowExpTypeTag>
|
||||||
|
{ static constexpr int value = 8; };
|
||||||
|
|
||||||
} // namespace Opm::Parameters
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
namespace Opm::Properties {
|
namespace Opm::Properties {
|
||||||
|
|
|
@ -21,18 +21,22 @@
|
||||||
#ifndef OPM_NON_LINEAR_SOLVER_HPP
|
#ifndef OPM_NON_LINEAR_SOLVER_HPP
|
||||||
#define OPM_NON_LINEAR_SOLVER_HPP
|
#define OPM_NON_LINEAR_SOLVER_HPP
|
||||||
|
|
||||||
#include <opm/simulators/timestepping/SimulatorReport.hpp>
|
#include <dune/common/fmatrix.hh>
|
||||||
|
#include <dune/istl/bcrsmatrix.hh>
|
||||||
|
|
||||||
#include <opm/common/ErrorMacros.hpp>
|
#include <opm/common/ErrorMacros.hpp>
|
||||||
#include <opm/simulators/timestepping/SimulatorTimerInterface.hpp>
|
#include <opm/common/Exceptions.hpp>
|
||||||
|
|
||||||
|
#include <opm/models/nonlinear/newtonmethodparameters.hh>
|
||||||
|
#include <opm/models/nonlinear/newtonmethodproperties.hh>
|
||||||
|
|
||||||
#include <opm/models/utils/parametersystem.hh>
|
#include <opm/models/utils/parametersystem.hh>
|
||||||
#include <opm/models/utils/propertysystem.hh>
|
#include <opm/models/utils/propertysystem.hh>
|
||||||
#include <opm/models/utils/basicproperties.hh>
|
#include <opm/models/utils/basicproperties.hh>
|
||||||
#include <opm/models/nonlinear/newtonmethodproperties.hh>
|
|
||||||
#include <opm/common/Exceptions.hpp>
|
|
||||||
|
|
||||||
#include <dune/common/fmatrix.hh>
|
#include <opm/simulators/timestepping/SimulatorReport.hpp>
|
||||||
#include <dune/istl/bcrsmatrix.hh>
|
#include <opm/simulators/timestepping/SimulatorTimerInterface.hpp>
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
namespace Opm::Properties {
|
namespace Opm::Properties {
|
||||||
|
@ -64,10 +68,6 @@ struct NewtonMaxRelax<TypeTag, TTag::FlowNonLinearSolver> {
|
||||||
static constexpr type value = 0.5;
|
static constexpr type value = 0.5;
|
||||||
};
|
};
|
||||||
template<class TypeTag>
|
template<class TypeTag>
|
||||||
struct NewtonMaxIterations<TypeTag, TTag::FlowNonLinearSolver> {
|
|
||||||
static constexpr int value = 20;
|
|
||||||
};
|
|
||||||
template<class TypeTag>
|
|
||||||
struct NewtonMinIterations<TypeTag, TTag::FlowNonLinearSolver> {
|
struct NewtonMinIterations<TypeTag, TTag::FlowNonLinearSolver> {
|
||||||
static constexpr int value = 2;
|
static constexpr int value = 2;
|
||||||
};
|
};
|
||||||
|
@ -78,6 +78,14 @@ struct NewtonRelaxationType<TypeTag, TTag::FlowNonLinearSolver> {
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
|
namespace Opm::Parameters {
|
||||||
|
|
||||||
|
template<class TypeTag>
|
||||||
|
struct NewtonMaxIterations<TypeTag, Properties::TTag::FlowNonLinearSolver>
|
||||||
|
{ static constexpr int value = 20; };
|
||||||
|
|
||||||
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
// Available relaxation scheme types.
|
// Available relaxation scheme types.
|
||||||
|
@ -128,7 +136,7 @@ void stabilizeNonlinearUpdate(BVector& dx, BVector& dxOld,
|
||||||
|
|
||||||
// overload with given parameters
|
// overload with given parameters
|
||||||
relaxMax_ = Parameters::get<TypeTag, Properties::NewtonMaxRelax>();
|
relaxMax_ = Parameters::get<TypeTag, Properties::NewtonMaxRelax>();
|
||||||
maxIter_ = Parameters::get<TypeTag, Properties::NewtonMaxIterations>();
|
maxIter_ = Parameters::get<TypeTag, Parameters::NewtonMaxIterations>();
|
||||||
minIter_ = Parameters::get<TypeTag, Properties::NewtonMinIterations>();
|
minIter_ = Parameters::get<TypeTag, Properties::NewtonMinIterations>();
|
||||||
|
|
||||||
const auto& relaxationTypeString = Parameters::get<TypeTag, Properties::NewtonRelaxationType>();
|
const auto& relaxationTypeString = Parameters::get<TypeTag, Properties::NewtonRelaxationType>();
|
||||||
|
@ -146,7 +154,7 @@ void stabilizeNonlinearUpdate(BVector& dx, BVector& dxOld,
|
||||||
{
|
{
|
||||||
Parameters::registerParam<TypeTag, Properties::NewtonMaxRelax>
|
Parameters::registerParam<TypeTag, Properties::NewtonMaxRelax>
|
||||||
("The maximum relaxation factor of a Newton iteration");
|
("The maximum relaxation factor of a Newton iteration");
|
||||||
Parameters::registerParam<TypeTag, Properties::NewtonMaxIterations>
|
Parameters::registerParam<TypeTag, Parameters::NewtonMaxIterations>
|
||||||
("The maximum number of Newton iterations per time step");
|
("The maximum number of Newton iterations per time step");
|
||||||
Parameters::registerParam<TypeTag, Properties::NewtonMinIterations>
|
Parameters::registerParam<TypeTag, Properties::NewtonMinIterations>
|
||||||
("The minimum number of Newton iterations per time step");
|
("The minimum number of Newton iterations per time step");
|
||||||
|
|
|
@ -112,13 +112,6 @@ struct LinearSolverBackend<TTag::TestTypeTag, TTag::FlowIstlSolverParams> {
|
||||||
using type = ISTLSolver<TTag::TestTypeTag>;
|
using type = ISTLSolver<TTag::TestTypeTag>;
|
||||||
};
|
};
|
||||||
|
|
||||||
// set the maximum number of Newton iterations to 8 so that we fail quickly (albeit
|
|
||||||
// relatively often)
|
|
||||||
template<class TypeTag>
|
|
||||||
struct NewtonMaxIterations<TypeTag, TTag::TestTypeTag> {
|
|
||||||
static constexpr int value = 8;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace Opm::Properties
|
} // namespace Opm::Properties
|
||||||
|
|
||||||
namespace Opm::Parameters {
|
namespace Opm::Parameters {
|
||||||
|
@ -145,6 +138,12 @@ struct NewtonTolerance<TypeTag, Properties::TTag::TestTypeTag>
|
||||||
static constexpr type value = 1e-1;
|
static constexpr type value = 1e-1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// set the maximum number of Newton iterations to 8 so that we fail quickly (albeit
|
||||||
|
// relatively often)
|
||||||
|
template<class TypeTag>
|
||||||
|
struct NewtonMaxIterations<TypeTag, Properties::TTag::TestTypeTag>
|
||||||
|
{ static constexpr int value = 8; };
|
||||||
|
|
||||||
} // namespace Opm::Parameters
|
} // namespace Opm::Parameters
|
||||||
|
|
||||||
#endif // OPM_TEST_TYPETAG_HPP
|
#endif // OPM_TEST_TYPETAG_HPP
|
||||||
|
|
Loading…
Reference in New Issue
Block a user