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:
Magne Sjaastad 2024-04-14 21:33:49 +02:00
parent 0c35890c70
commit 07cc21587a

View File

@ -171,10 +171,16 @@ RimGridCalculationVariable* RimGridCalculation::createVariable()
//--------------------------------------------------------------------------------------------------
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() )
{
if ( !calculationCase ) continue;
calculationCase->ensureReservoirCaseIsOpen();
if ( !calculationCase->eclipseCaseData() )
{
QString msg = QString( "No data available for case %1, aborting calculation" ).arg( calculationCase->caseUserDescription() );
@ -190,6 +196,8 @@ bool RimGridCalculation::calculate()
return false;
}
if ( checkIfGridSizeIsEqual )
{
for ( auto inputCase : inputCases() )
{
if ( !calculationCase->isGridSizeEqualTo( inputCase ) )
@ -201,6 +209,7 @@ bool RimGridCalculation::calculate()
}
}
}
}
if ( m_defaultValueType() == DefaultValueType::FROM_PROPERTY )
{