#5200 Allen results as separate results type only visible for faults

This commit is contained in:
Jacob Støren 2019-12-19 12:34:13 +01:00
parent 831b899091
commit 12e49656df
5 changed files with 75 additions and 37 deletions

View File

@ -33,6 +33,7 @@ void caf::AppEnum<RiaDefines::ResultCatType>::setUp()
addItem( RiaDefines::GENERATED, "GENERATED", "Generated" );
addItem( RiaDefines::INPUT_PROPERTY, "INPUT_PROPERTY", "Input Property" );
addItem( RiaDefines::FORMATION_NAMES, "FORMATION_NAMES", "Formation Names" );
addItem( RiaDefines::ALLEN_DIAGRAMS, "ALLEN_DIAGRAMS", "Allen Diagrams" );
addItem( RiaDefines::FLOW_DIAGNOSTICS, "FLOW_DIAGNOSTICS", "Flow Diagnostics" );
addItem( RiaDefines::INJECTION_FLOODING, "INJECTION_FLOODING", "Injection Flooding" );
setDefault( RiaDefines::DYNAMIC_NATIVE );

View File

@ -33,6 +33,7 @@ enum ResultCatType
GENERATED,
INPUT_PROPERTY,
FORMATION_NAMES,
ALLEN_DIAGRAMS,
FLOW_DIAGNOSTICS,
INJECTION_FLOODING,
REMOVED,

View File

@ -154,7 +154,8 @@ void RivNNCGeometryGenerator::textureCoordinates( cvf::Vec2fArray*
textureCoords->resize( numVertices );
cvf::Vec2f* rawPtr = textureCoords->ptr();
const std::vector<double>* nncResultVals = nullptr;
if ( resultType == RiaDefines::STATIC_NATIVE )
if ( resultType == RiaDefines::STATIC_NATIVE || resultType == RiaDefines::FORMATION_NAMES ||
resultType == RiaDefines::ALLEN_DIAGRAMS )
{
nncResultVals = m_nncData->staticConnectionScalarResult( resVarAddr );
}

View File

@ -644,32 +644,44 @@ QList<caf::PdmOptionItemInfo>
RimGridTimeHistoryCurve* timeHistoryCurve;
this->firstAncestorOrThisOfType( timeHistoryCurve );
// Do not include flow diagnostics results if it is a time history curve
// Do not include SourSimRL if no SourSim file is loaded
if ( timeHistoryCurve != nullptr || !hasSourSimRLFile || !enableSouring )
bool isSeparateFaultResult = false;
{
using ResCatEnum = caf::AppEnum<RiaDefines::ResultCatType>;
for ( size_t i = 0; i < ResCatEnum::size(); ++i )
RimEclipseFaultColors* sepFaultResult;
this->firstAncestorOrThisOfType( sepFaultResult );
if ( sepFaultResult ) isSeparateFaultResult = true;
}
using ResCatEnum = caf::AppEnum<RiaDefines::ResultCatType>;
for ( size_t i = 0; i < ResCatEnum::size(); ++i )
{
RiaDefines::ResultCatType resType = ResCatEnum::fromIndex( i );
// Do not include flow diagnostics results if it is a time history curve
if ( resType == RiaDefines::FLOW_DIAGNOSTICS && ( timeHistoryCurve ) )
{
RiaDefines::ResultCatType resType = ResCatEnum::fromIndex( i );
if ( resType == RiaDefines::FLOW_DIAGNOSTICS && ( timeHistoryCurve ) )
{
continue;
}
if ( resType == RiaDefines::SOURSIMRL && ( !hasSourSimRLFile ) )
{
continue;
}
if ( resType == RiaDefines::INJECTION_FLOODING && !enableSouring )
{
continue;
}
QString uiString = ResCatEnum::uiTextFromIndex( i );
options.push_back( caf::PdmOptionItemInfo( uiString, resType ) );
continue;
}
// Do not include SourSimRL if no SourSim file is loaded
if ( resType == RiaDefines::SOURSIMRL && ( !hasSourSimRLFile ) )
{
continue;
}
if ( resType == RiaDefines::INJECTION_FLOODING && !enableSouring )
{
continue;
}
if ( resType == RiaDefines::ALLEN_DIAGRAMS && !isSeparateFaultResult )
{
continue;
}
QString uiString = ResCatEnum::uiTextFromIndex( i );
options.push_back( caf::PdmOptionItemInfo( uiString, resType ) );
}
}
@ -1377,14 +1389,14 @@ bool RimEclipseResultDefinition::hasCategoryResult() const
if ( this->m_resultType() == RiaDefines::FLOW_DIAGNOSTICS && m_resultVariable() == RIG_FLD_MAX_FRACTION_TRACER_RESNAME )
return true;
if ( !this->hasStaticResult() ) return false;
if ( this->resultVariable() == RiaDefines::allCombinationsAllenResultName() ||
this->resultVariable() == RiaDefines::binaryAllenResultName() )
{
return true;
}
if ( !this->hasStaticResult() ) return false;
return RiaDefines::isNativeCategoryResult( this->resultVariable() );
}

View File

@ -446,7 +446,8 @@ size_t RigCaseCellResultsData::findOrCreateScalarResultIndex( const RigEclipseRe
//--------------------------------------------------------------------------------------------------
QStringList RigCaseCellResultsData::resultNames( RiaDefines::ResultCatType resType ) const
{
QStringList varList;
QStringList varList;
std::vector<RigEclipseResultInfo>::const_iterator it;
for ( it = m_resultInfos.begin(); it != m_resultInfos.end(); ++it )
{
@ -456,6 +457,7 @@ QStringList RigCaseCellResultsData::resultNames( RiaDefines::ResultCatType resTy
varList.push_back( it->resultName() );
}
}
return varList;
}
@ -907,11 +909,11 @@ void RigCaseCellResultsData::createPlaceholderResultEntries()
// Fault results
{
findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::STATIC_NATIVE,
findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ALLEN_DIAGRAMS,
RiaDefines::binaryAllenResultName() ),
false );
findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::STATIC_NATIVE,
findOrCreateScalarResultIndex( RigEclipseResultAddress( RiaDefines::ALLEN_DIAGRAMS,
RiaDefines::allCombinationsAllenResultName() ),
false );
}
@ -2878,6 +2880,8 @@ void RigCaseCellResultsData::setActiveFormationNames( RigFormationNames* activeF
fnData->at( cIdx ) = HUGE_VAL;
}
}
computeAllenResults( this, m_ownerMainGrid );
}
//--------------------------------------------------------------------------------------------------
@ -2986,21 +2990,28 @@ void RigCaseCellResultsData::computeAllenResults( RigCaseCellResultsData* cellRe
CVF_ASSERT( mainGrid );
CVF_ASSERT( cellResultsData );
auto allAllenEclResAddr = RigEclipseResultAddress( RiaDefines::STATIC_NATIVE,
auto allAllenEclResAddr = RigEclipseResultAddress( RiaDefines::ALLEN_DIAGRAMS,
RiaDefines::allCombinationsAllenResultName() );
auto binaryAllenEclResAddr = RigEclipseResultAddress( RiaDefines::STATIC_NATIVE, RiaDefines::binaryAllenResultName() );
auto binaryAllenEclResAddr = RigEclipseResultAddress( RiaDefines::ALLEN_DIAGRAMS,
RiaDefines::binaryAllenResultName() );
if ( mainGrid->nncData()->staticConnectionScalarResult( allAllenEclResAddr ) ) return;
std::vector<double>& allAllenResults = mainGrid->nncData()->makeStaticConnectionScalarResult(
RiaDefines::allCombinationsAllenResultName() );
std::vector<double>& allAllenFormationResults = mainGrid->nncData()->makeStaticConnectionScalarResult(
RiaDefines::activeFormationNamesResultName() );
std::vector<double>& binaryAllenResults = mainGrid->nncData()->makeStaticConnectionScalarResult(
RiaDefines::binaryAllenResultName() );
mainGrid->nncData()->setEclResultAddress( RiaDefines::allCombinationsAllenResultName(), allAllenEclResAddr );
mainGrid->nncData()->setEclResultAddress( RiaDefines::binaryAllenResultName(), binaryAllenEclResAddr );
mainGrid->nncData()->setEclResultAddress( RiaDefines::activeFormationNamesResultName(),
RigEclipseResultAddress( RiaDefines::FORMATION_NAMES,
RiaDefines::activeFormationNamesResultName() ) );
bool hasFormationData = cellResultsData->hasResultEntry(
RigEclipseResultAddress( RiaDefines::FORMATION_NAMES, RiaDefines::activeFormationNamesResultName() ) );
@ -3012,6 +3023,15 @@ void RigCaseCellResultsData::computeAllenResults( RigCaseCellResultsData* cellRe
RiaDefines::activeFormationNamesResultName() ),
0 );
cellResultsData->addStaticScalarResult( RiaDefines::ALLEN_DIAGRAMS,
RiaDefines::allCombinationsAllenResultName(),
false,
fnData.size() );
std::vector<double>* alData = cellResultsData->modifiableCellScalarResult( allAllenEclResAddr, 0 );
( *alData ) = fnData;
std::map<std::pair<int, int>, int> formationCombinationToCategory;
for ( size_t i = 0; i < mainGrid->nncData()->connections().size(); i++ )
@ -3055,13 +3075,15 @@ void RigCaseCellResultsData::computeAllenResults( RigCaseCellResultsData* cellRe
if ( category < 0 )
{
binaryAllenResults[i] = 0.0;
allAllenResults[i] = std::numeric_limits<double>::max();
binaryAllenResults[i] = 0.0;
allAllenResults[i] = std::numeric_limits<double>::max();
allAllenFormationResults[i] = std::numeric_limits<double>::max();
}
else
{
binaryAllenResults[i] = 1.0;
allAllenResults[i] = category;
binaryAllenResults[i] = 1.0;
allAllenResults[i] = category;
allAllenFormationResults[i] = formation1;
}
}
}
@ -3086,8 +3108,9 @@ void RigCaseCellResultsData::computeAllenResults( RigCaseCellResultsData* cellRe
binaryValue = 1.0;
}
allAllenResults[i] = k1;
binaryAllenResults[i] = binaryValue;
allAllenResults[i] = k1;
allAllenFormationResults[i] = k1;
binaryAllenResults[i] = binaryValue;
}
}
}