2016-05-04 07:11:04 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) Statoil ASA
|
|
|
|
//
|
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// ResInsight 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 at <http://www.gnu.org/licenses/gpl.html>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
2017-09-13 09:30:55 -05:00
|
|
|
#include <map>
|
2016-05-04 07:11:04 -05:00
|
|
|
|
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
class RifEclipseSummaryAddress
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
// Based on list in ecl_smspec.c and list of types taken from Eclipse Reference Manual ecl_rm_2011.1.pdf
|
|
|
|
enum SummaryVarCategory
|
|
|
|
{
|
2016-06-09 03:55:48 -05:00
|
|
|
SUMMARY_INVALID,
|
2016-06-07 08:12:14 -05:00
|
|
|
SUMMARY_FIELD,
|
|
|
|
SUMMARY_AQUIFER,
|
|
|
|
SUMMARY_NETWORK,
|
|
|
|
SUMMARY_MISC,
|
|
|
|
SUMMARY_REGION,
|
|
|
|
SUMMARY_REGION_2_REGION,
|
|
|
|
SUMMARY_WELL_GROUP,
|
|
|
|
SUMMARY_WELL,
|
|
|
|
SUMMARY_WELL_COMPLETION,
|
|
|
|
SUMMARY_WELL_LGR,
|
|
|
|
SUMMARY_WELL_COMPLETION_LGR,
|
|
|
|
SUMMARY_WELL_SEGMENT,
|
|
|
|
SUMMARY_BLOCK,
|
2017-10-17 07:34:02 -05:00
|
|
|
SUMMARY_BLOCK_LGR,
|
2017-11-22 13:34:18 -06:00
|
|
|
SUMMARY_CALCULATED,
|
|
|
|
SUMMARY_IMPORTED
|
2016-05-04 07:11:04 -05:00
|
|
|
};
|
|
|
|
|
2017-09-13 09:30:55 -05:00
|
|
|
enum SummaryIdentifierType
|
|
|
|
{
|
|
|
|
INPUT_REGION_NUMBER,
|
2017-09-20 06:06:39 -05:00
|
|
|
INPUT_REGION_2_REGION,
|
2017-09-13 09:30:55 -05:00
|
|
|
INPUT_WELL_NAME,
|
|
|
|
INPUT_WELL_GROUP_NAME,
|
|
|
|
INPUT_CELL_IJK,
|
|
|
|
INPUT_LGR_NAME,
|
|
|
|
INPUT_SEGMENT_NUMBER,
|
2017-12-12 08:09:52 -06:00
|
|
|
INPUT_AQUIFER_NUMBER,
|
|
|
|
INPUT_VECTOR_NAME,
|
2017-09-13 09:30:55 -05:00
|
|
|
};
|
|
|
|
|
2016-05-04 07:11:04 -05:00
|
|
|
public:
|
2016-06-09 03:55:48 -05:00
|
|
|
|
2017-09-21 02:32:10 -05:00
|
|
|
RifEclipseSummaryAddress() :
|
2016-06-09 03:55:48 -05:00
|
|
|
m_variableCategory(RifEclipseSummaryAddress::SUMMARY_INVALID),
|
|
|
|
m_regionNumber(-1),
|
|
|
|
m_regionNumber2(-1),
|
|
|
|
m_wellSegmentNumber(-1),
|
|
|
|
m_cellI(-1),
|
|
|
|
m_cellJ(-1),
|
2017-12-12 08:09:52 -06:00
|
|
|
m_cellK(-1),
|
|
|
|
m_aquiferNumber(-1)
|
2016-06-09 03:55:48 -05:00
|
|
|
{
|
|
|
|
}
|
2016-06-07 08:12:14 -05:00
|
|
|
|
2016-06-09 03:55:48 -05:00
|
|
|
RifEclipseSummaryAddress(SummaryVarCategory category,
|
|
|
|
const std::string& quantityName,
|
|
|
|
int regionNumber,
|
|
|
|
int regionNumber2,
|
|
|
|
const std::string& wellGroupName,
|
|
|
|
const std::string& wellName,
|
|
|
|
int wellSegmentNumber,
|
|
|
|
const std::string& lgrName,
|
|
|
|
int cellI,
|
|
|
|
int cellJ,
|
2017-12-12 08:09:52 -06:00
|
|
|
int cellK,
|
|
|
|
int aquiferNumber):
|
2016-06-09 03:55:48 -05:00
|
|
|
m_variableCategory(category),
|
|
|
|
m_quantityName(quantityName),
|
|
|
|
m_regionNumber(regionNumber),
|
|
|
|
m_regionNumber2(regionNumber2),
|
|
|
|
m_wellGroupName(wellGroupName),
|
|
|
|
m_wellName(wellName),
|
|
|
|
m_wellSegmentNumber(wellSegmentNumber),
|
|
|
|
m_lgrName(lgrName),
|
|
|
|
m_cellI(cellI),
|
|
|
|
m_cellJ(cellJ),
|
2017-12-12 08:09:52 -06:00
|
|
|
m_cellK(cellK),
|
|
|
|
m_aquiferNumber(aquiferNumber)
|
2016-06-09 03:55:48 -05:00
|
|
|
{
|
|
|
|
}
|
2016-06-07 08:12:14 -05:00
|
|
|
|
2017-09-13 09:30:55 -05:00
|
|
|
RifEclipseSummaryAddress(SummaryVarCategory category,
|
|
|
|
std::map<SummaryIdentifierType, std::string>& identifiers);
|
|
|
|
|
2016-06-09 03:55:48 -05:00
|
|
|
// Static specialized creation methods
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2016-06-09 03:55:48 -05:00
|
|
|
static RifEclipseSummaryAddress fieldVarAddress(const std::string& fieldVarName);
|
2017-10-17 07:34:02 -05:00
|
|
|
static RifEclipseSummaryAddress calculatedCurveAddress(const std::string& curveName);
|
2017-11-22 13:34:18 -06:00
|
|
|
static RifEclipseSummaryAddress importedAddress(const std::string& quantityName);
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2016-06-09 03:55:48 -05:00
|
|
|
// Access methods
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2017-09-21 02:32:10 -05:00
|
|
|
SummaryVarCategory category() const { return m_variableCategory; }
|
|
|
|
const std::string& quantityName() const { return m_quantityName; }
|
2016-06-09 03:55:48 -05:00
|
|
|
|
2017-09-21 02:32:10 -05:00
|
|
|
int regionNumber() const { return m_regionNumber; }
|
|
|
|
int regionNumber2() const { return m_regionNumber2; }
|
2016-06-09 03:55:48 -05:00
|
|
|
|
2017-09-21 02:32:10 -05:00
|
|
|
const std::string& wellGroupName() const { return m_wellGroupName; }
|
|
|
|
const std::string& wellName() const { return m_wellName; }
|
|
|
|
int wellSegmentNumber() const { return m_wellSegmentNumber; }
|
|
|
|
const std::string& lgrName() const { return m_lgrName; }
|
|
|
|
int cellI() const { return m_cellI; }
|
|
|
|
int cellJ() const { return m_cellJ; }
|
|
|
|
int cellK() const { return m_cellK; }
|
2017-12-12 08:09:52 -06:00
|
|
|
int aquiferNumber() const { return m_aquiferNumber; }
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2016-06-09 03:55:48 -05:00
|
|
|
// Derived properties
|
|
|
|
|
2017-09-15 04:47:16 -05:00
|
|
|
std::string uiText() const;
|
|
|
|
std::string uiText(RifEclipseSummaryAddress::SummaryIdentifierType itemTypeInput) const;
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2017-10-03 15:05:33 -05:00
|
|
|
bool isValid() const;
|
2017-11-24 08:17:20 -06:00
|
|
|
void setQuantityName(const std::string& quantity) { m_quantityName = quantity; }
|
2017-10-03 15:05:33 -05:00
|
|
|
void setWellName(const std::string& wellName) { m_wellName = wellName; }
|
|
|
|
void setWellGroupName(const std::string& wellGroupName) { m_wellGroupName = wellGroupName; }
|
2017-11-23 02:15:29 -06:00
|
|
|
void setRegion(int region) { m_regionNumber = region; }
|
2017-12-12 08:09:52 -06:00
|
|
|
void setAquiferNumber(int aquiferNumber) { m_aquiferNumber = aquiferNumber; }
|
2017-10-03 15:05:33 -05:00
|
|
|
|
2016-05-04 07:11:04 -05:00
|
|
|
private:
|
2016-06-07 08:12:14 -05:00
|
|
|
|
2017-09-15 04:47:16 -05:00
|
|
|
std::string formatUiTextIJK() const;
|
|
|
|
std::tuple<int, int, int> ijkTupleFromUiText(const std::string &s);
|
2017-09-20 06:06:39 -05:00
|
|
|
std::string formatUiTextRegionToRegion() const;
|
|
|
|
std::pair<int, int> regionToRegionPairFromUiText(const std::string &s);
|
2017-09-15 04:47:16 -05:00
|
|
|
|
2016-06-07 08:12:14 -05:00
|
|
|
SummaryVarCategory m_variableCategory;
|
2016-05-04 07:11:04 -05:00
|
|
|
std::string m_quantityName;
|
2016-06-07 08:12:14 -05:00
|
|
|
int m_regionNumber;
|
|
|
|
int m_regionNumber2;
|
|
|
|
std::string m_wellGroupName;
|
|
|
|
std::string m_wellName;
|
|
|
|
int m_wellSegmentNumber;
|
|
|
|
std::string m_lgrName;
|
|
|
|
int m_cellI;
|
|
|
|
int m_cellJ;
|
|
|
|
int m_cellK;
|
2017-12-12 08:09:52 -06:00
|
|
|
int m_aquiferNumber;
|
2016-05-04 07:11:04 -05:00
|
|
|
};
|
2016-06-09 03:55:48 -05:00
|
|
|
|
|
|
|
bool operator==(const RifEclipseSummaryAddress& first, const RifEclipseSummaryAddress& second);
|
|
|
|
|
2017-10-04 00:36:30 -05:00
|
|
|
bool operator<(const RifEclipseSummaryAddress& first, const RifEclipseSummaryAddress& second);
|