mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4483 Summary Plot: Data source for well segment number and completions
This commit is contained in:
@@ -26,8 +26,6 @@
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include <set>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -125,6 +123,50 @@ std::set<int> RiaSummaryCurveAnalyzer::regionNumbers() const
|
||||
return m_regionNumbers;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryCurveAnalyzer::wellCompletions(const std::string& wellName) const
|
||||
{
|
||||
std::set<std::string> connections;
|
||||
|
||||
for (const auto& conn : m_wellCompletions)
|
||||
{
|
||||
if (conn.first == wellName)
|
||||
{
|
||||
connections.insert(conn.second);
|
||||
}
|
||||
}
|
||||
|
||||
return connections;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<int> RiaSummaryCurveAnalyzer::wellSegmentNumbers(const std::string& wellName) const
|
||||
{
|
||||
std::set<int> segmentNumberForWell;
|
||||
|
||||
for (const auto& wellSegment : m_wellSegmentNumbers)
|
||||
{
|
||||
if (wellName.empty() || std::get<0>(wellSegment) == wellName)
|
||||
{
|
||||
segmentNumberForWell.insert(std::get<1>(wellSegment));
|
||||
}
|
||||
}
|
||||
|
||||
return segmentNumberForWell;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::set<std::string> RiaSummaryCurveAnalyzer::blocks() const
|
||||
{
|
||||
return m_blocks;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -136,33 +178,57 @@ std::set<RifEclipseSummaryAddress::SummaryVarCategory> RiaSummaryCurveAnalyzer::
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<QString> RiaSummaryCurveAnalyzer::identifierTexts(RifEclipseSummaryAddress::SummaryVarCategory category) const
|
||||
std::vector<QString> RiaSummaryCurveAnalyzer::identifierTexts(RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||
const std::string& secondaryIdentifier) const
|
||||
{
|
||||
std::vector<QString> stringSet;
|
||||
std::vector<QString> identifierStrings;
|
||||
|
||||
if (category == RifEclipseSummaryAddress::SUMMARY_REGION)
|
||||
{
|
||||
for (const auto& regionNumber : m_regionNumbers)
|
||||
{
|
||||
stringSet.push_back(QString::number(regionNumber));
|
||||
identifierStrings.push_back(QString::number(regionNumber));
|
||||
}
|
||||
}
|
||||
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL)
|
||||
{
|
||||
for (const auto& wellName : m_wellNames)
|
||||
{
|
||||
stringSet.push_back(QString::fromStdString(wellName));
|
||||
identifierStrings.push_back(QString::fromStdString(wellName));
|
||||
}
|
||||
}
|
||||
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL_GROUP)
|
||||
{
|
||||
for (const auto& wellGroupName : m_wellGroupNames)
|
||||
{
|
||||
stringSet.push_back(QString::fromStdString(wellGroupName));
|
||||
identifierStrings.push_back(QString::fromStdString(wellGroupName));
|
||||
}
|
||||
}
|
||||
else if (category == RifEclipseSummaryAddress::SUMMARY_BLOCK)
|
||||
{
|
||||
for (const auto& ijkBlock : m_blocks)
|
||||
{
|
||||
identifierStrings.push_back(QString::fromStdString(ijkBlock));
|
||||
}
|
||||
}
|
||||
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT)
|
||||
{
|
||||
auto segmentNumbers = wellSegmentNumbers(secondaryIdentifier);
|
||||
for (const auto& segment : segmentNumbers)
|
||||
{
|
||||
identifierStrings.push_back(QString::number(segment));
|
||||
}
|
||||
}
|
||||
else if (category == RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION)
|
||||
{
|
||||
auto connections = wellCompletions(secondaryIdentifier);
|
||||
for (const auto& conn : connections)
|
||||
{
|
||||
identifierStrings.push_back(QString::fromStdString(conn));
|
||||
}
|
||||
}
|
||||
|
||||
return stringSet;
|
||||
return identifierStrings;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -213,6 +279,9 @@ void RiaSummaryCurveAnalyzer::clear()
|
||||
m_wellGroupNames.clear();
|
||||
m_regionNumbers.clear();
|
||||
m_categories.clear();
|
||||
m_wellCompletions.clear();
|
||||
m_wellSegmentNumbers.clear();
|
||||
m_blocks.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -267,9 +336,11 @@ void RiaSummaryCurveAnalyzer::computeQuantityNamesWithHistory() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiaSummaryCurveAnalyzer::analyzeSingleAddress(const RifEclipseSummaryAddress& address)
|
||||
{
|
||||
if (!address.wellName().empty())
|
||||
const std::string& wellName = address.wellName();
|
||||
|
||||
if (!wellName.empty())
|
||||
{
|
||||
m_wellNames.insert(address.wellName());
|
||||
m_wellNames.insert(wellName);
|
||||
}
|
||||
|
||||
if (!address.quantityName().empty())
|
||||
@@ -287,6 +358,22 @@ void RiaSummaryCurveAnalyzer::analyzeSingleAddress(const RifEclipseSummaryAddres
|
||||
m_regionNumbers.insert(address.regionNumber());
|
||||
}
|
||||
|
||||
if (address.category() == RifEclipseSummaryAddress::SUMMARY_WELL_COMPLETION)
|
||||
{
|
||||
auto wellNameAndCompletion = std::make_pair(wellName, address.blockAsString());
|
||||
m_wellCompletions.insert(wellNameAndCompletion);
|
||||
}
|
||||
else if (address.category() == RifEclipseSummaryAddress::SUMMARY_WELL_SEGMENT)
|
||||
{
|
||||
auto wellNameAndSegment = std::make_pair(wellName, address.wellSegmentNumber());
|
||||
m_wellSegmentNumbers.insert(wellNameAndSegment);
|
||||
}
|
||||
else if (address.category() == RifEclipseSummaryAddress::SUMMARY_BLOCK)
|
||||
{
|
||||
auto text = address.blockAsString();
|
||||
m_blocks.insert(text);
|
||||
}
|
||||
|
||||
if (address.category() != RifEclipseSummaryAddress::SUMMARY_INVALID)
|
||||
{
|
||||
m_categories.insert(address.category());
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <vector>
|
||||
|
||||
class RimSummaryCurveCollection;
|
||||
@@ -44,18 +45,23 @@ public:
|
||||
std::set<std::string> quantities() const;
|
||||
std::set<std::string> quantityNamesWithHistory() const;
|
||||
std::set<std::string> quantityNamesNoHistory() const;
|
||||
|
||||
|
||||
std::string quantityNameForTitle() const;
|
||||
|
||||
std::set<std::string> wellNames() const;
|
||||
std::set<std::string> wellGroupNames() const;
|
||||
std::set<int> regionNumbers() const;
|
||||
|
||||
std::set<std::string> wellCompletions(const std::string& wellName) const;
|
||||
std::set<int> wellSegmentNumbers(const std::string& wellName) const;
|
||||
std::set<std::string> blocks() const;
|
||||
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> categories() const;
|
||||
|
||||
std::vector<QString> identifierTexts(RifEclipseSummaryAddress::SummaryVarCategory category) const;
|
||||
std::vector<QString> identifierTexts(RifEclipseSummaryAddress::SummaryVarCategory category,
|
||||
const std::string& secondaryIdentifier) const;
|
||||
|
||||
static std::vector<RifEclipseSummaryAddress> addressesForCategory(const std::set<RifEclipseSummaryAddress>& addresses,
|
||||
static std::vector<RifEclipseSummaryAddress> addressesForCategory(const std::set<RifEclipseSummaryAddress>& addresses,
|
||||
RifEclipseSummaryAddress::SummaryVarCategory category);
|
||||
|
||||
static std::string correspondingHistorySummaryCurveName(const std::string& curveName);
|
||||
@@ -67,13 +73,16 @@ private:
|
||||
void analyzeSingleAddress(const RifEclipseSummaryAddress& address);
|
||||
|
||||
private:
|
||||
std::set<std::string> m_quantities;
|
||||
std::set<std::string> m_quantities;
|
||||
mutable std::set<std::string> m_quantitiesWithMatchingHistory;
|
||||
mutable std::set<std::string> m_quantitiesNoMatchingHistory;
|
||||
|
||||
std::set<std::string> m_wellNames;
|
||||
std::set<std::string> m_wellGroupNames;
|
||||
std::set<int> m_regionNumbers;
|
||||
|
||||
std::set<std::string> m_wellNames;
|
||||
std::set<std::string> m_wellGroupNames;
|
||||
std::set<int> m_regionNumbers;
|
||||
std::set<std::pair<std::string, std::string>> m_wellCompletions;
|
||||
std::set<std::pair<std::string, int>> m_wellSegmentNumbers;
|
||||
std::set<std::string> m_blocks;
|
||||
|
||||
std::set<RifEclipseSummaryAddress::SummaryVarCategory> m_categories;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user