mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1126 Updating inserting to map to use insert. Adding access functions for calculated data and constructor for class (not finished)
This commit is contained in:
@@ -33,6 +33,19 @@
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RigTofAccumulatedPhaseFractionsCalculator::RigTofAccumulatedPhaseFractionsCalculator(RimEclipseCase* caseToApply,
|
||||
QString wellname,
|
||||
size_t timestep)
|
||||
:m_case(caseToApply),
|
||||
m_wellName(wellname),
|
||||
m_timeStep(timestep)
|
||||
{
|
||||
computeTOFaccumulations();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -109,24 +122,17 @@ void RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFract
|
||||
|
||||
for (int i = 0; i < tofData->size(); i++)
|
||||
{
|
||||
auto it = tofAndIndexMap.find(tofData->at(i));
|
||||
if (it == tofAndIndexMap.end())
|
||||
std::vector<int> vectorOfIndexes;
|
||||
vectorOfIndexes.push_back(i);
|
||||
|
||||
auto iteratorBoolFromInsertToMap = tofAndIndexMap.insert(std::make_pair(tofData->at(i), vectorOfIndexes));
|
||||
if (!iteratorBoolFromInsertToMap.second)
|
||||
{
|
||||
//Key does not exist
|
||||
std::vector<int> vectorOfIndexes;
|
||||
vectorOfIndexes.push_back(i);
|
||||
tofAndIndexMap[tofData->at(i)] = vectorOfIndexes;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Key does exisit
|
||||
std::vector<int> vectorOfIndexes = it->second;
|
||||
vectorOfIndexes.push_back(i);
|
||||
tofAndIndexMap[tofData->at(i)] = vectorOfIndexes;
|
||||
//Element exist alread, was not inserted
|
||||
iteratorBoolFromInsertToMap.first->second.push_back(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
double fractionPorvSum = 0.0;
|
||||
double fractionPorvPhaseSumSwat = 0.0;
|
||||
double fractionPorvPhaseSumSoil = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user