mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#11355 Use category if result name starts with FIP or ends with NUM
This commit is contained in:
parent
44e32fcff3
commit
b9d9d53964
@ -97,6 +97,17 @@ bool RiaResultNames::isFlowResultWithBothPosAndNegValues( const QString& resultN
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RiaResultNames::isCategoryResult( const QString& resultName )
|
||||
{
|
||||
if ( resultName.endsWith( "NUM", Qt::CaseInsensitive ) ) return true;
|
||||
if ( resultName.startsWith( "FIP", Qt::CaseInsensitive ) ) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -32,6 +32,7 @@ namespace RiaResultNames
|
||||
bool isPerCellFaceResult( const QString& resultName );
|
||||
bool isLogarithmicResult( const QString& resultName );
|
||||
bool isFlowResultWithBothPosAndNegValues( const QString& resultName );
|
||||
bool isCategoryResult( const QString& resultName );
|
||||
|
||||
QString undefinedResultName();
|
||||
QString undefinedGridFaultName();
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "RiaCellDividingTools.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaResultNames.h"
|
||||
#include "RiaStringEncodingTools.h"
|
||||
#include "RiaTextStringTools.h"
|
||||
|
||||
@ -439,7 +440,7 @@ bool RifEclipseInputFileTools::exportKeywords( const QString& resul
|
||||
if ( resultValues.empty() ) continue;
|
||||
|
||||
double defaultExportValue = 0.0;
|
||||
if ( keyword.endsWith( "NUM" ) )
|
||||
if ( RiaResultNames::isCategoryResult( keyword ) )
|
||||
{
|
||||
defaultExportValue = 1.0;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "RifEclipseInputPropertyLoader.h"
|
||||
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaResultNames.h"
|
||||
|
||||
#include "RifEclipseInputFileTools.h"
|
||||
#include "RifEclipseKeywordContent.h"
|
||||
@ -177,8 +178,8 @@ bool RifEclipseInputPropertyLoader::appendNewInputPropertyResult( RigEclipseCase
|
||||
return false;
|
||||
}
|
||||
|
||||
bool endsWithNum = eclipseKeyword.ends_with( "NUM" );
|
||||
auto dataType = endsWithNum ? RiaDefines::ResultDataType::INTEGER : RiaDefines::ResultDataType::FLOAT;
|
||||
bool isCategory = RiaResultNames::isCategoryResult( resultName );
|
||||
auto dataType = isCategory ? RiaDefines::ResultDataType::INTEGER : RiaDefines::ResultDataType::FLOAT;
|
||||
|
||||
RigEclipseResultAddress resAddr( RiaDefines::ResultCatType::INPUT_PROPERTY, dataType, resultName );
|
||||
caseData->results( RiaDefines::PorosityModelType::MATRIX_MODEL )->createResultEntry( resAddr, false );
|
||||
|
@ -1419,6 +1419,8 @@ bool RimEclipseResultDefinition::isCompletionTypeSelected() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RimEclipseResultDefinition::hasCategoryResult() const
|
||||
{
|
||||
if ( RiaResultNames::isCategoryResult( m_resultVariable() ) ) return true;
|
||||
|
||||
if ( auto* gridCellResults = currentGridCellResults() )
|
||||
{
|
||||
const auto addresses = gridCellResults->existingResults();
|
||||
|
Loading…
Reference in New Issue
Block a user