make Group constructible from variables
also make it default constructible, add accessors and equality operator
This commit is contained in:
@@ -162,12 +162,35 @@ struct ProductionControls {
|
||||
};
|
||||
|
||||
|
||||
Group();
|
||||
Group(const std::string& group_name, std::size_t insert_index_arg, std::size_t init_step_arg, double udq_undefined_arg, const UnitSystem& unit_system);
|
||||
Group(const std::string& gname,
|
||||
std::size_t insert_idx,
|
||||
std::size_t initstep,
|
||||
double udqUndef,
|
||||
const UnitSystem& units,
|
||||
GroupType gtype,
|
||||
double groupEF,
|
||||
bool transferGroupEF,
|
||||
int vfp,
|
||||
const std::string& parent,
|
||||
const IOrderSet<std::string>& well,
|
||||
const IOrderSet<std::string>& group,
|
||||
const GroupInjectionProperties& injProps,
|
||||
const GroupProductionProperties& prodProps);
|
||||
|
||||
|
||||
bool defined(std::size_t timeStep) const;
|
||||
std::size_t insert_index() const;
|
||||
std::size_t initStep() const;
|
||||
double udqUndefined() const;
|
||||
const UnitSystem& units() const;
|
||||
const std::string& name() const;
|
||||
GroupType type() const;
|
||||
int getGroupNetVFPTable() const;
|
||||
const IOrderSet<std::string>& iwells() const;
|
||||
const IOrderSet<std::string>& igroups() const;
|
||||
|
||||
bool updateNetVFPTable(int vfp_arg);
|
||||
bool update_gefac(double gefac, bool transfer_gefac);
|
||||
|
||||
@@ -203,6 +226,9 @@ struct ProductionControls {
|
||||
Phase injection_phase() const;
|
||||
bool has_control(ProductionCMode control) const;
|
||||
bool has_control(InjectionCMode control) const;
|
||||
|
||||
bool operator==(const Group& data) const;
|
||||
|
||||
private:
|
||||
bool hasType(GroupType gtype) const;
|
||||
void addType(GroupType new_gtype);
|
||||
|
||||
@@ -25,6 +25,11 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
Group::Group()
|
||||
: Group("", 0, 0, 0.0, UnitSystem())
|
||||
{
|
||||
}
|
||||
|
||||
Group::Group(const std::string& name, std::size_t insert_index_arg, std::size_t init_step_arg, double udq_undefined_arg, const UnitSystem& unit_system_arg) :
|
||||
m_name(name),
|
||||
m_insert_index(insert_index_arg),
|
||||
@@ -41,10 +46,57 @@ Group::Group(const std::string& name, std::size_t insert_index_arg, std::size_t
|
||||
this->parent_group = "FIELD";
|
||||
}
|
||||
|
||||
Group::Group(const std::string& gname,
|
||||
std::size_t insert_idx,
|
||||
std::size_t initstep,
|
||||
double udqUndef,
|
||||
const UnitSystem& units,
|
||||
GroupType gtype,
|
||||
double groupEF,
|
||||
bool transferGroupEF,
|
||||
int vfp,
|
||||
const std::string& parentName,
|
||||
const IOrderSet<std::string>& well,
|
||||
const IOrderSet<std::string>& group,
|
||||
const GroupInjectionProperties& injProps,
|
||||
const GroupProductionProperties& prodProps) :
|
||||
m_name(gname),
|
||||
m_insert_index(insert_idx),
|
||||
init_step(initstep),
|
||||
udq_undefined(udqUndef),
|
||||
unit_system(units),
|
||||
group_type(gtype),
|
||||
gefac(groupEF),
|
||||
transfer_gefac(transferGroupEF),
|
||||
vfp_table(vfp),
|
||||
parent_group(parentName),
|
||||
m_wells(well),
|
||||
m_groups(group),
|
||||
injection_properties(injProps),
|
||||
production_properties(prodProps)
|
||||
{
|
||||
}
|
||||
|
||||
std::size_t Group::insert_index() const {
|
||||
return this->m_insert_index;
|
||||
}
|
||||
|
||||
std::size_t Group::initStep() const {
|
||||
return this->init_step;
|
||||
}
|
||||
|
||||
double Group::udqUndefined() const {
|
||||
return this->udq_undefined;
|
||||
}
|
||||
|
||||
const UnitSystem& Group::units() const {
|
||||
return this->unit_system;
|
||||
}
|
||||
|
||||
Group::GroupType Group::type() const {
|
||||
return this->group_type;
|
||||
}
|
||||
|
||||
bool Group::defined(size_t timeStep) const {
|
||||
return (timeStep >= this->init_step);
|
||||
}
|
||||
@@ -65,6 +117,14 @@ int Group::getGroupNetVFPTable() const {
|
||||
return this->vfp_table;
|
||||
}
|
||||
|
||||
const IOrderSet<std::string>& Group::iwells() const {
|
||||
return m_wells;
|
||||
}
|
||||
|
||||
const IOrderSet<std::string>& Group::igroups() const {
|
||||
return m_groups;
|
||||
}
|
||||
|
||||
bool Group::updateNetVFPTable(int vfp_arg) {
|
||||
if (this->vfp_table != vfp_arg) {
|
||||
this->vfp_table = vfp_arg;
|
||||
@@ -493,4 +553,22 @@ Group::GuideRateTarget Group::GuideRateTargetFromString( const std::string& stri
|
||||
return GuideRateTarget::NO_GUIDE_RATE;
|
||||
}
|
||||
|
||||
bool Group::operator==(const Group& data) const
|
||||
{
|
||||
return this->name() == data.name() &&
|
||||
this->insert_index() == data.insert_index() &&
|
||||
this->initStep() == data.initStep() &&
|
||||
this->udqUndefined() == data.udqUndefined() &&
|
||||
this->units() == data.units() &&
|
||||
this->type() == data.type() &&
|
||||
this->getGroupEfficiencyFactor() == data.getGroupEfficiencyFactor() &&
|
||||
this->getTransferGroupEfficiencyFactor() == data.getTransferGroupEfficiencyFactor() &&
|
||||
this->getGroupNetVFPTable() == data.getGroupNetVFPTable() &&
|
||||
this->parent() == data.parent() &&
|
||||
this->iwells() == data.iwells() &&
|
||||
this->igroups() == data.igroups() &&
|
||||
this->injectionProperties() == data.injectionProperties() &&
|
||||
this->productionProperties() == data.productionProperties();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user