From 7109c8fa2248db7c8349a120e5661fde49116795 Mon Sep 17 00:00:00 2001 From: Jon Jenssen Date: Thu, 28 Dec 2023 18:06:22 +0100 Subject: [PATCH 1/4] Enable INP support without ODB libraries --- ApplicationExeCode/CMakeLists.txt | 2 +- ApplicationLibCode/CMakeLists.txt | 1 + .../RicGeoMechCopyCaseFeature.cpp | 9 +++++-- .../RicImportGeoMechCaseFeature.cpp | 8 +++++- ...ImportGeoMechCaseTimeStepFilterFeature.cpp | 9 +++++-- .../RigFemPartResultsCollection.cpp | 9 ++++--- .../GeoMechDataModel/RigGeoMechCaseData.cpp | 25 ++++++++++--------- .../GeoMechFileInterface/CMakeLists.txt | 25 +++++++++++++++++++ .../RifGeoMechReaderInterface.cpp | 0 .../RifGeoMechReaderInterface.h | 0 .../RifInpIncludeReader.cpp | 0 .../RifInpIncludeReader.h | 0 .../RifInpReader.cpp | 0 .../RifInpReader.h | 0 .../GeoMech/OdbReader/CMakeLists.txt | 8 +----- .../OdbReader_UnitTests/CMakeLists.txt | 6 ++--- .../UserInterface/RiuMainWindow.cpp | 3 +-- .../UserInterface/RiuMenuBarBuildTools.cpp | 2 -- CMakeLists.txt | 3 ++- 19 files changed, 73 insertions(+), 37 deletions(-) create mode 100644 ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt rename ApplicationLibCode/GeoMech/{OdbReader => GeoMechFileInterface}/RifGeoMechReaderInterface.cpp (100%) rename ApplicationLibCode/GeoMech/{OdbReader => GeoMechFileInterface}/RifGeoMechReaderInterface.h (100%) rename ApplicationLibCode/GeoMech/{OdbReader => GeoMechFileInterface}/RifInpIncludeReader.cpp (100%) rename ApplicationLibCode/GeoMech/{OdbReader => GeoMechFileInterface}/RifInpIncludeReader.h (100%) rename ApplicationLibCode/GeoMech/{OdbReader => GeoMechFileInterface}/RifInpReader.cpp (100%) rename ApplicationLibCode/GeoMech/{OdbReader => GeoMechFileInterface}/RifInpReader.h (100%) diff --git a/ApplicationExeCode/CMakeLists.txt b/ApplicationExeCode/CMakeLists.txt index be6d00179e..f196aad1d0 100644 --- a/ApplicationExeCode/CMakeLists.txt +++ b/ApplicationExeCode/CMakeLists.txt @@ -277,7 +277,7 @@ if(RESINSIGHT_ENABLE_GRPC) list(APPEND LINK_LIBRARIES GrpcInterface) endif() -list(APPEND LINK_LIBRARIES RigGeoMechDataModel) +list(APPEND LINK_LIBRARIES RigGeoMechDataModel RifGeoMechFileInterface) if(RESINSIGHT_USE_ODB_API) add_definitions(-DUSE_ODB_API) diff --git a/ApplicationLibCode/CMakeLists.txt b/ApplicationLibCode/CMakeLists.txt index 57192e6738..ff62c7ff1c 100644 --- a/ApplicationLibCode/CMakeLists.txt +++ b/ApplicationLibCode/CMakeLists.txt @@ -441,6 +441,7 @@ target_include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/UserInterface ${CMAKE_CURRENT_SOURCE_DIR}/GeoMech/GeoMechDataModel ${CMAKE_CURRENT_SOURCE_DIR}/GeoMech/GeoMechVisualization + ${CMAKE_CURRENT_SOURCE_DIR}/GeoMech/GeoMechFileInterface ${CMAKE_CURRENT_SOURCE_DIR}/GeoMech/OdbReader ${CMAKE_CURRENT_SOURCE_DIR}/Measurement ${ResInsight_SOURCE_DIR}/ThirdParty diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicGeoMechCopyCaseFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicGeoMechCopyCaseFeature.cpp index 880b3337d4..efc09f2fa6 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicGeoMechCopyCaseFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicGeoMechCopyCaseFeature.cpp @@ -50,10 +50,15 @@ void RicGeoMechCopyCaseFeature::onActionTriggered( bool isChecked ) RiaApplication* app = RiaApplication::instance(); QString defaultDir = app->lastUsedDialogDirectory( "GEOMECH_MODEL" ); + QString filterStr; +#if USE_ODB_API + filterStr += "Abaqus results (*.odb);;"; +#endif + filterStr += "Abaqus input file (*.inp)"; + for ( RimGeoMechCase* gmc : cases ) { - QString fileName = - RiuFileDialogTools::getOpenFileName( nullptr, "Import Geo-Mechanical Model", defaultDir, "Abaqus results (*.odb)" ); + QString fileName = RiuFileDialogTools::getOpenFileName( nullptr, "Import Geo-Mechanical Model", defaultDir, filterStr ); if ( fileName.isEmpty() ) break; defaultDir = QFileInfo( fileName ).absolutePath(); diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseFeature.cpp index f02d949fa2..3b66c8ced1 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseFeature.cpp @@ -34,11 +34,17 @@ void RicImportGeoMechCaseFeature::onActionTriggered( bool isChecked ) { RiaApplication* app = RiaApplication::instance(); + QString filterStr; +#if USE_ODB_API + filterStr += "Abaqus results (*.odb);;"; +#endif + filterStr += "Abaqus input file (*.inp)"; + QString defaultDir = app->lastUsedDialogDirectory( "GEOMECH_MODEL" ); QStringList fileNames = RiuFileDialogTools::getOpenFileNames( nullptr, "Import Geo-Mechanical Model", defaultDir, - "Abaqus results (*.odb);;Abaqus input file (*.inp)" ); + filterStr ); if ( !fileNames.empty() ) defaultDir = QFileInfo( fileNames.last() ).absolutePath(); app->setLastUsedDialogDirectory( "GEOMECH_MODEL", defaultDir ); diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseTimeStepFilterFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseTimeStepFilterFeature.cpp index a5c5a1ff8d..b02bbd5cf0 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseTimeStepFilterFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseTimeStepFilterFeature.cpp @@ -36,9 +36,14 @@ void RicImportGeoMechCaseTimeStepFilterFeature::onActionTriggered( bool isChecke { RiaApplication* app = RiaApplication::instance(); + QString filterStr; +#if USE_ODB_API + filterStr += "Abaqus results (*.odb);;"; +#endif + filterStr += "Abaqus input file (*.inp)"; + QString defaultDir = app->lastUsedDialogDirectory( "GEOMECH_MODEL" ); - QStringList fileNames = - RiuFileDialogTools::getOpenFileNames( nullptr, "Import Geo-Mechanical Model", defaultDir, "Abaqus results (*.odb)" ); + QStringList fileNames = RiuFileDialogTools::getOpenFileNames( nullptr, "Import Geo-Mechanical Model", defaultDir, filterStr ); if ( !fileNames.empty() ) defaultDir = QFileInfo( fileNames.last() ).absolutePath(); for ( QString fileName : fileNames ) { diff --git a/ApplicationLibCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp b/ApplicationLibCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp index 537a7ce72f..e723f5e4c4 100644 --- a/ApplicationLibCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp +++ b/ApplicationLibCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp @@ -73,10 +73,6 @@ #include "Riu3DMainWindowTools.h" -#ifdef USE_ODB_API -#include "RifOdbReader.h" -#endif - #include "cafProgressInfo.h" #include "cafTensor3.h" @@ -159,6 +155,11 @@ RigFemPartResultsCollection::RigFemPartResultsCollection( RifGeoMechReaderInterf m_waterDensityShearSlipIndicator = 1.03; + m_fractureGradientCalculationTypeMudWeightWindow = RimMudWeightWindowParameters::FractureGradientCalculationType::DERIVED_FROM_K0FG; + m_lowerLimitParameterMudWeightWindow = RimMudWeightWindowParameters::LowerLimitType::PORE_PRESSURE; + m_upperLimitParameterMudWeightWindow = RimMudWeightWindowParameters::UpperLimitType::FG; + m_nonReservoirPorePressureTypeMudWeightWindow = RimMudWeightWindowParameters::NonReservoirPorePressureType::PER_ELEMENT; + m_resultCalculators.push_back( std::unique_ptr( new RigFemPartResultCalculatorTimeLapse( *this ) ) ); m_resultCalculators.push_back( std::unique_ptr( new RigFemPartResultCalculatorSurfaceAngles( *this ) ) ); m_resultCalculators.push_back( std::unique_ptr( new RigFemPartResultCalculatorSurfaceAlignedStress( *this ) ) ); diff --git a/ApplicationLibCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.cpp b/ApplicationLibCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.cpp index 282e278c7c..8d61dc25b1 100644 --- a/ApplicationLibCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.cpp +++ b/ApplicationLibCode/GeoMech/GeoMechDataModel/RigGeoMechCaseData.cpp @@ -25,8 +25,8 @@ #include "RigFemPartResultsCollection.h" #include "RigGeoMechCaseData.h" -#ifdef USE_ODB_API #include "RifInpReader.h" +#ifdef USE_ODB_API #include "RifOdbReader.h" #endif @@ -86,19 +86,23 @@ RigFemPartResultsCollection* RigGeoMechCaseData::femPartResults() return m_femPartResultsColl.p(); } +#include "RiaStdStringTools.h" + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- bool RigGeoMechCaseData::open( std::string* errorMessage ) { -#ifdef USE_ODB_API - if ( m_geoMechCaseFileName.ends_with( ".odb" ) ) + auto filename = RiaStdStringTools::toUpper( m_geoMechCaseFileName ); + + if ( filename.ends_with( ".INP" ) ) { - m_readerInterface = new RifOdbReader; + m_readerInterface = new RifInpReader(); } - else +#ifdef USE_ODB_API + else if ( filename.ends_with( ".ODB" ) ) { - m_readerInterface = new RifInpReader; + m_readerInterface = new RifOdbReader(); } #endif @@ -111,13 +115,11 @@ bool RigGeoMechCaseData::open( std::string* errorMessage ) bool RigGeoMechCaseData::readTimeSteps( std::string* errorMessage, std::vector* stepNames ) { CVF_ASSERT( stepNames ); -#ifdef USE_ODB_API if ( m_readerInterface.notNull() && m_readerInterface->isOpen() ) { *stepNames = m_readerInterface->allStepNames(); return true; } -#endif *errorMessage = std::string( "Could not read time steps" ); return false; } @@ -128,7 +130,7 @@ bool RigGeoMechCaseData::readTimeSteps( std::string* errorMessage, std::vector& timeStepFilter, bool readOnlyLastFrame ) { CVF_ASSERT( errorMessage ); -#ifdef USE_ODB_API + if ( m_readerInterface.notNull() && m_readerInterface->isOpen() ) { m_readerInterface->setTimeStepFilter( timeStepFilter, readOnlyLastFrame ); @@ -154,7 +156,7 @@ bool RigGeoMechCaseData::readFemParts( std::string* errorMessage, const std::vec return true; } } -#endif + *errorMessage = std::string( "Could not read FEM parts" ); return false; } @@ -165,14 +167,13 @@ bool RigGeoMechCaseData::readFemParts( std::string* errorMessage, const std::vec bool RigGeoMechCaseData::readDisplacements( std::string* errorMessage, int partId, int timeStep, int frameIndex, std::vector* displacements ) { CVF_ASSERT( errorMessage ); -#ifdef USE_ODB_API + if ( m_readerInterface.notNull() && m_readerInterface->isOpen() ) { m_readerInterface->readDisplacements( partId, timeStep, frameIndex, displacements ); return true; } -#endif *errorMessage = std::string( "Could not read displacements." ); return false; } diff --git a/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt b/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt new file mode 100644 index 0000000000..6d521d9a02 --- /dev/null +++ b/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt @@ -0,0 +1,25 @@ +project(RifGeoMechFileInterface) + +# Unity Build +if(RESINSIGHT_ENABLE_UNITY_BUILD) + message("Cmake Unity build is enabled on : ${PROJECT_NAME}") + set(CMAKE_UNITY_BUILD true) +endif() + +add_library( + ${PROJECT_NAME} + RifInpReader.h + RifInpReader.cpp + RifGeoMechReaderInterface.h + RifGeoMechReaderInterface.cpp + RifInpIncludeReader.h + RifInpIncludeReader.cpp +) + +target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +set(LINK_LIBRARIES RigGeoMechDataModel LibCore) + +target_link_libraries(${PROJECT_NAME} ${LINK_LIBRARIES}) + +source_group("" FILES ${PROJECT_FILES}) diff --git a/ApplicationLibCode/GeoMech/OdbReader/RifGeoMechReaderInterface.cpp b/ApplicationLibCode/GeoMech/GeoMechFileInterface/RifGeoMechReaderInterface.cpp similarity index 100% rename from ApplicationLibCode/GeoMech/OdbReader/RifGeoMechReaderInterface.cpp rename to ApplicationLibCode/GeoMech/GeoMechFileInterface/RifGeoMechReaderInterface.cpp diff --git a/ApplicationLibCode/GeoMech/OdbReader/RifGeoMechReaderInterface.h b/ApplicationLibCode/GeoMech/GeoMechFileInterface/RifGeoMechReaderInterface.h similarity index 100% rename from ApplicationLibCode/GeoMech/OdbReader/RifGeoMechReaderInterface.h rename to ApplicationLibCode/GeoMech/GeoMechFileInterface/RifGeoMechReaderInterface.h diff --git a/ApplicationLibCode/GeoMech/OdbReader/RifInpIncludeReader.cpp b/ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpIncludeReader.cpp similarity index 100% rename from ApplicationLibCode/GeoMech/OdbReader/RifInpIncludeReader.cpp rename to ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpIncludeReader.cpp diff --git a/ApplicationLibCode/GeoMech/OdbReader/RifInpIncludeReader.h b/ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpIncludeReader.h similarity index 100% rename from ApplicationLibCode/GeoMech/OdbReader/RifInpIncludeReader.h rename to ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpIncludeReader.h diff --git a/ApplicationLibCode/GeoMech/OdbReader/RifInpReader.cpp b/ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpReader.cpp similarity index 100% rename from ApplicationLibCode/GeoMech/OdbReader/RifInpReader.cpp rename to ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpReader.cpp diff --git a/ApplicationLibCode/GeoMech/OdbReader/RifInpReader.h b/ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpReader.h similarity index 100% rename from ApplicationLibCode/GeoMech/OdbReader/RifInpReader.h rename to ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpReader.h diff --git a/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt b/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt index 6a083972b8..c4aaa587a4 100644 --- a/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt @@ -36,12 +36,6 @@ add_library( ${PROJECT_NAME} RifOdbReader.h RifOdbReader.cpp - RifInpReader.h - RifInpReader.cpp - RifGeoMechReaderInterface.h - RifGeoMechReaderInterface.cpp - RifInpIncludeReader.h - RifInpIncludeReader.cpp OdbSetup.cmake ) @@ -88,7 +82,7 @@ endif(MSVC) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries( - ${PROJECT_NAME} ${RI_ODB_LIBS} RigGeoMechDataModel LibCore + ${PROJECT_NAME} ${RI_ODB_LIBS} RigGeoMechDataModel RifGeoMechFileInterface LibCore ) source_group("" FILES ${PROJECT_FILES}) diff --git a/ApplicationLibCode/GeoMech/OdbReader_UnitTests/CMakeLists.txt b/ApplicationLibCode/GeoMech/OdbReader_UnitTests/CMakeLists.txt index 95e17c3061..aaa277a23d 100644 --- a/ApplicationLibCode/GeoMech/OdbReader_UnitTests/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/OdbReader_UnitTests/CMakeLists.txt @@ -1,5 +1,3 @@ -cmake_minimum_required(VERSION 2.8) - project(OdbReader_UnitTests) set(RI_VIZ_FWK_ROOT @@ -21,12 +19,14 @@ add_subdirectory(${RI_VIZ_FWK_ROOT}/LibCore buildVizFwk) add_subdirectory(../../ResultStatisticsCache buildResultStatisticsCache) add_subdirectory(../OdbReader buildOdbReader) add_subdirectory(../GeoMechDataModel buildGeoMechDataModel) +add_subdirectory(../GeoMechFileInterface buildGeoMechFileInterface) add_definitions(-DTEST_FILE="${RI_TEST_FILE}") include_directories(${RI_VIZ_FWK_ROOT}/LibCore) include_directories(../../ResultStatisticsCache) include_directories(../../ReservoirDataModel) +include_directories(../GeoMechFileInterface) include_directories(../OdbReader) include_directories(../GeoMechDataModel) include_directories(${RI_GTEST_ROOT}) @@ -36,6 +36,6 @@ set(UNIT_TEST_CPP_SOURCES main.cpp RifOdbReader-Test.cpp ) add_executable(${PROJECT_NAME} ${UNIT_TEST_CPP_SOURCES}) -target_link_libraries(${PROJECT_NAME} RifOdbReader) +target_link_libraries(${PROJECT_NAME} RifOdbReader RifGeoMechFileInterface) include(../OdbReader/OdbSetup.cmake) diff --git a/ApplicationLibCode/UserInterface/RiuMainWindow.cpp b/ApplicationLibCode/UserInterface/RiuMainWindow.cpp index a85ff2d0aa..0953e039ab 100644 --- a/ApplicationLibCode/UserInterface/RiuMainWindow.cpp +++ b/ApplicationLibCode/UserInterface/RiuMainWindow.cpp @@ -571,15 +571,14 @@ void RiuMainWindow::createToolBars() toolbar->addAction( cmdFeatureMgr->action( "RicImportEnsembleFeature" ) ); toolbar->hide(); } + { -#ifdef USE_ODB_API QToolBar* toolbar = addToolBar( tr( "Import GeoMech" ) ); toolbar->setObjectName( toolbar->windowTitle() ); toolbar->addAction( cmdFeatureMgr->action( "RicImportGeoMechCaseFeature" ) ); toolbar->addAction( cmdFeatureMgr->action( "RicImportGeoMechCaseTimeStepFilterFeature" ) ); toolbar->addAction( cmdFeatureMgr->action( "RicImportElementPropertyFeature" ) ); toolbar->hide(); -#endif } { diff --git a/ApplicationLibCode/UserInterface/RiuMenuBarBuildTools.cpp b/ApplicationLibCode/UserInterface/RiuMenuBarBuildTools.cpp index c62a3786c4..9e48e1a273 100644 --- a/ApplicationLibCode/UserInterface/RiuMenuBarBuildTools.cpp +++ b/ApplicationLibCode/UserInterface/RiuMenuBarBuildTools.cpp @@ -129,13 +129,11 @@ void RiuMenuBarBuildTools::addImportMenuWithActions( QObject* parent, QMenu* men importSummaryMenu->addAction( cmdFeatureMgr->action( "RicImportSummaryGroupFeature" ) ); importSummaryMenu->addAction( cmdFeatureMgr->action( "RicImportEnsembleFeature" ) ); -#ifdef USE_ODB_API importMenu->addSeparator(); QMenu* importGeoMechMenu = importMenu->addMenu( QIcon( ":/GeoMechCase24x24.png" ), "Geo Mechanical Cases" ); importGeoMechMenu->addAction( cmdFeatureMgr->action( "RicImportGeoMechCaseFeature" ) ); importGeoMechMenu->addAction( cmdFeatureMgr->action( "RicImportGeoMechCaseTimeStepFilterFeature" ) ); importGeoMechMenu->addAction( cmdFeatureMgr->action( "RicImportElementPropertyFeature" ) ); -#endif importMenu->addSeparator(); QMenu* importWellMenu = importMenu->addMenu( QIcon( ":/Well.svg" ), "Well Data" ); diff --git a/CMakeLists.txt b/CMakeLists.txt index d19eae1fa3..53b1c321f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -907,6 +907,7 @@ add_subdirectory(ApplicationLibCode) add_subdirectory(ApplicationLibCode/Commands) add_subdirectory(ApplicationLibCode/ResultStatisticsCache) add_subdirectory(ApplicationLibCode/GeoMech/GeoMechDataModel) +add_subdirectory(ApplicationLibCode/GeoMech/GeoMechFileInterface) if(RESINSIGHT_USE_ODB_API) add_subdirectory(ApplicationLibCode/GeoMech/OdbReader) endif() @@ -942,7 +943,7 @@ if(MSVC AND RESINSIGHT_ENABLE_STATIC_ANALYSIS) set(TARGETS_FOR_STATIC_ANALYSIS ${APP_FWK_LIBRARIES} ${APP_FWK_TEST_PROJECTS} ApplicationLibCode Commands - ResultStatisticsCache RigGeoMechDataModel + ResultStatisticsCache RigGeoMechDataModel RifGeoMechFileInterface ) foreach(TARGET_PROJECT ${TARGETS_FOR_STATIC_ANALYSIS}) From 355400a390ee8b2cb22ba230ecc431af8fbc7881 Mon Sep 17 00:00:00 2001 From: jonjenssen Date: Thu, 28 Dec 2023 17:07:07 +0000 Subject: [PATCH 2/4] Fixes by clang-format --- .../Commands/GeoMechCommands/RicImportGeoMechCaseFeature.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseFeature.cpp b/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseFeature.cpp index 3b66c8ced1..abf1fcc5f1 100644 --- a/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseFeature.cpp +++ b/ApplicationLibCode/Commands/GeoMechCommands/RicImportGeoMechCaseFeature.cpp @@ -41,10 +41,7 @@ void RicImportGeoMechCaseFeature::onActionTriggered( bool isChecked ) filterStr += "Abaqus input file (*.inp)"; QString defaultDir = app->lastUsedDialogDirectory( "GEOMECH_MODEL" ); - QStringList fileNames = RiuFileDialogTools::getOpenFileNames( nullptr, - "Import Geo-Mechanical Model", - defaultDir, - filterStr ); + QStringList fileNames = RiuFileDialogTools::getOpenFileNames( nullptr, "Import Geo-Mechanical Model", defaultDir, filterStr ); if ( !fileNames.empty() ) defaultDir = QFileInfo( fileNames.last() ).absolutePath(); app->setLastUsedDialogDirectory( "GEOMECH_MODEL", defaultDir ); From 739cbdf4b7a4a6b9fefca42028072f032bed7967 Mon Sep 17 00:00:00 2001 From: jonjenssen Date: Thu, 28 Dec 2023 17:06:59 +0000 Subject: [PATCH 3/4] Fixes by cmake-format --- .../GeoMech/GeoMechFileInterface/CMakeLists.txt | 8 ++------ ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt | 10 +++------- CMakeLists.txt | 9 +++++++-- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt b/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt index 6d521d9a02..2832dab452 100644 --- a/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/GeoMechFileInterface/CMakeLists.txt @@ -8,12 +8,8 @@ endif() add_library( ${PROJECT_NAME} - RifInpReader.h - RifInpReader.cpp - RifGeoMechReaderInterface.h - RifGeoMechReaderInterface.cpp - RifInpIncludeReader.h - RifInpIncludeReader.cpp + RifInpReader.h RifInpReader.cpp RifGeoMechReaderInterface.h + RifGeoMechReaderInterface.cpp RifInpIncludeReader.h RifInpIncludeReader.cpp ) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt b/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt index c4aaa587a4..80568a52ad 100644 --- a/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt +++ b/ApplicationLibCode/GeoMech/OdbReader/CMakeLists.txt @@ -32,12 +32,7 @@ else() add_definitions(-DABQ_MPI_PMPI) endif(MSVC) -add_library( - ${PROJECT_NAME} - RifOdbReader.h - RifOdbReader.cpp - OdbSetup.cmake -) +add_library(${PROJECT_NAME} RifOdbReader.h RifOdbReader.cpp OdbSetup.cmake) target_include_directories( ${PROJECT_NAME} PRIVATE ${RESINSIGHT_ODB_API_DIR}/include @@ -82,7 +77,8 @@ endif(MSVC) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries( - ${PROJECT_NAME} ${RI_ODB_LIBS} RigGeoMechDataModel RifGeoMechFileInterface LibCore + ${PROJECT_NAME} ${RI_ODB_LIBS} RigGeoMechDataModel RifGeoMechFileInterface + LibCore ) source_group("" FILES ${PROJECT_FILES}) diff --git a/CMakeLists.txt b/CMakeLists.txt index 53b1c321f6..4192ddb8d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -942,8 +942,13 @@ if(MSVC AND RESINSIGHT_ENABLE_STATIC_ANALYSIS) ) set(TARGETS_FOR_STATIC_ANALYSIS - ${APP_FWK_LIBRARIES} ${APP_FWK_TEST_PROJECTS} ApplicationLibCode Commands - ResultStatisticsCache RigGeoMechDataModel RifGeoMechFileInterface + ${APP_FWK_LIBRARIES} + ${APP_FWK_TEST_PROJECTS} + ApplicationLibCode + Commands + ResultStatisticsCache + RigGeoMechDataModel + RifGeoMechFileInterface ) foreach(TARGET_PROJECT ${TARGETS_FOR_STATIC_ANALYSIS}) From a71304964bb2f514058aa644ec6866e4910b2117 Mon Sep 17 00:00:00 2001 From: Jon Jenssen Date: Thu, 28 Dec 2023 18:20:57 +0100 Subject: [PATCH 4/4] Build fix --- .../GeoMech/GeoMechFileInterface/RifInpReader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpReader.cpp b/ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpReader.cpp index 9d90c52d9b..56f7e4dc62 100644 --- a/ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpReader.cpp +++ b/ApplicationLibCode/GeoMech/GeoMechFileInterface/RifInpReader.cpp @@ -114,7 +114,7 @@ bool RifInpReader::readFemParts( RigFemPartCollection* femParts ) auto elementType = read( m_stream, parts, nodes, elements, elementSets, m_stepNames, m_enableIncludes, m_includeEntries ); - for ( int i = 0; i < m_includeEntries.size(); i++ ) + for ( int i = 0; i < (int)m_includeEntries.size(); i++ ) { m_includeEntries[i].fileName = ( m_inputPath / m_includeEntries[i].fileName ).string(); } @@ -590,7 +590,7 @@ int RifInpReader::frameCount( int stepIndex ) const //-------------------------------------------------------------------------------------------------- std::vector RifInpReader::elementSetNames( int partIndex, std::string partName ) { - if ( partIndex >= m_partElementSetNames.size() ) return {}; + if ( partIndex >= (int)m_partElementSetNames.size() ) return {}; return m_partElementSetNames.at( partIndex ); }