Load group->parent_group when loading from restart file

This commit is contained in:
Joakim Hove
2020-10-02 19:05:09 +02:00
parent 5b3a76172b
commit aa54bc67de
6 changed files with 7 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ struct RstHeader;
struct RstGroup {
RstGroup(const UnitSystem& unit_system,
const RstHeader& header,
const std::string* zwel,
const int * igrp,
const float * sgrp,

View File

@@ -86,6 +86,7 @@ struct RstHeader {
int ntfreg;
int nplmix;
int ngroup;
int nwgmax;
bool e300_radial;
bool e100_radial;

View File

@@ -33,12 +33,13 @@ namespace RestartIO {
using M = ::Opm::UnitSystem::measure;
RstGroup::RstGroup(const ::Opm::UnitSystem& unit_system,
const RstHeader& header,
const std::string* zwel,
const int * igrp,
const float * sgrp,
const double * xgrp) :
name(trim_copy(zwel[0])),
parent_group(igrp[VI::IGroup::ParentGroup] ),
parent_group(igrp[header.nwgmax + VI::IGroup::ParentGroup] ),
oil_rate_limit( unit_system.to_si(M::liquid_surface_rate, sgrp[VI::SGroup::OilRateLimit])),
water_rate_limit( unit_system.to_si(M::liquid_surface_rate, sgrp[VI::SGroup::WatRateLimit])),
gas_rate_limit( unit_system.to_si(M::gas_surface_rate, sgrp[VI::SGroup::GasRateLimit])),

View File

@@ -84,6 +84,7 @@ RstHeader::RstHeader(const std::vector<int>& intehead, const std::vector<bool>&
ntfip(intehead[VI::intehead::NTFIP]),
nmfipr(intehead[VI::intehead::NMFIPR]),
ngroup(intehead[VI::intehead::NGRP]),
nwgmax(intehead[VI::intehead::NWGMAX]),
//
e300_radial(logihead[VI::logihead::E300Radial]),
e100_radial(logihead[VI::logihead::E100Radial]),

View File

@@ -181,6 +181,7 @@ void RstState::add_groups(const std::vector<std::string>& zgrp,
std::size_t xgrp_offset = ig * this->header.nxgrpz;
this->groups.emplace_back(this->unit_system,
this->header,
zgrp.data() + zgrp_offset,
igrp.data() + igrp_offset,
sgrp.data() + sgrp_offset,

View File

@@ -247,6 +247,7 @@ BOOST_AUTO_TEST_CASE(group_test) {
std::size_t xgrp_offset = ig * header.nxgrpz;
Opm::RestartIO::RstGroup group(unit_system,
header,
zgrp.data() + zgrp_offset,
igrp.data() + igrp_offset,
sgrp.data() + sgrp_offset,