mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
WBS-plot: Add optional support for maximum curve interval for UCS parameter curve (#10118)
* WBS-plot: Add optional support for maximum curve interval for UCS parameter curve * GeoMech: Guard out-of-bound access to Pore pressure data
This commit is contained in:
parent
b7f8d0e0f1
commit
d4f11e0f8f
@ -105,14 +105,17 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorNormalST::calculate( int par
|
||||
{
|
||||
for ( int elmNodIdx = 0; elmNodIdx < elmNodeCount; ++elmNodIdx )
|
||||
{
|
||||
size_t elmNodResIdx = femPart->elementNodeResultIdx( elmIdx, elmNodIdx );
|
||||
const size_t elmNodResIdx = femPart->elementNodeResultIdx( elmIdx, elmNodIdx );
|
||||
const int nodeIdx = femPart->nodeIdxFromElementNodeResultIdx( elmNodResIdx );
|
||||
float por = 0.0f;
|
||||
if ( nodeIdx < srcPORFrameData.size() )
|
||||
{
|
||||
por = srcPORFrameData[nodeIdx];
|
||||
if ( por == inf ) por = 0.0f;
|
||||
}
|
||||
|
||||
if ( elmNodResIdx < srcSFrameData.size() )
|
||||
{
|
||||
int nodeIdx = femPart->nodeIdxFromElementNodeResultIdx( elmNodResIdx );
|
||||
|
||||
float por = srcPORFrameData[nodeIdx];
|
||||
if ( por == inf ) por = 0.0f;
|
||||
|
||||
// ST = SE_abacus + porePressure
|
||||
// porePressure is POR-Bar.
|
||||
double SE_abacus = -srcSFrameData[elmNodResIdx];
|
||||
|
@ -833,6 +833,14 @@ QString RimWellLogCurveCommonDataSource::smoothingUiOrderinglabel()
|
||||
return "ApplySmoothing";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::pair<bool, double> RimWellLogCurveCommonDataSource::maximumCurvePointInterval() const
|
||||
{
|
||||
return m_maximumCurvePointInterval();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@ -103,6 +103,8 @@ public:
|
||||
|
||||
static QString smoothingUiOrderinglabel();
|
||||
|
||||
std::pair<bool, double> maximumCurvePointInterval() const;
|
||||
|
||||
private:
|
||||
void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override;
|
||||
QList<caf::PdmOptionItemInfo> calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions ) override;
|
||||
|
@ -50,6 +50,7 @@
|
||||
#include "RimTools.h"
|
||||
#include "RimWellBoreStabilityPlot.h"
|
||||
#include "RimWellLogCurve.h"
|
||||
#include "RimWellLogCurveCommonDataSource.h"
|
||||
#include "RimWellLogFile.h"
|
||||
#include "RimWellLogFileChannel.h"
|
||||
#include "RimWellLogPlot.h"
|
||||
@ -421,6 +422,29 @@ void RimWellLogExtractionCurve::onLoadDataAndUpdate( bool updateParentPlot )
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimWellLogExtractionCurve::performDataExtraction( bool* isUsingPseudoLength )
|
||||
{
|
||||
if ( dynamic_cast<RimGeoMechCase*>( m_case.value() ) && ( m_geomResultDefinition->resultPositionType() == RIG_WELLPATH_DERIVED ) &&
|
||||
( m_geomResultDefinition->resultFieldName() == "UCS" ) )
|
||||
{
|
||||
RimWellBoreStabilityPlot* wbsPlot = nullptr;
|
||||
this->firstAncestorOrThisOfType( wbsPlot );
|
||||
if ( wbsPlot )
|
||||
{
|
||||
auto maxCurvePointInterval = wbsPlot->commonDataSource()->maximumCurvePointInterval();
|
||||
if ( maxCurvePointInterval.first )
|
||||
{
|
||||
double maxIntervalLength = maxCurvePointInterval.second;
|
||||
|
||||
// Special handling for a UCS parameter curve as this curve also depends on UCS that can be defined in a LAS file with
|
||||
// high resolution. The maximum curve interval was designed to only be used by RimWellLogWbsCurve. To be able to use
|
||||
// this functionality for a wellpath UCS curve, we get the maximumCurvePointInterval directly. It is not possible to
|
||||
// control this setting locally on the curve object, the value is always taken directly from the WBS plot settings.
|
||||
extractData( isUsingPseudoLength, {}, maxIntervalLength );
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extractData( isUsingPseudoLength, {}, {} );
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ std::optional<T> createOptional( bool enable, const T& value )
|
||||
{
|
||||
if ( !enable ) return {};
|
||||
|
||||
return std::optional<T>( value );
|
||||
return value;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
Loading…
Reference in New Issue
Block a user