Skip to content

Commit

Permalink
Merge pull request #189 from joakim-hove/empty-region
Browse files Browse the repository at this point in the history
Will write (incorrect) TCPU to summary files.
  • Loading branch information
joakim-hove committed Jun 2, 2017
2 parents fbb34c5 + 9001c8f commit b5d8b43
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
7 changes: 7 additions & 0 deletions opm/output/eclipse/Summary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 > >
Expand Down Expand Up @@ -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}
};


Expand Down
14 changes: 14 additions & 0 deletions tests/test_Summary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ));
}

0 comments on commit b5d8b43

Please sign in to comment.