mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#11024 Allow grid calculator expressions with no input cases
Will make it possible to use calc := 3
This commit is contained in:
@@ -278,7 +278,16 @@ QList<caf::PdmOptionItemInfo> RimGridCalculation::calculateValueOptions( const c
|
||||
RimProject::current()->allViews( views );
|
||||
|
||||
RimEclipseCase* firstEclipseCase = nullptr;
|
||||
if ( !inputCases().empty() ) firstEclipseCase = inputCases().front();
|
||||
if ( !inputCases().empty() )
|
||||
{
|
||||
firstEclipseCase = inputCases().front();
|
||||
}
|
||||
else
|
||||
{
|
||||
// If no input cases are defined, use the destination case to determine the grid size. This will enable use of expressions with
|
||||
// no input cases like "calculation := 1.0"
|
||||
firstEclipseCase = m_destinationCase();
|
||||
}
|
||||
|
||||
if ( firstEclipseCase )
|
||||
{
|
||||
@@ -727,7 +736,15 @@ bool RimGridCalculation::calculateForCases( const std::vector<RimEclipseCase*>&
|
||||
}
|
||||
|
||||
std::vector<double> resultValues;
|
||||
resultValues.resize( dataForAllVariables[0].size() );
|
||||
if ( m_destinationCase && m_destinationCase->eclipseCaseData() )
|
||||
{
|
||||
// Find number of active cells in the destination case.
|
||||
auto activeCellInfoDestination = m_destinationCase->eclipseCaseData()->activeCellInfo( porosityModel );
|
||||
if ( activeCellInfoDestination )
|
||||
{
|
||||
resultValues.resize( activeCellInfoDestination->reservoirActiveCellCount() );
|
||||
}
|
||||
}
|
||||
parser.assignVector( leftHandSideVariableName, resultValues );
|
||||
|
||||
QString errorText;
|
||||
|
||||
2
ThirdParty/custom-opm-common/opm-common
vendored
2
ThirdParty/custom-opm-common/opm-common
vendored
Submodule ThirdParty/custom-opm-common/opm-common updated: 994162ff38...f0c77de5d4
2
ThirdParty/openzgy
vendored
2
ThirdParty/openzgy
vendored
Submodule ThirdParty/openzgy updated: 6c82a005d5...61126458c7
Reference in New Issue
Block a user