From 897a75019fb092b2119273465b830201bd8ba491 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 4 Sep 2023 12:51:17 +0200 Subject: [PATCH] #10574 opm-common: Add support for map axes import --- .../FileInterface/RifOpmGridTools.cpp | 26 +++++++++++++++++++ ResInsightVersion.cmake | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/ApplicationLibCode/FileInterface/RifOpmGridTools.cpp b/ApplicationLibCode/FileInterface/RifOpmGridTools.cpp index 2789556f958..d672014e17e 100644 --- a/ApplicationLibCode/FileInterface/RifOpmGridTools.cpp +++ b/ApplicationLibCode/FileInterface/RifOpmGridTools.cpp @@ -128,6 +128,32 @@ bool RifOpmGridTools::importGrid( const std::string& gridFilePath, RigMainGrid* transferCoordinatesCartesian( opmGrid, opmGrid, mainGrid, mainGrid, caseData ); + auto opmMapAxes = opmGrid.get_mapaxes(); + if ( opmMapAxes.size() == 6 ) + { + std::array mapAxes; + for ( size_t i = 0; i < opmMapAxes.size(); ++i ) + { + mapAxes[i] = opmMapAxes[i]; + } + + // Set the map axes transformation matrix on the main grid + mainGrid->setMapAxes( mapAxes ); + mainGrid->setUseMapAxes( true ); + + auto transform = mainGrid->mapAxisTransform(); + + // Invert the transformation matrix to convert from file coordinates to domain coordinates + transform.invert(); + +#pragma omp parallel for + for ( long i = 0; i < mainGrid->nodes().size(); i++ ) + { + auto& n = mainGrid->nodes()[i]; + n.transformPoint( transform ); + } + } + return true; } diff --git a/ResInsightVersion.cmake b/ResInsightVersion.cmake index 12760b95cb2..a64c1920640 100644 --- a/ResInsightVersion.cmake +++ b/ResInsightVersion.cmake @@ -11,7 +11,7 @@ set(RESINSIGHT_VERSION_TEXT "-dev") # Must be unique and increasing within one combination of major/minor/patch version # The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT # Format of text must be ".xx" -set(RESINSIGHT_DEV_VERSION ".02") +set(RESINSIGHT_DEV_VERSION ".03") # https://github.com/CRAVA/crava/tree/master/libs/nrlib set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")