Move a method

This commit is contained in:
Jacob Støren 2017-05-05 11:50:08 +02:00
parent a08dbc91ba
commit 0664592ec8

View File

@ -258,6 +258,35 @@ std::vector<double>* RigFlowDiagResults::calculateAverageTOFResult(const RigFlow
} }
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigFlowDiagResults::calculateSumOfFractionAndFractionMultTOF(size_t activeCellCount,
const std::vector<const std::vector<double> *> & fractions,
const std::vector<const std::vector<double> *> & TOFs,
std::vector<double> *sumOfFractions,
std::vector<double> *fractionMultTOF)
{
sumOfFractions->resize(activeCellCount, 0.0);
fractionMultTOF->resize(activeCellCount, 0.0);
for ( size_t iIdx = 0; iIdx < fractions.size() ; ++iIdx )
{
const std::vector<double> * frInj = fractions[iIdx];
const std::vector<double> * 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<const std::vector<double> *> & fractions,
const std::vector<const std::vector<double> *> & TOFs,
std::vector<double> *sumOfFractions,
std::vector<double> *fractionMultTOF)
{
sumOfFractions->resize(activeCellCount, 0.0);
fractionMultTOF->resize(activeCellCount, 0.0);
for ( size_t iIdx = 0; iIdx < fractions.size() ; ++iIdx )
{
const std::vector<double> * frInj = fractions[iIdx];
const std::vector<double> * 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];
}
}
}
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------