From c0e2d7748cbe38225068b48bd7830935e5c9fa98 Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Mon, 26 Oct 2015 10:28:42 +0100 Subject: [PATCH] Allow the rock properties to be zero initialized without a deck. This is needed in parallel runs where the rock properties will not be read from the deck but be communicated from a master process. Nevertheless we need to be able to initialize the data structures with the correct container size. In addition we need to be able to change the container values from opm-autodiff's BlackoilPropsDataHandle. --- opm/core/props/rock/RockFromDeck.cpp | 7 +++++++ opm/core/props/rock/RockFromDeck.hpp | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/opm/core/props/rock/RockFromDeck.cpp b/opm/core/props/rock/RockFromDeck.cpp index 91af70a80..58e634969 100644 --- a/opm/core/props/rock/RockFromDeck.cpp +++ b/opm/core/props/rock/RockFromDeck.cpp @@ -72,6 +72,13 @@ namespace Opm { } + RockFromDeck::RockFromDeck(std::size_t number_of_cells) + : porosity_(number_of_cells, 0), + permeability_(number_of_cells*9, 0.0), + permfield_valid_(number_of_cells, false) + { + } + void RockFromDeck::init(Opm::EclipseStateConstPtr eclState, int number_of_cells, const int* global_cell, const int* cart_dims) diff --git a/opm/core/props/rock/RockFromDeck.hpp b/opm/core/props/rock/RockFromDeck.hpp index c0ad9de34..0e202d358 100644 --- a/opm/core/props/rock/RockFromDeck.hpp +++ b/opm/core/props/rock/RockFromDeck.hpp @@ -31,10 +31,16 @@ namespace Opm class RockFromDeck { + // BlackoilPropsDataHandle needs mutable + // access to porosity and permeability + friend class BlackoilPropsDataHandle; + public: /// Default constructor. RockFromDeck(); - + /// Creates rock properties with zero porosity and permeability + /// \param number_of_cells The number of cells + RockFromDeck(std::size_t number_of_cells); /// Initialize from deck and cell mapping. /// \param eclState The EclipseState (processed deck) produced by the opm-parser code /// \param number_of_cells The number of cells in the grid.