From 4c0e0c8361f3c37f285220c3f04e6ea8ec2a3c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Mon, 14 Apr 2014 23:52:50 +0200 Subject: [PATCH] Implement low-level init() routines These are needed by the initialisation routines of the refactored opm-core (PR OPM/opm-core#518) that introduces support for parallel grids. --- opm/polymer/PolymerBlackoilState.hpp | 11 ++++++++--- opm/polymer/PolymerState.hpp | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/opm/polymer/PolymerBlackoilState.hpp b/opm/polymer/PolymerBlackoilState.hpp index d6f714ae0..8116ec2c8 100644 --- a/opm/polymer/PolymerBlackoilState.hpp +++ b/opm/polymer/PolymerBlackoilState.hpp @@ -35,9 +35,14 @@ namespace Opm public: void init(const UnstructuredGrid& g, int num_phases) { - state_blackoil_.init(g, num_phases); - concentration_.resize(g.number_of_cells, 0.0); - cmax_.resize(g.number_of_cells, 0.0); + this->init(g.number_of_cells, g.number_of_faces, num_phases); + } + + void init(int number_of_cells, int number_of_faces, int num_phases) + { + state_blackoil_.init(number_of_cells, number_of_faces, num_phases); + concentration_.resize(number_of_cells, 0.0); + cmax_.resize(number_of_cells, 0.0); } enum ExtremalSat { MinSat = BlackoilState::MinSat, MaxSat = BlackoilState::MaxSat }; diff --git a/opm/polymer/PolymerState.hpp b/opm/polymer/PolymerState.hpp index 6b9d7fd21..d5928edf9 100644 --- a/opm/polymer/PolymerState.hpp +++ b/opm/polymer/PolymerState.hpp @@ -34,9 +34,14 @@ namespace Opm public: void init(const UnstructuredGrid& g, int num_phases) { - state2p_.init(g, num_phases); - concentration_.resize(g.number_of_cells, 0.0); - cmax_.resize(g.number_of_cells, 0.0); + this->init(g.number_of_cells, g.number_of_faces, num_phases); + } + + void init(int number_of_cells, int number_of_faces, int num_phases) + { + state2p_.init(number_of_cells, number_of_faces, num_phases); + concentration_.resize(number_of_cells, 0.0); + cmax_.resize(number_of_cells, 0.0); } enum ExtremalSat { MinSat = TwophaseState::MinSat, MaxSat = TwophaseState::MaxSat };