opm-simulators
ExtboContainer.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_EXTBO_CONTAINER_HPP
27 #define OPM_EXTBO_CONTAINER_HPP
28 
29 #include <vector>
30 
31 namespace Opm {
32 
33 namespace data { class Solution; }
34 
35 template<class Scalar>
37 {
38  using ScalarBuffer = std::vector<Scalar>;
39 
40 public:
41  void allocate(const unsigned bufferSize);
42 
43  void assignMassFractions(const unsigned globalDofIdx,
44  const Scalar gas,
45  const Scalar oil,
46  const Scalar co2);
47 
48  void assignVolumes(const unsigned globalDofIdx,
49  const Scalar xVolume,
50  const Scalar yVolume);
51 
52  void assignZFraction(const unsigned globalDofIdx,
53  const Scalar zFraction);
54 
55  void outputRestart(data::Solution& sol);
56 
57  bool allocated() const
58  { return allocated_; }
59 
60 private:
61  bool allocated_ = false;
62  ScalarBuffer X_volume_;
63  ScalarBuffer Y_volume_;
64  ScalarBuffer Z_fraction_;
65  ScalarBuffer mFracOil_;
66  ScalarBuffer mFracGas_;
67  ScalarBuffer mFracCo2_;
68 };
69 
70 } // namespace Opm
71 
72 #endif // OPM_EXTBO_CONTAINER_HPP
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Definition: ExtboContainer.hpp:36