2016-05-04 07:11:04 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) Statoil ASA
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-05-04 07:11:04 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2016-05-04 07:11:04 -05:00
|
|
|
// 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.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2016-05-04 07:11:04 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#pragma once
|
|
|
|
|
2017-09-13 09:30:55 -05:00
|
|
|
#include <map>
|
2018-07-09 05:46:20 -05:00
|
|
|
#include <set>
|
2019-09-06 03:40:57 -05:00
|
|
|
#include <string>
|
2018-05-28 04:20:20 -05:00
|
|
|
#include <vector>
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2018-04-09 03:08:50 -05:00
|
|
|
class QTextStream;
|
2019-08-09 06:15:32 -05:00
|
|
|
class QString;
|
2018-06-07 03:02:54 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
#define ENSEMBLE_STAT_P10_QUANTITY_NAME "P10"
|
|
|
|
#define ENSEMBLE_STAT_P50_QUANTITY_NAME "P50"
|
|
|
|
#define ENSEMBLE_STAT_P90_QUANTITY_NAME "P90"
|
|
|
|
#define ENSEMBLE_STAT_MEAN_QUANTITY_NAME "MEAN"
|
2018-06-07 03:02:54 -05:00
|
|
|
|
2016-05-04 07:11:04 -05:00
|
|
|
//==================================================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==================================================================================================
|
|
|
|
class RifEclipseSummaryAddress
|
|
|
|
{
|
|
|
|
public:
|
2019-09-06 03:40:57 -05:00
|
|
|
// Based on list in ecl_smspec.c and list of types taken from Eclipse Reference Manual ecl_rm_2011.1.pdf
|
2018-09-13 05:38:17 -05:00
|
|
|
enum SummaryVarCategory : int8_t
|
2016-05-04 07:11:04 -05:00
|
|
|
{
|
2016-06-09 03:55:48 -05:00
|
|
|
SUMMARY_INVALID,
|
2019-09-06 03:40:57 -05:00
|
|
|
SUMMARY_FIELD,
|
|
|
|
SUMMARY_AQUIFER,
|
|
|
|
SUMMARY_NETWORK,
|
|
|
|
SUMMARY_MISC,
|
|
|
|
SUMMARY_REGION,
|
|
|
|
SUMMARY_REGION_2_REGION,
|
2022-04-07 14:06:40 -05:00
|
|
|
SUMMARY_GROUP,
|
2019-09-06 03:40:57 -05:00
|
|
|
SUMMARY_WELL,
|
|
|
|
SUMMARY_WELL_COMPLETION,
|
|
|
|
SUMMARY_WELL_LGR,
|
2016-06-07 08:12:14 -05:00
|
|
|
SUMMARY_WELL_COMPLETION_LGR,
|
2019-09-06 03:40:57 -05:00
|
|
|
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,
|
2018-06-07 03:02:54 -05:00
|
|
|
SUMMARY_IMPORTED,
|
|
|
|
SUMMARY_ENSEMBLE_STATISTICS
|
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,
|
2022-04-07 14:06:40 -05:00
|
|
|
INPUT_GROUP_NAME,
|
2017-09-13 09:30:55 -05:00
|
|
|
INPUT_CELL_IJK,
|
|
|
|
INPUT_LGR_NAME,
|
|
|
|
INPUT_SEGMENT_NUMBER,
|
2017-12-12 08:09:52 -06:00
|
|
|
INPUT_AQUIFER_NUMBER,
|
|
|
|
INPUT_VECTOR_NAME,
|
2019-12-09 02:21:06 -06:00
|
|
|
INPUT_ID
|
2017-09-13 09:30:55 -05:00
|
|
|
};
|
|
|
|
|
2016-05-04 07:11:04 -05:00
|
|
|
public:
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress()
|
|
|
|
: m_variableCategory( RifEclipseSummaryAddress::SUMMARY_INVALID )
|
|
|
|
, m_regionNumber( -1 )
|
|
|
|
, m_regionNumber2( -1 )
|
|
|
|
, m_wellSegmentNumber( -1 )
|
|
|
|
, m_cellI( -1 )
|
|
|
|
, m_cellJ( -1 )
|
|
|
|
, m_cellK( -1 )
|
|
|
|
, m_aquiferNumber( -1 )
|
|
|
|
, m_isErrorResult( false )
|
2019-12-09 02:21:06 -06:00
|
|
|
, m_id( -1 )
|
2019-09-06 03:40:57 -05:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
RifEclipseSummaryAddress( SummaryVarCategory category,
|
2022-05-06 09:34:37 -05:00
|
|
|
const std::string& vectorName,
|
2019-09-06 03:40:57 -05:00
|
|
|
int16_t regionNumber,
|
|
|
|
int16_t regionNumber2,
|
2022-04-07 14:06:40 -05:00
|
|
|
const std::string& groupName,
|
2019-09-06 03:40:57 -05:00
|
|
|
const std::string& wellName,
|
|
|
|
int16_t wellSegmentNumber,
|
|
|
|
const std::string& lgrName,
|
|
|
|
int32_t cellI,
|
|
|
|
int32_t cellJ,
|
|
|
|
int32_t cellK,
|
|
|
|
int16_t aquiferNumber,
|
2019-12-09 02:21:06 -06:00
|
|
|
bool isErrorResult,
|
|
|
|
int32_t id )
|
2019-09-06 03:40:57 -05:00
|
|
|
: m_variableCategory( category )
|
2022-05-06 09:34:37 -05:00
|
|
|
, m_vectorName( vectorName )
|
2019-09-06 03:40:57 -05:00
|
|
|
, m_regionNumber( regionNumber )
|
|
|
|
, m_regionNumber2( regionNumber2 )
|
2022-04-07 14:06:40 -05:00
|
|
|
, m_groupName( groupName )
|
2019-09-06 03:40:57 -05:00
|
|
|
, m_wellName( wellName )
|
|
|
|
, m_wellSegmentNumber( wellSegmentNumber )
|
|
|
|
, m_lgrName( lgrName )
|
|
|
|
, m_cellI( cellI )
|
|
|
|
, m_cellJ( cellJ )
|
|
|
|
, m_cellK( cellK )
|
|
|
|
, m_aquiferNumber( aquiferNumber )
|
|
|
|
, m_isErrorResult( isErrorResult )
|
2019-12-09 02:21:06 -06:00
|
|
|
, m_id( id )
|
2019-09-06 03:40:57 -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
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static RifEclipseSummaryAddress fromEclipseTextAddress( const std::string& textAddress );
|
2021-09-13 04:37:55 -05:00
|
|
|
static RifEclipseSummaryAddress fromEclipseTextAddressParseErrorTokens( const std::string& textAddress );
|
|
|
|
|
2022-05-06 09:34:37 -05:00
|
|
|
static RifEclipseSummaryAddress fieldAddress( const std::string& vectorName );
|
|
|
|
static RifEclipseSummaryAddress aquiferAddress( const std::string& vectorName, int aquiferNumber );
|
|
|
|
static RifEclipseSummaryAddress networkAddress( const std::string& vectorName );
|
|
|
|
static RifEclipseSummaryAddress miscAddress( const std::string& vectorName );
|
|
|
|
static RifEclipseSummaryAddress regionAddress( const std::string& vectorName, int regionNumber );
|
2019-09-06 03:40:57 -05:00
|
|
|
static RifEclipseSummaryAddress
|
2022-05-06 09:34:37 -05:00
|
|
|
regionToRegionAddress( const std::string& vectorName, int regionNumber, int region2Number );
|
|
|
|
static RifEclipseSummaryAddress groupAddress( const std::string& vectorName, const std::string& groupName );
|
|
|
|
static RifEclipseSummaryAddress wellAddress( const std::string& vectorName, const std::string& wellName );
|
2019-09-06 03:40:57 -05:00
|
|
|
static RifEclipseSummaryAddress
|
2022-05-06 09:34:37 -05:00
|
|
|
wellCompletionAddress( const std::string& vectorName, const std::string& wellName, int i, int j, int k );
|
2019-09-06 03:40:57 -05:00
|
|
|
static RifEclipseSummaryAddress
|
2022-05-06 09:34:37 -05:00
|
|
|
wellLgrAddress( const std::string& vectorName, const std::string& lgrName, const std::string& wellName );
|
|
|
|
static RifEclipseSummaryAddress wellCompletionLgrAddress( const std::string& vectorName,
|
2019-11-04 07:35:41 -06:00
|
|
|
const std::string& lgrName,
|
|
|
|
const std::string& wellName,
|
|
|
|
int i,
|
|
|
|
int j,
|
|
|
|
int k );
|
2019-09-06 03:40:57 -05:00
|
|
|
static RifEclipseSummaryAddress
|
2022-05-06 09:34:37 -05:00
|
|
|
wellSegmentAddress( const std::string& vectorName, const std::string& wellName, int segmentNumber );
|
|
|
|
static RifEclipseSummaryAddress blockAddress( const std::string& vectorName, int i, int j, int k );
|
2019-09-06 03:40:57 -05:00
|
|
|
static RifEclipseSummaryAddress
|
2022-05-06 09:34:37 -05:00
|
|
|
blockLgrAddress( const std::string& vectorName, const std::string& lgrName, int i, int j, int k );
|
|
|
|
static RifEclipseSummaryAddress calculatedAddress( const std::string& vectorName, int id );
|
|
|
|
static RifEclipseSummaryAddress importedAddress( const std::string& vectorName );
|
|
|
|
static RifEclipseSummaryAddress ensembleStatisticsAddress( const std::string& vectorName,
|
|
|
|
const std::string& datavectorName );
|
2019-09-06 03:40:57 -05:00
|
|
|
|
2020-12-07 09:48:25 -06:00
|
|
|
static std::string generateStringFromAddresses( const std::vector<RifEclipseSummaryAddress>& addressVector,
|
|
|
|
const std::string jointString = "; " );
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
static bool isDependentOnWellName( SummaryVarCategory category );
|
2018-11-22 08:24:14 -06:00
|
|
|
|
2016-06-09 03:55:48 -05:00
|
|
|
// Access methods
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2020-02-12 04:13:38 -06:00
|
|
|
SummaryVarCategory category() const { return m_variableCategory; }
|
2022-05-06 09:34:37 -05:00
|
|
|
const std::string& vectorName() const { return m_vectorName; }
|
|
|
|
bool isHistoryVector() const;
|
2020-02-12 04:13:38 -06:00
|
|
|
|
|
|
|
int regionNumber() const { return m_regionNumber; }
|
|
|
|
int regionNumber2() const { return m_regionNumber2; }
|
|
|
|
|
2022-04-07 14:06:40 -05:00
|
|
|
const std::string& groupName() const { return m_groupName; }
|
2020-02-12 04:13:38 -06:00
|
|
|
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; }
|
|
|
|
int aquiferNumber() const { return m_aquiferNumber; }
|
|
|
|
int id() const { return m_id; }
|
|
|
|
std::string blockAsString() const;
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2022-05-06 09:34:37 -05:00
|
|
|
const std::string ensembleStatisticsVectorName() const;
|
2018-06-12 07:22:32 -05:00
|
|
|
|
2016-06-09 03:55:48 -05:00
|
|
|
// Derived properties
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string uiText() const;
|
2020-02-25 08:56:08 -06:00
|
|
|
std::string itemUiText() const;
|
2020-02-25 03:27:24 -06:00
|
|
|
std::string addressComponentUiText( RifEclipseSummaryAddress::SummaryIdentifierType itemTypeInput ) const;
|
2019-09-06 03:40:57 -05:00
|
|
|
bool isUiTextMatchingFilterText( const QString& filterString ) const;
|
2016-05-04 07:11:04 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool isValid() const;
|
2022-05-06 09:34:37 -05:00
|
|
|
void setVectorName( const std::string& vectorName ) { m_vectorName = vectorName; }
|
2020-02-12 04:13:38 -06:00
|
|
|
void setWellName( const std::string& wellName ) { m_wellName = wellName; }
|
2022-04-07 14:06:40 -05:00
|
|
|
void setGroupName( const std::string& groupName ) { m_groupName = groupName; }
|
2020-02-12 04:13:38 -06:00
|
|
|
void setRegion( int region ) { m_regionNumber = (int16_t)region; }
|
|
|
|
void setAquiferNumber( int aquiferNumber ) { m_aquiferNumber = (int16_t)aquiferNumber; }
|
2019-09-06 03:40:57 -05:00
|
|
|
void setCellIjk( const std::string& uiText );
|
2020-02-12 04:13:38 -06:00
|
|
|
void setWellSegmentNumber( int segment ) { m_wellSegmentNumber = (int16_t)segment; }
|
2017-10-03 15:05:33 -05:00
|
|
|
|
2020-02-12 04:13:38 -06:00
|
|
|
void setAsErrorResult() { m_isErrorResult = true; }
|
|
|
|
bool isErrorResult() const { return m_isErrorResult; }
|
2019-12-09 02:21:06 -06:00
|
|
|
|
2020-02-12 04:13:38 -06:00
|
|
|
void setId( int id ) { m_id = id; }
|
2019-12-09 02:21:06 -06:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool hasAccumulatedData() const;
|
2016-06-07 08:12:14 -05:00
|
|
|
|
2022-05-06 09:34:37 -05:00
|
|
|
static std::string baseVectorName( const std::string& vectorName );
|
2020-10-01 08:48:53 -05:00
|
|
|
|
2018-07-09 05:46:20 -05:00
|
|
|
private:
|
2021-09-13 04:37:55 -05:00
|
|
|
static RifEclipseSummaryAddress fromTokens( const std::vector<std::string>& tokens );
|
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool isValidEclipseCategory() const;
|
|
|
|
static std::tuple<int32_t, int32_t, int32_t> ijkTupleFromUiText( const std::string& s );
|
|
|
|
std::string formatUiTextRegionToRegion() const;
|
|
|
|
std::pair<int16_t, int16_t> regionToRegionPairFromUiText( const std::string& s );
|
|
|
|
|
2022-05-06 09:34:37 -05:00
|
|
|
std::string m_vectorName;
|
2022-04-07 14:06:40 -05:00
|
|
|
std::string m_groupName;
|
2019-09-06 03:40:57 -05:00
|
|
|
std::string m_wellName;
|
|
|
|
std::string m_lgrName;
|
|
|
|
int32_t m_cellI;
|
|
|
|
int32_t m_cellJ;
|
|
|
|
int32_t m_cellK;
|
|
|
|
int16_t m_regionNumber;
|
|
|
|
int16_t m_regionNumber2;
|
|
|
|
int16_t m_wellSegmentNumber;
|
|
|
|
int16_t m_aquiferNumber;
|
|
|
|
SummaryVarCategory m_variableCategory;
|
|
|
|
bool m_isErrorResult;
|
2019-12-09 02:21:06 -06:00
|
|
|
int32_t m_id;
|
2016-05-04 07:11:04 -05:00
|
|
|
};
|
2016-06-09 03:55:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool operator==( const RifEclipseSummaryAddress& first, const RifEclipseSummaryAddress& second );
|
|
|
|
bool operator!=( const RifEclipseSummaryAddress& first, const RifEclipseSummaryAddress& second );
|
2016-06-09 03:55:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
bool operator<( const RifEclipseSummaryAddress& first, const RifEclipseSummaryAddress& second );
|
2018-04-09 03:08:50 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QTextStream& operator<<( QTextStream& str, const RifEclipseSummaryAddress& sobj );
|
2018-04-09 03:08:50 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
QTextStream& operator>>( QTextStream& str, RifEclipseSummaryAddress& sobj );
|