opm-simulators
CO2H2Container.hpp
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
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 2 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  Consult the COPYING file in the top-level source directory of this
19  module for the precise wording of the license and the list of
20  copyright holders.
21 */
26 #ifndef OPM_CO2H2_CONTAINER_HPP
27 #define OPM_CO2H2_CONTAINER_HPP
28 
29 #include <vector>
30 
31 namespace Opm {
32 
33 namespace data { class Solution; }
34 template<class Scalar> struct CO2H2SolutionContainer;
35 
36 template<class Scalar>
38 {
39  using ScalarBuffer = std::vector<Scalar>;
40 
41 public:
42  void allocate(const unsigned bufferSize, const bool isCO2);
43 
44  void assign(const unsigned globalDofIdx,
45  const Scalar xfrac,
46  const Scalar yfrac,
47  const bool isCO2);
48 
49  CO2H2SolutionContainer<Scalar> getSolution() const;
50 
51  void outputRestart(data::Solution& sol);
52 
53  void readRestart(const unsigned globalDofIdx,
54  const unsigned elemIdx,
55  const data::Solution& sol);
56 
57  bool allocated() const
58  { return allocated_; }
59 
60 private:
61  bool allocated_ = false;
62  ScalarBuffer cXmfCO2_{};
63  ScalarBuffer cXmfH2_{};
64  ScalarBuffer cYmfwat_{};
65 };
66 
67 } // namespace Opm
68 
69 #endif // OPM_CO2H2_CONTAINER_HPP
Struct holding CO2 and H2 extension data.
Definition: CO2H2Container.hpp:34
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Definition: CO2H2Container.hpp:37