mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Move a method
This commit is contained in:
parent
a08dbc91ba
commit
0664592ec8
@ -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];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
///
|
///
|
||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user