Improve variable names.

This commit is contained in:
Kristian Bendiksen 2024-12-06 15:55:32 +01:00
parent 6fd424ae85
commit c72e646e2f

View File

@ -704,12 +704,12 @@ void RigWellTargetCandidatesGenerator::generateEnsembleCandidates( RimEclipseCas
std::vector<int> occupancy( targetNumActiveCells, 0 ); std::vector<int> occupancy( targetNumActiveCells, 0 );
std::map<QString, std::vector<std::vector<double>>> porvSoilSamples; std::map<QString, std::vector<std::vector<double>>> resultNamesAndSamples;
porvSoilSamples["TOTAL_PORV_SOIL"] = {}; resultNamesAndSamples["TOTAL_PORV_SOIL"] = {};
porvSoilSamples["TOTAL_PORV_SGAS"] = {}; resultNamesAndSamples["TOTAL_PORV_SGAS"] = {};
porvSoilSamples["TOTAL_PORV_SOIL_SGAS"] = {}; resultNamesAndSamples["TOTAL_PORV_SOIL_SGAS"] = {};
porvSoilSamples["TOTAL_FIPOIL"] = {}; resultNamesAndSamples["TOTAL_FIPOIL"] = {};
porvSoilSamples["TOTAL_FIPGAS"] = {}; resultNamesAndSamples["TOTAL_FIPGAS"] = {};
for ( auto eclipseCase : ensemble.cases() ) for ( auto eclipseCase : ensemble.cases() )
{ {
@ -723,20 +723,20 @@ void RigWellTargetCandidatesGenerator::generateEnsembleCandidates( RimEclipseCas
resultsData->ensureKnownResultLoaded( clustersNumAddress ); resultsData->ensureKnownResultLoaded( clustersNumAddress );
const std::vector<double>& clusterNum = resultsData->cellScalarResults( clustersNumAddress, 0 ); const std::vector<double>& clusterNum = resultsData->cellScalarResults( clustersNumAddress, 0 );
std::map<QString, const std::vector<double>*> porvSoil; std::map<QString, const std::vector<double>*> namedInputVector;
for ( auto [resultName, vec] : porvSoilSamples ) for ( auto [resultName, vec] : resultNamesAndSamples )
{ {
RigEclipseResultAddress clusterPorvSoilAddress( RiaDefines::ResultCatType::GENERATED, resultName ); RigEclipseResultAddress resultAddress( RiaDefines::ResultCatType::GENERATED, resultName );
resultsData->ensureKnownResultLoaded( clusterPorvSoilAddress ); resultsData->ensureKnownResultLoaded( resultAddress );
const std::vector<double>& resultVector = resultsData->cellScalarResults( clusterPorvSoilAddress, 0 ); const std::vector<double>& resultVector = resultsData->cellScalarResults( resultAddress, 0 );
porvSoil[resultName] = &resultVector; namedInputVector[resultName] = &resultVector;
} }
std::map<QString, std::vector<double>> totalPorvSoil; std::map<QString, std::vector<double>> namedOutputVector;
for ( auto [resultName, vec] : porvSoilSamples ) for ( auto [resultName, vec] : resultNamesAndSamples )
{ {
totalPorvSoil[resultName] = std::vector( targetNumActiveCells, std::numeric_limits<double>::infinity() ); namedOutputVector[resultName] = std::vector( targetNumActiveCells, std::numeric_limits<double>::infinity() );
} }
for ( size_t targetCellIdx = 0; targetCellIdx < targetNumReservoirCells; targetCellIdx++ ) for ( size_t targetCellIdx = 0; targetCellIdx < targetNumReservoirCells; targetCellIdx++ )
@ -753,23 +753,23 @@ void RigWellTargetCandidatesGenerator::generateEnsembleCandidates( RimEclipseCas
if ( !std::isinf( clusterNum[resultIndex] ) && clusterNum[resultIndex] > 0 ) if ( !std::isinf( clusterNum[resultIndex] ) && clusterNum[resultIndex] > 0 )
{ {
occupancy[targetResultIndex]++; 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 ); createResultVector( targetCase, "OCCUPANCY", occupancy );
for ( auto [resultName, vec] : porvSoilSamples ) for ( auto [resultName, vec] : resultNamesAndSamples )
{ {
int nCells = static_cast<int>( targetNumActiveCells ); int nCells = static_cast<int>( targetNumActiveCells );
std::vector<double> p10Results( nCells, std::numeric_limits<double>::infinity() ); std::vector<double> p10Results( nCells, std::numeric_limits<double>::infinity() );