mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4683 clang-format on all files in ApplicationCode
This commit is contained in:
@@ -25,60 +25,60 @@ static const std::vector<time_t> EMPTY_TIME_STEPS_VECTOR;
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RifEnsembleStatisticsReader::RifEnsembleStatisticsReader(RimEnsembleStatisticsCase* ensStatCase)
|
||||
RifEnsembleStatisticsReader::RifEnsembleStatisticsReader( RimEnsembleStatisticsCase* ensStatCase )
|
||||
{
|
||||
CVF_ASSERT(ensStatCase);
|
||||
CVF_ASSERT( ensStatCase );
|
||||
|
||||
m_ensembleStatCase = ensStatCase;
|
||||
|
||||
m_allResultAddresses = std::set<RifEclipseSummaryAddress>(
|
||||
{RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_P10_QUANTITY_NAME, ""),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_P50_QUANTITY_NAME, ""),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_P90_QUANTITY_NAME, ""),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress(ENSEMBLE_STAT_MEAN_QUANTITY_NAME, "")});
|
||||
{RifEclipseSummaryAddress::ensembleStatisticsAddress( ENSEMBLE_STAT_P10_QUANTITY_NAME, "" ),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress( ENSEMBLE_STAT_P50_QUANTITY_NAME, "" ),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress( ENSEMBLE_STAT_P90_QUANTITY_NAME, "" ),
|
||||
RifEclipseSummaryAddress::ensembleStatisticsAddress( ENSEMBLE_STAT_MEAN_QUANTITY_NAME, "" )} );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
const std::vector<time_t>& RifEnsembleStatisticsReader::timeSteps(const RifEclipseSummaryAddress& resultAddress) const
|
||||
const std::vector<time_t>& RifEnsembleStatisticsReader::timeSteps( const RifEclipseSummaryAddress& resultAddress ) const
|
||||
{
|
||||
if (!validateAddress(resultAddress)) return EMPTY_TIME_STEPS_VECTOR;
|
||||
if ( !validateAddress( resultAddress ) ) return EMPTY_TIME_STEPS_VECTOR;
|
||||
return m_ensembleStatCase->timeSteps();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifEnsembleStatisticsReader::values(const RifEclipseSummaryAddress& resultAddress, std::vector<double>* values) const
|
||||
bool RifEnsembleStatisticsReader::values( const RifEclipseSummaryAddress& resultAddress, std::vector<double>* values ) const
|
||||
{
|
||||
if (!validateAddress(resultAddress)) return false;
|
||||
if ( !validateAddress( resultAddress ) ) return false;
|
||||
|
||||
const std::vector<double>* sourceData = nullptr;
|
||||
auto quantityName = resultAddress.ensembleStatisticsQuantityName();
|
||||
|
||||
if (quantityName == ENSEMBLE_STAT_P10_QUANTITY_NAME)
|
||||
if ( quantityName == ENSEMBLE_STAT_P10_QUANTITY_NAME )
|
||||
sourceData = &m_ensembleStatCase->p10();
|
||||
else if (quantityName == ENSEMBLE_STAT_P50_QUANTITY_NAME)
|
||||
else if ( quantityName == ENSEMBLE_STAT_P50_QUANTITY_NAME )
|
||||
sourceData = &m_ensembleStatCase->p50();
|
||||
else if (quantityName == ENSEMBLE_STAT_P90_QUANTITY_NAME)
|
||||
else if ( quantityName == ENSEMBLE_STAT_P90_QUANTITY_NAME )
|
||||
sourceData = &m_ensembleStatCase->p90();
|
||||
else if (quantityName == ENSEMBLE_STAT_MEAN_QUANTITY_NAME)
|
||||
else if ( quantityName == ENSEMBLE_STAT_MEAN_QUANTITY_NAME )
|
||||
sourceData = &m_ensembleStatCase->mean();
|
||||
|
||||
if (!sourceData) return false;
|
||||
if ( !sourceData ) return false;
|
||||
|
||||
values->clear();
|
||||
values->reserve(sourceData->size());
|
||||
for (auto val : *sourceData)
|
||||
values->push_back(val);
|
||||
values->reserve( sourceData->size() );
|
||||
for ( auto val : *sourceData )
|
||||
values->push_back( val );
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::string RifEnsembleStatisticsReader::unitName(const RifEclipseSummaryAddress& resultAddress) const
|
||||
std::string RifEnsembleStatisticsReader::unitName( const RifEclipseSummaryAddress& resultAddress ) const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
@@ -94,7 +94,7 @@ RiaEclipseUnitTools::UnitSystem RifEnsembleStatisticsReader::unitSystem() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifEnsembleStatisticsReader::validateAddress(const RifEclipseSummaryAddress& address) const
|
||||
bool RifEnsembleStatisticsReader::validateAddress( const RifEclipseSummaryAddress& address ) const
|
||||
{
|
||||
return address.category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS && !address.quantityName().empty();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user