mirror of
https://github.com/OPM/ResInsight.git
synced 2026-07-30 16:28:16 -05:00
NNC : Add settings to preferences and compute on demand
Ported several commits from dev #5913 Import NNC : Do not compute NNCs if importNNCs is disabled in preferences #5914 Import faults : Avoid computation of faults if turned off in preferences #5925 NNC computations : Add flag in preferences to include inactive cells Allan : Do not test for cached data in pytest #5925 Simplify computation of fault data #5932 NNC data : Compute geometry when NNC data is asked for Remove obsolete parameters
This commit is contained in:
@@ -608,7 +608,8 @@ void RimEclipseCase::computeCachedData()
|
||||
|
||||
{
|
||||
auto task = pInf.task( "Calculating faults", 17 );
|
||||
rigEclipseCase->mainGrid()->calculateFaults( rigEclipseCase->activeCellInfo( RiaDefines::MATRIX_MODEL ) );
|
||||
|
||||
ensureFaultDataIsComputed();
|
||||
}
|
||||
|
||||
{
|
||||
@@ -689,6 +690,23 @@ void RimEclipseCase::loadAndSyncronizeInputProperties( bool includeGridFileName
|
||||
RifEclipseInputPropertyLoader::loadAndSyncronizeInputProperties( inputPropertyCollection(), eclipseCaseData(), filenames );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimEclipseCase::ensureFaultDataIsComputed()
|
||||
{
|
||||
RigEclipseCaseData* rigEclipseCase = eclipseCaseData();
|
||||
if ( rigEclipseCase )
|
||||
{
|
||||
bool computeFaults = RiaApplication::instance()->preferences()->readerSettings()->importFaults();
|
||||
if ( computeFaults )
|
||||
{
|
||||
RigActiveCellInfo* actCellInfo = rigEclipseCase->activeCellInfo( RiaDefines::PorosityModelType::MATRIX_MODEL );
|
||||
rigEclipseCase->mainGrid()->calculateFaults( actCellInfo );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -115,6 +115,8 @@ public:
|
||||
|
||||
void loadAndSyncronizeInputProperties( bool includeGridFileName );
|
||||
|
||||
void ensureFaultDataIsComputed();
|
||||
|
||||
protected:
|
||||
void initAfterRead() override;
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
|
||||
@@ -21,6 +21,9 @@
|
||||
#include "RimEclipseCaseCollection.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaPreferences.h"
|
||||
|
||||
#include "RifReaderSettings.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigGridManager.h"
|
||||
@@ -75,8 +78,7 @@ RimIdenticalGridCaseGroup* RimEclipseCaseCollection::createIdenticalCaseGroupFro
|
||||
{
|
||||
CVF_ASSERT( mainCase );
|
||||
|
||||
RigEclipseCaseData* rigEclipseCase = mainCase->eclipseCaseData();
|
||||
RigMainGrid* equalGrid = registerCaseInGridCollection( rigEclipseCase );
|
||||
RigMainGrid* equalGrid = registerCaseInGridCollection( mainCase );
|
||||
CVF_ASSERT( equalGrid );
|
||||
|
||||
RimIdenticalGridCaseGroup* group = new RimIdenticalGridCaseGroup;
|
||||
@@ -113,9 +115,10 @@ void RimEclipseCaseCollection::removeCaseFromAllGroups( RimEclipseCase* reservoi
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigMainGrid* RimEclipseCaseCollection::registerCaseInGridCollection( RigEclipseCaseData* rigEclipseCase )
|
||||
RigMainGrid* RimEclipseCaseCollection::registerCaseInGridCollection( RimEclipseCase* rimEclipseCase )
|
||||
{
|
||||
CVF_ASSERT( rigEclipseCase );
|
||||
CVF_ASSERT( rimEclipseCase && rimEclipseCase->eclipseCaseData() );
|
||||
RigEclipseCaseData* rigEclipseCase = rimEclipseCase->eclipseCaseData();
|
||||
|
||||
RigMainGrid* equalGrid = m_gridCollection->findEqualGrid( rigEclipseCase->mainGrid() );
|
||||
|
||||
@@ -129,7 +132,7 @@ RigMainGrid* RimEclipseCaseCollection::registerCaseInGridCollection( RigEclipseC
|
||||
// This is the first insertion of this grid, compute cached data
|
||||
rigEclipseCase->mainGrid()->computeCachedData();
|
||||
|
||||
rigEclipseCase->mainGrid()->calculateFaults( rigEclipseCase->activeCellInfo( RiaDefines::MATRIX_MODEL ) );
|
||||
rimEclipseCase->ensureFaultDataIsComputed();
|
||||
|
||||
equalGrid = rigEclipseCase->mainGrid();
|
||||
}
|
||||
@@ -146,8 +149,7 @@ void RimEclipseCaseCollection::insertCaseInCaseGroup( RimIdenticalGridCaseGroup*
|
||||
{
|
||||
CVF_ASSERT( rimReservoir );
|
||||
|
||||
RigEclipseCaseData* rigEclipseCase = rimReservoir->eclipseCaseData();
|
||||
registerCaseInGridCollection( rigEclipseCase );
|
||||
registerCaseInGridCollection( rimReservoir );
|
||||
|
||||
caseGroup->addCase( rimReservoir );
|
||||
}
|
||||
|
||||
@@ -58,6 +58,6 @@ public:
|
||||
void recomputeStatisticsForAllCaseGroups();
|
||||
|
||||
private:
|
||||
RigMainGrid* registerCaseInGridCollection( RigEclipseCaseData* rigEclipseCase );
|
||||
RigMainGrid* registerCaseInGridCollection( RimEclipseCase* rimEclipseCase );
|
||||
cvf::ref<RigGridManager> m_gridCollection;
|
||||
};
|
||||
|
||||
@@ -1933,6 +1933,8 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen
|
||||
int frmIdx2 = it->first.second;
|
||||
int combIndex = it->second;
|
||||
|
||||
if ( frmIdx1 >= fnVector.size() || frmIdx2 >= fnVector.size() ) continue;
|
||||
|
||||
QString frmName1 = fnVector[frmIdx1];
|
||||
QString frmName2 = fnVector[frmIdx2];
|
||||
|
||||
|
||||
@@ -89,15 +89,6 @@ RimFaultInViewCollection::RimFaultInViewCollection()
|
||||
"",
|
||||
"" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &noCommonAreaNnncCollection,
|
||||
"NoCommonAreaNnncCollection",
|
||||
"NNCs With No Common Area",
|
||||
"",
|
||||
"",
|
||||
"" );
|
||||
noCommonAreaNnncCollection = new RimNoCommonAreaNncCollection;
|
||||
noCommonAreaNnncCollection.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &faults, "Faults", "Faults", "", "", "" );
|
||||
faults.uiCapability()->setUiHidden( true );
|
||||
}
|
||||
@@ -108,8 +99,6 @@ RimFaultInViewCollection::RimFaultInViewCollection()
|
||||
RimFaultInViewCollection::~RimFaultInViewCollection()
|
||||
{
|
||||
faults.deleteAllChildObjects();
|
||||
|
||||
delete noCommonAreaNnncCollection();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -262,73 +251,6 @@ void RimFaultInViewCollection::syncronizeFaults()
|
||||
|
||||
QString toolTip = QString( "Fault count (%1)" ).arg( newFaults.size() );
|
||||
setUiToolTip( toolTip );
|
||||
|
||||
// NNCs
|
||||
this->noCommonAreaNnncCollection()->noCommonAreaNncs().deleteAllChildObjects();
|
||||
|
||||
RigMainGrid* mainGrid = parentView()->mainGrid();
|
||||
const RigConnectionContainer& nncConnections = mainGrid->nncData()->connections();
|
||||
for ( size_t connIndex = 0; connIndex < nncConnections.size(); connIndex++ )
|
||||
{
|
||||
if ( !nncConnections[connIndex].hasCommonArea() )
|
||||
{
|
||||
RimNoCommonAreaNNC* noCommonAreaNnc = new RimNoCommonAreaNNC();
|
||||
|
||||
QString firstConnectionText;
|
||||
QString secondConnectionText;
|
||||
|
||||
{
|
||||
size_t gridLocalCellIndex;
|
||||
const RigGridBase* hostGrid =
|
||||
mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( nncConnections[connIndex].c1GlobIdx(),
|
||||
&gridLocalCellIndex );
|
||||
|
||||
size_t i, j, k;
|
||||
if ( hostGrid->ijkFromCellIndex( gridLocalCellIndex, &i, &j, &k ) )
|
||||
{
|
||||
// Adjust to 1-based Eclipse indexing
|
||||
i++;
|
||||
j++;
|
||||
k++;
|
||||
|
||||
if ( !hostGrid->isMainGrid() )
|
||||
{
|
||||
QString gridName = QString::fromStdString( hostGrid->gridName() );
|
||||
firstConnectionText = gridName + " ";
|
||||
}
|
||||
firstConnectionText += QString( "[%1 %2 %3] - " ).arg( i ).arg( j ).arg( k );
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
size_t gridLocalCellIndex;
|
||||
const RigGridBase* hostGrid =
|
||||
mainGrid->gridAndGridLocalIdxFromGlobalCellIdx( nncConnections[connIndex].c2GlobIdx(),
|
||||
&gridLocalCellIndex );
|
||||
|
||||
size_t i, j, k;
|
||||
if ( hostGrid->ijkFromCellIndex( gridLocalCellIndex, &i, &j, &k ) )
|
||||
{
|
||||
// Adjust to 1-based Eclipse indexing
|
||||
i++;
|
||||
j++;
|
||||
k++;
|
||||
|
||||
if ( !hostGrid->isMainGrid() )
|
||||
{
|
||||
QString gridName = QString::fromStdString( hostGrid->gridName() );
|
||||
secondConnectionText = gridName + " ";
|
||||
}
|
||||
secondConnectionText += QString( "[%1 %2 %3]" ).arg( i ).arg( j ).arg( k );
|
||||
}
|
||||
}
|
||||
|
||||
noCommonAreaNnc->name = firstConnectionText + secondConnectionText;
|
||||
this->noCommonAreaNnncCollection()->noCommonAreaNncs().push_back( noCommonAreaNnc );
|
||||
}
|
||||
|
||||
this->noCommonAreaNnncCollection()->updateName();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -77,8 +77,6 @@ public:
|
||||
caf::PdmChildArrayField<RimFaultInView*> faults;
|
||||
RimFaultInView* findFaultByName( QString name );
|
||||
|
||||
caf::PdmChildField<RimNoCommonAreaNncCollection*> noCommonAreaNnncCollection;
|
||||
|
||||
void uiOrderingFaults( QString uiConfigName, caf::PdmUiOrdering& uiOrdering );
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user