2020-03-20 07:53:30 -05:00
|
|
|
/*
|
|
|
|
Copyright 2020 Equinor ASA.
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
2020-03-20 08:48:32 -05:00
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2020-03-20 07:53:30 -05:00
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
2020-09-20 17:44:15 -05:00
|
|
|
*/
|
2020-03-20 07:53:30 -05:00
|
|
|
|
2020-03-27 02:07:52 -05:00
|
|
|
#ifndef OPM_IO_SUMMARYNODE_HPP
|
|
|
|
#define OPM_IO_SUMMARYNODE_HPP
|
|
|
|
|
|
|
|
#include <functional>
|
2020-04-01 03:30:10 -05:00
|
|
|
#include <optional>
|
2020-03-20 07:53:30 -05:00
|
|
|
#include <string>
|
2020-03-27 02:07:52 -05:00
|
|
|
#include <unordered_set>
|
2020-03-20 07:53:30 -05:00
|
|
|
|
2020-01-11 00:25:43 -06:00
|
|
|
namespace Opm { namespace EclIO {
|
2020-03-20 07:53:30 -05:00
|
|
|
|
|
|
|
struct SummaryNode {
|
|
|
|
enum class Category {
|
|
|
|
Well,
|
|
|
|
Group,
|
|
|
|
Field,
|
|
|
|
Region,
|
|
|
|
Block,
|
|
|
|
Connection,
|
|
|
|
Segment,
|
2020-09-20 17:44:15 -05:00
|
|
|
Aquifer,
|
|
|
|
Node,
|
2020-03-20 07:53:30 -05:00
|
|
|
Miscellaneous,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum class Type {
|
|
|
|
Rate,
|
|
|
|
Total,
|
|
|
|
Ratio,
|
|
|
|
Pressure,
|
|
|
|
Count,
|
|
|
|
Mode,
|
|
|
|
Undefined,
|
|
|
|
};
|
|
|
|
|
2020-03-26 02:20:50 -05:00
|
|
|
std::string keyword;
|
|
|
|
Category category;
|
|
|
|
Type type;
|
|
|
|
std::string wgname;
|
|
|
|
int number;
|
2020-08-27 00:58:15 -05:00
|
|
|
std::string fip_region;
|
2020-03-19 05:56:25 -05:00
|
|
|
|
2020-03-20 05:18:44 -05:00
|
|
|
constexpr static int default_number { std::numeric_limits<int>::min() };
|
|
|
|
|
2020-03-19 05:56:25 -05:00
|
|
|
std::string unique_key() const;
|
2020-03-27 02:07:52 -05:00
|
|
|
|
|
|
|
using number_renderer = std::function<std::string(const SummaryNode&)>;
|
|
|
|
std::string unique_key(number_renderer) const;
|
|
|
|
|
2020-03-20 05:54:19 -05:00
|
|
|
bool is_user_defined() const;
|
2020-03-27 02:07:52 -05:00
|
|
|
|
|
|
|
static Category category_from_keyword(const std::string&, const std::unordered_set<std::string> &miscellaneous_keywords = {});
|
2020-04-01 03:30:10 -05:00
|
|
|
|
|
|
|
std::optional<std::string> display_name() const;
|
|
|
|
std::optional<std::string> display_number() const;
|
|
|
|
std::optional<std::string> display_number(number_renderer) const;
|
2020-03-20 07:53:30 -05:00
|
|
|
};
|
|
|
|
|
2020-09-20 17:44:15 -05:00
|
|
|
}} // namespace Opm::EclIO
|
2020-03-27 02:07:52 -05:00
|
|
|
|
|
|
|
#endif // OPM_IO_SUMMARYNODE_HPP
|