///////////////////////////////////////////////////////////////////////////////// // // Copyright (C) 2026 Equinor 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 "RimReservoirGridEnsemble.h" #include "cafPdmUiTreeAttributes.h" #include "cafPdmField.h" #include "cafPdmProxyValueField.h" #include "cafPdmPtrField.h" #include #include class RimSumoDataSource; //================================================================================================== /// /// RimReservoirGridEnsembleSumo - Grid ensemble of one grid stored on Sumo, one case per realization /// /// The realizations come from a RimSumoDataSource instead of an ensemble file set. As in the base /// class the realization cases are not written to the project file, they are recreated from the data /// source when the project is loaded, see createCaseObjects. /// /// When all realizations report the same IJK dimensions, one RigMainGrid is kept in memory for the /// whole ensemble. Every realization still downloads and parses its own grid blob to read its own /// active cells, then releases the parsed geometry and points at the shared grid, see /// RimRoffCaseSumo::openEclipseGridFile. Realizations are opened lazily, the first time one is /// displayed; only the first realization is loaded when the ensemble is created. /// //================================================================================================== class RimReservoirGridEnsembleSumo : public RimReservoirGridEnsemble { CAF_PDM_HEADER_INIT; public: RimReservoirGridEnsembleSumo(); // gridDimensionsAreIdentical decides whether the realizations can share one grid. It comes from the // dimensions reported by Sumo, so no grid has to be downloaded to decide. void setSumoSource( RimSumoDataSource* dataSource, const QString& gridName, const std::vector& realizations, bool gridDimensionsAreIdentical ); // The realizations this grid exists for, which is not necessarily every realization of the ensemble. void setGridRealizations( const std::vector& realizations ); std::vector gridRealizations() const; // The realizations of the data source this grid has no data for, sorted. The data source decides which // realizations the ensemble has, without regard for which data types exist for them, so a grid can be // missing for some of them. Computed on demand: the realization selection can change after the ensemble // is created, see RimSumoDataSource. std::vector realizationsWithoutGridData() const; QString sumoGridName() const; void createGridCasesFromSumoSource(); bool doComputeMobileVolumeWeightedMean() const override; void setDoComputeMobileVolumeWeightedMean( bool enable ) override; protected: void defineUiOrdering( QString uiConfigName, caf::PdmUiOrdering& uiOrdering ) override; std::vector treeItemTags(); void createCaseObjects() override; bool detectGridDimensionEquality() override; void loadGridsInSharedMode() override; void setupBeforeSave() override; private: QString missingGridDataText() const; private: caf::PdmPtrField m_sumoDataSource; caf::PdmField m_gridName; // The realizations to create cases for, in the order the cases appear. The cases themselves are not // written to the project file, see the class comment. caf::PdmField> m_realizations; caf::PdmField> m_gridRealizations; // Reports the realizations without grid data. A proxy field, so it follows a changed realization // selection instead of going stale. caf::PdmProxyValueField m_missingGridDataInfo; caf::PdmField m_gridDimensionsAreIdentical; caf::PdmField m_doComputeMobileVolumeWeightedMean; };