diff --git a/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp b/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp index b18561d73..35cf9a3d4 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.hpp @@ -34,7 +34,7 @@ namespace Opm { class UDQContext{ public: - UDQContext(const UDQParams& params, const UDQFunctionTable& udqft, const SummaryState& summary_state); + UDQContext(const UDQFunctionTable& udqft, const SummaryState& summary_state); double get(const std::string& key) const; bool has_well_var(const std::string& well, const std::string& var) const; double get_well_var(const std::string& well, const std::string& var) const; @@ -45,7 +45,6 @@ namespace Opm { std::vector wells() const; std::vector groups() const; private: - const UDQParams& params; const UDQFunctionTable& udqft; const SummaryState& summary_state; std::unordered_map values; diff --git a/src/opm/output/eclipse/Summary.cpp b/src/opm/output/eclipse/Summary.cpp index b1a40158f..6091a13c9 100644 --- a/src/opm/output/eclipse/Summary.cpp +++ b/src/opm/output/eclipse/Summary.cpp @@ -1170,7 +1170,7 @@ void eval_udq(const Schedule& schedule, std::size_t sim_step, SummaryState& st) { const UDQConfig& udq = schedule.getUDQConfig(sim_step); const auto& func_table = udq.function_table(); - UDQContext context(udq.params(), func_table, st); + UDQContext context(func_table, st); std::vector wells; for (const auto& well_name : schedule.wellNames()) wells.push_back(well_name); diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.cpp index 1fd68d864..6485ff80f 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQContext.cpp @@ -24,8 +24,7 @@ namespace Opm { - UDQContext::UDQContext(const UDQParams& params_arg, const UDQFunctionTable& udqft_arg, const SummaryState& summary_state_arg) : - params(params_arg), + UDQContext::UDQContext(const UDQFunctionTable& udqft_arg, const SummaryState& summary_state_arg) : udqft(udqft_arg), summary_state(summary_state_arg) { diff --git a/tests/parser/UDQTests.cpp b/tests/parser/UDQTests.cpp index a40ca463d..325fdff71 100644 --- a/tests/parser/UDQTests.cpp +++ b/tests/parser/UDQTests.cpp @@ -55,7 +55,7 @@ BOOST_AUTO_TEST_CASE(MIX_SCALAR) { UDQParams udqp; UDQDefine def_add(udqp, "WU", {"WOPR", "+", "1"}); SummaryState st; - UDQContext context(UDQParams(), udqft, st); + UDQContext context(udqft, st); st.update_well_var("P1", "WOPR", 1); @@ -78,7 +78,7 @@ BOOST_AUTO_TEST_CASE(UDQFieldSetTest) { UDQDefine def_fxxx(udqp, "FU_SCALAR", {"123"}); UDQDefine def_fopr(udqp, "FUOPR", {"SUM", "(", "WOPR", ")"}); SummaryState st; - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("P1", "WOPR", 1.0); st.update_well_var("P2", "WOPR", 2.0); @@ -150,7 +150,7 @@ BOOST_AUTO_TEST_CASE(UDQ_GROUP_TEST) { UDQFunctionTable udqft(udqp); UDQDefine def_fopr(udqp, "FUOPR", {"SUM", "(", "GOPR", ")"}); SummaryState st; - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_group_var("G1", "GOPR", 1.0); st.update_group_var("G2", "GOPR", 2.0); @@ -171,7 +171,7 @@ BOOST_AUTO_TEST_CASE(UDQ_DEFINETEST) { { UDQDefine def(udqp, "WUBHP", {"WBHP"}); SummaryState st; - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("W1", "WBHP", 11); st.update_well_var("W2", "WBHP", 2); @@ -185,7 +185,7 @@ BOOST_AUTO_TEST_CASE(UDQ_DEFINETEST) { { UDQDefine def(udqp, "WUBHP", {"WBHP" , "'P*'"}); SummaryState st; - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("P1", "WBHP", 1); @@ -202,7 +202,7 @@ BOOST_AUTO_TEST_CASE(UDQ_DEFINETEST) { { UDQDefine def(udqp, "WUBHP", {"NINT" , "(", "WBHP", ")"}); SummaryState st; - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("P1", "WBHP", 4); st.update_well_var("P2", "WBHP", 3); st.update_well_var("I1", "WBHP", 2); @@ -440,7 +440,7 @@ BOOST_AUTO_TEST_CASE(UDQ_CONTEXT) { SummaryState st; UDQFunctionTable func_table; UDQParams udqp; - UDQContext ctx(udqp, func_table, st); + UDQContext ctx(func_table, st); BOOST_CHECK_EQUAL(ctx.get("JAN"), 1.0); BOOST_REQUIRE_THROW(ctx.get("NO_SUCH_KEY"), std::out_of_range); @@ -847,7 +847,7 @@ BOOST_AUTO_TEST_CASE(UDQ_POW_TEST) { UDQDefine def_pow1(udqp, "WU", {"WOPR", "+", "WWPR", "*", "WGOR", "^", "WWIR"}); UDQDefine def_pow2(udqp, "WU", {"(", "WOPR", "+", "WWPR", ")", "^", "(", "WOPR", "+" , "WGOR", "*", "WWIR", "-", "WOPT", ")"}); SummaryState st; - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("P1", "WOPR", 1); st.update_well_var("P1", "WWPR", 2); @@ -866,7 +866,7 @@ BOOST_AUTO_TEST_CASE(UDQ_CMP_TEST) { UDQParams udqp; UDQDefine def_cmp(udqp, "WU", {"WOPR", ">", "WWPR", "+", "WGOR", "*", "WWIR"}); SummaryState st; - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("P1", "WOPR", 0); st.update_well_var("P1", "WWPR", 10); @@ -893,7 +893,7 @@ BOOST_AUTO_TEST_CASE(UDQ_SCALAR_SET) { UDQParams udqp; UDQFunctionTable udqft; SummaryState st; - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("P1", "WOPR", 1); st.update_well_var("P2", "WOPR", 2); @@ -964,7 +964,7 @@ BOOST_AUTO_TEST_CASE(UDQ_BASIC_MATH_TEST) { UDQDefine def_muladd(udqp , "WUX", {"WOPR", "+", "WOPR", "*", "WOPR"}); UDQDefine def_wuwct(udqp , "WUWCT", {"WWPR", "/", "(", "WOPR", "+", "WWPR", ")"}); SummaryState st; - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("P1", "WOPR", 1); st.update_well_var("P2", "WOPR", 2); @@ -1024,7 +1024,7 @@ BOOST_AUTO_TEST_CASE(DECK_TEST) { UDQFunctionTable udqft(udqp); UDQDefine def(udqp, "WUOPRL", {"(", "WOPR", "OP1", "-", "150", ")", "*", "0.90"}); SummaryState st; - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("OP1", "WOPR", 300); st.update_well_var("OP2", "WOPR", 3000); @@ -1057,7 +1057,7 @@ BOOST_AUTO_TEST_CASE(UDQ_PARSE_ERROR) { UDQDefine def1(udqp, "WUBHP", tokens, parseContext, errors); SummaryState st; UDQFunctionTable udqft(udqp); - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("P1", "WBHP", 1); auto res = def1.eval(context); @@ -1081,7 +1081,7 @@ BOOST_AUTO_TEST_CASE(UDQ_TYPE_ERROR) { SummaryState st; UDQFunctionTable udqft(udqp); - UDQContext context(udqp, udqft, st); + UDQContext context(udqft, st); st.update_well_var("P1", "WBHP", 1); st.update_well_var("P2", "WBHP", 2); @@ -1230,7 +1230,6 @@ UDQ const auto& input = udq.input(); - const auto& def = udq.definitions(); BOOST_CHECK_EQUAL(input.size(), 5); BOOST_CHECK_EQUAL(udq.size(), 5);