20 #ifndef OPM_SUMMARY_CONFIG_HPP 21 #define OPM_SUMMARY_CONFIG_HPP 23 #include <opm/io/eclipse/SummaryNode.hpp> 25 #include <opm/common/OpmLog/KeywordLocation.hpp> 27 #include <opm/input/eclipse/EclipseState/Grid/GridDims.hpp> 36 #include <unordered_set> 44 class FieldPropsManager;
60 using Category = Opm::EclIO::SummaryNode::Category;
63 using Type = Opm::EclIO::SummaryNode::Type;
126 const std::string&
keyword()
const {
return this->keyword_; }
129 Category
category()
const {
return this->category_; }
132 Type
type()
const {
return this->type_; }
138 int number()
const {
return this->number_; }
144 const std::string&
fip_region()
const {
return *this->fip_region_ ; }
148 {
return this->lgr_name_; }
154 { this->lgr_name_ = name;
return *
this; }
167 auto lgr = this->lgr_name_.has_value()
168 ? std::optional<EclIO::lgr_info>{
EclIO::lgr_info{ *this->lgr_name_, {} } }
169 : std::optional<EclIO::lgr_info>{};
187 template<
class Serializer>
190 serializer(keyword_);
191 serializer(category_);
196 serializer(fip_region_);
197 serializer(userDefined_);
198 serializer(lgr_name_);
203 std::string keyword_{};
209 Type type_{ Type::Undefined };
218 int number_{std::numeric_limits<int>::min()};
221 std::optional<std::string> fip_region_{};
224 bool userDefined_{
false};
229 KeywordLocation loc{};
233 std::optional<std::string> lgr_name_{};
260 bool operator==(
const SummaryConfigNode& lhs,
const SummaryConfigNode& rhs);
269 bool operator<(
const SummaryConfigNode& lhs,
const SummaryConfigNode& rhs);
280 return ! (lhs == rhs);
292 return ! (rhs < lhs);
316 return ! (lhs < rhs);
399 template <
typename T>
446 const std::set<std::string>& shortKwds,
447 const std::set<std::string>& smryKwds);
455 auto begin()
const {
return this->m_keywords.begin(); }
460 auto end()
const {
return this->m_keywords.end(); }
463 std::size_t
size()
const {
return this->m_keywords.size(); }
468 return this->extraFracturingVectors_;
521 bool hasKeyword(
const std::string& keyword)
const;
533 bool match(
const std::string& keywordPattern)
const;
583 template<
class Serializer>
586 serializer(this->m_keywords);
587 serializer(this->extraFracturingVectors_);
588 serializer(this->short_keywords);
589 serializer(this->summary_keywords);
590 serializer(this->noSumLgr_);
596 {
return runSummaryConfig.create; }
653 std::function<
GridDims(
const std::string&)> gridDims);
668 std::set<std::string> short_keywords{};
671 std::set<std::string> summary_keywords{};
689 } runSummaryConfig{};
693 bool noSumLgr_ {
false };
703 void handleProcessingInstruction(
const std::string& keyword);
708 #endif // OPM_SUMMARY_CONFIG_HPP SummaryConfig()=default
Default constructor.
bool narrow
Whether or not to output the .RSM file in "narrow" format.
Definition: SummaryConfig.hpp:682
std::vector< SummaryConfigNode > keyword_list
Convenience type alias for a linear sequence of summary vector definitions.
Definition: SummaryConfig.hpp:325
bool createRunSummary() const
Whether or not to create a human-readable .RSM file at the end of the simulation run.
Definition: SummaryConfig.hpp:595
std::size_t size() const
Number of summary vectors in current collection.
Definition: SummaryConfig.hpp:463
bool isUserDefined() const
Retrieve summary vector's UDQ flag.
Definition: SummaryConfig.hpp:141
Definition: KeywordLocation.hpp:27
Opm::EclIO::SummaryNode::Type Type
Summary vector type (rates, cumulative, pressure, &c)
Definition: SummaryConfig.hpp:63
int number() const
Retrieve summary vector's associated numeric ID.
Definition: SummaryConfig.hpp:138
Definition: Schedule.hpp:102
const std::string & fip_region() const
Retrieve summary vector's associated region.
Definition: SummaryConfig.hpp:144
bool operator==(const SummaryConfig &data) const
Equality predicate.
Collection of run's summary vectors.
Definition: SummaryConfig.hpp:320
bool operator<=(const SummaryConfigNode &lhs, const SummaryConfigNode &rhs)
Less-than-or-equal comparison operator for SummaryConfigNode objects.
Definition: SummaryConfig.hpp:290
Definition: FieldPropsManager.hpp:42
const std::string & keyword() const
Retrieve summary vector name.
Definition: SummaryConfig.hpp:126
SummaryConfigNode::Category parseKeywordCategory(const std::string &keyword)
Infer summary vector level from keyword name.
Definition of a single summary vector.
Definition: SummaryConfig.hpp:56
const std::optional< std::string > & lgr_name() const
Retrieve LGR name for this summary vector.
Definition: SummaryConfig.hpp:147
bool operator>(const SummaryConfigNode &lhs, const SummaryConfigNode &rhs)
Greater-than comparison operator for SummaryConfigNode objects.
Definition: SummaryConfig.hpp:302
std::set< std::string > fip_regions() const
Named region sets needed across all known region level vectors.
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: SummaryNode.hpp:31
bool hasKeyword(const std::string &keyword) const
Query existence of summary vector name.
bool hasSummaryKey(const std::string &key) const
Query existence of fully qualified summary vector key.
Definition: EclipseState.hpp:66
Definition: AquiferConfig.hpp:73
bool operator>=(const SummaryConfigNode &lhs, const SummaryConfigNode &rhs)
Greater-than-or-equal comparison operator for SummaryConfigNode objects.
Definition: SummaryConfig.hpp:314
bool operator<(const SummaryConfigNode &lhs, const SummaryConfigNode &rhs)
Canonical comparison operator for SummaryConfigNode objects.
SummaryConfigNode::Type parseKeywordType(std::string keyword)
Infer summary vector type from keyword name.
std::string uniqueNodeKey() const
Retrieve a unique distinguishing identifier for this summary vector.
SummaryConfigNode()=default
Default constructor.
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition: SummaryConfig.hpp:188
SummaryConfigNode & parameterType(const Type type)
Assign vector type.
bool require3DField(const std::string &keyword) const
Query whether or not a 3D dynamic property is needed to evaluate some/all summary vectors...
const SummaryConfigNode & operator[](std::size_t index) const
Retrieve summary vector definition from linear index.
keyword_list registerRequisiteUDQorActionSummaryKeys(const std::vector< std::string > &extraKeys, const EclipseState &es, const Schedule &sched)
Form definitions from vectors used in UDQs and ACTIONX.
static SummaryConfig serializationTestObject()
Create a serialisation test object.
bool create
Whether or not to create a human-readable .RSM file at the end of the simulation run.
Definition: SummaryConfig.hpp:677
Type type() const
Retrieve summary vector's type.
Definition: SummaryConfig.hpp:132
bool noSumLgr() const
Whether or not to suppress the ROOT.LGR local-grid summary file.
Definition: SummaryConfig.hpp:599
Control parser behaviour in failure conditions.
Definition: ParseContext.hpp:114
auto end() const
One past the end of the sequence of summary vector definitions.
Definition: SummaryConfig.hpp:460
SummaryConfigNode & lgr_name(const std::string &name)
Assign LGR name for this summary vector.
Definition: SummaryConfig.hpp:153
Category category() const
Retrieve summary vector's level.
Definition: SummaryConfig.hpp:129
const KeywordLocation & location() const
Retrieve summary keyword location in input.
Definition: SummaryConfig.hpp:162
Definition: GridDims.hpp:30
Definition: SummaryNode.hpp:36
const keyword_list & extraFracturingVectors() const
Partially defined summary vectors relating to fracturing processes.
Definition: SummaryConfig.hpp:466
keyword_list keywords(const std::string &keywordPattern) const
Retrieve all vector definitions matching a vector name pattern.
SummaryConfig & merge(const SummaryConfig &other)
Incorporate other vector collection into current.
const std::string & namedEntity() const
Retrieve summary vector's named entity.
Definition: SummaryConfig.hpp:135
Opm::EclIO::SummaryNode::Category Category
Summary vector level (field, well, region, &c).
Definition: SummaryConfig.hpp:60
std::set< std::string > fip_regions_interreg_flow() const
Named region sets needed across all known inter-region vectors.
bool separate
Whether or not to create a separate .RSM file instead of placing the run summary at the end of the ...
Definition: SummaryConfig.hpp:688
Class for (de-)serializing.
Definition: Serializer.hpp:95
bool match(const std::string &keywordPattern) const
Query existence of summary vector name with pattern matching.
auto begin() const
Beginning of sequence of summary vector definitions.
Definition: SummaryConfig.hpp:455
bool operator!=(const SummaryConfigNode &lhs, const SummaryConfigNode &rhs)
Inequality operator for SummaryConfigNode objects.
Definition: SummaryConfig.hpp:278
Definition: ErrorGuard.hpp:30
static SummaryConfigNode serializationTestObject()
Create a serialisation test object.
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition: SummaryConfig.hpp:584