Write (incorect) TCPU value to summary files.

This commit is contained in:
Joakim Hove 2017-05-30 06:33:46 +02:00
parent 976a963f7a
commit ac70c34c68
2 changed files with 21 additions and 0 deletions

View File

@ -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}
};

View File

@ -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" ));
}