BlackoilSolventState.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2015 IRIS AS, Applied Mathematics.
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef OPM_BLACKOILSOLVENTSTATE_HEADER_INCLUDED
21 #define OPM_BLACKOILSOLVENTSTATE_HEADER_INCLUDED
22 
23 #include <opm/core/simulator/BlackoilState.hpp>
24 #include <opm/core/grid.h>
25 #include <vector>
26 
27 
28 namespace Opm
29 {
30 
33  class BlackoilSolventState : public BlackoilState
34  {
35  public:
36  void init(const UnstructuredGrid& g, int num_phases)
37  {
38  this->init(g.number_of_cells, g.number_of_faces, num_phases);
39  }
40 
41  void init(int number_of_cells, int number_of_faces, int num_phases)
42  {
43  BlackoilState::init(number_of_cells, number_of_faces, num_phases);
44  solventId_ = SimulatorState::registerCellData( "SSOL", 1 );
45  }
46 
47  std::vector<double>& solvent_saturation() { return cellData()[ solventId_ ]; }
48  const std::vector<double>& solvent_saturation() const { return cellData()[ solventId_ ]; }
49 
50  private:
51  int solventId_;
52  };
53 
54 } // namespace Opm
55 
56 
57 
58 
59 #endif // OPM_BLACKOILSOLVENTSTATE_HEADER_INCLUDED
std::vector< double > & solvent_saturation()
Definition: BlackoilSolventState.hpp:47
const std::vector< double > & solvent_saturation() const
Definition: BlackoilSolventState.hpp:48
Definition: AdditionalObjectDeleter.hpp:22
Definition: BlackoilSolventState.hpp:33
void init(int number_of_cells, int number_of_faces, int num_phases)
Definition: BlackoilSolventState.hpp:41
void init(const UnstructuredGrid &g, int num_phases)
Definition: BlackoilSolventState.hpp:36