Only construct SeqILU0 in try block.

The rest is not needed and this simplyfies code.
This commit is contained in:
Markus Blatt
2015-09-08 12:06:03 +02:00
parent 2d50408b5f
commit 3c1498ce92

View File

@@ -134,15 +134,13 @@ namespace Opm
{
typedef AdditionalObjectDeleter<SeqPreconditioner> Deleter;
typedef std::unique_ptr<ParPreconditioner, Deleter> Pointer;
Pointer precond;
int ilu_setup_successful = 1;
std::string message;
const double relax = 1.0;
SeqPreconditioner* seq_precond = nullptr;
try {
SeqPreconditioner* seq_precond= new SeqPreconditioner(opA.getmat(),
relax);
precond = Pointer(new ParPreconditioner(*seq_precond, comm),
Deleter(*seq_precond));
seq_precond= new SeqPreconditioner(opA.getmat(),
relax);
}
catch ( Dune::MatrixBlockError error )
{
@@ -158,7 +156,8 @@ namespace Opm
{
throw Dune::MatrixBlockError();
}
return precond;
return Pointer(new ParPreconditioner(*seq_precond, comm),
Deleter(*seq_precond));
}
#endif