mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-24 18:20:22 -06:00
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:
parent
221565f038
commit
4527ce8ffd
@ -234,6 +234,10 @@ namespace Opm
|
||||
return dx;
|
||||
}
|
||||
|
||||
const boost::any& NewtonIterationBlackoilCPR::parallelInformation() const
|
||||
{
|
||||
return parallelInformation_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -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_;
|
||||
|
@ -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
|
||||
|
@ -74,5 +74,9 @@ namespace Opm
|
||||
return dx;
|
||||
}
|
||||
|
||||
const boost::any& NewtonIterationBlackoilSimple::parallelInformation() const
|
||||
{
|
||||
return parallelInformation_;
|
||||
}
|
||||
} // namespace Opm
|
||||
|
||||
|
@ -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_;
|
||||
|
Loading…
Reference in New Issue
Block a user