ALQState.hpp
Go to the documentation of this file.
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 <optional>
25#include <string>
26
27
28namespace Opm {
29
30template<class Scalar>
32{
33public:
35
36 Scalar get() const;
37 void update_default(Scalar value);
38 void set(Scalar value);
39 bool oscillation() const;
40 void update_count(bool increase);
44
45 template<class Serializer>
46 void serializeOp(Serializer& serializer)
47 {
48 serializer(current_alq_);
49 serializer(default_alq_);
50 serializer(alq_increase_count_);
51 serializer(alq_decrease_count_);
52 }
53
54 bool operator==(const ALQState&) const;
55
56private:
57 std::optional<Scalar> current_alq_;
58 Scalar default_alq_{0.0};
59 int alq_increase_count_{0};
60 int alq_decrease_count_{0};
61};
62
63}
64
65#endif
66
67
68
Definition: ALQState.hpp:32
static ALQState serializationTestObject()
void set(Scalar value)
int get_decrement_count() const
void serializeOp(Serializer &serializer)
Definition: ALQState.hpp:46
bool oscillation() const
void reset_count()
bool operator==(const ALQState &) const
void update_count(bool increase)
int get_increment_count() const
void update_default(Scalar value)
Scalar get() const
Definition: blackoilboundaryratevector.hh:39