Add access to the underlying information about the parallelization.

We need it serveral places and all of them seem to have access to
NewtonIterationBlackoilInterface. This makes it natural to give access
to it and prevent users from having to forward it manually at several
places in the simulator driver.
This commit is contained in:
Markus Blatt 2015-01-29 11:30:03 +01:00
parent 221565f038
commit 4527ce8ffd
5 changed files with 21 additions and 1 deletions

View File

@ -234,6 +234,10 @@ namespace Opm
return dx;
}
const boost::any& NewtonIterationBlackoilCPR::parallelInformation() const
{
return parallelInformation_;
}

View File

@ -71,6 +71,11 @@ namespace Opm
/// \copydoc NewtonIterationBlackoilInterface::iterations
virtual int iterations () const { return iterations_; }
/// \copydoc NewtonIterationBlackoilInterface::parallelInformation
virtual const boost::any& parallelInformation() const;
private:
/// \brief construct the CPR preconditioner and the solver.
/// \tparam P The type of the parallel information.
/// \param parallelInformation the information about the parallelization.
@ -99,7 +104,6 @@ namespace Opm
linsolve.apply(x, istlb, result);
}
private:
mutable int iterations_;
double cpr_relax_;
unsigned int cpr_ilu_n_;

View File

@ -23,6 +23,7 @@
#include <opm/autodiff/LinearisedBlackoilResidual.hpp>
#include <boost/any.hpp>
namespace Opm
{
@ -42,6 +43,10 @@ namespace Opm
/// \return number of linear iterations used during last call of computeNewtonIncrement
virtual int iterations () const = 0;
/// \brief Get the information about the parallelization of the grid.
virtual const boost::any& parallelInformation() const = 0;
};
} // namespace Opm

View File

@ -74,5 +74,9 @@ namespace Opm
return dx;
}
const boost::any& NewtonIterationBlackoilSimple::parallelInformation() const
{
return parallelInformation_;
}
} // namespace Opm

View File

@ -55,6 +55,9 @@ namespace Opm
/// \copydoc NewtonIterationBlackoilInterface::iterations
virtual int iterations () const { return iterations_; }
/// \copydoc NewtonIterationBlackoilInterface::parallelInformation
virtual const boost::any& parallelInformation() const;
private:
std::unique_ptr<LinearSolverInterface> linsolver_;
mutable int iterations_;