mirror of
https://github.com/OPM/ResInsight.git
synced 2024-12-28 01:41:42 -06:00
Work in progress
This commit is contained in:
parent
0edb4e5d65
commit
a6c0146d29
@ -162,6 +162,12 @@ bool RifReaderOpmCommonActive::importGrid( RigMainGrid* /* mainGrid*/, RigEclips
|
||||
|
||||
for ( int lgrIdx = 0; lgrIdx < numLGRs; lgrIdx++ )
|
||||
{
|
||||
RiaLogging::info(
|
||||
QString( "Loading %0 active of %1 total cells in LGR grid %2." )
|
||||
.arg( QString::fromStdString( RiaStdStringTools::formatThousandGrouping( lgrGrids[lgrIdx].totalActiveCells() ) ) )
|
||||
.arg( QString::fromStdString( RiaStdStringTools::formatThousandGrouping( lgrGrids[lgrIdx].totalNumberOfCells() ) ) )
|
||||
.arg( lgrIdx + 1 ) );
|
||||
|
||||
RigGridBase* parentGrid = hasParentInfo ? activeGrid->gridByName( lgr_parent_names[lgrIdx] ) : activeGrid;
|
||||
|
||||
RigLocalGrid* localGrid = static_cast<RigLocalGrid*>( activeGrid->gridById( lgrIdx + 1 ) );
|
||||
@ -325,7 +331,7 @@ void RifReaderOpmCommonActive::transferActiveGeometry( Opm::EclIO::EGrid& opmMa
|
||||
const auto newCellCount = cellStartIndex + cellCount + 1;
|
||||
activeGrid->reservoirCells().resize( newCellCount, defaultCell );
|
||||
activeGrid->reservoirCells()[newCellCount - 1].setInvalid( true );
|
||||
activeGrid->nodes().resize( ( newCellCount ) * 8, cvf::Vec3d( 0, 0, 0 ) );
|
||||
activeGrid->nodes().resize( (newCellCount)*8, cvf::Vec3d( 0, 0, 0 ) );
|
||||
|
||||
auto& riNodes = activeGrid->nodes();
|
||||
|
||||
|
@ -448,6 +448,17 @@ size_t RigGridBase::localCellIndexToNative( size_t gridLocalCellIndex ) const
|
||||
return m_indexToGlobalStartOfCells + gridLocalCellIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigGridBase::localNativeCellIndexToNative( size_t nativeLocalCellIndex ) const
|
||||
{
|
||||
if ( !m_mainGrid ) return nativeLocalCellIndex;
|
||||
|
||||
const auto nativeStartIdx = m_mainGrid->globalCellIndexToNative( m_indexToGlobalStartOfCells );
|
||||
return nativeStartIdx + nativeLocalCellIndex;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -74,6 +74,7 @@ public:
|
||||
void characteristicCellSizes( double* iSize, double* jSize, double* kSize ) const override;
|
||||
|
||||
size_t localCellIndexToNative( size_t gridLocalCellIndex ) const;
|
||||
size_t localNativeCellIndexToNative( size_t nativeLocalCellIndex ) const;
|
||||
void setIndexToGlobalStartOfCells( size_t indexToGlobalStartOfCells ) { m_indexToGlobalStartOfCells = indexToGlobalStartOfCells; }
|
||||
|
||||
void setGridIndex( size_t index ) { m_gridIndex = index; }
|
||||
|
@ -138,7 +138,7 @@ const RigCell& RigMainGrid::cellByGridAndGridLocalCellIdx( size_t gridIdx, size_
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
size_t RigMainGrid::reservoirCellIndexByGridAndGridLocalCellIndex( size_t gridIdx, size_t gridLocalCellIdx ) const
|
||||
{
|
||||
return gridByIndex( gridIdx )->reservoirCellIndex( gridLocalCellIdx );
|
||||
return gridByIndex( gridIdx )->localCellIndexToNative( gridLocalCellIdx );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -588,7 +588,7 @@ void RigMainGrid::addUnNamedFaultFaces( int global
|
||||
continue;
|
||||
}
|
||||
|
||||
neighborReservoirCellIdx = hostGrid->reservoirCellIndex( nativeNeighborGridCellIdx );
|
||||
neighborReservoirCellIdx = hostGrid->localCellIndexToNative( nativeNeighborGridCellIdx );
|
||||
if ( cell( neighborReservoirCellIdx ).isInvalid() )
|
||||
{
|
||||
continue;
|
||||
@ -943,7 +943,7 @@ void RigMainGrid::buildCellSearchTreeOptimized( size_t cellsPerBoundingBox )
|
||||
const auto& localCell = subGrid->cell( localIdx );
|
||||
if ( localCell.mainGridCellIndex() == cellIdx )
|
||||
{
|
||||
aggregatedCellIndices.push_back( static_cast<int>( subGrid->reservoirCellIndex( localIdx ) ) );
|
||||
aggregatedCellIndices.push_back( static_cast<int>( subGrid->localCellIndexToNative( localIdx ) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user