diff --git a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp index ce61f758ea..1261d74b61 100644 --- a/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp +++ b/ApplicationCode/ReservoirDataModel/RigFlowDiagResults.cpp @@ -258,6 +258,35 @@ std::vector* RigFlowDiagResults::calculateAverageTOFResult(const RigFlow } +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RigFlowDiagResults::calculateSumOfFractionAndFractionMultTOF(size_t activeCellCount, + const std::vector *> & fractions, + const std::vector *> & TOFs, + std::vector *sumOfFractions, + std::vector *fractionMultTOF) +{ + sumOfFractions->resize(activeCellCount, 0.0); + fractionMultTOF->resize(activeCellCount, 0.0); + + for ( size_t iIdx = 0; iIdx < fractions.size() ; ++iIdx ) + { + const std::vector * frInj = fractions[iIdx]; + const std::vector * tofInj = TOFs[iIdx]; + + if ( ! (frInj && tofInj) ) continue; + + for ( size_t acIdx = 0 ; acIdx < activeCellCount; ++acIdx ) + { + if ( (*frInj)[acIdx] == HUGE_VAL ) continue; + + (*sumOfFractions)[acIdx] += (*frInj)[acIdx]; + (*fractionMultTOF)[acIdx] += (*frInj)[acIdx] * (*tofInj)[acIdx]; + } + } +} + //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- @@ -434,35 +463,6 @@ RigFlowDiagResults::findNamedResultsForSelectedTracers(const RigFlowDiagResultAd } -//-------------------------------------------------------------------------------------------------- -/// -//-------------------------------------------------------------------------------------------------- -void RigFlowDiagResults::calculateSumOfFractionAndFractionMultTOF(size_t activeCellCount, - const std::vector *> & fractions, - const std::vector *> & TOFs, - std::vector *sumOfFractions, - std::vector *fractionMultTOF) -{ - sumOfFractions->resize(activeCellCount, 0.0); - fractionMultTOF->resize(activeCellCount, 0.0); - - for ( size_t iIdx = 0; iIdx < fractions.size() ; ++iIdx ) - { - const std::vector * frInj = fractions[iIdx]; - const std::vector * tofInj = TOFs[iIdx]; - - if ( ! (frInj && tofInj) ) continue; - - for ( size_t acIdx = 0 ; acIdx < activeCellCount; ++acIdx ) - { - if ( (*frInj)[acIdx] == HUGE_VAL ) continue; - - (*sumOfFractions)[acIdx] += (*frInj)[acIdx]; - (*fractionMultTOF)[acIdx] += (*frInj)[acIdx] * (*tofInj)[acIdx]; - } - } -} - //-------------------------------------------------------------------------------------------------- /// //--------------------------------------------------------------------------------------------------