FieldProps::default_region() - public property
This commit is contained in:
@@ -34,6 +34,7 @@ public:
|
||||
FieldPropsManager() = default;
|
||||
FieldPropsManager(const Deck& deck, const EclipseGrid& grid, const TableManager& tables);
|
||||
void reset_grid(const EclipseGrid& grid);
|
||||
const std::string& default_region() const;
|
||||
|
||||
/*
|
||||
Because the FieldProps class can autocreate properties the semantics of
|
||||
|
||||
@@ -263,7 +263,7 @@ FieldProps::FieldProps(const Deck& deck, const EclipseGrid& grid_arg, const Tabl
|
||||
tables(table_arg),
|
||||
active_size(grid_arg.getNumActive()),
|
||||
actnum(grid_arg.getACTNUM()),
|
||||
default_region(default_region_keyword(deck))
|
||||
m_default_region(default_region_keyword(deck))
|
||||
{
|
||||
if (Section::hasGRID(deck))
|
||||
this->scanGRIDSection(GRIDSection(deck));
|
||||
@@ -379,7 +379,7 @@ FieldProps::FieldData<int>& FieldProps::get(const std::string& keyword) {
|
||||
}
|
||||
|
||||
std::vector<Box::cell_index> FieldProps::region_index( const DeckItem& region_item, int region_value ) {
|
||||
std::string region_name = region_item.defaultApplied(0) ? this->default_region : make_region_name(region_item.get<std::string>(0));
|
||||
std::string region_name = region_item.defaultApplied(0) ? this->m_default_region : make_region_name(region_item.get<std::string>(0));
|
||||
const auto& region = this->get<int>(region_name);
|
||||
if (!region.valid())
|
||||
throw std::invalid_argument("Trying to work with invalid region: " + region_name);
|
||||
@@ -701,6 +701,9 @@ void FieldProps::scanSCHEDULESection(const SCHEDULESection& schedule_section) {
|
||||
}
|
||||
}
|
||||
|
||||
const std::string& FieldProps::default_region() const {
|
||||
return this->m_default_region;
|
||||
}
|
||||
|
||||
template std::vector<bool> FieldProps::defaulted<int>(const std::string& keyword);
|
||||
template std::vector<bool> FieldProps::defaulted<double>(const std::string& keyword);
|
||||
|
||||
@@ -116,6 +116,9 @@ public:
|
||||
FieldProps(const Deck& deck, const EclipseGrid& grid, const TableManager& table_arg);
|
||||
void reset_grid(const EclipseGrid& grid);
|
||||
|
||||
const std::string& default_region() const;
|
||||
|
||||
|
||||
template <typename T>
|
||||
FieldData<T>& get(const std::string& keyword);
|
||||
|
||||
@@ -197,7 +200,7 @@ private:
|
||||
const TableManager& tables;
|
||||
std::size_t active_size;
|
||||
std::vector<int> actnum;
|
||||
const std::string default_region;
|
||||
const std::string m_default_region;
|
||||
std::unordered_map<std::string, FieldData<int>> int_data;
|
||||
std::unordered_map<std::string, FieldData<double>> double_data;
|
||||
};
|
||||
|
||||
@@ -86,6 +86,10 @@ std::vector<bool> FieldPropsManager::defaulted(const std::string& keyword) const
|
||||
}
|
||||
|
||||
|
||||
const std::string& FieldPropsManager::default_region() const {
|
||||
return this->fp->default_region();
|
||||
}
|
||||
|
||||
template bool FieldPropsManager::supported<int>(const std::string&);
|
||||
template bool FieldPropsManager::supported<double>(const std::string&);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user