Renamed UDQInput -> UDQCOnfig

This commit is contained in:
Joakim Hove
2019-07-26 17:17:06 +02:00
committed by Jostein Alvestad
parent 9ff301625b
commit 28c2e7024c
8 changed files with 30 additions and 58 deletions

View File

@@ -139,7 +139,7 @@ if(ENABLE_ECL_INPUT)
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.cpp
src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.cpp
@@ -562,10 +562,9 @@ if(ENABLE_ECL_INPUT)
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQDefine.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunction.hpp
opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQFunctionTable.hpp

View File

@@ -101,7 +101,7 @@ namespace Opm
class UnitSystem;
class ErrorGuard;
class WListManager;
class UDQInput;
class UDQConfig;
class Schedule {
public:
@@ -179,7 +179,7 @@ namespace Opm
const WellTestConfig& wtestConfig(size_t timestep) const;
const WListManager& getWListManager(size_t timeStep) const;
const UDQInput& getUDQConfig(size_t timeStep) const;
const UDQConfig& getUDQConfig(size_t timeStep) const;
const Action::Actions& actions() const;
void evalAction(const SummaryState& summary_state, size_t timeStep);
@@ -226,7 +226,7 @@ namespace Opm
std::map<int, DynamicState<std::shared_ptr<VFPInjTable>>> vfpinj_tables;
DynamicState<std::shared_ptr<WellTestConfig>> wtest_config;
DynamicState<std::shared_ptr<WListManager>> wlist_manager;
DynamicState<std::shared_ptr<UDQInput>> udq_config;
DynamicState<std::shared_ptr<UDQConfig>> udq_config;
DynamicState<WellProducer::ControlModeEnum> global_whistctl_mode;
RFTConfig rft_config;

View File

@@ -38,9 +38,9 @@ namespace Opm {
class DeckRecord;
class Deck;
class UDQInput {
class UDQConfig {
public:
explicit UDQInput(const Deck& deck);
explicit UDQConfig(const Deck& deck);
const std::string& unit(const std::string& key) const;
bool has_unit(const std::string& keyword) const;
bool has_keyword(const std::string& keyword) const;
@@ -49,34 +49,7 @@ namespace Opm {
std::vector<UDQDefine> definitions() const;
std::vector<UDQDefine> definitions(UDQVarType var_type) const;
/*
The input_definitions() function is written to supply the information
needed when writing the restart file. The return value is a list of
pairs, where the first element in the pair is the index in the deck
for a particular UDQ keyword, and then the corresponding keyword.
Assume a deck keyword which looks like this:
UDQ
ASSIGN WUX 10 /
UNITS WUX 'BARSA' /
DEFINE WUPR SUM(WOPR) * 0.75 /
DEFINE FUCK MAX(WOPR) * 1.25 /
ASSIGN FUX 100 /
DEFINE BUPR ?? /
/
Then the return value from input_definitions() will be:
{{1, UDQDefine("WUPR")},
{2, UDQDefine("FUCK")},
{4, UDQDefine("BUPR")}
Where the the numerical index is the index in a fictious vector
consisting of only the ASSIGN and DEFINE keywords, in input order.
*/
std::vector<std::pair<size_t, UDQDefine>> input_definitions() const;
std::vector<UDQInput> input() const;
std::vector<UDQAssign> assignments() const;
std::vector<UDQAssign> assignments(UDQVarType var_type) const;

View File

@@ -36,7 +36,7 @@
#include <opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp>
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
@@ -1168,7 +1168,7 @@ bool is_udq(const std::string& keyword) {
void eval_udq(const Schedule& schedule, std::size_t sim_step, SummaryState& st)
{
const UDQInput& udq = schedule.getUDQConfig(sim_step);
const UDQConfig& udq = schedule.getUDQConfig(sim_step);
const auto& func_table = udq.function_table();
UDQContext context(udq.params(), func_table, st);
std::vector<std::string> wells;

View File

@@ -48,7 +48,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
@@ -117,7 +117,7 @@ namespace {
m_runspec( runspec ),
wtest_config(this->m_timeMap, std::make_shared<WellTestConfig>() ),
wlist_manager( this->m_timeMap, std::make_shared<WListManager>()),
udq_config(this->m_timeMap, std::make_shared<UDQInput>(deck)),
udq_config(this->m_timeMap, std::make_shared<UDQConfig>(deck)),
global_whistctl_mode(this->m_timeMap, WellProducer::CMODE_UNDEFINED),
rft_config(this->m_timeMap)
{
@@ -1126,7 +1126,7 @@ namespace {
void Schedule::handleUDQ(const DeckKeyword& keyword, size_t currentStep) {
const auto& current = *this->udq_config.get(currentStep);
std::shared_ptr<UDQInput> new_udq = std::make_shared<UDQInput>(current);
std::shared_ptr<UDQConfig> new_udq = std::make_shared<UDQConfig>(current);
for (const auto& record : keyword)
new_udq->add_record(record);
@@ -2455,7 +2455,7 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
return *ptr;
}
const UDQInput& Schedule::getUDQConfig(size_t timeStep) const {
const UDQConfig& Schedule::getUDQConfig(size_t timeStep) const {
const auto& ptr = this->udq_config.get(timeStep);
return *ptr;
}

View File

@@ -20,7 +20,7 @@
#include <algorithm>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp>
namespace Opm {
@@ -35,17 +35,17 @@ namespace Opm {
}
UDQInput::UDQInput(const Deck& deck) :
UDQConfig::UDQConfig(const Deck& deck) :
udq_params(deck),
udqft(this->udq_params)
{
}
const UDQParams& UDQInput::params() const {
const UDQParams& UDQConfig::params() const {
return this->udq_params;
}
void UDQInput::add_record(const DeckRecord& record) {
void UDQConfig::add_record(const DeckRecord& record) {
auto action = UDQ::actionType(record.getItem("ACTION").get<std::string>(0));
const auto& quantity = record.getItem("QUANTITY").get<std::string>(0);
const auto& data = record.getItem("DATA").getData<std::string>();
@@ -79,7 +79,7 @@ namespace Opm {
}
std::vector<UDQDefine> UDQInput::definitions() const {
std::vector<UDQDefine> UDQConfig::definitions() const {
std::vector<UDQDefine> ret;
for (const auto& index_pair : this->input_index) {
if (index_pair.second.second == UDQAction::DEFINE) {
@@ -91,7 +91,7 @@ namespace Opm {
}
std::vector<UDQDefine> UDQInput::definitions(UDQVarType var_type) const {
std::vector<UDQDefine> UDQConfig::definitions(UDQVarType var_type) const {
std::vector<UDQDefine> filtered_defines;
for (const auto& index_pair : this->input_index) {
if (index_pair.second.second == UDQAction::DEFINE) {
@@ -105,7 +105,7 @@ namespace Opm {
}
std::vector<std::pair<size_t, UDQDefine>> UDQInput::input_definitions() const {
std::vector<std::pair<size_t, UDQDefine>> UDQConfig::input_definitions() const {
std::vector<std::pair<size_t, UDQDefine>> res;
for (const auto& index_pair : this->input_index) {
if (index_pair.second.second == UDQAction::DEFINE) {
@@ -117,7 +117,7 @@ namespace Opm {
}
std::vector<UDQAssign> UDQInput::assignments() const {
std::vector<UDQAssign> UDQConfig::assignments() const {
std::vector<UDQAssign> ret;
for (const auto& index_pair : this->input_index) {
if (index_pair.second.second == UDQAction::ASSIGN) {
@@ -129,7 +129,7 @@ namespace Opm {
}
std::vector<UDQAssign> UDQInput::assignments(UDQVarType var_type) const {
std::vector<UDQAssign> UDQConfig::assignments(UDQVarType var_type) const {
std::vector<UDQAssign> filtered_defines;
for (const auto& index_pair : this->input_index) {
if (index_pair.second.second == UDQAction::ASSIGN) {
@@ -144,7 +144,7 @@ namespace Opm {
const std::string& UDQInput::unit(const std::string& key) const {
const std::string& UDQConfig::unit(const std::string& key) const {
const auto pair_ptr = this->units.find(key);
if (pair_ptr == this->units.end())
throw std::invalid_argument("No such UDQ quantity: " + key);
@@ -153,7 +153,7 @@ namespace Opm {
}
void UDQInput::assign_unit(const std::string& keyword, const std::string& quoted_unit) {
void UDQConfig::assign_unit(const std::string& keyword, const std::string& quoted_unit) {
const std::string unit = strip_quotes(quoted_unit);
const auto pair_ptr = this->units.find(keyword);
if (pair_ptr != this->units.end()) {
@@ -165,12 +165,12 @@ namespace Opm {
this->units[keyword] = unit;
}
bool UDQInput::has_unit(const std::string& keyword) const {
bool UDQConfig::has_unit(const std::string& keyword) const {
return (this->units.count(keyword) > 0);
}
bool UDQInput::has_keyword(const std::string& keyword) const {
bool UDQConfig::has_keyword(const std::string& keyword) const {
if (this->m_assignments.count(keyword) > 0)
return true;
@@ -188,7 +188,7 @@ namespace Opm {
}
const UDQFunctionTable& UDQInput::function_table() const {
const UDQFunctionTable& UDQConfig::function_table() const {
return this->udqft;
}
}

View File

@@ -34,8 +34,8 @@
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp>

View File

@@ -26,7 +26,7 @@ Copyright 2018 Statoil ASA.
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQInput.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQSet.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQAssign.hpp>