Merge pull request #3640 from totto82/inj_comm

communicate inj_resv/surface_rates
This commit is contained in:
Atgeirr Flø Rasmussen 2021-10-29 15:35:24 +02:00 committed by GitHub
commit 2a7a9d46ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 23 deletions

View File

@ -35,9 +35,9 @@ bool GroupState::operator==(const GroupState& other) const {
this->prod_red_rates == other.prod_red_rates &&
this->inj_red_rates == other.inj_red_rates &&
this->inj_resv_rates == other.inj_resv_rates &&
this->inj_potentials == other.inj_potentials &&
this->inj_rein_rates == other.inj_rein_rates &&
this->inj_vrep_rate == other.inj_vrep_rate &&
this->inj_surface_rates == other.inj_surface_rates &&
this->m_grat_sales_target == other.m_grat_sales_target &&
this->injection_controls == other.injection_controls;
}
@ -202,23 +202,6 @@ bool GroupState::has_grat_sales_target(const std::string& gname) const {
//-------------------------------------------------------------------------
void GroupState::update_injection_potentials(const std::string& gname, const std::vector<double>& potentials) {
if (potentials.size() != this->num_phases)
throw std::logic_error("Wrong number of phases");
this->inj_potentials[gname] = potentials;
}
const std::vector<double>& GroupState::injection_potentials(const std::string& gname) const {
auto group_iter = this->inj_potentials.find(gname);
if (group_iter == this->inj_potentials.end())
throw std::logic_error("No such group");
return group_iter->second;
}
//-------------------------------------------------------------------------
bool GroupState::has_production_control(const std::string& gname) const {
auto group_iter = this->production_controls.find(gname);
if (group_iter == this->production_controls.end())
@ -321,7 +304,6 @@ std::string GroupState::dump() const
dump_groupmap(root, "prod_red_rates", this->prod_red_rates);
dump_groupmap(root, "inj_red_rates", this->inj_red_rates);
dump_groupmap(root, "inj_resv_rates", this->inj_resv_rates);
dump_groupmap(root, "inj_potentials", this->inj_potentials);
dump_groupmap(root, "inj_rein_rates", this->inj_rein_rates);
dump_groupmap(root, "vrep_rate", this->inj_vrep_rate);
dump_groupmap(root, "grat_sales_target", this->m_grat_sales_target);

View File

@ -60,9 +60,6 @@ public:
void update_injection_rein_rates(const std::string& gname, const std::vector<double>& rates);
const std::vector<double>& injection_rein_rates(const std::string& gname) const;
void update_injection_potentials(const std::string& gname, const std::vector<double>& potentials);
const std::vector<double>& injection_potentials(const std::string& gname) const;
void update_injection_vrep_rate(const std::string& gname, double rate);
double injection_vrep_rate(const std::string& gname) const;
@ -112,6 +109,7 @@ public:
iterateContainer(inj_red_rates, func);
iterateContainer(inj_resv_rates, func);
iterateContainer(inj_rein_rates, func);
iterateContainer(inj_surface_rates, func);
};
// Compute the size of the data.
@ -172,7 +170,6 @@ private:
std::map<std::string, std::vector<double>> inj_red_rates;
std::map<std::string, std::vector<double>> inj_surface_rates;
std::map<std::string, std::vector<double>> inj_resv_rates;
std::map<std::string, std::vector<double>> inj_potentials;
std::map<std::string, std::vector<double>> inj_rein_rates;
std::map<std::string, double> inj_vrep_rate;
std::map<std::string, double> m_grat_sales_target;