mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Adjustments before release
* Make sure existing project files do not filter intersection geometry by cell filters * #10241 Temporarily revert changes to resampling changes These fixes had unintended side effect on well flow plot and rft plots seen in regression tests https://github.com/OPM/ResInsight/issues/10241 * Update version number
This commit is contained in:
parent
76102a8396
commit
5bd492dc56
@ -31,6 +31,7 @@
|
|||||||
#include "RimGridView.h"
|
#include "RimGridView.h"
|
||||||
#include "RimIntersectionResultDefinition.h"
|
#include "RimIntersectionResultDefinition.h"
|
||||||
#include "RimIntersectionResultsDefinitionCollection.h"
|
#include "RimIntersectionResultsDefinitionCollection.h"
|
||||||
|
#include "RimProject.h"
|
||||||
#include "RimSimWellInView.h"
|
#include "RimSimWellInView.h"
|
||||||
|
|
||||||
#include "Riu3DMainWindowTools.h"
|
#include "Riu3DMainWindowTools.h"
|
||||||
@ -560,6 +561,17 @@ void RimIntersectionCollection::defineEditorAttribute( const caf::PdmFieldHandle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
///
|
||||||
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
void RimIntersectionCollection::initAfterRead()
|
||||||
|
{
|
||||||
|
if ( RimProject::current()->isProjectFileVersionEqualOrOlderThan( "2023.03.0" ) )
|
||||||
|
{
|
||||||
|
m_applyCellFilters = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
@ -99,6 +99,7 @@ protected:
|
|||||||
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override;
|
||||||
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
|
||||||
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override;
|
||||||
|
void initAfterRead() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RimEclipseView* eclipseView() const;
|
RimEclipseView* eclipseView() const;
|
||||||
|
@ -345,52 +345,41 @@ cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData(
|
|||||||
return reSampledData;
|
return reSampledData;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RigWellLogCurveData::interpolateSegment( RiaDefines::DepthTypeEnum resamplingDepthType,
|
void RigWellLogCurveData::interpolateSegment( RiaDefines::DepthTypeEnum resamplingDepthType,
|
||||||
std::vector<double>& resampledValues,
|
double depthValue,
|
||||||
std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& resampledDepths,
|
|
||||||
double targetDepthValue,
|
|
||||||
size_t firstIndex,
|
size_t firstIndex,
|
||||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& originalDepths,
|
std::vector<double>& xValues,
|
||||||
const std::vector<double>& propertyValues,
|
std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& resampledDepths,
|
||||||
double eps )
|
const double eps ) const
|
||||||
{
|
{
|
||||||
if ( !originalDepths.contains( resamplingDepthType ) ) return;
|
auto depthIt = m_depths.find( resamplingDepthType );
|
||||||
|
|
||||||
const size_t secondIndex = firstIndex + 1;
|
size_t secondIndex = firstIndex + 1;
|
||||||
const auto& depthValues = originalDepths.find( resamplingDepthType )->second;
|
|
||||||
if ( secondIndex >= depthValues.size() ) return;
|
|
||||||
|
|
||||||
const double depth0 = depthValues[firstIndex];
|
double depth0 = depthIt->second[firstIndex];
|
||||||
const double depth1 = depthValues[secondIndex];
|
double depth1 = depthIt->second[secondIndex];
|
||||||
const double x0 = propertyValues[firstIndex];
|
double x0 = m_propertyValues[firstIndex];
|
||||||
const double x1 = propertyValues[secondIndex];
|
double x1 = m_propertyValues[secondIndex];
|
||||||
double slope = 0.0;
|
double slope = 0.0;
|
||||||
if ( std::fabs( depth1 - depth0 ) > eps )
|
if ( std::fabs( depth1 - depth0 ) > eps )
|
||||||
{
|
{
|
||||||
slope = ( x1 - x0 ) / ( depth1 - depth0 );
|
slope = ( x1 - x0 ) / ( depth1 - depth0 );
|
||||||
}
|
}
|
||||||
const double resampledValue = slope * ( targetDepthValue - depth0 ) + x0;
|
double xValue = slope * ( depthValue - depth0 ) + x0;
|
||||||
resampledValues.push_back( resampledValue );
|
xValues.push_back( xValue );
|
||||||
|
|
||||||
for ( const auto& [depthType, depthTypeValues] : originalDepths )
|
for ( auto depthTypeValuesPair : m_depths )
|
||||||
{
|
{
|
||||||
// Skip the depth type we are resampling and ensure depth values are available
|
if ( depthTypeValuesPair.first != resamplingDepthType )
|
||||||
if ( depthType == resamplingDepthType ) continue;
|
{
|
||||||
if ( depthTypeValues.size() < secondIndex - 1 ) continue;
|
double otherDepth0 = depthTypeValuesPair.second[0];
|
||||||
|
double otherDepth1 = depthTypeValuesPair.second[1];
|
||||||
const double otherDepth0 = depthTypeValues[firstIndex];
|
double otherSlope = ( otherDepth1 - otherDepth0 ) / ( depth1 - depth0 );
|
||||||
const double otherDepth1 = depthTypeValues[secondIndex];
|
resampledDepths[depthTypeValuesPair.first].push_back( otherSlope * ( depthValue - depth0 ) + otherDepth0 );
|
||||||
const double otherSlope = ( otherDepth1 - otherDepth0 ) / ( depth1 - depth0 );
|
}
|
||||||
resampledDepths[depthType].push_back( otherSlope * ( targetDepthValue - depth0 ) + otherDepth0 );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
bool isLeftOf( double x1, double x2, bool reverseOrder, double eps )
|
bool isLeftOf( double x1, double x2, bool reverseOrder, double eps )
|
||||||
{
|
{
|
||||||
if ( reverseOrder )
|
if ( reverseOrder )
|
||||||
@ -400,9 +389,6 @@ bool isLeftOf( double x1, double x2, bool reverseOrder, double eps )
|
|||||||
return x2 - x1 > eps;
|
return x2 - x1 > eps;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
bool isRightOf( double x1, double x2, bool reverseOrder, double eps )
|
bool isRightOf( double x1, double x2, bool reverseOrder, double eps )
|
||||||
{
|
{
|
||||||
return isLeftOf( x2, x1, reverseOrder, eps );
|
return isLeftOf( x2, x1, reverseOrder, eps );
|
||||||
@ -411,61 +397,53 @@ bool isRightOf( double x1, double x2, bool reverseOrder, double eps )
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
std::pair<std::vector<double>, std::map<RiaDefines::DepthTypeEnum, std::vector<double>>>
|
cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData( RiaDefines::DepthTypeEnum resamplingDepthType,
|
||||||
RigWellLogCurveData::createResampledValuesAndDepths( RiaDefines::DepthTypeEnum resamplingDepthType,
|
const std::vector<double>& depths ) const
|
||||||
const std::vector<double>& targetDepths,
|
|
||||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& originalDepths,
|
|
||||||
const std::vector<double>& propertyValues )
|
|
||||||
{
|
{
|
||||||
const double eps = 1.0e-8;
|
const double eps = 1.0e-8;
|
||||||
|
|
||||||
auto depthIt = originalDepths.find( resamplingDepthType );
|
std::vector<double> xValues;
|
||||||
if ( depthIt == originalDepths.end() || depthIt->second.empty() ) return {};
|
|
||||||
const auto& depthValues = depthIt->second;
|
|
||||||
|
|
||||||
std::vector<double> resampledValues;
|
|
||||||
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths;
|
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths;
|
||||||
resampledDepths.insert( std::make_pair( resamplingDepthType, targetDepths ) );
|
resampledDepths.insert( std::make_pair( resamplingDepthType, depths ) );
|
||||||
|
|
||||||
cvf::ref<RigWellLogCurveData> resampledCurveData = new RigWellLogCurveData;
|
auto depthIt = m_depths.find( resamplingDepthType );
|
||||||
|
|
||||||
|
cvf::ref<RigWellLogCurveData> reSampledData = new RigWellLogCurveData;
|
||||||
|
|
||||||
|
if ( depthIt == m_depths.end() || depthIt->second.empty() ) return reSampledData;
|
||||||
|
|
||||||
bool reverseOrder = resamplingDepthType == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER;
|
bool reverseOrder = resamplingDepthType == RiaDefines::DepthTypeEnum::CONNECTION_NUMBER;
|
||||||
|
|
||||||
size_t segmentSearchStartIdx = 0;
|
size_t segmentSearchStartIdx = 0;
|
||||||
for ( const auto& targetDepth : targetDepths )
|
for ( auto depth : depths )
|
||||||
{
|
{
|
||||||
bool foundPoint = false;
|
bool foundPoint = false;
|
||||||
for ( size_t segmentStartIdx = segmentSearchStartIdx; segmentStartIdx < depthValues.size(); ++segmentStartIdx )
|
for ( size_t segmentStartIdx = segmentSearchStartIdx; segmentStartIdx < depthIt->second.size(); ++segmentStartIdx )
|
||||||
{
|
{
|
||||||
if ( std::fabs( depthValues[segmentStartIdx] - targetDepth ) < eps ) // already have this depth point, reuse it
|
if ( std::fabs( depthIt->second[segmentStartIdx] - depth ) < eps ) // already have this depth point,
|
||||||
|
// reuse it
|
||||||
{
|
{
|
||||||
resampledValues.push_back( propertyValues[segmentStartIdx] );
|
xValues.push_back( m_propertyValues[segmentStartIdx] );
|
||||||
// Copy all depth types for this segment
|
// Copy all depth types for this segment
|
||||||
for ( const auto& depthTypeValuesPair : originalDepths )
|
for ( auto depthTypeValuesPair : m_depths )
|
||||||
{
|
{
|
||||||
if ( depthTypeValuesPair.first != resamplingDepthType )
|
if ( depthTypeValuesPair.first != resamplingDepthType )
|
||||||
{
|
{
|
||||||
resampledDepths[depthTypeValuesPair.first].push_back( depthTypeValuesPair.second[segmentStartIdx] );
|
resampledDepths[depthTypeValuesPair.first].push_back( depthTypeValuesPair.second[segmentStartIdx] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
segmentSearchStartIdx = segmentStartIdx;
|
segmentSearchStartIdx = segmentStartIdx + 1;
|
||||||
foundPoint = true;
|
foundPoint = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if ( segmentStartIdx < depthValues.size() - 1 )
|
else if ( segmentStartIdx < depthIt->second.size() - 1 )
|
||||||
{
|
{
|
||||||
double minDepthSegment = std::min( depthValues[segmentStartIdx], depthValues[segmentStartIdx + 1] );
|
double minDepthSegment = std::min( depthIt->second[segmentStartIdx], depthIt->second[segmentStartIdx + 1] );
|
||||||
double maxDepthSegment = std::max( depthValues[segmentStartIdx], depthValues[segmentStartIdx + 1] );
|
double maxDepthSegment = std::max( depthIt->second[segmentStartIdx], depthIt->second[segmentStartIdx + 1] );
|
||||||
if ( cvf::Math::valueInRange( targetDepth, minDepthSegment, maxDepthSegment ) )
|
if ( cvf::Math::valueInRange( depth, minDepthSegment, maxDepthSegment ) )
|
||||||
{
|
{
|
||||||
interpolateSegment( resamplingDepthType,
|
interpolateSegment( resamplingDepthType, depth, segmentStartIdx, xValues, resampledDepths, eps );
|
||||||
resampledValues,
|
|
||||||
resampledDepths,
|
|
||||||
targetDepth,
|
|
||||||
segmentStartIdx,
|
|
||||||
originalDepths,
|
|
||||||
propertyValues,
|
|
||||||
eps );
|
|
||||||
segmentSearchStartIdx = segmentStartIdx;
|
segmentSearchStartIdx = segmentStartIdx;
|
||||||
foundPoint = true;
|
foundPoint = true;
|
||||||
break;
|
break;
|
||||||
@ -474,18 +452,17 @@ std::pair<std::vector<double>, std::map<RiaDefines::DepthTypeEnum, std::vector<d
|
|||||||
}
|
}
|
||||||
if ( !foundPoint )
|
if ( !foundPoint )
|
||||||
{
|
{
|
||||||
if ( isLeftOf( targetDepth, depthValues.front(), reverseOrder, eps ) )
|
if ( isLeftOf( depth, depthIt->second.front(), reverseOrder, eps ) )
|
||||||
{
|
{
|
||||||
// Extrapolate from front two
|
// Extrapolate from front two
|
||||||
const size_t firstIndex = 0;
|
interpolateSegment( resamplingDepthType, depth, 0, xValues, resampledDepths, eps );
|
||||||
interpolateSegment( resamplingDepthType, resampledValues, resampledDepths, targetDepth, firstIndex, originalDepths, propertyValues, eps );
|
|
||||||
foundPoint = true;
|
foundPoint = true;
|
||||||
}
|
}
|
||||||
else if ( isRightOf( targetDepth, depthValues.back(), reverseOrder, eps ) )
|
else if ( isRightOf( depth, depthIt->second.back(), reverseOrder, eps ) )
|
||||||
{
|
{
|
||||||
// Extrapolate from end two
|
// Extrapolate from end two
|
||||||
const size_t N = depthValues.size() - 1;
|
const size_t N = depthIt->second.size() - 1;
|
||||||
interpolateSegment( resamplingDepthType, resampledValues, resampledDepths, targetDepth, N - 1, originalDepths, propertyValues, eps );
|
interpolateSegment( resamplingDepthType, depth, N - 1, xValues, resampledDepths, eps );
|
||||||
foundPoint = true;
|
foundPoint = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -493,18 +470,6 @@ std::pair<std::vector<double>, std::map<RiaDefines::DepthTypeEnum, std::vector<d
|
|||||||
CAF_ASSERT( foundPoint );
|
CAF_ASSERT( foundPoint );
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::make_pair( resampledValues, resampledDepths );
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
cvf::ref<RigWellLogCurveData> RigWellLogCurveData::calculateResampledCurveData( RiaDefines::DepthTypeEnum resamplingDepthType,
|
|
||||||
const std::vector<double>& depths ) const
|
|
||||||
{
|
|
||||||
const auto [xValues, resampledDepths] = createResampledValuesAndDepths( resamplingDepthType, depths, m_depths, m_propertyValues );
|
|
||||||
|
|
||||||
cvf::ref<RigWellLogCurveData> reSampledData = new RigWellLogCurveData;
|
|
||||||
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true, m_useLogarithmicScale );
|
reSampledData->setValuesAndDepths( xValues, resampledDepths, m_rkbDiff, m_depthUnit, true, m_useLogarithmicScale );
|
||||||
return reSampledData;
|
return reSampledData;
|
||||||
}
|
}
|
||||||
|
@ -82,20 +82,12 @@ public:
|
|||||||
cvf::ref<RigWellLogCurveData> calculateResampledCurveData( double newMeasuredDepthStepSize ) const;
|
cvf::ref<RigWellLogCurveData> calculateResampledCurveData( double newMeasuredDepthStepSize ) const;
|
||||||
cvf::ref<RigWellLogCurveData> calculateResampledCurveData( RiaDefines::DepthTypeEnum resamplingDepthType,
|
cvf::ref<RigWellLogCurveData> calculateResampledCurveData( RiaDefines::DepthTypeEnum resamplingDepthType,
|
||||||
const std::vector<double>& depths ) const;
|
const std::vector<double>& depths ) const;
|
||||||
static void interpolateSegment( RiaDefines::DepthTypeEnum resamplingDepthType,
|
void interpolateSegment( RiaDefines::DepthTypeEnum resamplingDepthType,
|
||||||
std::vector<double>& resampledValues,
|
double depthValue,
|
||||||
std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& resampledDepths,
|
|
||||||
double targetDepthValue,
|
|
||||||
size_t firstIndex,
|
size_t firstIndex,
|
||||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& originalDepths,
|
std::vector<double>& xValues,
|
||||||
const std::vector<double>& propertyValues,
|
std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& resampledDepths,
|
||||||
double eps );
|
const double eps ) const;
|
||||||
|
|
||||||
static std::pair<std::vector<double>, std::map<RiaDefines::DepthTypeEnum, std::vector<double>>>
|
|
||||||
createResampledValuesAndDepths( RiaDefines::DepthTypeEnum resamplingDepthType,
|
|
||||||
const std::vector<double>& targetDepths,
|
|
||||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& originalDepths,
|
|
||||||
const std::vector<double>& propertyValues );
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void calculateIntervalsOfContinousValidValues();
|
void calculateIntervalsOfContinousValidValues();
|
||||||
|
@ -91,8 +91,6 @@ set(SOURCE_GROUP_SOURCE_FILES
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RifStimPlanCsvSummaryReader-Test.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RifStimPlanCsvSummaryReader-Test.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools-Test.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiaEnsembleNameTools-Test.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RigDeclineCurveCalculator-Test.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RigDeclineCurveCalculator-Test.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RigWellLogCurveData-Test.cpp
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimWellLogCalculatedCurve-Test.cpp
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RifReaderFmuRft-Test.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RifReaderFmuRft-Test.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RimSummaryRegressionAnalysisCurve-Test.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RimSummaryRegressionAnalysisCurve-Test.cpp
|
||||||
)
|
)
|
||||||
|
@ -1,183 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Copyright (C) 2023- 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 "gtest/gtest.h"
|
|
||||||
|
|
||||||
#include "RiaDefines.h"
|
|
||||||
|
|
||||||
#include "RigWellLogCurveData.h"
|
|
||||||
|
|
||||||
#include "cvfVector3.h"
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
TEST( RigWellLogCurveData, interpolateSegment_first )
|
|
||||||
{
|
|
||||||
// Input data
|
|
||||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>> originalDepths =
|
|
||||||
{ { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, { 0.0, 20.0, 40.0 } },
|
|
||||||
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, { 0.0, 30.0, 60.0 } },
|
|
||||||
{ RiaDefines::DepthTypeEnum::PSEUDO_LENGTH, { 0.0, 40.0, 80.0 } } };
|
|
||||||
const std::vector<double> propertyValues = { 0.0, 100.0, 150.0 };
|
|
||||||
const double eps = 1e-6;
|
|
||||||
|
|
||||||
// Output data
|
|
||||||
const auto resamplingDepthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
|
|
||||||
std::vector<double> resampledValues;
|
|
||||||
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths;
|
|
||||||
|
|
||||||
// Target data (resampling with MEASURED_DEPTH)
|
|
||||||
const double targetDepthValue = 10.0; // Halfway between index 0 and 1 for MEASURED_DEPTH in originalDepths
|
|
||||||
const size_t firstIndex = 0;
|
|
||||||
|
|
||||||
// Call the function under test
|
|
||||||
RigWellLogCurveData::interpolateSegment( resamplingDepthType,
|
|
||||||
resampledValues,
|
|
||||||
resampledDepths,
|
|
||||||
targetDepthValue,
|
|
||||||
firstIndex,
|
|
||||||
originalDepths,
|
|
||||||
propertyValues,
|
|
||||||
eps );
|
|
||||||
|
|
||||||
// Check the results
|
|
||||||
ASSERT_EQ( resampledValues.size(), size_t( 1 ) );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledValues[0], 50.0 );
|
|
||||||
|
|
||||||
ASSERT_EQ( resampledDepths.size(), size_t( 2 ) );
|
|
||||||
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH].size(), size_t( 1 ) );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][0], 15.0 );
|
|
||||||
|
|
||||||
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH].size(), size_t( 1 ) );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][0], 20.0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
TEST( RigWellLogCurveData, interpolateSegment_second )
|
|
||||||
{
|
|
||||||
// Input data
|
|
||||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>> originalDepths =
|
|
||||||
{ { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, { 0.0, 20.0, 40.0 } },
|
|
||||||
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, { 0.0, 30.0, 60.0 } },
|
|
||||||
{ RiaDefines::DepthTypeEnum::PSEUDO_LENGTH, { 0.0, 40.0, 80.0 } } };
|
|
||||||
const std::vector<double> propertyValues = { 0.0, 100.0, 150.0 };
|
|
||||||
const double eps = 1e-6;
|
|
||||||
|
|
||||||
// Output data
|
|
||||||
const auto resamplingDepthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
|
|
||||||
std::vector<double> resampledValues;
|
|
||||||
std::map<RiaDefines::DepthTypeEnum, std::vector<double>> resampledDepths;
|
|
||||||
|
|
||||||
// Target data (resampling with MEASURED_DEPTH)
|
|
||||||
const double firstTargetDepthValue = 10.0; // Halfway between index 0 and 1 for MEASURED_DEPTH in originalDepths
|
|
||||||
const double secondTargetDepthValue = 30.0; // Halfway between index 1 and 2 for MEASURED_DEPTH in originalDepths
|
|
||||||
const size_t firstIndex = 0;
|
|
||||||
const size_t secondIndex = 1;
|
|
||||||
|
|
||||||
// Call the function under test with first index and target value
|
|
||||||
RigWellLogCurveData::interpolateSegment( resamplingDepthType,
|
|
||||||
resampledValues,
|
|
||||||
resampledDepths,
|
|
||||||
firstTargetDepthValue,
|
|
||||||
firstIndex,
|
|
||||||
originalDepths,
|
|
||||||
propertyValues,
|
|
||||||
eps );
|
|
||||||
|
|
||||||
// Call the function under test with second index and target value
|
|
||||||
RigWellLogCurveData::interpolateSegment( resamplingDepthType,
|
|
||||||
resampledValues,
|
|
||||||
resampledDepths,
|
|
||||||
secondTargetDepthValue,
|
|
||||||
secondIndex,
|
|
||||||
originalDepths,
|
|
||||||
propertyValues,
|
|
||||||
eps );
|
|
||||||
|
|
||||||
// Check the results
|
|
||||||
ASSERT_EQ( resampledValues.size(), size_t( 2 ) );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledValues[0], 50.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledValues[1], 125.0 );
|
|
||||||
|
|
||||||
ASSERT_EQ( resampledDepths.size(), size_t( 2 ) );
|
|
||||||
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH].size(), size_t( 2 ) );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][0], 15.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][1], 45.0 );
|
|
||||||
|
|
||||||
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH].size(), size_t( 2 ) );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][0], 20.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][1], 60.0 );
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
TEST( RigWellLogCurveData, CreateResampledValuesAndDepthsTest )
|
|
||||||
{
|
|
||||||
// Input data
|
|
||||||
RiaDefines::DepthTypeEnum resamplingDepthType = RiaDefines::DepthTypeEnum::MEASURED_DEPTH;
|
|
||||||
const std::vector<double> targetDepths = { 0.0, 5.0, 10.0, 15.0 };
|
|
||||||
const std::map<RiaDefines::DepthTypeEnum, std::vector<double>> originalDepths =
|
|
||||||
{ { RiaDefines::DepthTypeEnum::MEASURED_DEPTH, { 0.0, 10.0, 20.0 } },
|
|
||||||
{ RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH, { 0.0, 20.0, 40.0 } },
|
|
||||||
{ RiaDefines::DepthTypeEnum::PSEUDO_LENGTH, { 0.0, 30.0, 60.0 } } };
|
|
||||||
const std::vector<double> propertyValues = { 0.0, 100.0, 200.0 };
|
|
||||||
|
|
||||||
// Call the function under test
|
|
||||||
auto result = RigWellLogCurveData::createResampledValuesAndDepths( resamplingDepthType, targetDepths, originalDepths, propertyValues );
|
|
||||||
|
|
||||||
// Check the results
|
|
||||||
std::vector<double>& resampledPropertyValues = result.first;
|
|
||||||
std::map<RiaDefines::DepthTypeEnum, std::vector<double>>& resampledDepths = result.second;
|
|
||||||
const auto expectedSize = targetDepths.size();
|
|
||||||
|
|
||||||
ASSERT_EQ( resampledDepths.size(), originalDepths.size() );
|
|
||||||
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH].size(), expectedSize );
|
|
||||||
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH].size(), expectedSize );
|
|
||||||
ASSERT_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH].size(), expectedSize );
|
|
||||||
|
|
||||||
ASSERT_EQ( resampledPropertyValues.size(), expectedSize );
|
|
||||||
|
|
||||||
// Example assertions for the specific values
|
|
||||||
ASSERT_DOUBLE_EQ( resampledPropertyValues[0], 0.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledPropertyValues[1], 50.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledPropertyValues[2], 100.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledPropertyValues[3], 150.0 );
|
|
||||||
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][0], 0.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][1], 5.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][2], 10.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::MEASURED_DEPTH][3], 15.0 );
|
|
||||||
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][0], 0.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][1], 10.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][2], 20.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::TRUE_VERTICAL_DEPTH][3], 30.0 );
|
|
||||||
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][0], 0.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][1], 15.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][2], 30.0 );
|
|
||||||
ASSERT_DOUBLE_EQ( resampledDepths[RiaDefines::DepthTypeEnum::PSEUDO_LENGTH][3], 45.0 );
|
|
||||||
}
|
|
@ -1,17 +1,17 @@
|
|||||||
|
|
||||||
set(RESINSIGHT_MAJOR_VERSION 2023)
|
set(RESINSIGHT_MAJOR_VERSION 2023)
|
||||||
set(RESINSIGHT_MINOR_VERSION 03)
|
set(RESINSIGHT_MINOR_VERSION 06)
|
||||||
set(RESINSIGHT_PATCH_VERSION 1)
|
set(RESINSIGHT_PATCH_VERSION 0)
|
||||||
|
|
||||||
# Opional text with no restrictions
|
# Opional text with no restrictions
|
||||||
set(RESINSIGHT_VERSION_TEXT "-dev")
|
#set(RESINSIGHT_VERSION_TEXT "-dev")
|
||||||
#set(RESINSIGHT_VERSION_TEXT "-RC_04")
|
set(RESINSIGHT_VERSION_TEXT "-RC_01")
|
||||||
|
|
||||||
# Optional text
|
# Optional text
|
||||||
# Must be unique and increasing within one combination of major/minor/patch version
|
# Must be unique and increasing within one combination of major/minor/patch version
|
||||||
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
|
# The uniqueness of this text is independent of RESINSIGHT_VERSION_TEXT
|
||||||
# Format of text must be ".xx"
|
# Format of text must be ".xx"
|
||||||
set(RESINSIGHT_DEV_VERSION ".01")
|
#set(RESINSIGHT_DEV_VERSION ".01")
|
||||||
|
|
||||||
# https://github.com/CRAVA/crava/tree/master/libs/nrlib
|
# https://github.com/CRAVA/crava/tree/master/libs/nrlib
|
||||||
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")
|
set(NRLIB_GITHUB_SHA "ba35d4359882f1c6f5e9dc30eb95fe52af50fd6f")
|
||||||
|
Loading…
Reference in New Issue
Block a user