From ac70c34c68f7c985f284e8e3cf63db0ab21f4374 Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Tue, 30 May 2017 06:33:46 +0200 Subject: [PATCH] Write (incorect) TCPU value to summary files. --- src/opm/output/eclipse/Summary.cpp | 7 +++++++ tests/test_Summary.cpp | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/opm/output/eclipse/Summary.cpp b/src/opm/output/eclipse/Summary.cpp index 0450d64f2..e0a4f6b06 100644 --- a/src/opm/output/eclipse/Summary.cpp +++ b/src/opm/output/eclipse/Summary.cpp @@ -479,6 +479,10 @@ quantity bsgas( const fn_args& args) { } +quantity extra_time( const fn_args& args) { + return { 0.0, measure::time }; +} + template< typename F, typename G > auto mul( F f, G g ) -> bin_op< F, G, std::multiplies< quantity > > @@ -732,6 +736,9 @@ static const std::unordered_map< std::string, ofun > funs = { {"BWSAT" , bswat}, {"BSGAS" , bsgas}, {"BGSAS" , bsgas}, + + /* Misc keywords, the 'extra' handlers will only set the value 0 - with the correct dimension*/ + {"TCPU" , extra_time} }; diff --git a/tests/test_Summary.cpp b/tests/test_Summary.cpp index 604a45e39..a083f19ea 100644 --- a/tests/test_Summary.cpp +++ b/tests/test_Summary.cpp @@ -899,3 +899,17 @@ BOOST_AUTO_TEST_CASE(fpr) { } + +BOOST_AUTO_TEST_CASE(MISC) { + setup cfg( "test_MISC"); + + out::Summary writer( cfg.es, cfg.config, cfg.grid , cfg.name ); + writer.add_timestep( 0, 0 * day, cfg.es, cfg.wells , cfg.solution); + writer.add_timestep( 1, 1 * day, cfg.es, cfg.wells , cfg.solution); + writer.add_timestep( 2, 2 * day, cfg.es, cfg.wells , cfg.solution); + writer.write(); + + auto res = readsum( cfg.name ); + const auto* resp = res.get(); + BOOST_CHECK( ecl_sum_has_key( resp , "TCPU" )); +}