Add group mamber to RstWell
This commit is contained in:
parent
6d3cb49c11
commit
6afd05db1b
@ -35,6 +35,7 @@ class RstHeader;
|
||||
|
||||
struct RstWell {
|
||||
RstWell(const RstHeader& header,
|
||||
const std::string& group_arg,
|
||||
const std::string* zwel,
|
||||
const int * iwel,
|
||||
const float * swel,
|
||||
@ -44,6 +45,7 @@ struct RstWell {
|
||||
const double * xcon);
|
||||
|
||||
RstWell(const RstHeader& header,
|
||||
const std::string& group_arg,
|
||||
const std::string* zwel,
|
||||
const int * iwel,
|
||||
const float * swel,
|
||||
@ -55,6 +57,7 @@ struct RstWell {
|
||||
const std::vector<double>& rseg);
|
||||
|
||||
std::string name;
|
||||
std::string group;
|
||||
std::array<int, 2> ij;
|
||||
std::pair<int,int> k1k2;
|
||||
int wtype;
|
||||
|
@ -57,8 +57,11 @@ RstState::RstState(const std::vector<int>& intehead,
|
||||
std::size_t icon_offset = iw * this->header.niconz * this->header.ncwmax;
|
||||
std::size_t scon_offset = iw * this->header.nsconz * this->header.ncwmax;
|
||||
std::size_t xcon_offset = iw * this->header.nxconz * this->header.ncwmax;
|
||||
int group_index = iwel[ iwel_offset + VI::IWell::Group ] - 1;
|
||||
const std::string group = this->groups[group_index].name;
|
||||
|
||||
this->wells.emplace_back(this->header,
|
||||
group,
|
||||
zwel.data() + zwel_offset,
|
||||
iwel.data() + iwel_offset,
|
||||
swel.data() + swel_offset,
|
||||
@ -100,8 +103,11 @@ RstState::RstState(const std::vector<int>& intehead,
|
||||
std::size_t icon_offset = iw * this->header.niconz * this->header.ncwmax;
|
||||
std::size_t scon_offset = iw * this->header.nsconz * this->header.ncwmax;
|
||||
std::size_t xcon_offset = iw * this->header.nxconz * this->header.ncwmax;
|
||||
int group_index = iwel[ iwel_offset + VI::IWell::Group ] - 1;
|
||||
const std::string group = this->groups[group_index].name;
|
||||
|
||||
this->wells.emplace_back(this->header,
|
||||
group,
|
||||
zwel.data() + zwel_offset,
|
||||
iwel.data() + iwel_offset,
|
||||
swel.data() + swel_offset,
|
||||
@ -182,3 +188,4 @@ RstState RstState::load(EclIO::ERst& rst_file, int report_step) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -33,6 +33,7 @@ namespace Opm {
|
||||
namespace RestartIO {
|
||||
|
||||
RstWell::RstWell(const RstHeader& header,
|
||||
const std::string& group_arg,
|
||||
const std::string* zwel,
|
||||
const int * iwel,
|
||||
const float * swel,
|
||||
@ -41,6 +42,7 @@ RstWell::RstWell(const RstHeader& header,
|
||||
const float * scon,
|
||||
const double * xcon) :
|
||||
name(trim_copy(zwel[0])),
|
||||
group(group_arg),
|
||||
ij({iwel[VI::IWell::IHead] - 1, iwel[VI::IWell::JHead] - 1}),
|
||||
k1k2(std::make_pair(iwel[VI::IWell::FirstK] - 1, iwel[VI::IWell::LastK] - 1)),
|
||||
wtype(iwel[VI::IWell::WType]),
|
||||
@ -96,6 +98,7 @@ RstWell::RstWell(const RstHeader& header,
|
||||
|
||||
|
||||
RstWell::RstWell(const RstHeader& header,
|
||||
const std::string& group_arg,
|
||||
const std::string* zwel,
|
||||
const int * iwel,
|
||||
const float * swel,
|
||||
@ -105,7 +108,7 @@ RstWell::RstWell(const RstHeader& header,
|
||||
const double * xcon,
|
||||
const std::vector<int>& iseg,
|
||||
const std::vector<double>& rseg) :
|
||||
RstWell(header, zwel, iwel, swel, xwel, icon, scon, xcon)
|
||||
RstWell(header, group_arg, zwel, iwel, swel, xwel, icon, scon, xcon)
|
||||
{
|
||||
|
||||
if (this->msw_index) {
|
||||
|
@ -828,6 +828,7 @@ BOOST_AUTO_TEST_CASE(WELL_POD) {
|
||||
std::size_t xcon_offset = header.nxconz * header.ncwmax * iw;
|
||||
|
||||
wells.emplace_back(header,
|
||||
"GROUP",
|
||||
zwel.data() + zwel_offset,
|
||||
iwel.data() + iwel_offset,
|
||||
swel.data() + swel_offset,
|
||||
|
Loading…
Reference in New Issue
Block a user