///////////////////////////////////////////////////////////////////////////////// // // 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 "RigCompletionData.h" #include "RicExportCompletionDataSettingsUi.h" #include #include #include #include #include class RifTextDataTableFormatter; class RimPerforationInterval; class RimWellPath; //================================================================================================== /// Building blocks used when generating and writing COMPDAT, COMPLUMP and WPIMULT data //================================================================================================== class RicCompletionDataExportTools { public: static std::vector generatePerforationsCompdatValues( const RimWellPath* wellPath, const std::vector& intervals, const RicExportCompletionDataSettingsUi& settings, const std::optional& exportDate = std::nullopt ); static RigCompletionData combineEclipseCellCompletions( const std::vector& completions, const RicExportCompletionDataSettingsUi& settings ); static std::vector mainGridCompletions( const std::vector& allCompletions ); static std::map> subGridsCompletions( const std::vector& allCompletions ); static void exportCompdatTableUsingFormatter( RifTextDataTableFormatter& formatter, const QString& gridName, const std::vector& completionData ); static void exportComplumpTableUsingFormatter( RifTextDataTableFormatter& formatter, const QString& gridName, const std::vector& completionData ); static void exportWpimultTableUsingFormatter( RifTextDataTableFormatter& formatter, const QString& gridName, const std::vector& completionData ); static void appendCompletionData( std::map>* completionData, const std::vector& data ); static RimWellPath* topLevelWellPath( const RigCompletionData& completion ); // Completion number for a cell with several contributions: the number with the largest summed MD overlap // (endMD - startMD) wins, ties go to the lowest number. Independent of contribution order. static std::optional completionNumberForCell( const std::vector& completions ); };