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.
|
||||
|
||||
LinearSolverPetsc::LinearSolverPetsc()
|
||||
{
|
||||
OPM_THROW(std::runtime_error, "Pestc just can be called through paramers.\n");
|
||||
}
|
||||
|
||||
LinearSolverPetsc::LinearSolverPetsc(const parameter::ParameterGroup& param)
|
||||
: ksp_type_("gmres")
|
||||
, pc_type_("sor")
|
||||
|
@ -33,14 +33,10 @@ namespace Opm
|
||||
{
|
||||
public:
|
||||
/// Default constructor.
|
||||
/// All parameters controlling the solver are defaulted:
|
||||
/// ksp_type gmres
|
||||
/// pc_type jacobi
|
||||
/// ksp_view 0
|
||||
/// ksp_rtol 1e-5
|
||||
/// ksp_atol 1e-50
|
||||
/// ksp_dtol 1e5
|
||||
/// ksp_max_it 1e5
|
||||
/// Declared, but not implemented. Petsc can only be created through
|
||||
/// the ParameterGroup constructor, everything else is an error. This way
|
||||
/// the error is caught compile time and not rune time, which is nice as
|
||||
/// it is a static error.
|
||||
LinearSolverPetsc();
|
||||
|
||||
/// Construct from parameters
|
||||
|
Loading…
Reference in New Issue
Block a user