Adds ::Aquifer to Opm::EclIO::SummaryNode::Category.

This commit is contained in:
Williham Williham Totland 2020-03-26 10:53:09 +01:00
parent 5a701a2ee8
commit 4e08ff7f6d
5 changed files with 12 additions and 1 deletions

View File

@ -23,6 +23,7 @@ namespace Opm::EclIO {
struct SummaryNode {
enum class Category {
Aquifer,
Well,
Group,
Field,

View File

@ -29,6 +29,7 @@ namespace {
constexpr bool use_number(Opm::EclIO::SummaryNode::Category category) {
switch (category) {
case Opm::EclIO::SummaryNode::Category::Aquifer: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Block: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Connection: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Region: [[fallthrough]];
@ -49,6 +50,7 @@ constexpr bool use_name(Opm::EclIO::SummaryNode::Category category) {
case Opm::EclIO::SummaryNode::Category::Segment: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Well:
return true;
case Opm::EclIO::SummaryNode::Category::Aquifer: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Block: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Field: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Miscellaneous: [[fallthrough]];

View File

@ -1328,7 +1328,8 @@ inline std::vector<Opm::Well> find_wells( const Opm::Schedule& schedule,
return wells;
}
case Opm::EclIO::SummaryNode::Category::Block:
case Opm::EclIO::SummaryNode::Category::Aquifer: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Block: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Miscellaneous:
return {};
}
@ -1346,6 +1347,7 @@ bool need_wells(const Opm::EclIO::SummaryNode& node) {
return true;
case Opm::EclIO::SummaryNode::Category::Region:
return std::regex_match(node.keyword, region_keyword_regex);
case Opm::EclIO::SummaryNode::Category::Aquifer: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Miscellaneous: [[fallthrough]];
case Opm::EclIO::SummaryNode::Category::Block:
return false;

View File

@ -93,6 +93,7 @@ FuncType Parser::get_func(const std::string& arg) {
using Cat = SummaryConfigNode::Category;
SummaryConfigNode::Category cat = parseKeywordCategory(arg);
switch (cat) {
case Cat::Aquifer: return FuncType::aquifer;
case Cat::Well: return FuncType::well;
case Cat::Group: return FuncType::group;
case Cat::Connection: return FuncType::well_connection;

View File

@ -712,6 +712,7 @@ inline void keywordMISC( SummaryConfig::keyword_list& list,
std::string to_string(const SummaryConfigNode::Category cat) {
switch( cat ) {
case SummaryConfigNode::Category::Aquifer: return "Aquifer";
case SummaryConfigNode::Category::Well: return "Well";
case SummaryConfigNode::Category::Group: return "Group";
case SummaryConfigNode::Category::Field: return "Field";
@ -828,6 +829,7 @@ SummaryConfigNode::Category parseKeywordCategory(const std::string& keyword) {
if (is_special(keyword)) { return Cat::Miscellaneous; }
switch (keyword[0]) {
case 'A': return Cat::Aquifer;
case 'W': return Cat::Well;
case 'G': return Cat::Group;
case 'F': return Cat::Field;
@ -897,6 +899,7 @@ std::string SummaryConfigNode::uniqueNodeKey() const
case SummaryConfigNode::Category::Miscellaneous:
return this->keyword();
case SummaryConfigNode::Category::Aquifer: [[fallthrough]];
case SummaryConfigNode::Category::Region: [[fallthrough]];
case SummaryConfigNode::Category::Block:
return this->keyword() + ':' + std::to_string(this->number());
@ -929,6 +932,7 @@ bool operator==(const SummaryConfigNode& lhs, const SummaryConfigNode& rhs)
// Equal if associated to same named entity
return lhs.namedEntity() == rhs.namedEntity();
case SummaryConfigNode::Category::Aquifer: [[fallthrough]];
case SummaryConfigNode::Category::Region: [[fallthrough]];
case SummaryConfigNode::Category::Block:
// Equal if associated to same numeric entity
@ -964,6 +968,7 @@ bool operator<(const SummaryConfigNode& lhs, const SummaryConfigNode& rhs)
// Ordering determined by namedEntityd entity
return lhs.namedEntity() < rhs.namedEntity();
case SummaryConfigNode::Category::Aquifer: [[fallthrough]];
case SummaryConfigNode::Category::Region: [[fallthrough]];
case SummaryConfigNode::Category::Block:
// Ordering determined by numeric entity