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:
Jørgen Kvalsvik 2014-09-22 15:35:57 +02:00
parent ade7aa658e
commit ce3981a55e
2 changed files with 4 additions and 13 deletions

View File

@ -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")

View File

@ -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