mirror of
https://github.com/OPM/ResInsight.git
synced 2026-10-27 23:50:19 -05:00
#14223 Calculate geometry grid properties when creating grid from python API
Compute the depth related geometry properties (DEPTH, DX, DY, DZ, TOPS, BOTTOM) in RimCornerPointCase::createFromCoordinatesArray and replaceGridFromCoordinatesArray, matching the behavior when importing a grid from file. The computation is guarded by the same autoComputeDepthRelatedProperties preference used by the file importers.
This commit is contained in:
1 parent
c4a8f38b65
commit
8c17130714
4 files changed
+90
-1
No files matched your search
@@ -21,6 +21,7 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaDefines.h"
|
||||
#include "RiaLogging.h"
|
||||
#include "RiaPreferencesGrid.h"
|
||||
#include "RiaQStringFormatter.h"
|
||||
|
||||
#include "RifInputPropertyLoader.h"
|
||||
@@ -108,6 +109,7 @@ std::expected<RimCornerPointCase*, QString> RimCornerPointCase::createFromCoordi
|
||||
|
||||
buildGrid( *cornerPointCase->eclipseCaseData(), nx, ny, nz, coord, zcorn, actnum );
|
||||
cornerPointCase->computeCachedData();
|
||||
computeDepthRelatedResults( *cornerPointCase );
|
||||
|
||||
return cornerPointCase;
|
||||
}
|
||||
@@ -142,6 +144,7 @@ std::expected<void, QString> RimCornerPointCase::replaceGridFromCoordinatesArray
|
||||
|
||||
buildGrid( *cornerPointCase.eclipseCaseData(), nx, ny, nz, coord, zcorn, actnum );
|
||||
cornerPointCase.computeCachedData();
|
||||
computeDepthRelatedResults( cornerPointCase );
|
||||
|
||||
return {};
|
||||
}
|
||||
@@ -369,6 +372,19 @@ void RimCornerPointCase::createActnumResult( RigEclipseCaseData& eclipseCaseData
|
||||
std::fill( ( *modifiableData )[0].begin(), ( *modifiableData )[0].end(), 1.0 );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Compute the depth related geometry properties (DEPTH, DX, DY, DZ, TOPS, BOTTOM), matching the
|
||||
/// behavior when a grid is imported from file.
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimCornerPointCase::computeDepthRelatedResults( RimCornerPointCase& cornerPointCase )
|
||||
{
|
||||
if ( RiaPreferencesGrid::current()->autoComputeDepthRelatedProperties() )
|
||||
{
|
||||
cornerPointCase.results( RiaDefines::PorosityModelType::MATRIX_MODEL )->computeDepthRelatedResults();
|
||||
cornerPointCase.results( RiaDefines::PorosityModelType::FRACTURE_MODEL )->computeDepthRelatedResults();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -71,6 +71,8 @@ protected:
|
||||
|
||||
static void createActnumResult( RigEclipseCaseData& eclipseCaseData );
|
||||
|
||||
static void computeDepthRelatedResults( RimCornerPointCase& cornerPointCase );
|
||||
|
||||
static std::array<cvf::Vec3d, 8> getCorners( const RigMainGrid& grid,
|
||||
const std::vector<float>& coord,
|
||||
const std::vector<float>& zcorn,
|
||||
|
||||
Reference in new issue
Block a user