ConnectionValues.hpp
Go to the documentation of this file.
1/*
2 Copyright 2016 Statoil ASA.
3 Copyright 2016 SINTEF ICT, Applied Mathematics.
4
5 This file is part of the Open Porous Media project (OPM).
6
7 OPM is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 OPM is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with OPM. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#ifndef OPM_CONNECTIONVALUES_HEADER_INCLUDED
22#define OPM_CONNECTIONVALUES_HEADER_INCLUDED
23
24#include <cstddef>
25#include <vector>
26
27namespace Opm
28{
29namespace FlowDiagnostics
30{
31
32
34 {
35 public:
37 {
38 std::vector<double>::size_type total;
39 };
40
41 struct NumPhases
42 {
43 std::size_t total;
44 };
45
46 struct ConnID
47 {
48 std::vector<double>::size_type id;
49 };
50
51 struct PhaseID
52 {
53 std::size_t id;
54 };
55
57 const NumPhases& nphase);
58
59 std::vector<double>::size_type numConnections() const;
60 std::size_t numPhases() const;
61
62 double operator()(const ConnID& connection,
63 const PhaseID& phase) const;
64
65 double& operator()(const ConnID& connection,
66 const PhaseID& phase);
67
68 private:
69 NumConnections nconn_;
70 NumPhases nphase_;
71
72 std::vector<double> data_;
73 };
74
75} // namespace FlowDiagnostics
76} // namespace Opm
77
78#endif // OPM_CONNECTIONVALUES_HEADER_INCLUDED
Definition: ConnectionValues.hpp:34
double & operator()(const ConnID &connection, const PhaseID &phase)
double operator()(const ConnID &connection, const PhaseID &phase) const
ConnectionValues(const NumConnections &nconn, const NumPhases &nphase)
std::vector< double >::size_type numConnections() const
Definition: A.hpp:4
Definition: ConnectionValues.hpp:47
std::vector< double >::size_type id
Definition: ConnectionValues.hpp:48
std::vector< double >::size_type total
Definition: ConnectionValues.hpp:38
Definition: ConnectionValues.hpp:42
std::size_t total
Definition: ConnectionValues.hpp:43
Definition: ConnectionValues.hpp:52
std::size_t id
Definition: ConnectionValues.hpp:53