mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Remove duplicated curve extraction code for layers.
This commit is contained in:
@@ -38,7 +38,6 @@
|
||||
#include "RimFractureModelPlot.h"
|
||||
#include "RimFractureModelPlotCollection.h"
|
||||
#include "RimFractureModelTemplate.h"
|
||||
#include "RimLayerCurve.h"
|
||||
#include "RimMainPlotCollection.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimProject.h"
|
||||
@@ -311,7 +310,7 @@ void RicNewFractureModelPlotFeature::createLayersTrack( RimFractureModelPlot* pl
|
||||
|
||||
caf::ColorTable colors = RiaColorTables::wellLogPlotPaletteColors();
|
||||
|
||||
RimLayerCurve* curve = new RimLayerCurve;
|
||||
RimFractureModelCurve* curve = new RimFractureModelCurve;
|
||||
curve->setCurveProperty( RiaDefines::CurveProperty::LAYERS );
|
||||
curve->setFractureModel( fractureModel );
|
||||
curve->setCase( eclipseCase );
|
||||
|
||||
@@ -164,7 +164,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScaling.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScalingCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimLayerCurve.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimAbstractPlotCollection.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPropertyCurve.h
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.h
|
||||
@@ -343,7 +342,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticProperties.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScaling.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimElasticPropertyScalingCollection.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimLayerCurve.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimNonNetLayers.cpp
|
||||
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCalculator.cpp
|
||||
|
||||
@@ -42,9 +42,7 @@
|
||||
#include "RimFractureModel.h"
|
||||
#include "RimFractureModelCalculator.h"
|
||||
#include "RimFractureModelElasticPropertyCalculator.h"
|
||||
#include "RimFractureModelPlot.h"
|
||||
#include "RimFractureModelTemplate.h"
|
||||
#include "RimLayerCurve.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimNonNetLayers.h"
|
||||
#include "RimTools.h"
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "RimFractureModel.h"
|
||||
#include "RimFractureModelCalculator.h"
|
||||
#include "RimFractureModelTemplate.h"
|
||||
#include "RimLayerCurve.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
#include "RimNonNetLayers.h"
|
||||
#include "RimWellPath.h"
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2020- 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 "RimLayerCurve.h"
|
||||
|
||||
#include "RigEclipseCaseData.h"
|
||||
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimFractureModel.h"
|
||||
#include "RimFractureModelCalculator.h"
|
||||
#include "RimModeledWellPath.h"
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RimLayerCurve, "LayerCurve" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimLayerCurve::RimLayerCurve()
|
||||
{
|
||||
CAF_PDM_InitObject( "Fracture Model Curve", "", "", "" );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_fractureModel, "FractureModel", "Fracture Model", "", "", "" );
|
||||
m_fractureModel.uiCapability()->setUiTreeChildrenHidden( true );
|
||||
m_fractureModel.uiCapability()->setUiHidden( true );
|
||||
|
||||
CAF_PDM_InitFieldNoDefault( &m_curveProperty, "CurveProperty", "Curve Property", "", "", "" );
|
||||
m_curveProperty.uiCapability()->setUiHidden( true );
|
||||
|
||||
m_wellPath = nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimLayerCurve::~RimLayerCurve()
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimLayerCurve::setFractureModel( RimFractureModel* fractureModel )
|
||||
{
|
||||
m_fractureModel = fractureModel;
|
||||
m_wellPath = fractureModel->thicknessDirectionWellPath();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimLayerCurve::performDataExtraction( bool* isUsingPseudoLength )
|
||||
{
|
||||
std::vector<double> values;
|
||||
std::vector<double> measuredDepthValues;
|
||||
std::vector<double> tvDepthValues;
|
||||
double rkbDiff = 0.0;
|
||||
|
||||
RiaDefines::DepthUnitType depthUnit = RiaDefines::DepthUnitType::UNIT_METER;
|
||||
QString xUnits = RiaWellLogUnitTools<double>::noUnitString();
|
||||
|
||||
*isUsingPseudoLength = false;
|
||||
|
||||
if ( m_fractureModel && m_fractureModel->eclipseCase() )
|
||||
{
|
||||
RimEclipseCase* eclipseCase = m_fractureModel->eclipseCase();
|
||||
|
||||
bool isOk = m_fractureModel->calculator()->extractCurveData( curveProperty(),
|
||||
m_timeStep,
|
||||
values,
|
||||
measuredDepthValues,
|
||||
tvDepthValues,
|
||||
rkbDiff );
|
||||
if ( !isOk )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RiaEclipseUnitTools::UnitSystem eclipseUnitsType = eclipseCase->eclipseCaseData()->unitsType();
|
||||
if ( eclipseUnitsType == RiaEclipseUnitTools::UnitSystem::UNITS_FIELD )
|
||||
{
|
||||
// See https://github.com/OPM/ResInsight/issues/538
|
||||
|
||||
depthUnit = RiaDefines::DepthUnitType::UNIT_FEET;
|
||||
}
|
||||
}
|
||||
|
||||
bool performDataSmoothing = false;
|
||||
if ( !values.empty() && !measuredDepthValues.empty() )
|
||||
{
|
||||
if ( tvDepthValues.empty() )
|
||||
{
|
||||
this->setValuesAndDepths( values,
|
||||
measuredDepthValues,
|
||||
RiaDefines::DepthTypeEnum::MEASURED_DEPTH,
|
||||
0.0,
|
||||
depthUnit,
|
||||
!performDataSmoothing,
|
||||
xUnits );
|
||||
}
|
||||
else
|
||||
{
|
||||
this->setValuesWithMdAndTVD( values,
|
||||
measuredDepthValues,
|
||||
tvDepthValues,
|
||||
rkbDiff,
|
||||
depthUnit,
|
||||
!performDataSmoothing,
|
||||
xUnits );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
QString RimLayerCurve::createCurveAutoName()
|
||||
{
|
||||
return "Layers";
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RimLayerCurve::setCurveProperty( RiaDefines::CurveProperty curveProperty )
|
||||
{
|
||||
m_curveProperty = curveProperty;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RiaDefines::CurveProperty RimLayerCurve::curveProperty() const
|
||||
{
|
||||
return m_curveProperty();
|
||||
}
|
||||
@@ -1,60 +0,0 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2020- 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.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RimFractureModelPropertyCurve.h"
|
||||
#include "RimWellLogExtractionCurve.h"
|
||||
|
||||
#include "cafPdmField.h"
|
||||
#include "cafPdmPtrField.h"
|
||||
|
||||
class RimFractureModel;
|
||||
class RimColorLegend;
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RimLayerCurve : public RimWellLogExtractionCurve, public RimFractureModelPropertyCurve
|
||||
{
|
||||
CAF_PDM_HEADER_INIT;
|
||||
|
||||
public:
|
||||
RimLayerCurve();
|
||||
~RimLayerCurve() override;
|
||||
|
||||
void setFractureModel( RimFractureModel* fractureModel );
|
||||
|
||||
void setEclipseResultCategory( RiaDefines::ResultCatType catType );
|
||||
|
||||
void setCurveProperty( RiaDefines::CurveProperty ) override;
|
||||
RiaDefines::CurveProperty curveProperty() const override;
|
||||
|
||||
protected:
|
||||
QString createCurveAutoName() override;
|
||||
|
||||
void performDataExtraction( bool* isUsingPseudoLength ) override;
|
||||
|
||||
// static QString findFaciesName( const RimColorLegend& colorLegend, double value );
|
||||
static QString findFormationNameForDepth( const std::vector<QString>& formationNames,
|
||||
const std::vector<std::pair<double, double>>& depthRanges,
|
||||
double depth );
|
||||
|
||||
caf::PdmPtrField<RimFractureModel*> m_fractureModel;
|
||||
caf::PdmField<caf::AppEnum<RiaDefines::CurveProperty>> m_curveProperty;
|
||||
};
|
||||
Reference in New Issue
Block a user