#6305 GeoMech derived result: fix normalization when combined with time lapse.

The results for the different time steps are now normalized before the
difference is computed.
This commit is contained in:
Kristian Bendiksen 2020-08-18 14:37:14 +02:00 committed by Magne Sjaastad
parent 59679f54ad
commit 26c863e310

View File

@ -68,14 +68,27 @@ RigFemScalarResultFrames* RigFemPartResultCalculatorTimeLapse::calculate( int
"Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) ); "Calculating " + QString::fromStdString( resVarAddr.fieldName + ": " + resVarAddr.componentName ) );
frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() ); frameCountProgress.setNextProgressIncrement( m_resultCollection->frameCount() );
RigFemResultAddress resVarNative( resVarAddr.resultPosType, RigFemResultAddress resVarNative( resVarAddr.resultPosType,
resVarAddr.fieldName, resVarAddr.fieldName,
resVarAddr.componentName, resVarAddr.componentName,
RigFemResultAddress::noTimeLapseValue(), RigFemResultAddress::noTimeLapseValue(),
resVarAddr.refKLayerIndex ); resVarAddr.refKLayerIndex );
RigFemScalarResultFrames* srcDataFrames = m_resultCollection->findOrLoadScalarResult( partIndex, resVarNative ); resVarNative.normalizedByHydrostaticPressure = resVarAddr.normalizedByHydrostaticPressure;
RigFemScalarResultFrames* srcDataFrames = nullptr;
RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr ); RigFemScalarResultFrames* dstDataFrames = m_resultCollection->createScalarResult( partIndex, resVarAddr );
// Normalizable result: needs to be normalized before the diff is calculated
if ( resVarAddr.normalizeByHydrostaticPressure() && RigFemPartResultsCollection::isNormalizableResult( resVarAddr ) )
{
RigFemPartResultCalculatorNormalized normalizedCalculator( *m_resultCollection );
srcDataFrames = normalizedCalculator.calculate( partIndex, resVarNative );
}
else
{
srcDataFrames = m_resultCollection->findOrLoadScalarResult( partIndex, resVarNative );
}
frameCountProgress.incrementProgress(); frameCountProgress.incrementProgress();
int frameCount = srcDataFrames->frameCount(); int frameCount = srcDataFrames->frameCount();