///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2015- Statoil ASA // Copyright (C) 2015- Ceetron Solutions AS // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include "RimCase.h" #include "cafFilePath.h" #include "cafPdmChildArrayField.h" #include "cafPdmField.h" #include "cafPdmObject.h" #include "cafPdmPointer.h" #include "cvfObject.h" #include class RimGeoMechView; class RigGeoMechCaseData; class RifGeoMechReaderInterface; class RimGeoMechContourMapView; class RimGeoMechContourMapViewCollection; class RimMudWeightWindowParameters; //================================================================================================== /// /// //================================================================================================== class RimGeoMechCase : public RimCase { CAF_PDM_HEADER_INIT; public: enum CaseOpenStatus { CASE_OPEN_OK = 0, CASE_OPEN_CANCELLED, CASE_OPEN_ERROR }; enum class BiotCoefficientType { BIOT_NONE = 0, BIOT_FIXED, BIOT_PER_ELEMENT }; enum class InitialPermeabilityType { INITIAL_PERMEABILITY_FIXED = 0, INITIAL_PERMEABILITY_PER_ELEMENT }; RimGeoMechCase( void ); ~RimGeoMechCase( void ) override; CaseOpenStatus openGeoMechCase( std::string* errorMessage ); RimGeoMechCase* createCopy( const QString& newInputFileName ); RigGeoMechCaseData* geoMechData(); const RigGeoMechCaseData* geoMechData() const; RimGeoMechContourMapViewCollection* contourMapCollection(); void reloadDataAndUpdate(); RimGeoMechView* createAndAddReservoirView(); RimGeoMechView* createCopyAndAddView( const RimGeoMechView* sourceView ); void updateFilePathsFromProjectPath( const QString& projectPath, const QString& oldProjectPath ) override; std::vector timeStepDates() const override; QStringList timeStepStrings() const override; QString timeStepName( int frameIdx ) const override; cvf::BoundingBox reservoirBoundingBox() override; cvf::BoundingBox activeCellsBoundingBox() const override; cvf::BoundingBox allCellsBoundingBox() const override; double characteristicCellSize() const override; void addElementPropertyFiles( const std::vector& filenames ); double cohesion() const; double frictionAngleDeg() const; void setApplyTimeFilter( bool applyTimeFilter ); // Fields: caf::PdmChildArrayField geoMechViews; BiotCoefficientType biotCoefficientType() const; double biotFixedCoefficient() const; QString biotResultAddress() const; InitialPermeabilityType initialPermeabilityType() const; double initialPermeabilityFixed() const; QString initialPermeabilityAddress() const; double permeabilityExponent() const; std::vector possibleElementPropertyFieldNames(); std::vector elementPropertyFileNames() const; QString findFileNameForElementProperty( const std::string& elementProperty, const std::map addressesInFiles ) const; void updateConnectedViews(); private: cvf::Vec3d displayModelOffset() const override; static std::vector vectorOfValidDateTimesFromTimeStepStrings( const QStringList& timeStepStrings ); static QDateTime dateTimeFromTimeStepString( const QString& timeStepString ); void fieldChangedByUi( const caf::PdmFieldHandle* changedField, const QVariant& oldValue, const QVariant& newValue ) override; void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; void defineUiTreeOrdering( caf::PdmUiTreeOrdering& uiTreeOrdering, QString uiConfigName = "" ) override; void defineEditorAttribute( const caf::PdmFieldHandle* field, QString uiConfigName, caf::PdmUiEditorAttribute* attribute ) override; QList calculateValueOptions( const caf::PdmFieldHandle* fieldNeedingOptions, bool* useOptionsOnly ) override; void updateFormationNamesData() override; void initAfterRead() override; static QString subStringOfDigits( const QString& timeStepString, int numberOfDigitsToFind ); void importElementPropertyFile(); void closeSelectedElementPropertyFiles(); void reloadSelectedElementPropertyFiles(); std::vector allSpecialViews() const override; private: cvf::ref m_geoMechCaseData; caf::PdmField m_cohesion; caf::PdmField m_frictionAngleDeg; caf::PdmField> m_elementPropertyFileNames; caf::PdmField> m_elementPropertyFileNameIndexUiSelection; caf::PdmField m_importElementPropertyFileCommand; caf::PdmField m_closeElementPropertyFileCommand; caf::PdmField m_reloadElementPropertyFileCommand; caf::PdmField> m_biotCoefficientType; caf::PdmField m_biotFixedCoefficient; caf::PdmField m_biotResultAddress; caf::PdmField> m_initialPermeabilityType; caf::PdmField m_initialPermeabilityFixed; caf::PdmField m_initialPermeabilityResultAddress; caf::PdmField m_permeabilityExponent; caf::PdmField m_waterDensityShearSlipIndicator; caf::PdmChildField m_contourMapCollection; caf::PdmChildField m_mudWeightWindowParameters; bool m_applyTimeFilter; };