My Project
Loading...
Searching...
No Matches
ALQState.hpp
1/*
2 Copyright 2021 Equinor ASA
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_ALQ_STATE_HEADER_INCLUDED
21#define OPM_ALQ_STATE_HEADER_INCLUDED
22
23#include <map>
24#include <string>
25
26namespace Opm {
27
28template<class Scalar>
30{
31public:
32 static ALQState serializationTestObject();
33
34 std::size_t pack_size() const;
35 std::size_t unpack_data(const Scalar* data);
36 std::size_t pack_data(Scalar* data) const;
37
38 Scalar get(const std::string& wname) const;
39 void update_default(const std::string& wname, Scalar value);
40 void set(const std::string& wname, Scalar value);
41 bool oscillation(const std::string& wname) const;
42 void update_count(const std::string& wname, bool increase);
43 void reset_count();
44 int get_increment_count(const std::string& wname) const;
45 int get_decrement_count(const std::string& wname) const;
46 void set_debug_counter(int value);
47 int get_debug_counter();
48 int update_debug_counter();
49
50 template<class Serializer>
51 void serializeOp(Serializer& serializer)
52 {
53 serializer(current_alq_);
54 serializer(default_alq_);
55 serializer(alq_increase_count_);
56 serializer(alq_decrease_count_);
57 serializer(debug_counter_);
58 }
59
60 bool operator==(const ALQState&) const;
61
62private:
63 std::map<std::string, Scalar> current_alq_;
64 std::map<std::string, Scalar> default_alq_;
65 std::map<std::string, int> alq_increase_count_;
66 std::map<std::string, int> alq_decrease_count_;
67 int debug_counter_ = 0;
68};
69
70}
71
72#endif
73
74
75
Definition ALQState.hpp:30
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37