Fixed indentation issues

Renamed and added asserts
p4#: 20846
This commit is contained in:
Magne Sjaastad 2013-03-11 14:04:48 +01:00
parent 086262a4b6
commit 61e8115141

View File

@ -25,21 +25,23 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RigStatistics::addNamedResult(RigReservoirCellResults* cellResults, RimDefines::ResultCatType resultType, const QString& resultName, size_t activeCellCount)
void RigStatistics::addNamedResult(RigReservoirCellResults* destinationCellResults, RimDefines::ResultCatType resultType, const QString& resultName, size_t activeUnionCellCount)
{
// Use time step dates from first result in first source case
CVF_ASSERT(m_sourceCases.size() > 0);
QList<QDateTime> timeStepDates = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates(0);
size_t resultIndexMin = cellResults->addEmptyScalarResult(resultType, resultName);
cellResults->setTimeStepDates(resultIndexMin, timeStepDates);
QList<QDateTime> sourceTimeStepDates = m_sourceCases[0]->results(RifReaderInterface::MATRIX_RESULTS)->timeStepDates(0);
size_t destinationScalarResultIndex = destinationCellResults->addEmptyScalarResult(resultType, resultName);
CVF_ASSERT(destinationScalarResultIndex != cvf::UNDEFINED_SIZE_T);
std::vector< std::vector<double> >& dataValues = cellResults->cellScalarResults(resultIndexMin);
dataValues.resize(timeStepDates.size());
destinationCellResults->setTimeStepDates(destinationScalarResultIndex, sourceTimeStepDates);
std::vector< std::vector<double> >& dataValues = destinationCellResults->cellScalarResults(destinationScalarResultIndex);
dataValues.resize(sourceTimeStepDates.size());
for (int i = 0; i < timeStepDates.size(); i++)
// Initializes the size of the destination dataset to active union cell count
for (int i = 0; i < sourceTimeStepDates.size(); i++)
{
dataValues[i].resize(activeCellCount, HUGE_VAL);
dataValues[i].resize(activeUnionCellCount, HUGE_VAL);
}
}