#6032 Merge SE.SEM and ST.STM calculation and rename to S*.SM

This commit is contained in:
Kristian Bendiksen
2020-06-05 11:09:56 +02:00
parent 8ddec683b0
commit 46059e7a40
6 changed files with 29 additions and 175 deletions

View File

@@ -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

View File

@@ -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 <http://www.gnu.org/licenses/gpl.html>
// 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 <QString>
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
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<float>& sa11Data = sa11->frameData( fIdx );
const std::vector<float>& sa22Data = sa22->frameData( fIdx );
const std::vector<float>& sa33Data = sa33->frameData( fIdx );
std::vector<float>& dstFrameData = dstDataFrames->frameData( fIdx );
size_t valCount = sa11Data.size();
dstFrameData.resize( valCount );
#pragma omp parallel for
for ( long vIdx = 0; vIdx < static_cast<long>( valCount ); ++vIdx )
{
dstFrameData[vIdx] = ( sa11Data[vIdx] + sa22Data[vIdx] + sa33Data[vIdx] ) / 3.0f;
}
frameCountProgress.incrementProgress();
}
return dstDataFrames;
}

View File

@@ -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 );

View File

@@ -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;
};

View File

@@ -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 <http://www.gnu.org/licenses/gpl.html>
// 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;
};

View File

@@ -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<RigFemPartResultCalculator>( new RigFemPartResultCalculatorEV( *this ) ) );
m_resultCalculators.push_back(
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSEM( *this ) ) );
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSM( *this ) ) );
m_resultCalculators.push_back( std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorQ( *this ) ) );
m_resultCalculators.push_back(
std::unique_ptr<RigFemPartResultCalculator>( new RigFemPartResultCalculatorSTM( *this ) ) );
m_resultCalculators.push_back(
std::unique_ptr<RigFemPartResultCalculator>( 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<std::string, std::vector<std::string>>
{
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<std::string, std::vector<std::string>>
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<std::string, std::vector<std::string>>
{
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<std::string, std::vector<std::string>>
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<RigFemResultAddress>
std::set<RigFemResultAddress> RigFemPartResultsCollection::normalizedResults()
{
std::set<std::string> validFields = {"SE", "ST"};
std::set<std::string> validComponents = {"S11", "S22", "S33", "S12", "S13", "S23", "S1", "S2", "S3"};
std::set<std::string> validComponents = {"S11", "S22", "S33", "S12", "S13", "S23", "S1", "S2", "S3", "SM"};
std::set<RigFemResultAddress> results;
for ( auto field : validFields )
@@ -1171,10 +1167,6 @@ std::set<RigFemResultAddress> 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 ) );