NewtonIterationBlackoilInterleaved.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2015 SINTEF ICT, Applied Mathematics.
3  Copyright 2015 IRIS AS
4  Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services
5  Copyright 2015 NTNU
6  Copyright 2015 Statoil AS
7  Copyright 2015 IRIS AS
8 
9  This file is part of the Open Porous Media project (OPM).
10 
11  OPM is free software: you can redistribute it and/or modify
12  it under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OPM is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  GNU General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OPM. If not, see <http://www.gnu.org/licenses/>.
23 */
24 
25 #ifndef OPM_NEWTONITERATIONBLACKOILINTERLEAVED_HEADER_INCLUDED
26 #define OPM_NEWTONITERATIONBLACKOILINTERLEAVED_HEADER_INCLUDED
27 
28 
30 #include <opm/core/utility/parameters/ParameterGroup.hpp>
31 
32 #include <array>
33 #include <memory>
34 
35 namespace Opm
36 {
39  {
45 
47  // read values from parameter class
48  NewtonIterationBlackoilInterleavedParameters( const parameter::ParameterGroup& param )
49  {
50  // set default parameters
51  reset();
52 
53  // read parameters (using previsouly set default values)
54  newton_use_gmres_ = param.getDefault("newton_use_gmres", newton_use_gmres_ );
55  linear_solver_reduction_ = param.getDefault("linear_solver_reduction", linear_solver_reduction_ );
56  linear_solver_maxiter_ = param.getDefault("linear_solver_maxiter", linear_solver_maxiter_);
57  linear_solver_restart_ = param.getDefault("linear_solver_restart", linear_solver_restart_);
58  linear_solver_verbosity_ = param.getDefault("linear_solver_verbosity", linear_solver_verbosity_);
59  }
60 
61  // set default values
62  void reset()
63  {
64  newton_use_gmres_ = false;
65  linear_solver_reduction_ = 1e-2;
66  linear_solver_maxiter_ = 50;
67  linear_solver_restart_ = 40;
68  linear_solver_verbosity_ = 0;
69  }
70  };
71 
72 
77  {
78  public:
79 
84  NewtonIterationBlackoilInterleaved(const parameter::ParameterGroup& param,
85  const boost::any& parallelInformation=boost::any());
86 
93 
95  virtual int iterations () const { return iterations_; }
96 
98  virtual const boost::any& parallelInformation() const;
99 
100  private:
101  // max number of equations supported, increase if necessary
102  static const int maxNumberEquations_ = 6 ;
103 
104  mutable std::array< std::unique_ptr< NewtonIterationBlackoilInterface >, maxNumberEquations_+1 > newtonIncrement_;
106  boost::any parallelInformation_;
107  mutable int iterations_;
108  };
109 
110 } // namespace Opm
111 
112 
113 #endif // OPM_NEWTONITERATIONBLACKOILINTERLEAVED_HEADER_INCLUDED
virtual int iterations() const
Definition: NewtonIterationBlackoilInterleaved.hpp:95
Definition: NewtonIterationBlackoilInterleaved.hpp:76
Definition: LinearisedBlackoilResidual.hpp:47
int linear_solver_verbosity_
Definition: NewtonIterationBlackoilInterleaved.hpp:43
LinearisedBlackoilResidual::ADB::V SolutionVector
Return type for linearSolve(). A simple, non-ad vector type.
Definition: NewtonIterationBlackoilInterface.hpp:35
void reset()
Definition: NewtonIterationBlackoilInterleaved.hpp:62
Definition: AdditionalObjectDeleter.hpp:22
int linear_solver_restart_
Definition: NewtonIterationBlackoilInterleaved.hpp:42
int linear_solver_maxiter_
Definition: NewtonIterationBlackoilInterleaved.hpp:41
double linear_solver_reduction_
Definition: NewtonIterationBlackoilInterleaved.hpp:40
Interface class for (linear) solvers for the fully implicit black-oil system.
Definition: NewtonIterationBlackoilInterface.hpp:31
bool newton_use_gmres_
Definition: NewtonIterationBlackoilInterleaved.hpp:44
virtual SolutionVector computeNewtonIncrement(const LinearisedBlackoilResidual &residual) const
NewtonIterationBlackoilInterleavedParameters(const parameter::ParameterGroup &param)
Definition: NewtonIterationBlackoilInterleaved.hpp:48
NewtonIterationBlackoilInterleavedParameters()
Definition: NewtonIterationBlackoilInterleaved.hpp:46
virtual const boost::any & parallelInformation() const
Get the information about the parallelization of the grid.
NewtonIterationBlackoilInterleaved(const parameter::ParameterGroup &param, const boost::any &parallelInformation=boost::any())
This class carries all parameters for the NewtonIterationBlackoilInterleaved class.
Definition: NewtonIterationBlackoilInterleaved.hpp:38