Skip to content

Commit

Permalink
#10574 opm-common: Add support for map axes import
Browse files Browse the repository at this point in the history
  • Loading branch information
magnesj committed Sep 4, 2023
1 parent 7a782ce commit 3e38124
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions ApplicationLibCode/FileInterface/RifOpmGridTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<double, 6> 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 < static_cast<long>( mainGrid->nodes().size() ); i++ )
{
auto& n = mainGrid->nodes()[i];
n.transformPoint( transform );
}
}

return true;
}

Expand Down
2 changes: 1 addition & 1 deletion ResInsightVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 3e38124

Please sign in to comment.