From c72e646e2fcd651044c8e8c8a60e12ba6466dc8a Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Fri, 6 Dec 2024 15:55:32 +0100 Subject: [PATCH] Improve variable names. --- .../Well/RigWellTargetCandidatesGenerator.cpp | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.cpp b/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.cpp index a62a12bb6d..21ffbef78a 100644 --- a/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.cpp +++ b/ApplicationLibCode/ReservoirDataModel/Well/RigWellTargetCandidatesGenerator.cpp @@ -704,12 +704,12 @@ void RigWellTargetCandidatesGenerator::generateEnsembleCandidates( RimEclipseCas std::vector occupancy( targetNumActiveCells, 0 ); - std::map>> porvSoilSamples; - porvSoilSamples["TOTAL_PORV_SOIL"] = {}; - porvSoilSamples["TOTAL_PORV_SGAS"] = {}; - porvSoilSamples["TOTAL_PORV_SOIL_SGAS"] = {}; - porvSoilSamples["TOTAL_FIPOIL"] = {}; - porvSoilSamples["TOTAL_FIPGAS"] = {}; + std::map>> resultNamesAndSamples; + resultNamesAndSamples["TOTAL_PORV_SOIL"] = {}; + resultNamesAndSamples["TOTAL_PORV_SGAS"] = {}; + resultNamesAndSamples["TOTAL_PORV_SOIL_SGAS"] = {}; + resultNamesAndSamples["TOTAL_FIPOIL"] = {}; + resultNamesAndSamples["TOTAL_FIPGAS"] = {}; for ( auto eclipseCase : ensemble.cases() ) { @@ -723,20 +723,20 @@ void RigWellTargetCandidatesGenerator::generateEnsembleCandidates( RimEclipseCas resultsData->ensureKnownResultLoaded( clustersNumAddress ); const std::vector& clusterNum = resultsData->cellScalarResults( clustersNumAddress, 0 ); - std::map*> porvSoil; + std::map*> namedInputVector; - for ( auto [resultName, vec] : porvSoilSamples ) + for ( auto [resultName, vec] : resultNamesAndSamples ) { - RigEclipseResultAddress clusterPorvSoilAddress( RiaDefines::ResultCatType::GENERATED, resultName ); - resultsData->ensureKnownResultLoaded( clusterPorvSoilAddress ); - const std::vector& resultVector = resultsData->cellScalarResults( clusterPorvSoilAddress, 0 ); - porvSoil[resultName] = &resultVector; + RigEclipseResultAddress resultAddress( RiaDefines::ResultCatType::GENERATED, resultName ); + resultsData->ensureKnownResultLoaded( resultAddress ); + const std::vector& resultVector = resultsData->cellScalarResults( resultAddress, 0 ); + namedInputVector[resultName] = &resultVector; } - std::map> totalPorvSoil; - for ( auto [resultName, vec] : porvSoilSamples ) + std::map> namedOutputVector; + for ( auto [resultName, vec] : resultNamesAndSamples ) { - totalPorvSoil[resultName] = std::vector( targetNumActiveCells, std::numeric_limits::infinity() ); + namedOutputVector[resultName] = std::vector( targetNumActiveCells, std::numeric_limits::infinity() ); } for ( size_t targetCellIdx = 0; targetCellIdx < targetNumReservoirCells; targetCellIdx++ ) @@ -753,23 +753,23 @@ void RigWellTargetCandidatesGenerator::generateEnsembleCandidates( RimEclipseCas if ( !std::isinf( clusterNum[resultIndex] ) && clusterNum[resultIndex] > 0 ) { occupancy[targetResultIndex]++; - for ( auto [resultName, vec] : porvSoilSamples ) + for ( auto [resultName, vec] : resultNamesAndSamples ) { - totalPorvSoil[resultName][targetResultIndex] = porvSoil[resultName]->at( resultIndex ); + namedOutputVector[resultName][targetResultIndex] = namedInputVector[resultName]->at( resultIndex ); } } } } - for ( auto [resultName, vec] : porvSoilSamples ) + for ( auto [resultName, vec] : resultNamesAndSamples ) { - porvSoilSamples[resultName].push_back( totalPorvSoil[resultName] ); + resultNamesAndSamples[resultName].push_back( namedOutputVector[resultName] ); } } createResultVector( targetCase, "OCCUPANCY", occupancy ); - for ( auto [resultName, vec] : porvSoilSamples ) + for ( auto [resultName, vec] : resultNamesAndSamples ) { int nCells = static_cast( targetNumActiveCells ); std::vector p10Results( nCells, std::numeric_limits::infinity() );