mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5800 Delta summary : Fix computations for fixed time step
Use the original dataset, not the resampled dataset when finding the constant value to use.
This commit is contained in:
parent
c9def2063d
commit
4102ba1454
@ -248,13 +248,13 @@ std::pair<std::vector<time_t>, std::vector<double>>
|
|||||||
std::vector<double> calculatedValues;
|
std::vector<double> calculatedValues;
|
||||||
calculatedValues.reserve( sampleCount );
|
calculatedValues.reserve( sampleCount );
|
||||||
|
|
||||||
int clampedIndexCase1 = std::min( fixedTimeStepCase1, static_cast<int>( allValues1.size() ) );
|
int clampedIndexCase1 = std::min( fixedTimeStepCase1, static_cast<int>( values1.size() ) );
|
||||||
int clampedIndexCase2 = std::min( fixedTimeStepCase2, static_cast<int>( allValues2.size() ) );
|
int clampedIndexCase2 = std::min( fixedTimeStepCase2, static_cast<int>( values2.size() ) );
|
||||||
|
|
||||||
for ( size_t i = 0; i < sampleCount; i++ )
|
for ( size_t i = 0; i < sampleCount; i++ )
|
||||||
{
|
{
|
||||||
double valueCase1 = clampedIndexCase1 >= 0 ? allValues1[clampedIndexCase1] : allValues1[i];
|
double valueCase1 = clampedIndexCase1 >= 0 ? values1[clampedIndexCase1] : allValues1[i];
|
||||||
double valueCase2 = clampedIndexCase2 >= 0 ? allValues2[clampedIndexCase2] : allValues2[i];
|
double valueCase2 = clampedIndexCase2 >= 0 ? values2[clampedIndexCase2] : allValues2[i];
|
||||||
if ( m_operator == DerivedSummaryOperator::DERIVED_OPERATOR_SUB )
|
if ( m_operator == DerivedSummaryOperator::DERIVED_OPERATOR_SUB )
|
||||||
{
|
{
|
||||||
calculatedValues.push_back( valueCase1 - valueCase2 );
|
calculatedValues.push_back( valueCase1 - valueCase2 );
|
||||||
|
Loading…
Reference in New Issue
Block a user