mirror of
https://github.com/OPM/ResInsight.git
synced 2025-01-21 22:13:25 -06:00
Move grid size check to calculate()
This move will make it possible to use a calculator expression defined for a different grid size for grid case statistics.
This commit is contained in:
parent
5ecc43d49f
commit
917fd9b3b5
@ -111,6 +111,22 @@ RimGridCalculationVariable* RimGridCalculation::createVariable()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimGridCalculation::calculate()
|
||||
{
|
||||
for ( auto calculationCase : outputEclipseCases() )
|
||||
{
|
||||
if ( !calculationCase ) continue;
|
||||
|
||||
for ( auto inputCase : inputCases() )
|
||||
{
|
||||
if ( !calculationCase->isGridSizeEqualTo( inputCase ) )
|
||||
{
|
||||
QString msg = "Detected IJK mismatch between input cases and destination case. All grid "
|
||||
"cases must have identical IJK sizes.";
|
||||
RiaLogging::errorInMessageBox( nullptr, "Grid Property Calculator", msg );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto timeSteps = std::nullopt;
|
||||
|
||||
return calculateForCases( outputEclipseCases(), timeSteps );
|
||||
@ -529,20 +545,6 @@ bool RimGridCalculation::calculateForCases( const std::vector<RimEclipseCase*>&
|
||||
return false;
|
||||
}
|
||||
|
||||
for ( auto calculationCase : calculationCases )
|
||||
{
|
||||
for ( auto inputCase : inputCases() )
|
||||
{
|
||||
if ( !calculationCase->isGridSizeEqualTo( inputCase ) )
|
||||
{
|
||||
QString msg = "Detected IJK mismatch between input cases and destination case. All grid "
|
||||
"cases must have identical IJK sizes.";
|
||||
RiaLogging::errorInMessageBox( nullptr, "Grid Property Calculator", msg );
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const bool isMultipleCasesPresent = calculationCases.size() > 1;
|
||||
|
||||
if ( isMultipleCasesPresent )
|
||||
|
Loading…
Reference in New Issue
Block a user