mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
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:
@@ -25,6 +25,7 @@
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigGridBase.h"
|
||||
#include "RigSimWellData.h"
|
||||
#include "RigWellResultFrame.h"
|
||||
#include "RigWellResultPoint.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
@@ -173,7 +174,7 @@ public:
|
||||
qint32 wellStatus = 0;
|
||||
if ( currentWellResult->hasWellResult( tsIdx ) )
|
||||
{
|
||||
switch ( currentWellResult->wellResultFrame( tsIdx )->m_productionType )
|
||||
switch ( currentWellResult->wellResultFrame( tsIdx )->productionType() )
|
||||
{
|
||||
case RiaDefines::WellProductionType::PRODUCER:
|
||||
wellType = "Producer";
|
||||
@@ -189,7 +190,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
wellStatus = currentWellResult->wellResultFrame( tsIdx )->m_isOpen ? 1 : 0;
|
||||
wellStatus = currentWellResult->wellResultFrame( tsIdx )->isOpen() ? 1 : 0;
|
||||
}
|
||||
|
||||
wellTypes.push_back( wellType );
|
||||
@@ -283,29 +284,25 @@ public:
|
||||
std::vector<RigGridBase*> grids;
|
||||
rimCase->eclipseCaseData()->allGrids( &grids );
|
||||
|
||||
for ( size_t bIdx = 0; bIdx < wellResFrame->m_wellResultBranches.size(); ++bIdx )
|
||||
for ( const auto& wellResultBranch : wellResFrame->wellResultBranches() )
|
||||
{
|
||||
const std::vector<RigWellResultPoint>& branchResPoints = wellResFrame->m_wellResultBranches[bIdx].m_branchResultPoints;
|
||||
for ( size_t rpIdx = 0; rpIdx < branchResPoints.size(); ++rpIdx )
|
||||
for ( const auto& branchResultPoint : wellResultBranch.branchResultPoints() )
|
||||
{
|
||||
const RigWellResultPoint& resPoint = branchResPoints[rpIdx];
|
||||
|
||||
if ( resPoint.isCell() )
|
||||
if ( branchResultPoint.isCell() )
|
||||
{
|
||||
size_t i;
|
||||
size_t j;
|
||||
size_t k;
|
||||
size_t gridIdx = resPoint.gridIndex();
|
||||
grids[gridIdx]->ijkFromCellIndex( resPoint.cellIndex(), &i, &j, &k );
|
||||
bool isOpen = resPoint.isOpen();
|
||||
int branchId = resPoint.branchId();
|
||||
int segmentId = resPoint.segmentId();
|
||||
|
||||
size_t gridIdx = branchResultPoint.gridIndex();
|
||||
grids[gridIdx]->ijkFromCellIndex( branchResultPoint.cellIndex(), &i, &j, &k );
|
||||
bool isOpen = branchResultPoint.isOpen();
|
||||
int branchId = branchResultPoint.branchId();
|
||||
int segmentId = branchResultPoint.segmentId();
|
||||
cellIs.push_back( static_cast<qint32>( i + 1 ) ); // NB: 1-based index in Octave
|
||||
cellJs.push_back( static_cast<qint32>( j + 1 ) ); // NB: 1-based index in Octave
|
||||
cellKs.push_back( static_cast<qint32>( k + 1 ) ); // NB: 1-based index in Octave
|
||||
gridIndices.push_back( static_cast<qint32>( gridIdx ) );
|
||||
cellStatuses.push_back( static_cast<qint32>( isOpen ) );
|
||||
cellStatuses.push_back( isOpen ? static_cast<qint32>( 1 ) : static_cast<qint32>( 0 ) );
|
||||
branchIds.push_back( branchId );
|
||||
segmentIds.push_back( segmentId );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user