///////////////////////////////////////////////////////////////////////////////// // // 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 // for more details. // ///////////////////////////////////////////////////////////////////////////////// #pragma once #include #include class RimEclipseResultCase; class QString; //================================================================================================== /// //================================================================================================== class RigTofAccumulatedPhaseFractionsCalculator { public: explicit RigTofAccumulatedPhaseFractionsCalculator(RimEclipseResultCase* caseToApply, QString wellname, size_t timestep); const std::vector& sortedUniqueTOFValues() const { return m_tofInIncreasingOrder; } const std::vector& accumulatedPhaseFractionsSwat() const { return m_accumulatedPhaseFractionSwat; } const std::vector& accumulatedPhaseFractionsSoil() const { return m_accumulatedPhaseFractionSoil; } const std::vector& accumulatedPhaseFractionsSgas() const { return m_accumulatedPhaseFractionSgas; } private: friend class RigTofAccumulatedPhaseFractionsCalculatorTester; static void sortTofAndCalculateAccPhaseFraction(const std::vector* tofData, const std::vector* fractionData, const std::vector* porvResults, const std::vector* swatResults, const std::vector* soilResults, const std::vector* sgasResults, std::vector& tofInIncreasingOrder, std::vector& accumulatedPhaseFractionSwat, std::vector& accumulatedPhaseFractionSoil, std::vector& accumulatedPhaseFractionSgas); private: std::vector m_tofInIncreasingOrder; std::vector m_accumulatedPhaseFractionSwat; std::vector m_accumulatedPhaseFractionSgas; std::vector m_accumulatedPhaseFractionSoil; }; class RigTofAccumulatedPhaseFractionsCalculatorTester { public: static void testSortTofAndCalculateAccPhaseFraction(const std::vector* tofData, const std::vector* fractionData, const std::vector* porvResults, const std::vector* swatResults, const std::vector* soilResults, const std::vector* sgasResults, std::vector& tofInIncreasingOrder, std::vector& accumulatedPhaseFractionSwat, std::vector& accumulatedPhaseFractionSoil, std::vector& accumulatedPhaseFractionSgas) { RigTofAccumulatedPhaseFractionsCalculator::sortTofAndCalculateAccPhaseFraction(tofData, fractionData, porvResults, swatResults, soilResults, sgasResults, tofInIncreasingOrder, accumulatedPhaseFractionSwat, accumulatedPhaseFractionSoil, accumulatedPhaseFractionSgas); } };