mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -45,20 +45,20 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigEclipseCaseData::RigEclipseCaseData(RimEclipseCase* ownerCase)
|
||||
: m_hasParsedDeckForEquilData(false)
|
||||
RigEclipseCaseData::RigEclipseCaseData( RimEclipseCase* ownerCase )
|
||||
: m_hasParsedDeckForEquilData( false )
|
||||
{
|
||||
m_mainGrid = new RigMainGrid();
|
||||
m_ownerCase = ownerCase;
|
||||
|
||||
m_matrixModelResults = new RigCaseCellResultsData(this, RiaDefines::MATRIX_MODEL);
|
||||
m_fractureModelResults = new RigCaseCellResultsData(this, RiaDefines::FRACTURE_MODEL);
|
||||
m_matrixModelResults = new RigCaseCellResultsData( this, RiaDefines::MATRIX_MODEL );
|
||||
m_fractureModelResults = new RigCaseCellResultsData( this, RiaDefines::FRACTURE_MODEL );
|
||||
|
||||
m_activeCellInfo = new RigActiveCellInfo;
|
||||
m_fractureActiveCellInfo = new RigActiveCellInfo;
|
||||
|
||||
m_matrixModelResults->setActiveCellInfo(m_activeCellInfo.p());
|
||||
m_fractureModelResults->setActiveCellInfo(m_fractureActiveCellInfo.p());
|
||||
m_matrixModelResults->setActiveCellInfo( m_activeCellInfo.p() );
|
||||
m_fractureModelResults->setActiveCellInfo( m_fractureActiveCellInfo.p() );
|
||||
|
||||
m_unitsType = RiaEclipseUnitTools::UNITS_METRIC;
|
||||
}
|
||||
@@ -87,90 +87,90 @@ const RigMainGrid* RigEclipseCaseData::mainGrid() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::setMainGrid(RigMainGrid* mainGrid)
|
||||
void RigEclipseCaseData::setMainGrid( RigMainGrid* mainGrid )
|
||||
{
|
||||
m_mainGrid = mainGrid;
|
||||
|
||||
m_matrixModelResults->setMainGrid(m_mainGrid.p());
|
||||
m_fractureModelResults->setMainGrid(m_mainGrid.p());
|
||||
m_matrixModelResults->setMainGrid( m_mainGrid.p() );
|
||||
m_fractureModelResults->setMainGrid( m_mainGrid.p() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::allGrids(std::vector<RigGridBase*>* grids)
|
||||
void RigEclipseCaseData::allGrids( std::vector<RigGridBase*>* grids )
|
||||
{
|
||||
CVF_ASSERT(grids);
|
||||
CVF_ASSERT( grids );
|
||||
|
||||
if (m_mainGrid.isNull())
|
||||
if ( m_mainGrid.isNull() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < m_mainGrid->gridCount(); i++)
|
||||
for ( i = 0; i < m_mainGrid->gridCount(); i++ )
|
||||
{
|
||||
grids->push_back(m_mainGrid->gridByIndex(i));
|
||||
grids->push_back( m_mainGrid->gridByIndex( i ) );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::allGrids(std::vector<const RigGridBase*>* grids) const
|
||||
void RigEclipseCaseData::allGrids( std::vector<const RigGridBase*>* grids ) const
|
||||
{
|
||||
CVF_ASSERT(grids);
|
||||
CVF_ASSERT( grids );
|
||||
|
||||
if (m_mainGrid.isNull())
|
||||
if ( m_mainGrid.isNull() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < m_mainGrid->gridCount(); i++)
|
||||
for ( i = 0; i < m_mainGrid->gridCount(); i++ )
|
||||
{
|
||||
grids->push_back(m_mainGrid->gridByIndex(i));
|
||||
grids->push_back( m_mainGrid->gridByIndex( i ) );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Get grid by index. The main grid has index 0, so the first lgr has index 1
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigGridBase* RigEclipseCaseData::grid(size_t index) const
|
||||
const RigGridBase* RigEclipseCaseData::grid( size_t index ) const
|
||||
{
|
||||
CVF_ASSERT(m_mainGrid.notNull());
|
||||
return m_mainGrid->gridByIndex(index);
|
||||
CVF_ASSERT( m_mainGrid.notNull() );
|
||||
return m_mainGrid->gridByIndex( index );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Get grid by index. The main grid has index 0, so the first lgr has index 1
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigGridBase* RigEclipseCaseData::grid(size_t index)
|
||||
RigGridBase* RigEclipseCaseData::grid( size_t index )
|
||||
{
|
||||
CVF_ASSERT(m_mainGrid.notNull());
|
||||
return m_mainGrid->gridByIndex(index);
|
||||
CVF_ASSERT( m_mainGrid.notNull() );
|
||||
return m_mainGrid->gridByIndex( index );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigGridBase* RigEclipseCaseData::grid(const QString& gridName) const
|
||||
const RigGridBase* RigEclipseCaseData::grid( const QString& gridName ) const
|
||||
{
|
||||
if (m_mainGrid.isNull())
|
||||
if ( m_mainGrid.isNull() )
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (gridName.isEmpty())
|
||||
if ( gridName.isEmpty() )
|
||||
{
|
||||
return m_mainGrid.p();
|
||||
}
|
||||
|
||||
size_t i;
|
||||
for (i = 0; i < m_mainGrid->gridCount(); i++)
|
||||
for ( i = 0; i < m_mainGrid->gridCount(); i++ )
|
||||
{
|
||||
const RigGridBase* grid = m_mainGrid->gridByIndex(i);
|
||||
if (QString::fromStdString(grid->gridName()) == gridName) return grid;
|
||||
const RigGridBase* grid = m_mainGrid->gridByIndex( i );
|
||||
if ( QString::fromStdString( grid->gridName() ) == gridName ) return grid;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ const RigGridBase* RigEclipseCaseData::grid(const QString& gridName) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigEclipseCaseData::gridCount() const
|
||||
{
|
||||
CVF_ASSERT(m_mainGrid.notNull());
|
||||
CVF_ASSERT( m_mainGrid.notNull() );
|
||||
return m_mainGrid->gridCount();
|
||||
}
|
||||
|
||||
@@ -190,10 +190,10 @@ size_t RigEclipseCaseData::gridCount() const
|
||||
void RigEclipseCaseData::computeWellCellsPrGrid()
|
||||
{
|
||||
// If we have computed this already, return
|
||||
if (m_wellCellsInGrid.size()) return;
|
||||
if ( m_wellCellsInGrid.size() ) return;
|
||||
|
||||
std::vector<RigGridBase*> grids;
|
||||
this->allGrids(&grids);
|
||||
this->allGrids( &grids );
|
||||
|
||||
// Debug code used to display grid names and grid sizes
|
||||
/*
|
||||
@@ -217,50 +217,50 @@ void RigEclipseCaseData::computeWellCellsPrGrid()
|
||||
|
||||
// Allocate and initialize the arrays
|
||||
|
||||
m_wellCellsInGrid.resize(grids.size());
|
||||
m_gridCellToResultWellIndex.resize(grids.size());
|
||||
m_wellCellsInGrid.resize( grids.size() );
|
||||
m_gridCellToResultWellIndex.resize( grids.size() );
|
||||
|
||||
for (gIdx = 0; gIdx < grids.size(); ++gIdx)
|
||||
for ( gIdx = 0; gIdx < grids.size(); ++gIdx )
|
||||
{
|
||||
if (m_wellCellsInGrid[gIdx].isNull() || m_wellCellsInGrid[gIdx]->size() != grids[gIdx]->cellCount())
|
||||
if ( m_wellCellsInGrid[gIdx].isNull() || m_wellCellsInGrid[gIdx]->size() != grids[gIdx]->cellCount() )
|
||||
{
|
||||
m_wellCellsInGrid[gIdx] = new cvf::UByteArray;
|
||||
m_wellCellsInGrid[gIdx]->resize(grids[gIdx]->cellCount());
|
||||
m_wellCellsInGrid[gIdx]->resize( grids[gIdx]->cellCount() );
|
||||
|
||||
m_gridCellToResultWellIndex[gIdx] = new cvf::UIntArray;
|
||||
m_gridCellToResultWellIndex[gIdx]->resize(grids[gIdx]->cellCount());
|
||||
m_gridCellToResultWellIndex[gIdx]->resize( grids[gIdx]->cellCount() );
|
||||
}
|
||||
m_wellCellsInGrid[gIdx]->setAll(false);
|
||||
m_gridCellToResultWellIndex[gIdx]->setAll(cvf::UNDEFINED_UINT);
|
||||
m_wellCellsInGrid[gIdx]->setAll( false );
|
||||
m_gridCellToResultWellIndex[gIdx]->setAll( cvf::UNDEFINED_UINT );
|
||||
}
|
||||
|
||||
// Fill arrays with data
|
||||
size_t wIdx;
|
||||
for (wIdx = 0; wIdx < m_simWellData.size(); ++wIdx)
|
||||
for ( wIdx = 0; wIdx < m_simWellData.size(); ++wIdx )
|
||||
{
|
||||
size_t tIdx;
|
||||
for (tIdx = 0; tIdx < m_simWellData[wIdx]->m_wellCellsTimeSteps.size(); ++tIdx)
|
||||
for ( tIdx = 0; tIdx < m_simWellData[wIdx]->m_wellCellsTimeSteps.size(); ++tIdx )
|
||||
{
|
||||
RigWellResultFrame& wellCells = m_simWellData[wIdx]->m_wellCellsTimeSteps[tIdx];
|
||||
|
||||
// Well result branches
|
||||
for (size_t sIdx = 0; sIdx < wellCells.m_wellResultBranches.size(); ++sIdx)
|
||||
for ( size_t sIdx = 0; sIdx < wellCells.m_wellResultBranches.size(); ++sIdx )
|
||||
{
|
||||
RigWellResultBranch& wellSegment = wellCells.m_wellResultBranches[sIdx];
|
||||
|
||||
size_t cdIdx;
|
||||
for (cdIdx = 0; cdIdx < wellSegment.m_branchResultPoints.size(); ++cdIdx)
|
||||
for ( cdIdx = 0; cdIdx < wellSegment.m_branchResultPoints.size(); ++cdIdx )
|
||||
{
|
||||
size_t gridIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridIndex;
|
||||
size_t gridCellIndex = wellSegment.m_branchResultPoints[cdIdx].m_gridCellIndex;
|
||||
|
||||
if (gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size())
|
||||
if ( gridIndex < m_wellCellsInGrid.size() && gridCellIndex < m_wellCellsInGrid[gridIndex]->size() )
|
||||
{
|
||||
// NOTE : We do not check if the grid cell is active as we do for well head.
|
||||
// If we add test for active cell, thorough testing and verification of the new behaviour must be adressed
|
||||
|
||||
m_wellCellsInGrid[gridIndex]->set(gridCellIndex, true);
|
||||
m_gridCellToResultWellIndex[gridIndex]->set(gridCellIndex, static_cast<cvf::uint>(wIdx));
|
||||
m_wellCellsInGrid[gridIndex]->set( gridCellIndex, true );
|
||||
m_gridCellToResultWellIndex[gridIndex]->set( gridCellIndex, static_cast<cvf::uint>( wIdx ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -271,7 +271,7 @@ void RigEclipseCaseData::computeWellCellsPrGrid()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::setSimWellData(const cvf::Collection<RigSimWellData>& data)
|
||||
void RigEclipseCaseData::setSimWellData( const cvf::Collection<RigSimWellData>& data )
|
||||
{
|
||||
m_simWellData = data;
|
||||
m_wellCellsInGrid.clear();
|
||||
@@ -289,9 +289,9 @@ std::set<QString> RigEclipseCaseData::findSortedWellNames() const
|
||||
|
||||
const cvf::Collection<RigSimWellData>& simWellData = wellResults();
|
||||
|
||||
for (size_t wIdx = 0; wIdx < simWellData.size(); ++wIdx)
|
||||
for ( size_t wIdx = 0; wIdx < simWellData.size(); ++wIdx )
|
||||
{
|
||||
sortedWellNames.insert(simWellData[wIdx]->m_wellName);
|
||||
sortedWellNames.insert( simWellData[wIdx]->m_wellName );
|
||||
}
|
||||
|
||||
return sortedWellNames;
|
||||
@@ -300,11 +300,11 @@ std::set<QString> RigEclipseCaseData::findSortedWellNames() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigSimWellData* RigEclipseCaseData::findSimWellData(QString wellName) const
|
||||
const RigSimWellData* RigEclipseCaseData::findSimWellData( QString wellName ) const
|
||||
{
|
||||
for (size_t wIdx = 0; wIdx < m_simWellData.size(); ++wIdx)
|
||||
for ( size_t wIdx = 0; wIdx < m_simWellData.size(); ++wIdx )
|
||||
{
|
||||
if (m_simWellData[wIdx]->m_wellName == wellName)
|
||||
if ( m_simWellData[wIdx]->m_wellName == wellName )
|
||||
{
|
||||
return m_simWellData[wIdx].p();
|
||||
}
|
||||
@@ -316,10 +316,10 @@ const RigSimWellData* RigEclipseCaseData::findSimWellData(QString wellName) cons
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const cvf::UByteArray* RigEclipseCaseData::wellCellsInGrid(size_t gridIndex)
|
||||
const cvf::UByteArray* RigEclipseCaseData::wellCellsInGrid( size_t gridIndex )
|
||||
{
|
||||
computeWellCellsPrGrid();
|
||||
CVF_ASSERT(gridIndex < m_wellCellsInGrid.size());
|
||||
CVF_ASSERT( gridIndex < m_wellCellsInGrid.size() );
|
||||
|
||||
return m_wellCellsInGrid[gridIndex].p();
|
||||
}
|
||||
@@ -327,10 +327,10 @@ const cvf::UByteArray* RigEclipseCaseData::wellCellsInGrid(size_t gridIndex)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const cvf::UIntArray* RigEclipseCaseData::gridCellToResultWellIndex(size_t gridIndex)
|
||||
const cvf::UIntArray* RigEclipseCaseData::gridCellToResultWellIndex( size_t gridIndex )
|
||||
{
|
||||
computeWellCellsPrGrid();
|
||||
CVF_ASSERT(gridIndex < m_gridCellToResultWellIndex.size());
|
||||
CVF_ASSERT( gridIndex < m_gridCellToResultWellIndex.size() );
|
||||
|
||||
return m_gridCellToResultWellIndex[gridIndex].p();
|
||||
}
|
||||
@@ -338,25 +338,25 @@ const cvf::UIntArray* RigEclipseCaseData::gridCellToResultWellIndex(size_t gridI
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigCell& RigEclipseCaseData::cellFromWellResultCell(const RigWellResultPoint& wellResultCell) const
|
||||
const RigCell& RigEclipseCaseData::cellFromWellResultCell( const RigWellResultPoint& wellResultCell ) const
|
||||
{
|
||||
CVF_ASSERT(wellResultCell.isCell());
|
||||
CVF_ASSERT( wellResultCell.isCell() );
|
||||
|
||||
size_t gridIndex = wellResultCell.m_gridIndex;
|
||||
size_t gridCellIndex = wellResultCell.m_gridCellIndex;
|
||||
|
||||
std::vector<const RigGridBase*> grids;
|
||||
allGrids(&grids);
|
||||
allGrids( &grids );
|
||||
|
||||
return grids[gridIndex]->cell(gridCellIndex);
|
||||
return grids[gridIndex]->cell( gridCellIndex );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigEclipseCaseData::findSharedSourceFace(cvf::StructGridInterface::FaceType& sharedSourceFace,
|
||||
const RigWellResultPoint& sourceWellCellResult,
|
||||
const RigWellResultPoint& otherWellCellResult) const
|
||||
bool RigEclipseCaseData::findSharedSourceFace( cvf::StructGridInterface::FaceType& sharedSourceFace,
|
||||
const RigWellResultPoint& sourceWellCellResult,
|
||||
const RigWellResultPoint& otherWellCellResult ) const
|
||||
{
|
||||
size_t gridIndex = sourceWellCellResult.m_gridIndex;
|
||||
size_t gridCellIndex = sourceWellCellResult.m_gridCellIndex;
|
||||
@@ -364,28 +364,28 @@ bool RigEclipseCaseData::findSharedSourceFace(cvf::StructGridInterface::FaceType
|
||||
size_t otherGridIndex = otherWellCellResult.m_gridIndex;
|
||||
size_t otherGridCellIndex = otherWellCellResult.m_gridCellIndex;
|
||||
|
||||
if (gridIndex != otherGridIndex) return false;
|
||||
if ( gridIndex != otherGridIndex ) return false;
|
||||
|
||||
std::vector<const RigGridBase*> grids;
|
||||
allGrids(&grids);
|
||||
allGrids( &grids );
|
||||
|
||||
const RigGridBase* grid = grids[gridIndex];
|
||||
size_t i, j, k;
|
||||
grid->ijkFromCellIndex(gridCellIndex, &i, &j, &k);
|
||||
grid->ijkFromCellIndex( gridCellIndex, &i, &j, &k );
|
||||
|
||||
size_t faceIdx;
|
||||
for (faceIdx = 0; faceIdx < 6; faceIdx++)
|
||||
for ( faceIdx = 0; faceIdx < 6; faceIdx++ )
|
||||
{
|
||||
cvf::StructGridInterface::FaceType sourceFace = static_cast<cvf::StructGridInterface::FaceType>(faceIdx);
|
||||
cvf::StructGridInterface::FaceType sourceFace = static_cast<cvf::StructGridInterface::FaceType>( faceIdx );
|
||||
|
||||
size_t ni, nj, nk;
|
||||
grid->neighborIJKAtCellFace(i, j, k, sourceFace, &ni, &nj, &nk);
|
||||
grid->neighborIJKAtCellFace( i, j, k, sourceFace, &ni, &nj, &nk );
|
||||
|
||||
if (grid->isCellValid(ni, nj, nk))
|
||||
if ( grid->isCellValid( ni, nj, nk ) )
|
||||
{
|
||||
size_t neighborCellIndex = grid->cellIndexFromIJK(ni, nj, nk);
|
||||
size_t neighborCellIndex = grid->cellIndexFromIJK( ni, nj, nk );
|
||||
|
||||
if (neighborCellIndex == otherGridCellIndex)
|
||||
if ( neighborCellIndex == otherGridCellIndex )
|
||||
{
|
||||
sharedSourceFace = sourceFace;
|
||||
return true;
|
||||
@@ -403,20 +403,20 @@ class CellRangeBB
|
||||
{
|
||||
public:
|
||||
CellRangeBB()
|
||||
: m_min(cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T)
|
||||
, m_max(cvf::Vec3st::ZERO)
|
||||
: m_min( cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T, cvf::UNDEFINED_SIZE_T )
|
||||
, m_max( cvf::Vec3st::ZERO )
|
||||
{
|
||||
}
|
||||
|
||||
void add(size_t i, size_t j, size_t k)
|
||||
void add( size_t i, size_t j, size_t k )
|
||||
{
|
||||
if (i < m_min.x()) m_min.x() = i;
|
||||
if (j < m_min.y()) m_min.y() = j;
|
||||
if (k < m_min.z()) m_min.z() = k;
|
||||
if ( i < m_min.x() ) m_min.x() = i;
|
||||
if ( j < m_min.y() ) m_min.y() = j;
|
||||
if ( k < m_min.z() ) m_min.z() = k;
|
||||
|
||||
if (i > m_max.x()) m_max.x() = i;
|
||||
if (j > m_max.y()) m_max.y() = j;
|
||||
if (k > m_max.z()) m_max.z() = k;
|
||||
if ( i > m_max.x() ) m_max.x() = i;
|
||||
if ( j > m_max.y() ) m_max.y() = j;
|
||||
if ( k > m_max.z() ) m_max.z() = k;
|
||||
}
|
||||
|
||||
public:
|
||||
@@ -429,29 +429,29 @@ public:
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::computeActiveCellIJKBBox()
|
||||
{
|
||||
if (m_mainGrid.notNull() && m_activeCellInfo.notNull() && m_fractureActiveCellInfo.notNull())
|
||||
if ( m_mainGrid.notNull() && m_activeCellInfo.notNull() && m_fractureActiveCellInfo.notNull() )
|
||||
{
|
||||
CellRangeBB matrixModelActiveBB;
|
||||
CellRangeBB fractureModelActiveBB;
|
||||
|
||||
size_t idx;
|
||||
for (idx = 0; idx < m_mainGrid->cellCount(); idx++)
|
||||
for ( idx = 0; idx < m_mainGrid->cellCount(); idx++ )
|
||||
{
|
||||
size_t i, j, k;
|
||||
m_mainGrid->ijkFromCellIndex(idx, &i, &j, &k);
|
||||
m_mainGrid->ijkFromCellIndex( idx, &i, &j, &k );
|
||||
|
||||
if (m_activeCellInfo->isActive(idx))
|
||||
if ( m_activeCellInfo->isActive( idx ) )
|
||||
{
|
||||
matrixModelActiveBB.add(i, j, k);
|
||||
matrixModelActiveBB.add( i, j, k );
|
||||
}
|
||||
|
||||
if (m_fractureActiveCellInfo->isActive(idx))
|
||||
if ( m_fractureActiveCellInfo->isActive( idx ) )
|
||||
{
|
||||
fractureModelActiveBB.add(i, j, k);
|
||||
fractureModelActiveBB.add( i, j, k );
|
||||
}
|
||||
}
|
||||
m_activeCellInfo->setIJKBoundingBox(matrixModelActiveBB.m_min, matrixModelActiveBB.m_max);
|
||||
m_fractureActiveCellInfo->setIJKBoundingBox(fractureModelActiveBB.m_min, fractureModelActiveBB.m_max);
|
||||
m_activeCellInfo->setIJKBoundingBox( matrixModelActiveBB.m_min, matrixModelActiveBB.m_max );
|
||||
m_fractureActiveCellInfo->setIJKBoundingBox( fractureModelActiveBB.m_min, fractureModelActiveBB.m_max );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -470,9 +470,9 @@ void RigEclipseCaseData::computeActiveCellBoundingBoxes()
|
||||
std::vector<QString> RigEclipseCaseData::simulationWellNames() const
|
||||
{
|
||||
std::vector<QString> wellNames;
|
||||
for (const auto& wellResult : wellResults())
|
||||
for ( const auto& wellResult : wellResults() )
|
||||
{
|
||||
wellNames.push_back(wellResult->m_wellName);
|
||||
wellNames.push_back( wellResult->m_wellName );
|
||||
}
|
||||
return wellNames;
|
||||
}
|
||||
@@ -480,57 +480,63 @@ std::vector<QString> RigEclipseCaseData::simulationWellNames() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigEclipseCaseData::hasSimulationWell(const QString& simWellName) const
|
||||
bool RigEclipseCaseData::hasSimulationWell( const QString& simWellName ) const
|
||||
{
|
||||
const auto wellNames = simulationWellNames();
|
||||
return std::find(wellNames.begin(), wellNames.end(), simWellName) != wellNames.end();
|
||||
return std::find( wellNames.begin(), wellNames.end(), simWellName ) != wellNames.end();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<const RigWellPath*> RigEclipseCaseData::simulationWellBranches(const QString& simWellName,
|
||||
bool includeAllCellCenters,
|
||||
bool useAutoDetectionOfBranches) const
|
||||
std::vector<const RigWellPath*> RigEclipseCaseData::simulationWellBranches( const QString& simWellName,
|
||||
bool includeAllCellCenters,
|
||||
bool useAutoDetectionOfBranches ) const
|
||||
{
|
||||
std::vector<const RigWellPath*> branches;
|
||||
|
||||
if (simWellName.isEmpty() || simWellName.toUpper() == "NONE")
|
||||
if ( simWellName.isEmpty() || simWellName.toUpper() == "NONE" )
|
||||
{
|
||||
return branches;
|
||||
}
|
||||
|
||||
const RigSimWellData* simWellData = findSimWellData(simWellName);
|
||||
if (!simWellData) return branches;
|
||||
const RigSimWellData* simWellData = findSimWellData( simWellName );
|
||||
if ( !simWellData ) return branches;
|
||||
|
||||
std::tuple<QString, bool, bool> simWellSeachItem =
|
||||
std::make_tuple(simWellName, includeAllCellCenters, useAutoDetectionOfBranches);
|
||||
std::tuple<QString, bool, bool> simWellSeachItem = std::make_tuple( simWellName,
|
||||
includeAllCellCenters,
|
||||
useAutoDetectionOfBranches );
|
||||
|
||||
if (m_simWellBranchCache.find(simWellSeachItem) == m_simWellBranchCache.end())
|
||||
if ( m_simWellBranchCache.find( simWellSeachItem ) == m_simWellBranchCache.end() )
|
||||
{
|
||||
std::vector<std::vector<cvf::Vec3d>> pipeBranchesCLCoords;
|
||||
std::vector<std::vector<RigWellResultPoint>> pipeBranchesCellIds;
|
||||
|
||||
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame(
|
||||
this, simWellData, -1, useAutoDetectionOfBranches, includeAllCellCenters, pipeBranchesCLCoords, pipeBranchesCellIds);
|
||||
RigSimulationWellCenterLineCalculator::calculateWellPipeCenterlineFromWellFrame( this,
|
||||
simWellData,
|
||||
-1,
|
||||
useAutoDetectionOfBranches,
|
||||
includeAllCellCenters,
|
||||
pipeBranchesCLCoords,
|
||||
pipeBranchesCellIds );
|
||||
|
||||
m_simWellBranchCache.insert(std::make_pair(simWellSeachItem, cvf::Collection<RigWellPath>()));
|
||||
m_simWellBranchCache.insert( std::make_pair( simWellSeachItem, cvf::Collection<RigWellPath>() ) );
|
||||
|
||||
for (size_t brIdx = 0; brIdx < pipeBranchesCLCoords.size(); ++brIdx)
|
||||
for ( size_t brIdx = 0; brIdx < pipeBranchesCLCoords.size(); ++brIdx )
|
||||
{
|
||||
auto wellMdCalculator = RigSimulationWellCoordsAndMD(pipeBranchesCLCoords[brIdx]);
|
||||
auto wellMdCalculator = RigSimulationWellCoordsAndMD( pipeBranchesCLCoords[brIdx] );
|
||||
|
||||
cvf::ref<RigWellPath> newWellPath = new RigWellPath();
|
||||
newWellPath->m_measuredDepths = wellMdCalculator.measuredDepths();
|
||||
newWellPath->m_wellPathPoints = wellMdCalculator.wellPathPoints();
|
||||
|
||||
m_simWellBranchCache[simWellSeachItem].push_back(newWellPath.p());
|
||||
m_simWellBranchCache[simWellSeachItem].push_back( newWellPath.p() );
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto& branch : m_simWellBranchCache[simWellSeachItem])
|
||||
for ( const auto& branch : m_simWellBranchCache[simWellSeachItem] )
|
||||
{
|
||||
branches.push_back(branch.p());
|
||||
branches.push_back( branch.p() );
|
||||
}
|
||||
|
||||
return branches;
|
||||
@@ -540,7 +546,7 @@ std::vector<const RigWellPath*> RigEclipseCaseData::simulationWellBranches(const
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::setVirtualPerforationTransmissibilities(
|
||||
RigVirtualPerforationTransmissibilities* virtualPerforationTransmissibilities)
|
||||
RigVirtualPerforationTransmissibilities* virtualPerforationTransmissibilities )
|
||||
{
|
||||
m_virtualPerforationTransmissibilities = virtualPerforationTransmissibilities;
|
||||
}
|
||||
@@ -556,11 +562,12 @@ const RigVirtualPerforationTransmissibilities* RigEclipseCaseData::virtualPerfor
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::ensureDeckIsParsedForEquilData(const QString& dataDeckFile, const QString& includeFileAbsolutePathPrefix)
|
||||
void RigEclipseCaseData::ensureDeckIsParsedForEquilData( const QString& dataDeckFile,
|
||||
const QString& includeFileAbsolutePathPrefix )
|
||||
{
|
||||
if (!m_hasParsedDeckForEquilData)
|
||||
if ( !m_hasParsedDeckForEquilData )
|
||||
{
|
||||
RifReaderEclipseOutput::importEquilData(dataDeckFile, includeFileAbsolutePathPrefix, this);
|
||||
RifReaderEclipseOutput::importEquilData( dataDeckFile, includeFileAbsolutePathPrefix, this );
|
||||
|
||||
m_hasParsedDeckForEquilData = true;
|
||||
}
|
||||
@@ -577,7 +584,7 @@ std::vector<RigEquil> RigEclipseCaseData::equilData() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::setEquilData(const std::vector<RigEquil>& equilObjects)
|
||||
void RigEclipseCaseData::setEquilData( const std::vector<RigEquil>& equilObjects )
|
||||
{
|
||||
m_equil = equilObjects;
|
||||
}
|
||||
@@ -585,9 +592,9 @@ void RigEclipseCaseData::setEquilData(const std::vector<RigEquil>& equilObjects)
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel)
|
||||
RigActiveCellInfo* RigEclipseCaseData::activeCellInfo( RiaDefines::PorosityModelType porosityModel )
|
||||
{
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
if ( porosityModel == RiaDefines::MATRIX_MODEL )
|
||||
{
|
||||
return m_activeCellInfo.p();
|
||||
}
|
||||
@@ -598,9 +605,9 @@ RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelT
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::PorosityModelType porosityModel) const
|
||||
const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo( RiaDefines::PorosityModelType porosityModel ) const
|
||||
{
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
if ( porosityModel == RiaDefines::MATRIX_MODEL )
|
||||
{
|
||||
return m_activeCellInfo.p();
|
||||
}
|
||||
@@ -611,17 +618,18 @@ const RigActiveCellInfo* RigEclipseCaseData::activeCellInfo(RiaDefines::Porosity
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::setActiveCellInfo(RiaDefines::PorosityModelType porosityModel, RigActiveCellInfo* activeCellInfo)
|
||||
void RigEclipseCaseData::setActiveCellInfo( RiaDefines::PorosityModelType porosityModel,
|
||||
RigActiveCellInfo* activeCellInfo )
|
||||
{
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
if ( porosityModel == RiaDefines::MATRIX_MODEL )
|
||||
{
|
||||
m_activeCellInfo = activeCellInfo;
|
||||
m_matrixModelResults->setActiveCellInfo(m_activeCellInfo.p());
|
||||
m_matrixModelResults->setActiveCellInfo( m_activeCellInfo.p() );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fractureActiveCellInfo = activeCellInfo;
|
||||
m_fractureModelResults->setActiveCellInfo(m_fractureActiveCellInfo.p());
|
||||
m_fractureModelResults->setActiveCellInfo( m_fractureActiveCellInfo.p() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -630,7 +638,8 @@ void RigEclipseCaseData::setActiveCellInfo(RiaDefines::PorosityModelType porosit
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigEclipseCaseData::hasFractureResults() const
|
||||
{
|
||||
if (activeCellInfo(RiaDefines::FRACTURE_MODEL) && activeCellInfo(RiaDefines::FRACTURE_MODEL)->reservoirActiveCellCount() > 0)
|
||||
if ( activeCellInfo( RiaDefines::FRACTURE_MODEL ) &&
|
||||
activeCellInfo( RiaDefines::FRACTURE_MODEL )->reservoirActiveCellCount() > 0 )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -643,16 +652,16 @@ bool RigEclipseCaseData::hasFractureResults() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::computeActiveCellsGeometryBoundingBox()
|
||||
{
|
||||
if (m_activeCellInfo.isNull() || m_fractureActiveCellInfo.isNull())
|
||||
if ( m_activeCellInfo.isNull() || m_fractureActiveCellInfo.isNull() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_mainGrid.isNull())
|
||||
if ( m_mainGrid.isNull() )
|
||||
{
|
||||
cvf::BoundingBox bb;
|
||||
m_activeCellInfo->setGeometryBoundingBox(bb);
|
||||
m_fractureActiveCellInfo->setGeometryBoundingBox(bb);
|
||||
m_activeCellInfo->setGeometryBoundingBox( bb );
|
||||
m_fractureActiveCellInfo->setGeometryBoundingBox( bb );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -661,54 +670,54 @@ void RigEclipseCaseData::computeActiveCellsGeometryBoundingBox()
|
||||
activeInfos[1] = m_activeCellInfo.p(); // Last, to make this bb.min become display offset
|
||||
|
||||
cvf::BoundingBox bb;
|
||||
for (int acIdx = 0; acIdx < 2; ++acIdx)
|
||||
for ( int acIdx = 0; acIdx < 2; ++acIdx )
|
||||
{
|
||||
bb.reset();
|
||||
if (m_mainGrid->nodes().size() == 0)
|
||||
if ( m_mainGrid->nodes().size() == 0 )
|
||||
{
|
||||
bb.add(cvf::Vec3d::ZERO);
|
||||
bb.add( cvf::Vec3d::ZERO );
|
||||
}
|
||||
else
|
||||
{
|
||||
std::array<cvf::Vec3d, 8> hexCorners;
|
||||
for (size_t i = 0; i < m_mainGrid->cellCount(); i++)
|
||||
for ( size_t i = 0; i < m_mainGrid->cellCount(); i++ )
|
||||
{
|
||||
if (activeInfos[acIdx]->isActive(i))
|
||||
if ( activeInfos[acIdx]->isActive( i ) )
|
||||
{
|
||||
m_mainGrid->cellCornerVertices(i, hexCorners.data());
|
||||
for (const auto& corner : hexCorners)
|
||||
m_mainGrid->cellCornerVertices( i, hexCorners.data() );
|
||||
for ( const auto& corner : hexCorners )
|
||||
{
|
||||
bb.add(corner);
|
||||
bb.add( corner );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
activeInfos[acIdx]->setGeometryBoundingBox(bb);
|
||||
activeInfos[acIdx]->setGeometryBoundingBox( bb );
|
||||
}
|
||||
|
||||
m_mainGrid->setDisplayModelOffset(bb.min());
|
||||
m_mainGrid->setDisplayModelOffset( bb.min() );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::setActiveFormationNames(RigFormationNames* activeFormationNames)
|
||||
void RigEclipseCaseData::setActiveFormationNames( RigFormationNames* activeFormationNames )
|
||||
{
|
||||
m_matrixModelResults->setActiveFormationNames(activeFormationNames);
|
||||
m_matrixModelResults->setActiveFormationNames( activeFormationNames );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigEclipseCaseData::setActiveFormationNamesAndUpdatePlots(RigFormationNames* activeFormationNames)
|
||||
void RigEclipseCaseData::setActiveFormationNamesAndUpdatePlots( RigFormationNames* activeFormationNames )
|
||||
{
|
||||
setActiveFormationNames(activeFormationNames);
|
||||
setActiveFormationNames( activeFormationNames );
|
||||
|
||||
RimProject* project = RiaApplication::instance()->project();
|
||||
if (project)
|
||||
if ( project )
|
||||
{
|
||||
if (project->mainPlotCollection())
|
||||
if ( project->mainPlotCollection() )
|
||||
{
|
||||
project->mainPlotCollection->updatePlotsWithFormations();
|
||||
}
|
||||
@@ -726,9 +735,9 @@ RigFormationNames* RigEclipseCaseData::activeFormationNames()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel)
|
||||
RigCaseCellResultsData* RigEclipseCaseData::results( RiaDefines::PorosityModelType porosityModel )
|
||||
{
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
if ( porosityModel == RiaDefines::MATRIX_MODEL )
|
||||
{
|
||||
return m_matrixModelResults.p();
|
||||
}
|
||||
@@ -739,9 +748,9 @@ RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelTyp
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityModelType porosityModel) const
|
||||
const RigCaseCellResultsData* RigEclipseCaseData::results( RiaDefines::PorosityModelType porosityModel ) const
|
||||
{
|
||||
if (porosityModel == RiaDefines::MATRIX_MODEL)
|
||||
if ( porosityModel == RiaDefines::MATRIX_MODEL )
|
||||
{
|
||||
return m_matrixModelResults.p();
|
||||
}
|
||||
@@ -752,17 +761,18 @@ const RigCaseCellResultsData* RigEclipseCaseData::results(RiaDefines::PorosityMo
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<double>* RigEclipseCaseData::resultValues(RiaDefines::PorosityModelType porosityModel,
|
||||
RiaDefines::ResultCatType type,
|
||||
const QString& resultName,
|
||||
size_t timeStepIndex)
|
||||
const std::vector<double>* RigEclipseCaseData::resultValues( RiaDefines::PorosityModelType porosityModel,
|
||||
RiaDefines::ResultCatType type,
|
||||
const QString& resultName,
|
||||
size_t timeStepIndex )
|
||||
{
|
||||
RigCaseCellResultsData* gridCellResults = this->results(porosityModel);
|
||||
RigCaseCellResultsData* gridCellResults = this->results( porosityModel );
|
||||
|
||||
const std::vector<double>* swatResults = nullptr;
|
||||
if (gridCellResults->ensureKnownResultLoaded(RigEclipseResultAddress(type, resultName)))
|
||||
if ( gridCellResults->ensureKnownResultLoaded( RigEclipseResultAddress( type, resultName ) ) )
|
||||
{
|
||||
swatResults = &(gridCellResults->cellScalarResults(RigEclipseResultAddress(type, resultName), timeStepIndex));
|
||||
swatResults = &(
|
||||
gridCellResults->cellScalarResults( RigEclipseResultAddress( type, resultName ), timeStepIndex ) );
|
||||
}
|
||||
|
||||
return swatResults;
|
||||
|
||||
Reference in New Issue
Block a user