Release 2023.06

This commit is contained in:
Magne Sjaastad
2023-06-19 13:48:44 +02:00
committed by GitHub
parent a7108f0a09
commit 77bf792b1a
1390 changed files with 66974 additions and 11511 deletions

View File

@@ -23,6 +23,7 @@ set(SOURCE_GROUP_HEADER_FILES
${CMAKE_CURRENT_LIST_DIR}/RimcFractureTemplate.h
${CMAKE_CURRENT_LIST_DIR}/RimcThermalFractureTemplate.h
${CMAKE_CURRENT_LIST_DIR}/RimcIntersection.h
${CMAKE_CURRENT_LIST_DIR}/RimcEclipseCase.h
)
set(SOURCE_GROUP_SOURCE_FILES
@@ -50,6 +51,7 @@ set(SOURCE_GROUP_SOURCE_FILES
${CMAKE_CURRENT_LIST_DIR}/RimcFractureTemplate.cpp
${CMAKE_CURRENT_LIST_DIR}/RimcThermalFractureTemplate.cpp
${CMAKE_CURRENT_LIST_DIR}/RimcIntersection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimcEclipseCase.cpp
)
list(APPEND CODE_HEADER_FILES ${SOURCE_GROUP_HEADER_FILES})

View File

@@ -0,0 +1,100 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#include "RimcEclipseCase.h"
#include "RiaApplication.h"
#include "RiaGuiApplication.h"
#include "RicImportSummaryCasesFeature.h"
#include "RimEclipseCase.h"
#include "RimFileSummaryCase.h"
#include "RimOilField.h"
#include "RimProject.h"
#include "RimSummaryCase.h"
#include "RimSurfaceCollection.h"
#include "RiuPlotMainWindow.h"
#include "cafPdmFieldScriptingCapability.h"
#include <QDir>
#include <QFileInfo>
#include <memory>
CAF_PDM_OBJECT_METHOD_SOURCE_INIT( RimEclipseCase, RimcEclipseCase_importProperties, "import_properties" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimcEclipseCase_importProperties::RimcEclipseCase_importProperties( caf::PdmObjectHandle* self )
: caf::PdmObjectMethod( self )
{
CAF_PDM_InitObject( "Import Properties", "", "", "Import Properties" );
CAF_PDM_InitScriptableFieldNoDefault( &m_fileNames, "FileNames", "" );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::PdmObjectHandle* RimcEclipseCase_importProperties::execute()
{
std::vector<QString> absolutePaths = m_fileNames;
for ( auto& path : absolutePaths )
{
QFileInfo projectPathInfo( path );
if ( !projectPathInfo.exists() )
{
QDir startDir( RiaApplication::instance()->startDir() );
path = startDir.absoluteFilePath( path );
}
}
QStringList propertyFileNames;
std::copy( absolutePaths.begin(), absolutePaths.end(), std::back_inserter( propertyFileNames ) );
auto eclipseCase = self<RimEclipseCase>();
eclipseCase->importAsciiInputProperties( propertyFileNames );
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimcEclipseCase_importProperties::resultIsPersistent() const
{
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::unique_ptr<caf::PdmObjectHandle> RimcEclipseCase_importProperties::defaultResult() const
{
return nullptr;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RimcEclipseCase_importProperties::isNullptrValidResult() const
{
return true;
}

View File

@@ -0,0 +1,46 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2020- Equinor ASA
//
// ResInsight is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE.
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
#pragma once
#include "cafPdmField.h"
#include "cafPdmObjectHandle.h"
#include "cafPdmObjectMethod.h"
#include <QString>
#include <memory>
//==================================================================================================
///
//==================================================================================================
class RimcEclipseCase_importProperties : public caf::PdmObjectMethod
{
CAF_PDM_HEADER_INIT;
public:
RimcEclipseCase_importProperties( caf::PdmObjectHandle* self );
caf::PdmObjectHandle* execute() override;
bool resultIsPersistent() const override;
std::unique_ptr<PdmObjectHandle> defaultResult() const override;
bool isNullptrValidResult() const override;
private:
caf::PdmField<std::vector<QString>> m_fileNames;
};

View File

@@ -221,8 +221,7 @@ caf::PdmObjectHandle* RimcExtrudedCurveIntersection_geometry::execute()
}
{
RimEclipseView* eclView = nullptr;
intersection->firstAncestorOfType( eclView );
auto eclView = intersection->firstAncestorOfType<RimEclipseView>();
if ( eclView && eclView->eclipseCase() )
{
auto offset = eclView->eclipseCase()->displayModelOffset();
@@ -305,8 +304,7 @@ caf::PdmObjectHandle* RimcExtrudedCurveIntersection_geometryResult::execute()
auto geoGenerator = RimcExtrudedCurveIntersection_geometry::createGeometryGenerator( intersection, m_geometryType() );
if ( geoGenerator && geoGenerator->isAnyGeometryPresent() )
{
RimEclipseView* eclView = nullptr;
intersection->firstAncestorOfType( eclView );
auto eclView = intersection->firstAncestorOfType<RimEclipseView>();
if ( !eclView )
{
RiaLogging::error( "No Eclipse view found. Extraction of intersection result is only supported for "

View File

@@ -62,12 +62,13 @@ caf::PdmObjectHandle* RimProject_importSummaryCase::execute()
absolutePath = startDir.absoluteFilePath( m_fileName );
}
QStringList summaryFileNames{ absolutePath };
std::vector<RimSummaryCase*> newCases;
bool ensembleOrGroup = false;
bool allowDialogs = false;
QStringList summaryFileNames{ absolutePath };
if ( RicImportSummaryCasesFeature::createSummaryCasesFromFiles( summaryFileNames, &newCases, ensembleOrGroup, allowDialogs ) )
RicImportSummaryCasesFeature::CreateConfig createConfig{ .fileType = RiaDefines::FileType::SMSPEC,
.ensembleOrGroup = false,
.allowDialogs = false };
auto [isOk, newCases] = RicImportSummaryCasesFeature::createSummaryCasesFromFiles( summaryFileNames, createConfig );
if ( isOk )
{
RicImportSummaryCasesFeature::addSummaryCases( newCases );

View File

@@ -54,8 +54,7 @@ caf::PdmObjectHandle* RimcStimPlanModelCollection_appendStimPlanModel::execute()
RimStimPlanModelCollection* stimPlanModelCollection = self<RimStimPlanModelCollection>();
if ( m_wellPath )
{
RimWellPathCollection* wellPathCollection = nullptr;
stimPlanModelCollection->firstAncestorOrThisOfTypeAsserted( wellPathCollection );
auto wellPathCollection = stimPlanModelCollection->firstAncestorOrThisOfTypeAsserted<RimWellPathCollection>();
stimPlanModel = RicNewStimPlanModelFeature::addStimPlanModel( m_wellPath, wellPathCollection );
}

View File

@@ -69,7 +69,7 @@ caf::PdmObjectHandle* RimcSummaryPlotCollection_newSummaryPlot::execute()
}
if ( !m_summaryCases.empty() )
{
std::vector<RimSummaryCase*> summaryCases = m_summaryCases.ptrReferencedObjects();
std::vector<RimSummaryCase*> summaryCases = m_summaryCases.ptrReferencedObjectsByType();
if ( !addressStrings.empty() )
{
newPlot = RicSummaryPlotFeatureImpl::createSummaryPlotForCases( summaryCases, addressStrings );