mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-28 20:13:49 -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;
|
return dx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const boost::any& NewtonIterationBlackoilCPR::parallelInformation() const
|
||||||
|
{
|
||||||
|
return parallelInformation_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,6 +71,11 @@ namespace Opm
|
|||||||
/// \copydoc NewtonIterationBlackoilInterface::iterations
|
/// \copydoc NewtonIterationBlackoilInterface::iterations
|
||||||
virtual int iterations () const { return 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.
|
/// \brief construct the CPR preconditioner and the solver.
|
||||||
/// \tparam P The type of the parallel information.
|
/// \tparam P The type of the parallel information.
|
||||||
/// \param parallelInformation the information about the parallelization.
|
/// \param parallelInformation the information about the parallelization.
|
||||||
@ -99,7 +104,6 @@ namespace Opm
|
|||||||
linsolve.apply(x, istlb, result);
|
linsolve.apply(x, istlb, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
|
||||||
mutable int iterations_;
|
mutable int iterations_;
|
||||||
double cpr_relax_;
|
double cpr_relax_;
|
||||||
unsigned int cpr_ilu_n_;
|
unsigned int cpr_ilu_n_;
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
|
|
||||||
#include <opm/autodiff/LinearisedBlackoilResidual.hpp>
|
#include <opm/autodiff/LinearisedBlackoilResidual.hpp>
|
||||||
|
|
||||||
|
#include <boost/any.hpp>
|
||||||
namespace Opm
|
namespace Opm
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -42,6 +43,10 @@ namespace Opm
|
|||||||
|
|
||||||
/// \return number of linear iterations used during last call of computeNewtonIncrement
|
/// \return number of linear iterations used during last call of computeNewtonIncrement
|
||||||
virtual int iterations () const = 0;
|
virtual int iterations () const = 0;
|
||||||
|
|
||||||
|
|
||||||
|
/// \brief Get the information about the parallelization of the grid.
|
||||||
|
virtual const boost::any& parallelInformation() const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
@ -74,5 +74,9 @@ namespace Opm
|
|||||||
return dx;
|
return dx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const boost::any& NewtonIterationBlackoilSimple::parallelInformation() const
|
||||||
|
{
|
||||||
|
return parallelInformation_;
|
||||||
|
}
|
||||||
} // namespace Opm
|
} // namespace Opm
|
||||||
|
|
||||||
|
@ -55,6 +55,9 @@ namespace Opm
|
|||||||
/// \copydoc NewtonIterationBlackoilInterface::iterations
|
/// \copydoc NewtonIterationBlackoilInterface::iterations
|
||||||
virtual int iterations () const { return iterations_; }
|
virtual int iterations () const { return iterations_; }
|
||||||
|
|
||||||
|
/// \copydoc NewtonIterationBlackoilInterface::parallelInformation
|
||||||
|
virtual const boost::any& parallelInformation() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<LinearSolverInterface> linsolver_;
|
std::unique_ptr<LinearSolverInterface> linsolver_;
|
||||||
mutable int iterations_;
|
mutable int iterations_;
|
||||||
|
Loading…
Reference in New Issue
Block a user