Refactor classes in RigWellResultPoint.h

* Move RigWellResultFrame implementation into separate file
Update/correct includes accordingly

* First step of moving attributes from public to private
- Move public members to private and create interface
- Single public member remains due to strong dependency on usage of reference and reference to its object public members

* Second step of moving attributes from public to privatee
- Remove usage of reference directly to attributes. Interface with copy and set.
- Moving attributes in RigWellResultFrame and RigWellResultBranch

* Move class RigWellResultBranch into separate file
This commit is contained in:
Jørgen Herje
2023-04-14 11:00:45 +02:00
committed by GitHub
parent dc4d4022d2
commit 457dc9080f
36 changed files with 653 additions and 999 deletions

View File

@@ -24,6 +24,7 @@
#include "RigFlowDiagResults.h"
#include "RigMainGrid.h"
#include "RigSimWellData.h"
#include "RigWellResultFrame.h"
#include "RigWellResultPoint.h"
#include "RimEclipseResultCase.h"
@@ -178,8 +179,8 @@ std::map<std::string, std::vector<int>> RimFlowDiagSolution::allTracerActiveCell
if ( !simWellData[wIdx]->hasWellResult( timeStepIndex ) ) continue;
const RigWellResultFrame* wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex );
bool isInjectorWell = ( wellResFrame->m_productionType != RiaDefines::WellProductionType::PRODUCER &&
wellResFrame->m_productionType != RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE );
bool isInjectorWell = ( wellResFrame->productionType() != RiaDefines::WellProductionType::PRODUCER &&
wellResFrame->productionType() != RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE );
std::string wellName = simWellData[wIdx]->m_wellName.toStdString();
std::string wellNameXf = addCrossFlowEnding( simWellData[wIdx]->m_wellName ).toStdString();
@@ -187,9 +188,9 @@ std::map<std::string, std::vector<int>> RimFlowDiagSolution::allTracerActiveCell
std::vector<int>& tracerCells = tracersWithCells[wellName];
std::vector<int>& tracerCellsCrossFlow = tracersWithCells[wellNameXf];
for ( const RigWellResultBranch& wBr : wellResFrame->m_wellResultBranches )
for ( const RigWellResultBranch& wBr : wellResFrame->wellResultBranches() )
{
for ( const RigWellResultPoint& wrp : wBr.m_branchResultPoints )
for ( const RigWellResultPoint& wrp : wBr.branchResultPoints() )
{
if ( wrp.isValid() && wrp.isOpen() &&
( ( useInjectors && wrp.flowRate() < 0.0 ) || ( !useInjectors && wrp.flowRate() > 0.0 ) ) )
@@ -241,14 +242,14 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusOverall(
tracerStatus = TracerStatusType::CLOSED;
for ( const RigWellResultFrame& wellResFrame : simWellData[wIdx]->m_wellCellsTimeSteps )
{
if ( RiaDefines::isInjector( wellResFrame.m_productionType ) )
if ( RiaDefines::isInjector( wellResFrame.productionType() ) )
{
if ( tracerStatus == TracerStatusType::PRODUCER )
tracerStatus = TracerStatusType::VARYING;
else
tracerStatus = TracerStatusType::INJECTOR;
}
else if ( wellResFrame.m_productionType == RiaDefines::WellProductionType::PRODUCER )
else if ( wellResFrame.productionType() == RiaDefines::WellProductionType::PRODUCER )
{
if ( tracerStatus == TracerStatusType::INJECTOR )
tracerStatus = TracerStatusType::VARYING;
@@ -294,14 +295,14 @@ RimFlowDiagSolution::TracerStatusType RimFlowDiagSolution::tracerStatusInTimeSte
const RigWellResultFrame* wellResFrame = simWellData[wIdx]->wellResultFrame( timeStepIndex );
if ( RiaDefines::isInjector( wellResFrame->m_productionType ) )
if ( RiaDefines::isInjector( wellResFrame->productionType() ) )
{
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::PRODUCER;
return TracerStatusType::INJECTOR;
}
else if ( wellResFrame->m_productionType == RiaDefines::WellProductionType::PRODUCER ||
wellResFrame->m_productionType == RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
else if ( wellResFrame->productionType() == RiaDefines::WellProductionType::PRODUCER ||
wellResFrame->productionType() == RiaDefines::WellProductionType::UNDEFINED_PRODUCTION_TYPE )
{
if ( hasCrossFlowEnding( tracerName ) ) return TracerStatusType::INJECTOR;

View File

@@ -28,7 +28,7 @@
#include "RigSimWellData.h"
#include "RigSimulationWellCenterLineCalculator.h"
#include "RigSimulationWellCoordsAndMD.h"
#include "RigWellResultPoint.h"
#include "RigWellResultFrame.h"
#include "RimEclipseCase.h"
#include "RimEclipseCaseTools.h"
@@ -501,7 +501,7 @@ QString RimWellAllocationPlot::wellStatusTextForTimeStep( const QString& wellNam
{
const RigWellResultFrame* wellResultFrame = simWellData->wellResultFrame( timeStep );
RiaDefines::WellProductionType prodType = wellResultFrame->m_productionType;
RiaDefines::WellProductionType prodType = wellResultFrame->productionType();
switch ( prodType )
{

View File

@@ -27,6 +27,7 @@
#include "RigSimWellData.h"
#include "RigSimulationWellCenterLineCalculator.h"
#include "RigWellAllocationOverTime.h"
#include "RigWellResultFrame.h"
#include "RimEclipseCaseTools.h"
#include "RimEclipseCellColors.h"

View File

@@ -34,6 +34,7 @@
#include "RigSimWellData.h"
#include "RigWellLogExtractor.h"
#include "RigWellPath.h"
#include "RigWellResultFrame.h"
#include "RigWellResultPoint.h"
#include "RimDataSourceForRftPlt.h"
@@ -409,9 +410,9 @@ public:
const RigMainGrid* mainGrid = eclCase->eclipseCaseData()->mainGrid();
for ( size_t brIdx = 0; brIdx < resFrame->m_wellResultBranches.size(); ++brIdx )
for ( size_t brIdx = 0; brIdx < resFrame->wellResultBranches().size(); ++brIdx )
{
const std::vector<RigWellResultPoint>& branchResPoints = resFrame->m_wellResultBranches[brIdx].m_branchResultPoints;
const std::vector<RigWellResultPoint> branchResPoints = resFrame->branchResultPointsFromBranchIndex( brIdx );
for ( size_t wrpIdx = 0; wrpIdx < branchResPoints.size(); wrpIdx++ )
{
const RigGridBase* grid = mainGrid->gridByIndex( branchResPoints[wrpIdx].gridIndex() );
@@ -447,9 +448,9 @@ public:
m_pipeBranchCLCoords.push_back( intersections[wpExIdx].endPoint );
m_pipeBranchMeasuredDepths.push_back( intersections[wpExIdx].endMD );
const RigWellResultPoint& resPoint = resFrame->m_wellResultBranches[it->second.first].m_branchResultPoints[it->second.second];
const RigWellResultPoint resPoint = resFrame->branchResultPointsFromBranchIndex( it->second.first )[it->second.second];
m_pipeBranchWellResultPoints.push_back( resPoint );
if ( wpExIdx < intersections.size() - 1 )
{
m_pipeBranchWellResultPoints.push_back( RigWellResultPoint() ); // Invalid res point describing the