diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/CMakeLists.txt b/ApplicationCode/GeoMech/GeoMechDataModel/CMakeLists.txt index 943026882a..12401cd752 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/CMakeLists.txt +++ b/ApplicationCode/GeoMech/GeoMechDataModel/CMakeLists.txt @@ -74,14 +74,12 @@ add_library( ${PROJECT_NAME} RigFemPartResultCalculatorEV.cpp RigFemPartResultCalculatorQ.h RigFemPartResultCalculatorQ.cpp - RigFemPartResultCalculatorSTM.h - RigFemPartResultCalculatorSTM.cpp + RigFemPartResultCalculatorSM.h + RigFemPartResultCalculatorSM.cpp RigFemPartResultCalculatorCompaction.h RigFemPartResultCalculatorCompaction.cpp RigFemPartResultCalculatorStressGradients.h RigFemPartResultCalculatorStressGradients.cpp - RigFemPartResultCalculatorSEM.h - RigFemPartResultCalculatorSEM.cpp RigFemPartResultCalculatorNE.h RigFemPartResultCalculatorNE.cpp RigFemPartResultCalculatorFormationIndices.h diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSEM.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSEM.cpp deleted file mode 100644 index e7d25fb75a..0000000000 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSEM.cpp +++ /dev/null @@ -1,105 +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 -// for more details. -// -///////////////////////////////////////////////////////////////////////////////// - -#include "RigFemPartResultCalculatorSEM.h" - -#include "RigFemPart.h" -#include "RigFemPartCollection.h" -#include "RigFemPartResultsCollection.h" -#include "RigFemResultAddress.h" -#include "RigFemScalarResultFrames.h" - -#include "cafProgressInfo.h" - -#include - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RigFemPartResultCalculatorSEM::RigFemPartResultCalculatorSEM( RigFemPartResultsCollection& collection ) - : RigFemPartResultCalculator( collection ) -{ -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RigFemPartResultCalculatorSEM::~RigFemPartResultCalculatorSEM() -{ -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -bool RigFemPartResultCalculatorSEM::isMatching( const RigFemResultAddress& resVarAddr ) const -{ - return ( resVarAddr.fieldName == "SE" && resVarAddr.componentName == "SEM" ); -} - -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -RigFemScalarResultFrames* RigFemPartResultCalculatorSEM::calculate( int partIndex, const RigFemResultAddress& resVarAddr ) -{ - CVF_ASSERT( resVarAddr.fieldName == "SE" && resVarAddr.componentName == "SEM" ); - - caf::ProgressInfo frameCountProgress( m_resultCollection->frameCount() * 4, "" ); - frameCountProgress.setProgressDescription( - "Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) ); - frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); - - RigFemScalarResultFrames* sa11 = - m_resultCollection->findOrLoadScalarResult( partIndex, - RigFemResultAddress( resVarAddr.resultPosType, "SE", "S11" ) ); - frameCountProgress.incrementProgress(); - frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); - RigFemScalarResultFrames* sa22 = - m_resultCollection->findOrLoadScalarResult( partIndex, - RigFemResultAddress( resVarAddr.resultPosType, "SE", "S22" ) ); - frameCountProgress.incrementProgress(); - frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); - RigFemScalarResultFrames* sa33 = - m_resultCollection->findOrLoadScalarResult( partIndex, - RigFemResultAddress( resVarAddr.resultPosType, "SE", "S33" ) ); - - RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr ); - - frameCountProgress.incrementProgress(); - - int frameCount = sa11->frameCount(); - for ( int fIdx = 0; fIdx < frameCount; ++fIdx ) - { - const std::vector& sa11Data = sa11->frameData( fIdx ); - const std::vector& sa22Data = sa22->frameData( fIdx ); - const std::vector& sa33Data = sa33->frameData( fIdx ); - - std::vector& dstFrameData = dstDataFrames->frameData( fIdx ); - size_t valCount = sa11Data.size(); - dstFrameData.resize( valCount ); - -#pragma omp parallel for - for ( long vIdx = 0; vIdx < static_cast( valCount ); ++vIdx ) - { - dstFrameData[vIdx] = ( sa11Data[vIdx] + sa22Data[vIdx] + sa33Data[vIdx] ) / 3.0f; - } - - frameCountProgress.incrementProgress(); - } - - return dstDataFrames; -} diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSTM.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSM.cpp similarity index 76% rename from ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSTM.cpp rename to ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSM.cpp index b0973a54ca..4e238aa9d5 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSTM.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSM.cpp @@ -16,7 +16,7 @@ // ///////////////////////////////////////////////////////////////////////////////// -#include "RigFemPartResultCalculatorSTM.h" +#include "RigFemPartResultCalculatorSM.h" #include "RigFemPart.h" #include "RigFemPartCollection.h" @@ -31,7 +31,7 @@ //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigFemPartResultCalculatorSTM::RigFemPartResultCalculatorSTM( RigFemPartResultsCollection& collection ) +RigFemPartResultCalculatorSM::RigFemPartResultCalculatorSM( RigFemPartResultsCollection& collection ) : RigFemPartResultCalculator( collection ) { } @@ -39,24 +39,24 @@ RigFemPartResultCalculatorSTM::RigFemPartResultCalculatorSTM( RigFemPartResultsC //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigFemPartResultCalculatorSTM::~RigFemPartResultCalculatorSTM() +RigFemPartResultCalculatorSM::~RigFemPartResultCalculatorSM() { } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RigFemPartResultCalculatorSTM::isMatching( const RigFemResultAddress& resVarAddr ) const +bool RigFemPartResultCalculatorSM::isMatching( const RigFemResultAddress& resVarAddr ) const { - return ( resVarAddr.fieldName == "ST" && resVarAddr.componentName == "STM" ); + return ( ( resVarAddr.fieldName == "ST" || resVarAddr.fieldName == "SE" ) && resVarAddr.componentName == "SM" ); } //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -RigFemScalarResultFrames* RigFemPartResultCalculatorSTM::calculate( int partIndex, const RigFemResultAddress& resVarAddr ) +RigFemScalarResultFrames* RigFemPartResultCalculatorSM::calculate( int partIndex, const RigFemResultAddress& resVarAddr ) { - CVF_ASSERT( resVarAddr.fieldName == "ST" && resVarAddr.componentName == "STM" ); + CVF_ASSERT( isMatching( resVarAddr ) ); caf::ProgressInfo frameCountProgress( m_resultCollection->frameCount() * 4, "" ); frameCountProgress.setProgressDescription( @@ -65,17 +65,23 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorSTM::calculate( int partInde RigFemScalarResultFrames* st11 = m_resultCollection->findOrLoadScalarResult( partIndex, - RigFemResultAddress( resVarAddr.resultPosType, "ST", "S11" ) ); + RigFemResultAddress( resVarAddr.resultPosType, + resVarAddr.fieldName, + "S11" ) ); frameCountProgress.incrementProgress(); frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); RigFemScalarResultFrames* st22 = m_resultCollection->findOrLoadScalarResult( partIndex, - RigFemResultAddress( resVarAddr.resultPosType, "ST", "S22" ) ); + RigFemResultAddress( resVarAddr.resultPosType, + resVarAddr.fieldName, + "S22" ) ); frameCountProgress.incrementProgress(); frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); RigFemScalarResultFrames* st33 = m_resultCollection->findOrLoadScalarResult( partIndex, - RigFemResultAddress( resVarAddr.resultPosType, "ST", "S33" ) ); + RigFemResultAddress( resVarAddr.resultPosType, + resVarAddr.fieldName, + "S33" ) ); RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr ); diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSEM.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSM.h similarity index 86% rename from ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSEM.h rename to ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSM.h index 4ef9255d7d..87e17073ab 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSEM.h +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSM.h @@ -27,11 +27,11 @@ class RigFemResultAddress; //================================================================================================== /// //================================================================================================== -class RigFemPartResultCalculatorSEM : public RigFemPartResultCalculator +class RigFemPartResultCalculatorSM : public RigFemPartResultCalculator { public: - explicit RigFemPartResultCalculatorSEM( RigFemPartResultsCollection& collection ); - virtual ~RigFemPartResultCalculatorSEM(); + explicit RigFemPartResultCalculatorSM( RigFemPartResultsCollection& collection ); + virtual ~RigFemPartResultCalculatorSM(); bool isMatching( const RigFemResultAddress& resVarAddr ) const override; RigFemScalarResultFrames* calculate( int partIndex, const RigFemResultAddress& resVarAddr ) override; }; diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSTM.h b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSTM.h deleted file mode 100644 index 9d1506685a..0000000000 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultCalculatorSTM.h +++ /dev/null @@ -1,37 +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 -// for more details. -// -///////////////////////////////////////////////////////////////////////////////// - -#pragma once - -#include "RigFemPartResultCalculator.h" - -class RigFemPartResultsCollection; -class RigFemScalarResultFrames; -class RigFemResultAddress; - -//================================================================================================== -/// -//================================================================================================== -class RigFemPartResultCalculatorSTM : public RigFemPartResultCalculator -{ -public: - explicit RigFemPartResultCalculatorSTM( RigFemPartResultsCollection& collection ); - virtual ~RigFemPartResultCalculatorSTM(); - bool isMatching( const RigFemResultAddress& resVarAddr ) const override; - RigFemScalarResultFrames* calculate( int partIndex, const RigFemResultAddress& resVarAddr ) override; -}; diff --git a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp index 6c4697858e..fb14b98782 100644 --- a/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp +++ b/ApplicationCode/GeoMech/GeoMechDataModel/RigFemPartResultsCollection.cpp @@ -48,9 +48,8 @@ #include "RigFemPartResultCalculatorPrincipalStrain.h" #include "RigFemPartResultCalculatorPrincipalStress.h" #include "RigFemPartResultCalculatorQ.h" -#include "RigFemPartResultCalculatorSEM.h" #include "RigFemPartResultCalculatorSFI.h" -#include "RigFemPartResultCalculatorSTM.h" +#include "RigFemPartResultCalculatorSM.h" #include "RigFemPartResultCalculatorShearSE.h" #include "RigFemPartResultCalculatorShearST.h" #include "RigFemPartResultCalculatorStressAnisotropy.h" @@ -139,10 +138,8 @@ RigFemPartResultsCollection::RigFemPartResultsCollection( RifGeoMechReaderInterf m_resultCalculators.push_back( std::unique_ptr( new RigFemPartResultCalculatorEV( *this ) ) ); m_resultCalculators.push_back( - std::unique_ptr( new RigFemPartResultCalculatorSEM( *this ) ) ); + std::unique_ptr( new RigFemPartResultCalculatorSM( *this ) ) ); m_resultCalculators.push_back( std::unique_ptr( new RigFemPartResultCalculatorQ( *this ) ) ); - m_resultCalculators.push_back( - std::unique_ptr( new RigFemPartResultCalculatorSTM( *this ) ) ); m_resultCalculators.push_back( std::unique_ptr( new RigFemPartResultCalculatorStressGradients( *this ) ) ); m_resultCalculators.push_back( @@ -335,6 +332,7 @@ void RigFemPartResultsCollection::setBiotCoefficientParameters( double biotFixed componentNames.push_back( "S2azi" ); componentNames.push_back( "S3inc" ); componentNames.push_back( "S3azi" ); + componentNames.push_back( "SM" ); for ( auto elementType : {RIG_ELEMENT_NODAL, RIG_INTEGRATION_POINT} ) { @@ -366,14 +364,12 @@ void RigFemPartResultsCollection::setBiotCoefficientParameters( double biotFixed // SE only: depends on SE.S1 and SE.S3 deleteResult( RigFemResultAddress( elementType, "SE", "SFI", RigFemResultAddress::allTimeLapsesValue() ) ); deleteResult( RigFemResultAddress( elementType, "SE", "DSM", RigFemResultAddress::allTimeLapsesValue() ) ); - deleteResult( RigFemResultAddress( elementType, "SE", "SEM", RigFemResultAddress::allTimeLapsesValue() ) ); // SE only: depends on SE.DSM deleteResult( RigFemResultAddress( elementType, "SE", "FOS", RigFemResultAddress::allTimeLapsesValue() ) ); // ST only: depends on ST.S1 and ST.S3 deleteResult( RigFemResultAddress( elementType, "ST", "Q", RigFemResultAddress::allTimeLapsesValue() ) ); - deleteResult( RigFemResultAddress( elementType, "ST", "STM", RigFemResultAddress::allTimeLapsesValue() ) ); } for ( auto fieldName : {"SE", "ST"} ) @@ -552,7 +548,7 @@ std::map> { fieldCompNames = m_readerInterface->scalarElementNodeFieldAndComponentNames(); - fieldCompNames["SE"].push_back( "SEM" ); + fieldCompNames["SE"].push_back( "SM" ); fieldCompNames["SE"].push_back( "SFI" ); fieldCompNames["SE"].push_back( "DSM" ); fieldCompNames["SE"].push_back( "FOS" ); @@ -574,7 +570,7 @@ std::map> fieldCompNames["SE"].push_back( "S3inc" ); fieldCompNames["SE"].push_back( "S3azi" ); - fieldCompNames["ST"].push_back( "STM" ); + fieldCompNames["ST"].push_back( "SM" ); fieldCompNames["ST"].push_back( "Q" ); for ( auto& s : stressComponentNames ) @@ -621,7 +617,7 @@ std::map> { fieldCompNames = m_readerInterface->scalarIntegrationPointFieldAndComponentNames(); - fieldCompNames["SE"].push_back( "SEM" ); + fieldCompNames["SE"].push_back( "SM" ); fieldCompNames["SE"].push_back( "SFI" ); fieldCompNames["SE"].push_back( "DSM" ); fieldCompNames["SE"].push_back( "FOS" ); @@ -648,7 +644,7 @@ std::map> fieldCompNames["SE"].push_back( "S3inc" ); fieldCompNames["SE"].push_back( "S3azi" ); - fieldCompNames["ST"].push_back( "STM" ); + fieldCompNames["ST"].push_back( "SM" ); fieldCompNames["ST"].push_back( "Q" ); fieldCompNames["ST"].push_back( "S11" ); @@ -1160,7 +1156,7 @@ std::vector std::set RigFemPartResultsCollection::normalizedResults() { std::set validFields = {"SE", "ST"}; - std::set validComponents = {"S11", "S22", "S33", "S12", "S13", "S23", "S1", "S2", "S3"}; + std::set validComponents = {"S11", "S22", "S33", "S12", "S13", "S23", "S1", "S2", "S3", "SM"}; std::set results; for ( auto field : validFields ) @@ -1171,10 +1167,6 @@ std::set RigFemPartResultsCollection::normalizedResults() RigFemResultAddress( RIG_ELEMENT_NODAL, field, component, RigFemResultAddress::allTimeLapsesValue(), -1, true ) ); } } - results.insert( - RigFemResultAddress( RIG_ELEMENT_NODAL, "SE", "SEM", RigFemResultAddress::allTimeLapsesValue(), -1, true ) ); - results.insert( - RigFemResultAddress( RIG_ELEMENT_NODAL, "ST", "STM", RigFemResultAddress::allTimeLapsesValue(), -1, true ) ); results.insert( RigFemResultAddress( RIG_ELEMENT_NODAL, "ST", "Q", RigFemResultAddress::allTimeLapsesValue(), -1, true ) );