mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#8102 Ensemble Well Log Plot: Fix crash when using TVD
This commit is contained in:
@@ -23,18 +23,19 @@
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RigWellLogIndexDepthOffset::setIndexOffsetDepth( int kIndex, double topDepth, double bottomDepth )
|
||||
void RigWellLogIndexDepthOffset::setIndexOffsetDepth( int kIndex, double topMd, double bottomMd, double topTvd, double bottomTvd )
|
||||
{
|
||||
m_depthOffsets[kIndex] = std::pair<double, double>( topDepth, bottomDepth );
|
||||
m_mdOffsets[kIndex] = std::pair<double, double>( topMd, bottomMd );
|
||||
m_tvdOffsets[kIndex] = std::pair<double, double>( topTvd, bottomTvd );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigWellLogIndexDepthOffset::getTopDepth( int kIndex ) const
|
||||
double RigWellLogIndexDepthOffset::getTopMd( int kIndex ) const
|
||||
{
|
||||
auto hit = m_depthOffsets.find( kIndex );
|
||||
if ( hit != m_depthOffsets.end() )
|
||||
auto hit = m_mdOffsets.find( kIndex );
|
||||
if ( hit != m_mdOffsets.end() )
|
||||
{
|
||||
return hit->second.first;
|
||||
}
|
||||
@@ -45,10 +46,38 @@ double RigWellLogIndexDepthOffset::getTopDepth( int kIndex ) const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigWellLogIndexDepthOffset::getBottomDepth( int kIndex ) const
|
||||
double RigWellLogIndexDepthOffset::getBottomMd( int kIndex ) const
|
||||
{
|
||||
auto hit = m_depthOffsets.find( kIndex );
|
||||
if ( hit != m_depthOffsets.end() )
|
||||
auto hit = m_mdOffsets.find( kIndex );
|
||||
if ( hit != m_mdOffsets.end() )
|
||||
{
|
||||
return hit->second.second;
|
||||
}
|
||||
|
||||
return std::numeric_limits<double>::infinity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigWellLogIndexDepthOffset::getTopTvd( int kIndex ) const
|
||||
{
|
||||
auto hit = m_tvdOffsets.find( kIndex );
|
||||
if ( hit != m_tvdOffsets.end() )
|
||||
{
|
||||
return hit->second.first;
|
||||
}
|
||||
|
||||
return std::numeric_limits<double>::infinity();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
double RigWellLogIndexDepthOffset::getBottomTvd( int kIndex ) const
|
||||
{
|
||||
auto hit = m_tvdOffsets.find( kIndex );
|
||||
if ( hit != m_tvdOffsets.end() )
|
||||
{
|
||||
return hit->second.second;
|
||||
}
|
||||
@@ -62,7 +91,7 @@ double RigWellLogIndexDepthOffset::getBottomDepth( int kIndex ) const
|
||||
std::vector<int> RigWellLogIndexDepthOffset::sortedIndexes() const
|
||||
{
|
||||
std::vector<int> indexes;
|
||||
for ( auto m : m_depthOffsets )
|
||||
for ( auto m : m_mdOffsets )
|
||||
{
|
||||
indexes.push_back( m.first );
|
||||
}
|
||||
|
||||
@@ -28,11 +28,14 @@ public:
|
||||
RigWellLogIndexDepthOffset() = default;
|
||||
~RigWellLogIndexDepthOffset() override = default;
|
||||
|
||||
void setIndexOffsetDepth( int kIndex, double topDepth, double bottomDepth );
|
||||
double getTopDepth( int kIndex ) const;
|
||||
double getBottomDepth( int kIndex ) const;
|
||||
void setIndexOffsetDepth( int kIndex, double topMd, double bottomMd, double topTvd, double bottomTvd );
|
||||
double getTopMd( int kIndex ) const;
|
||||
double getBottomMd( int kIndex ) const;
|
||||
double getTopTvd( int kIndex ) const;
|
||||
double getBottomTvd( int kIndex ) const;
|
||||
std::vector<int> sortedIndexes() const;
|
||||
|
||||
private:
|
||||
std::map<int, std::pair<double, double>> m_depthOffsets;
|
||||
std::map<int, std::pair<double, double>> m_mdOffsets;
|
||||
std::map<int, std::pair<double, double>> m_tvdOffsets;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user