Skip to content

Commit

Permalink
Merge branch '2020.04-patch-01'
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed May 27, 2020
2 parents 695571c + 3613e7f commit dc188dc
Show file tree
Hide file tree
Showing 89 changed files with 1,556 additions and 829 deletions.
26 changes: 21 additions & 5 deletions ApplicationCode/Application/RiaDefines.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +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::ALLAN_DIAGRAMS, "ALLAN_DIAGRAMS", "Allan Diagrams" );
addItem( RiaDefines::FLOW_DIAGNOSTICS, "FLOW_DIAGNOSTICS", "Flow Diagnostics" );
addItem( RiaDefines::INJECTION_FLOODING, "INJECTION_FLOODING", "Injection Flooding" );
setDefault( RiaDefines::DYNAMIC_NATIVE );
Expand Down Expand Up @@ -373,17 +373,33 @@ QString RiaDefines::completionTypeResultName()
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::formationBinaryAllenResultName()
QString RiaDefines::formationBinaryAllanResultName()
{
return "Binary Formation Allen";
return "Binary Formation Allan";
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RiaDefines::formationAllenResultName()
QString RiaDefines::formationAllanResultName()
{
return "Formation Allen";
return "Formation Allan";
}

//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::set<QString> RiaDefines::nncResultNames()
{
return {combinedTransmissibilityResultName(),
formationAllanResultName(),
formationBinaryAllanResultName(),
combinedWaterFluxResultName(),
combinedGasFluxResultName(),
combinedOilFluxResultName(),
combinedRiAreaNormTranResultName(),
combinedRiMultResultName(),
combinedRiTranResultName()};
}

//--------------------------------------------------------------------------------------------------
Expand Down
8 changes: 5 additions & 3 deletions ApplicationCode/Application/RiaDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#pragma once

#include <QString>
#include <set>
#include <vector>

namespace RiaDefines
Expand All @@ -33,7 +34,7 @@ enum ResultCatType
GENERATED,
INPUT_PROPERTY,
FORMATION_NAMES,
ALLEN_DIAGRAMS,
ALLAN_DIAGRAMS,
FLOW_DIAGNOSTICS,
INJECTION_FLOODING,
REMOVED,
Expand Down Expand Up @@ -106,8 +107,9 @@ QString mobilePoreVolumeName();
QString completionTypeResultName();

// Fault results
QString formationBinaryAllenResultName();
QString formationAllenResultName();
QString formationBinaryAllanResultName();
QString formationAllanResultName();
std::set<QString> nncResultNames();

// Mock model text identifiers
QString mockModelBasic();
Expand Down
4 changes: 2 additions & 2 deletions ApplicationCode/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ if (MSVC)
# warning C4005: Macro redefinition for math constants (M_PI, M_SQRT2 etc)

# If possible, the following command is supposed to be the final target
# set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "/W4 /wd4190 /wd4100 /wd4127")
# set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "/W3 /wd4190 /wd4100 /wd4127")

set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "/W4 /wd4190 /wd4100 /wd4127 /wd4245 /wd4005")
set_target_properties(ResInsight PROPERTIES COMPILE_FLAGS "/W3 /wd4190 /wd4100 /wd4127 /wd4245 /wd4005")
if (CMAKE_CXX_COMPILER_VERSION LESS_EQUAL 19.14)
# The following warning is generated over 800 times from a qwt header only using VS2015
# Disabling temporarily
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void RicFishbonesTransmissibilityCalculationFeatureImp::appendMainWellBoreParts(

for ( const auto& cellIntersectionInfo : intersectedCellsIntersectionInfo )
{
QString completionMetaData = wellPath->name() + " main bore";
QString completionMetaData = wellPath->completions()->wellNameForExport() + " main bore";
WellBorePartForTransCalc wellBorePart = WellBorePartForTransCalc( cellIntersectionInfo.intersectionLengthsInCellCS,
holeRadius,
skinFactor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#include "RimTools.h"
#include "RimWellPath.h"
#include "RimWellPathCollection.h"
#include "RimWellPathCompletions.h"
#include "RimWellPathFracture.h"
#include "RimWellPathFractureCollection.h"

Expand Down Expand Up @@ -253,7 +254,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createWellFileLocationText( co
auto fileWellPath = dynamic_cast<RimFileWellPath*>( wellPath );
if ( fileWellPath )
{
formatter.add( wellPath->name() );
formatter.add( wellPath->completions()->wellNameForExport() );
formatter.add( fileWellPath->filePath() );
formatter.rowCompleted();
}
Expand Down Expand Up @@ -564,7 +565,7 @@ QString RicWellPathFractureTextReportFeatureImpl::createFractureInstancesText(
fracture->firstAncestorOrThisOfType( wellPath );
if ( wellPath )
{
wellName = wellPath->name();
wellName = wellPath->completions()->wellNameForExport();
}

formatter.add( wellName );
Expand Down
11 changes: 1 addition & 10 deletions ApplicationCode/Commands/RicCreateTemporaryLgrFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,7 @@ void RicCreateTemporaryLgrFeature::updateViews( RimEclipseCase* eclipseCase )

RiaApplication::instance()->project()->mainPlotCollection()->wellLogPlotCollection()->reloadAllPlots();

for ( const auto& v : eclipseCase->views() )
{
RimEclipseView* eclipseView = dynamic_cast<RimEclipseView*>( v );
if ( eclipseView )
{
eclipseView->scheduleReservoirGridGeometryRegen();
}

v->loadDataAndUpdate();
}
eclipseCase->createDisplayModelAndUpdateAllViews();
}

//--------------------------------------------------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include "RiaColorTables.h"
#include "RiaGuiApplication.h"
#include "RiaPreferences.h"

#include "RiaSummaryTools.h"
#include "RimEnsembleCurveFilterCollection.h"
Expand Down Expand Up @@ -49,30 +50,45 @@ CAF_CMD_SOURCE_INIT( RicNewSummaryEnsembleCurveSetFeature, "RicNewSummaryEnsembl
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimEnsembleCurveSet* RicNewSummaryEnsembleCurveSetFeature::addDefaultCurveSet( RimSummaryPlot* plot,
RimSummaryCaseCollection* ensemble )
std::vector<RimEnsembleCurveSet*> RicNewSummaryEnsembleCurveSetFeature::addDefaultCurveSets( RimSummaryPlot* plot,
RimSummaryCaseCollection* ensemble )
{
CVF_ASSERT( plot && ensemble );
CVF_ASSERT( plot && ensemble );

RimProject* project = RiaApplication::instance()->project();
CVF_ASSERT( project );

RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();
QString curvesTextFilter = RiaApplication::instance()->preferences()->defaultSummaryCurvesTextFilter;
QStringList curveFilters = curvesTextFilter.split( ";", QString::SkipEmptyParts );

// Use same counting as RicNewSummaryCurveFeature::onActionTriggered
auto colorIndex = plot->singleColorCurveCount();
curveSet->setColor( RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f( colorIndex ) );
curveSet->legendConfig()->setColorRange(
RimEnsembleCurveSetColorManager::cycledEnsembleColorRange( static_cast<int>( colorIndex ) ) );
std::set<RifEclipseSummaryAddress> addrs = ensemble->ensembleSummaryAddresses();

curveSet->setSummaryCaseCollection( ensemble );
curveSet->setSummaryAddress( RifEclipseSummaryAddress::fieldAddress( "FOPT" ) );

curveSet->filterCollection()->addFilter();

plot->ensembleCurveSetCollection()->addCurveSet( curveSet );
std::vector<RimEnsembleCurveSet*> curveSets;
for ( const auto& addr : addrs )
{
for (auto filter : curveFilters)
{
if ( addr.isUiTextMatchingFilterText( filter ) )
{
RimEnsembleCurveSet* curveSet = new RimEnsembleCurveSet();

// Use same counting as RicNewSummaryCurveFeature::onActionTriggered
auto colorIndex = plot->singleColorCurveCount();
curveSet->setColor( RiaColorTables::summaryCurveDefaultPaletteColors().cycledColor3f( colorIndex ) );
curveSet->legendConfig()->setColorRange(
RimEnsembleCurveSetColorManager::cycledEnsembleColorRange( static_cast<int>( colorIndex ) ) );

curveSet->setSummaryCaseCollection( ensemble );
curveSet->setSummaryAddress( addr );
curveSet->filterCollection()->addFilter();

plot->ensembleCurveSetCollection()->addCurveSet( curveSet );
curveSets.push_back( curveSet );
}
}
}

return curveSet;
return curveSets;
}

//--------------------------------------------------------------------------------------------------
Expand All @@ -84,14 +100,16 @@ RimSummaryPlot*
RiaGuiApplication* app = RiaGuiApplication::instance();
RimProject* proj = app->project();

if ( RiaApplication::instance()->preferences()->defaultSummaryCurvesTextFilter().isEmpty() ) return nullptr;

RimSummaryPlotCollection* summaryPlotCollection = proj->mainPlotCollection->summaryPlotCollection();
RimSummaryPlot* plot = summaryPlotCollection->createSummaryPlotWithAutoTitle();

RimEnsembleCurveSet* firstCurveSetCreated = nullptr;
for ( RimSummaryCaseCollection* ensemble : ensembles )
{
RimEnsembleCurveSet* curveSet = RicNewSummaryEnsembleCurveSetFeature::addDefaultCurveSet( plot, ensemble );
if ( !firstCurveSetCreated ) firstCurveSetCreated = curveSet;
std::vector<RimEnsembleCurveSet*> curveSets = RicNewSummaryEnsembleCurveSetFeature::addDefaultCurveSets( plot, ensemble );
if ( !firstCurveSetCreated && !curveSets.empty() ) firstCurveSetCreated = curveSets.front();
}

plot->loadDataAndUpdate();
Expand Down Expand Up @@ -138,15 +156,20 @@ void RicNewSummaryEnsembleCurveSetFeature::onActionTriggered( bool isChecked )
CVF_ASSERT( !project->summaryGroups().empty() );
auto ensemble = project->summaryGroups().back();

auto curveSet = RicNewSummaryEnsembleCurveSetFeature::addDefaultCurveSet( plot, ensemble );
RimEnsembleCurveSet* firstCurveSet = nullptr;
if (!RiaApplication::instance()->preferences()->defaultSummaryCurvesTextFilter().isEmpty())
{
auto curveSets = RicNewSummaryEnsembleCurveSetFeature::addDefaultCurveSets(plot, ensemble);
if ( !curveSets.empty() ) firstCurveSet = curveSets.front();
}
plot->loadDataAndUpdate();
plot->updateConnectedEditors();

RiaGuiApplication* app = RiaGuiApplication::instance();
RiuPlotMainWindow* mainPlotWindow = app->getOrCreateAndShowMainPlotWindow();
if ( mainPlotWindow )
if ( mainPlotWindow && firstCurveSet)
{
mainPlotWindow->selectAsCurrentItem( curveSet );
mainPlotWindow->selectAsCurrentItem(firstCurveSet);
mainPlotWindow->updateSummaryPlotToolBar();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class RicNewSummaryEnsembleCurveSetFeature : public caf::CmdFeature
void setupActionLook( QAction* actionToSetup ) override;

private:
static RimEnsembleCurveSet* addDefaultCurveSet( RimSummaryPlot* plot, RimSummaryCaseCollection* ensemble );
static std::vector<RimEnsembleCurveSet*> addDefaultCurveSets( RimSummaryPlot* plot, RimSummaryCaseCollection* ensemble );

private:
RimSummaryPlot* selectedSummaryPlot() const;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ void RicNewWellBoreStabilityPlotFeature::createParametersTrack( RimWellBoreStabi
paramCurvesTrack->setXAxisGridVisibility( RimWellLogPlot::AXIS_GRID_MAJOR_AND_MINOR );
paramCurvesTrack->setFormationWellPath( wellPath );
paramCurvesTrack->setFormationCase( geoMechCase );
paramCurvesTrack->setAnnotationType( RiuPlotAnnotationTool::CURVE_ANNOTATIONS );
paramCurvesTrack->setShowRegionLabels( true );
paramCurvesTrack->setShowWindow( false );
std::set<RigWbsParameter> parameters = RigWbsParameter::allParameters();
Expand Down
62 changes: 44 additions & 18 deletions ApplicationCode/FileInterface/RifEclipseInputFileTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -846,25 +846,51 @@ bool RifEclipseInputFileTools::readProperty( const QString& fileName,
return false;
}

ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_grdecl_dynamic__( filePointer,
eclipseKeyWord.toLatin1().data(),
false,
ecl_type_create_from_type( ECL_FLOAT_TYPE ) );
bool isOk = false;
if ( eclipseKeywordData )
qint64 filePos = -1;

{
QString errMsg;
isOk = readDataFromKeyword( eclipseKeywordData, caseData, resultName, &errMsg );
if ( !isOk )
std::vector<RifKeywordAndFilePos> keywordsAndFilePos;
findKeywordsOnFile( fileName, &keywordsAndFilePos );
for ( auto kwAndPos : keywordsAndFilePos )
{
RiaLogging::error( QString( "Failed to read property: %1" ).arg( errMsg ) );
if ( kwAndPos.keyword == eclipseKeyWord )
{
filePos = kwAndPos.filePos;
}
}
ecl_kw_free( eclipseKeywordData );
}
else

bool isOk = false;

if ( filePos == -1 )
{
RiaLogging::error( QString( "Failed to load keyword %1 from file: %2" ).arg( eclipseKeyWord ).arg( fileName ) );
}
else
{
fseek( filePointer, filePos, SEEK_SET );

ecl_kw_type* eclipseKeywordData =
ecl_kw_fscanf_alloc_grdecl_dynamic__( filePointer,
eclipseKeyWord.toLatin1().data(),
false,
ecl_type_create_from_type( ECL_FLOAT_TYPE ) );

if ( eclipseKeywordData )
{
QString errMsg;
isOk = readDataFromKeyword( eclipseKeywordData, caseData, resultName, &errMsg );
if ( !isOk )
{
RiaLogging::error( QString( "Failed to read property: %1" ).arg( errMsg ) );
}
ecl_kw_free( eclipseKeywordData );
}
else
{
RiaLogging::error( QString( "Failed to load keyword %1 from file: %2" ).arg( eclipseKeyWord ).arg( fileName ) );
}
}

fclose( filePointer );

Expand Down Expand Up @@ -1294,17 +1320,17 @@ QString RifEclipseInputFileTools::faultFaceText( cvf::StructGridInterface::FaceT
switch ( faceType )
{
case cvf::StructGridInterface::POS_I:
return QString( " I" );
return QString( "I " );
case cvf::StructGridInterface::NEG_I:
return QString( "-I" );
return QString( "I-" );
case cvf::StructGridInterface::POS_J:
return QString( " J" );
return QString( "J " );
case cvf::StructGridInterface::NEG_J:
return QString( "-J" );
return QString( "J-" );
case cvf::StructGridInterface::POS_K:
return QString( " K" );
return QString( "K " );
case cvf::StructGridInterface::NEG_K:
return QString( "-K" );
return QString( "K-" );
default:
CVF_ASSERT( false );
}
Expand Down
7 changes: 7 additions & 0 deletions ApplicationCode/FileInterface/RifEclipseSummaryAddress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,13 @@ bool RifEclipseSummaryAddress::hasAccumulatedData() const
}

QString qBaseName = baseQuantityName( quantityForInspection );

if ( qBaseName.endsWith( "WCT" ) || qBaseName.endsWith( "WCTH" ) )
{
// https://github.com/OPM/ResInsight/issues/5808
return false;
}

return qBaseName.endsWith( "T" ) || qBaseName.endsWith( "TH" );
}

Expand Down
Loading

0 comments on commit dc188dc

Please sign in to comment.