mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Makes using wrong constructor a compile-time error
Petsc only supports initialisation through the ParameterGroup constructor. Calling the default, non-arg constructor is a static error, and not implementing it makes using it break compiles.
This commit is contained in:
parent
ade7aa658e
commit
ce3981a55e
@ -219,11 +219,6 @@ namespace{
|
|||||||
|
|
||||||
} // anonymous namespace.
|
} // anonymous namespace.
|
||||||
|
|
||||||
LinearSolverPetsc::LinearSolverPetsc()
|
|
||||||
{
|
|
||||||
OPM_THROW(std::runtime_error, "Pestc just can be called through paramers.\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
LinearSolverPetsc::LinearSolverPetsc(const parameter::ParameterGroup& param)
|
LinearSolverPetsc::LinearSolverPetsc(const parameter::ParameterGroup& param)
|
||||||
: ksp_type_("gmres")
|
: ksp_type_("gmres")
|
||||||
, pc_type_("sor")
|
, pc_type_("sor")
|
||||||
|
@ -33,14 +33,10 @@ namespace Opm
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/// Default constructor.
|
/// Default constructor.
|
||||||
/// All parameters controlling the solver are defaulted:
|
/// Declared, but not implemented. Petsc can only be created through
|
||||||
/// ksp_type gmres
|
/// the ParameterGroup constructor, everything else is an error. This way
|
||||||
/// pc_type jacobi
|
/// the error is caught compile time and not rune time, which is nice as
|
||||||
/// ksp_view 0
|
/// it is a static error.
|
||||||
/// ksp_rtol 1e-5
|
|
||||||
/// ksp_atol 1e-50
|
|
||||||
/// ksp_dtol 1e5
|
|
||||||
/// ksp_max_it 1e5
|
|
||||||
LinearSolverPetsc();
|
LinearSolverPetsc();
|
||||||
|
|
||||||
/// Construct from parameters
|
/// Construct from parameters
|
||||||
|
Loading…
Reference in New Issue
Block a user