2014-02-10 03:41:18 -06:00
|
|
|
/*
|
|
|
|
Copyright 2014 SINTEF ICT, Applied Mathematics.
|
2014-10-01 06:50:08 -05:00
|
|
|
Copyright 2014 IRIS AS
|
2014-02-10 03:41:18 -06:00
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2014-04-08 09:11:08 -05:00
|
|
|
#ifndef OPM_NEWTONITERATIONBLACKOILSIMPLE_HEADER_INCLUDED
|
|
|
|
#define OPM_NEWTONITERATIONBLACKOILSIMPLE_HEADER_INCLUDED
|
2014-02-10 03:41:18 -06:00
|
|
|
|
|
|
|
|
2014-04-08 09:11:08 -05:00
|
|
|
#include <opm/autodiff/NewtonIterationBlackoilInterface.hpp>
|
2014-05-12 04:10:59 -05:00
|
|
|
#include <opm/core/utility/parameters/ParameterGroup.hpp>
|
2014-02-10 03:41:18 -06:00
|
|
|
#include <opm/core/linalg/LinearSolverInterface.hpp>
|
2014-05-12 04:10:59 -05:00
|
|
|
#include <memory>
|
2014-02-10 03:41:18 -06:00
|
|
|
|
|
|
|
namespace Opm
|
|
|
|
{
|
|
|
|
|
|
|
|
/// This class solves the fully implicit black-oil system by
|
|
|
|
/// simply concatenating the Jacobian matrices and passing the
|
|
|
|
/// resulting system to a linear solver. The linear solver used
|
|
|
|
/// can be passed in as a constructor argument.
|
2014-04-08 09:11:08 -05:00
|
|
|
class NewtonIterationBlackoilSimple : public NewtonIterationBlackoilInterface
|
2014-02-10 03:41:18 -06:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/// Construct a system solver.
|
2014-05-12 04:10:59 -05:00
|
|
|
/// \param[in] param parameters controlling the behaviour and
|
|
|
|
/// choice of linear solver.
|
2015-01-28 08:37:07 -06:00
|
|
|
/// \param[in] parallelInformation In the case of a parallel run
|
|
|
|
/// with dune-istl the information about the parallelization.
|
|
|
|
NewtonIterationBlackoilSimple(const parameter::ParameterGroup& param,
|
|
|
|
const boost::any& parallelInformation=boost::any());
|
2014-02-10 03:41:18 -06:00
|
|
|
|
2014-04-08 08:28:10 -05:00
|
|
|
/// Solve the system of linear equations Ax = b, with A being the
|
2014-02-10 03:41:18 -06:00
|
|
|
/// combined derivative matrix of the residual and b
|
|
|
|
/// being the residual itself.
|
|
|
|
/// \param[in] residual residual object containing A and b.
|
|
|
|
/// \return the solution x
|
2014-04-08 09:16:54 -05:00
|
|
|
virtual SolutionVector computeNewtonIncrement(const LinearisedBlackoilResidual& residual) const;
|
2014-02-10 03:41:18 -06:00
|
|
|
|
2014-10-01 06:50:08 -05:00
|
|
|
/// \copydoc NewtonIterationBlackoilInterface::iterations
|
|
|
|
virtual int iterations () const { return iterations_; }
|
|
|
|
|
2015-01-29 04:30:03 -06:00
|
|
|
/// \copydoc NewtonIterationBlackoilInterface::parallelInformation
|
|
|
|
virtual const boost::any& parallelInformation() const;
|
|
|
|
|
2014-02-10 03:41:18 -06:00
|
|
|
private:
|
2014-05-12 04:10:59 -05:00
|
|
|
std::unique_ptr<LinearSolverInterface> linsolver_;
|
2014-10-01 06:50:08 -05:00
|
|
|
mutable int iterations_;
|
2015-02-12 07:04:53 -06:00
|
|
|
boost::any parallelInformation_;
|
2014-02-10 03:41:18 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Opm
|
|
|
|
|
|
|
|
|
2014-04-08 09:11:08 -05:00
|
|
|
#endif // OPM_NEWTONITERATIONBLACKOILSIMPLE_HEADER_INCLUDED
|