mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Check equal grid size only when required
Equal grid size is required if there is more than one grid case in the expression. If a cell filter view is active, the visibility is based on one view and reused for all other grid models, and requires equal grid size.
This commit is contained in:
parent
0c35890c70
commit
07cc21587a
@ -171,10 +171,16 @@ RimGridCalculationVariable* RimGridCalculation::createVariable()
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
bool RimGridCalculation::calculate()
|
bool RimGridCalculation::calculate()
|
||||||
{
|
{
|
||||||
|
// Equal grid size is required if there is more than one grid case in the expression. If a cell filter view is active, the visibility is
|
||||||
|
// based on one view and reused for all other grid models, and requires equal grid size.
|
||||||
|
bool checkIfGridSizeIsEqual = !allSourceCasesAreEqualToDestinationCase() || m_cellFilterView != nullptr;
|
||||||
|
|
||||||
for ( auto calculationCase : outputEclipseCases() )
|
for ( auto calculationCase : outputEclipseCases() )
|
||||||
{
|
{
|
||||||
if ( !calculationCase ) continue;
|
if ( !calculationCase ) continue;
|
||||||
|
|
||||||
|
calculationCase->ensureReservoirCaseIsOpen();
|
||||||
|
|
||||||
if ( !calculationCase->eclipseCaseData() )
|
if ( !calculationCase->eclipseCaseData() )
|
||||||
{
|
{
|
||||||
QString msg = QString( "No data available for case %1, aborting calculation" ).arg( calculationCase->caseUserDescription() );
|
QString msg = QString( "No data available for case %1, aborting calculation" ).arg( calculationCase->caseUserDescription() );
|
||||||
@ -190,6 +196,8 @@ bool RimGridCalculation::calculate()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( checkIfGridSizeIsEqual )
|
||||||
|
{
|
||||||
for ( auto inputCase : inputCases() )
|
for ( auto inputCase : inputCases() )
|
||||||
{
|
{
|
||||||
if ( !calculationCase->isGridSizeEqualTo( inputCase ) )
|
if ( !calculationCase->isGridSizeEqualTo( inputCase ) )
|
||||||
@ -201,6 +209,7 @@ bool RimGridCalculation::calculate()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ( m_defaultValueType() == DefaultValueType::FROM_PROPERTY )
|
if ( m_defaultValueType() == DefaultValueType::FROM_PROPERTY )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user