From 70c3b4df7108ee9216a0471ab43b1b73cbf18a72 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Mon, 11 Mar 2019 11:45:35 +0100 Subject: [PATCH] Whitespace --- .../RifEnsembleStatisticsReader.cpp | 51 ++++++++++--------- 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/ApplicationCode/FileInterface/RifEnsembleStatisticsReader.cpp b/ApplicationCode/FileInterface/RifEnsembleStatisticsReader.cpp index 8e57ac02bd..2a766988c2 100644 --- a/ApplicationCode/FileInterface/RifEnsembleStatisticsReader.cpp +++ b/ApplicationCode/FileInterface/RifEnsembleStatisticsReader.cpp @@ -1,17 +1,17 @@ ///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2017- Statoil ASA -// +// // ResInsight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. -// +// // ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY // WARRANTY; without even the implied warranty of MERCHANTABILITY or // FITNESS FOR A PARTICULAR PURPOSE. -// -// See the GNU General Public License at +// +// See the GNU General Public License at // for more details. // ///////////////////////////////////////////////////////////////////////////////// @@ -20,11 +20,10 @@ #include "RimEnsembleStatisticsCase.h" - static const std::vector EMPTY_TIME_STEPS_VECTOR; //-------------------------------------------------------------------------------------------------- -/// +/// //-------------------------------------------------------------------------------------------------- RifEnsembleStatisticsReader::RifEnsembleStatisticsReader(RimEnsembleStatisticsCase* ensStatCase) { @@ -33,16 +32,14 @@ RifEnsembleStatisticsReader::RifEnsembleStatisticsReader(RimEnsembleStatisticsCa m_ensembleStatCase = ensStatCase; m_allResultAddresses = std::set( - { - 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& RifEnsembleStatisticsReader::timeSteps(const RifEclipseSummaryAddress& resultAddress) const { @@ -51,30 +48,35 @@ const std::vector& RifEnsembleStatisticsReader::timeSteps(const RifEclip } //-------------------------------------------------------------------------------------------------- -/// +/// //-------------------------------------------------------------------------------------------------- bool RifEnsembleStatisticsReader::values(const RifEclipseSummaryAddress& resultAddress, std::vector* values) const { if (!validateAddress(resultAddress)) return false; - const std::vector* sourceData = nullptr; - auto quantityName = resultAddress.ensembleStatisticsQuantityName(); + const std::vector* sourceData = nullptr; + auto quantityName = resultAddress.ensembleStatisticsQuantityName(); - if (quantityName == ENSEMBLE_STAT_P10_QUANTITY_NAME) sourceData = &m_ensembleStatCase->p10(); - else if (quantityName == ENSEMBLE_STAT_P50_QUANTITY_NAME) sourceData = &m_ensembleStatCase->p50(); - else if (quantityName == ENSEMBLE_STAT_P90_QUANTITY_NAME) sourceData = &m_ensembleStatCase->p90(); - else if (quantityName == ENSEMBLE_STAT_MEAN_QUANTITY_NAME) sourceData = &m_ensembleStatCase->mean(); + if (quantityName == ENSEMBLE_STAT_P10_QUANTITY_NAME) + sourceData = &m_ensembleStatCase->p10(); + else if (quantityName == ENSEMBLE_STAT_P50_QUANTITY_NAME) + sourceData = &m_ensembleStatCase->p50(); + else if (quantityName == ENSEMBLE_STAT_P90_QUANTITY_NAME) + sourceData = &m_ensembleStatCase->p90(); + else if (quantityName == ENSEMBLE_STAT_MEAN_QUANTITY_NAME) + sourceData = &m_ensembleStatCase->mean(); if (!sourceData) return false; values->clear(); values->reserve(sourceData->size()); - for (auto val : *sourceData) values->push_back(val); + for (auto val : *sourceData) + values->push_back(val); return true; } //-------------------------------------------------------------------------------------------------- -/// +/// //-------------------------------------------------------------------------------------------------- std::string RifEnsembleStatisticsReader::unitName(const RifEclipseSummaryAddress& resultAddress) const { @@ -82,10 +84,9 @@ std::string RifEnsembleStatisticsReader::unitName(const RifEclipseSummaryAddress } //-------------------------------------------------------------------------------------------------- -/// +/// //-------------------------------------------------------------------------------------------------- bool RifEnsembleStatisticsReader::validateAddress(const RifEclipseSummaryAddress& address) const { - return address.category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS && - !address.quantityName().empty(); + return address.category() == RifEclipseSummaryAddress::SUMMARY_ENSEMBLE_STATISTICS && !address.quantityName().empty(); }