TracerConfig.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 Equinor
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_TRACER_CONFIG_HPP
21#define OPM_TRACER_CONFIG_HPP
22
25
26namespace Opm {
27
28class Deck;
29class UnitSystem;
30
32public:
33 struct TracerEntry {
36 std::vector<double> concentration;
38
39 TracerEntry() = default;
40 TracerEntry(const std::string& name_, Phase phase_, std::vector<double> concentration_)
41 : name(name_)
42 , phase(phase_)
43 , concentration(std::move(concentration_))
44 {}
45
46 TracerEntry(const std::string& name_, Phase phase_, TracerVdTable tvdpf_)
47 : name(name_)
48 , phase(phase_)
49 , tvdpf(std::move(tvdpf_))
50 {}
51
52 bool operator==(const TracerEntry& data) const {
53 return this->name == data.name &&
54 this->phase == data.phase &&
55 this->concentration == data.concentration &&
56 this->tvdpf == data.tvdpf;
57 }
58
59 template<class Serializer>
60 void serializeOp(Serializer& serializer)
61 {
62 serializer(name);
63 serializer(phase);
64 serializer(concentration);
65 tvdpf.serializeOp(serializer);
66 }
67 };
68
69 TracerConfig() = default;
70 TracerConfig(const UnitSystem& unit_system, const Deck& deck);
71
73
74 size_t size() const;
75
76 const std::vector<TracerEntry>::const_iterator begin() const;
77 const std::vector<TracerEntry>::const_iterator end() const;
78
79 template<class Serializer>
80 void serializeOp(Serializer& serializer)
81 {
82 serializer.vector(tracers);
83 }
84
85 bool operator==(const TracerConfig& data) const;
86
87private:
88 std::vector<TracerEntry> tracers;
89};
90
91}
92
93#endif
const char *const string
Definition: cJSON.h:170
Definition: Deck.hpp:115
Definition: Serializer.hpp:38
void serializeOp(Serializer &serializer)
Definition: SimpleTable.hpp:73
Definition: TracerConfig.hpp:31
TracerConfig(const UnitSystem &unit_system, const Deck &deck)
void serializeOp(Serializer &serializer)
Definition: TracerConfig.hpp:80
bool operator==(const TracerConfig &data) const
const std::vector< TracerEntry >::const_iterator end() const
static TracerConfig serializeObject()
TracerConfig()=default
const std::vector< TracerEntry >::const_iterator begin() const
size_t size() const
A class that contains tracer concentration vs depth table.
Definition: TracerVdTable.hpp:37
Definition: UnitSystem.hpp:32
Definition: A.hpp:4
Phase
Definition: Runspec.hpp:34
static std::string data()
Definition: exprtk.hpp:40022
Definition: TracerConfig.hpp:33
void serializeOp(Serializer &serializer)
Definition: TracerConfig.hpp:60
TracerVdTable tvdpf
Definition: TracerConfig.hpp:37
Phase phase
Definition: TracerConfig.hpp:35
bool operator==(const TracerEntry &data) const
Definition: TracerConfig.hpp:52
TracerEntry()=default
TracerEntry(const std::string &name_, Phase phase_, TracerVdTable tvdpf_)
Definition: TracerConfig.hpp:46
TracerEntry(const std::string &name_, Phase phase_, std::vector< double > concentration_)
Definition: TracerConfig.hpp:40
std::vector< double > concentration
Definition: TracerConfig.hpp:36
std::string name
Definition: TracerConfig.hpp:34