#6007 Add user interface for facies properties.

This commit is contained in:
Kristian Bendiksen
2020-05-26 22:22:06 +02:00
committed by Magne Sjaastad
parent e9e32bfc3a
commit 79af3d7379
12 changed files with 625 additions and 2 deletions

View File

@@ -158,6 +158,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimColorLegendItem.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlot.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlotCollection.h
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.h
${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.h
)
@@ -320,6 +321,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RimColorLegendItem.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlot.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelPlotCollection.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFractureModelCurve.cpp
${CMAKE_CURRENT_LIST_DIR}/RimFaciesProperties.cpp
)
list(APPEND CODE_HEADER_FILES

View File

@@ -34,6 +34,7 @@
#include "RimEclipseCellColors.h"
#include "RimEclipseView.h"
#include "RimEllipseFractureTemplate.h"
#include "RimFaciesProperties.h"
#include "RimModeledWellPath.h"
#include "RimOilField.h"
#include "RimProject.h"
@@ -103,6 +104,8 @@ RimFractureModel::RimFractureModel()
CAF_PDM_InitField( &m_boundingBoxHorizontal, "BoundingBoxHorizontal", 50.0, "Bounding Box Horizontal", "", "", "" );
CAF_PDM_InitField( &m_boundingBoxVertical, "BoundingBoxVertical", 100.0, "Bounding Box Vertical", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_faciesProperties, "FaciesProperties", "Facies Properties", "", "", "" );
}
//--------------------------------------------------------------------------------------------------
@@ -356,6 +359,7 @@ cvf::Vec3d RimFractureModel::calculateTSTDirection() const
void RimFractureModel::defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering )
{
m_thicknessDirectionWellPath.uiCapability()->setUiHidden( true );
m_faciesProperties.uiCapability()->setUiHidden( false );
}
//--------------------------------------------------------------------------------------------------
@@ -450,3 +454,19 @@ void RimFractureModel::findThicknessTargetPoints( cvf::Vec3d& topPosition, cvf::
bottomPlane.intersect( position, belowPlane, &bottomPosition );
RiaLogging::info( QString( "Bottom: %1" ).arg( RimFractureModel::vecToString( bottomPosition ) ) );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFaciesProperties* RimFractureModel::faciesProperties() const
{
return m_faciesProperties;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFractureModel::setFaciesProperties( RimFaciesProperties* faciesProperties )
{
m_faciesProperties = faciesProperties;
}

View File

@@ -34,6 +34,7 @@
class RimEclipseCase;
class RimWellPath;
class RimModeledWellPath;
class RimFaciesProperties;
//==================================================================================================
///
@@ -70,8 +71,10 @@ public:
RimWellPath* wellPath() const;
RimModeledWellPath* thicknessDirectionWellPath() const;
void setThicknessDirectionWellPath( RimModeledWellPath* thicknessDirectionWellPath );
RimModeledWellPath* thicknessDirectionWellPath() const;
void setThicknessDirectionWellPath( RimModeledWellPath* thicknessDirectionWellPath );
void setFaciesProperties( RimFaciesProperties* faciesProperties );
RimFaciesProperties* faciesProperties() const;
protected:
void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override;
@@ -92,4 +95,5 @@ protected:
caf::PdmField<double> m_boundingBoxVertical;
caf::PdmField<double> m_boundingBoxHorizontal;
caf::PdmPtrField<RimModeledWellPath*> m_thicknessDirectionWellPath;
caf::PdmChildField<RimFaciesProperties*> m_faciesProperties;
};

View File

@@ -431,6 +431,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
{
menuBuilder << "RicNewFractureModelPlotFeature";
menuBuilder << "RicImportFaciesFeature";
menuBuilder << "RicImportFaciesPropertiesFeature";
}
else if ( dynamic_cast<Rim3dWellLogCurveCollection*>( firstUiItem ) ||
dynamic_cast<Rim3dWellLogExtractionCurve*>( firstUiItem ) ||

View File

@@ -0,0 +1,153 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "RimFaciesProperties.h"
#include "cafPdmUiLineEditor.h"
#include "cafPdmUiTextEditor.h"
CAF_PDM_SOURCE_INIT( RimFaciesProperties, "FaciesProperties" );
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFaciesProperties::RimFaciesProperties()
{
CAF_PDM_InitObject( "RimFaciesProperties", "", "", "" );
CAF_PDM_InitFieldNoDefault( &m_filePath, "FilePath", "File Path", "", "", "" );
m_filePath.uiCapability()->setUiReadOnly( true );
m_filePath.uiCapability()->setUiEditorTypeName( caf::PdmUiLineEditor::uiEditorTypeName() );
CAF_PDM_InitFieldNoDefault( &m_propertiesTable, "PropertiesTable", "Properties Table", "", "", "" );
m_propertiesTable.uiCapability()->setUiEditorTypeName( caf::PdmUiTextEditor::uiEditorTypeName() );
m_propertiesTable.uiCapability()->setUiLabelPosition( caf::PdmUiItemInfo::HIDDEN );
m_propertiesTable.uiCapability()->setUiReadOnly( true );
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
RimFaciesProperties::~RimFaciesProperties()
{
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFaciesProperties::filePath() const
{
return m_filePath.v().path();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaciesProperties::setFilePath( const QString& filePath )
{
m_filePath = filePath;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaciesProperties::setPropertiesForFacies( FaciesKey& key, const RigFaciesProperties& properties )
{
m_properties.insert( std::pair<FaciesKey, RigFaciesProperties>( key, properties ) );
m_propertiesTable = generatePropertiesTable();
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RimFaciesProperties::defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute )
{
if ( field == &m_propertiesTable )
{
auto myAttr = dynamic_cast<caf::PdmUiTextEditorAttribute*>( attribute );
if ( myAttr )
{
myAttr->wrapMode = caf::PdmUiTextEditorAttribute::NoWrap;
myAttr->textMode = caf::PdmUiTextEditorAttribute::HTML;
}
}
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
QString RimFaciesProperties::generatePropertiesTable()
{
QString header( "<table border=1>"
" <thead>"
" <tr bgcolor=lightblue>"
" <th>Field</th>"
" <th>Formation</th>"
" <th>Facies</th>"
" <th>Porosity</th>"
" <th>Young's Modulus</th>"
" <th>Poisson's Ratio</th>"
" <th>K-Ic</th>"
" <th>Proppant Embedment</th>"
" </tr>"
" </thead>"
" <tbody>" );
QString body;
for ( auto prop : m_properties )
{
const QString& fieldName = prop.second.fieldName();
const std::vector<double>& porosity = prop.second.porosity();
const std::vector<double>& youngsModulus = prop.second.youngsModulus();
const std::vector<double>& poissonsRatio = prop.second.poissonsRatio();
const std::vector<double>& K_Ic = prop.second.K_Ic();
const std::vector<double>& proppantEmbedment = prop.second.proppantEmbedment();
for ( size_t i = 0; i < porosity.size(); i++ )
{
QString format( "<tr>"
" <td>%1</td>"
" <td>%2</td>"
" <td>%3</td>"
" <td align=right>%4</td>"
" <td align=right>%5</td>"
" <td align=right>%6</td>"
" <td align=right>%7</td>"
" <td align=right>%8</td>"
"</tr>" );
QString line = format.arg( fieldName )
.arg( prop.second.formationName() )
.arg( prop.second.faciesName() )
.arg( porosity[i] )
.arg( youngsModulus[i] )
.arg( poissonsRatio[i] )
.arg( K_Ic[i] )
.arg( proppantEmbedment[i] );
body.append( line );
}
}
QString footer( "</tbody></table>" );
return header + body + footer;
}

View File

@@ -0,0 +1,61 @@
/////////////////////////////////////////////////////////////////////////////////
//
// 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 "cafFilePath.h"
#include "cafPdmField.h"
#include "cafPdmObject.h"
#include "RigFaciesProperties.h"
#include <QString>
#include <tuple>
typedef std::tuple<QString, QString, QString> FaciesKey;
//==================================================================================================
///
//==================================================================================================
class RimFaciesProperties : public caf::PdmObject
{
CAF_PDM_HEADER_INIT;
public:
RimFaciesProperties();
~RimFaciesProperties() override;
QString filePath() const;
void setFilePath( const QString& filePath );
void setPropertiesForFacies( FaciesKey& key, const RigFaciesProperties& properties );
protected:
void defineEditorAttribute( const caf::PdmFieldHandle* field,
QString uiConfigName,
caf::PdmUiEditorAttribute* attribute ) override;
private:
QString generatePropertiesTable();
caf::PdmField<caf::FilePath> m_filePath;
caf::PdmField<QString> m_propertiesTable;
std::map<FaciesKey, RigFaciesProperties> m_properties;
};