All Classes Functions Variables
Summary.hpp
1 /*
2  Copyright 2016 Statoil ASA.
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
20 #ifndef OPM_OUTPUT_SUMMARY_HPP
21 #define OPM_OUTPUT_SUMMARY_HPP
22 
23 #include <string>
24 #include <vector>
25 #include <unordered_map>
26 
27 #include <ert/ecl/ecl_sum.h>
28 #include <ert/ecl/Smspec.hpp>
29 
30 #include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
31 
32 #include <opm/output/data/Wells.hpp>
33 #include <opm/output/data/Cells.hpp>
34 #include <opm/output/data/Solution.hpp>
35 #include <opm/output/eclipse/RegionCache.hpp>
36 
37 namespace Opm {
38 
39  class EclipseState;
40  class Schedule;
41  class SummaryConfig;
42  class EclipseGrid;
43 
44 namespace out {
45 
46 class Summary {
47  public:
48  Summary( const EclipseState&, const SummaryConfig&, const EclipseGrid& );
49  Summary( const EclipseState&, const SummaryConfig&, const EclipseGrid&, const std::string& );
50  Summary( const EclipseState&, const SummaryConfig&, const EclipseGrid&, const char* basename );
51 
52  void add_timestep( int report_step,
53  double secs_elapsed,
54  const EclipseState& es,
55  const data::Wells&,
56  const data::Solution&,
57  const std::map<std::string, double>& misc_values);
58 
59  void set_initial( const data::Solution& );
60  void write();
61 
62  ~Summary();
63 
64  private:
65  class keyword_handlers;
66 
67  const EclipseGrid& grid;
68  out::RegionCache regionCache;
69  ERT::ert_unique_ptr< ecl_sum_type, ecl_sum_free > ecl_sum;
70  std::unique_ptr< keyword_handlers > handlers;
71  const ecl_sum_tstep_type* prev_tstep = nullptr;
72  double prev_time_elapsed = 0;
73  double initial_oip = 0.0;
74  const std::vector<double> porv;
75 };
76 
77 }
78 }
79 
80 #endif //OPM_OUTPUT_SUMMARY_HPP
Definition: Solution.hpp:32
Definition: Summary.hpp:46
Definition: Summary.cpp:803
Definition: Wells.hpp:109
Definition: RegionCache.hpp:30