My Project
SimulatorReport.hpp
1 /*
2  Copyright 2012, 2020 SINTEF Digital, Mathematics and Cybernetics.
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_SIMULATORREPORT_HEADER_INCLUDED
21 #define OPM_SIMULATORREPORT_HEADER_INCLUDED
22 #include <cassert>
23 #include <iosfwd>
24 #include <vector>
25 
26 namespace Opm
27 {
28 
31  {
32  double pressure_time;
33  double transport_time;
34  double total_time;
35  double solver_time;
36  double assemble_time;
37  double pre_post_time;
38  double assemble_time_well;
39  double linear_solve_setup_time;
40  double linear_solve_time;
41  double update_time;
42  double output_write_time;
43 
44  unsigned int total_well_iterations;
45  unsigned int total_linearizations;
46  unsigned int total_newton_iterations;
47  unsigned int total_linear_iterations;
48  unsigned int min_linear_iterations;
49  unsigned int max_linear_iterations;
50 
51 
52  bool converged;
53  bool well_group_control_changed;
54  int exit_status;
55 
56  double global_time;
57  double timestep_length;
58 
62  void operator+=(const SimulatorReportSingle& sr);
64  void reportStep(std::ostringstream& os) const;
66  void reportFullyImplicit(std::ostream& os, const SimulatorReportSingle* failedReport = nullptr) const;
67  };
68 
70  {
71  SimulatorReportSingle success;
72  SimulatorReportSingle failure;
73  std::vector<SimulatorReportSingle> stepreports;
74 
75  void operator+=(const SimulatorReportSingle& sr);
76  void operator+=(const SimulatorReport& sr);
77  void reportFullyImplicit(std::ostream& os) const;
78  void fullReports(std::ostream& os) const;
79  };
80 
81  } // namespace Opm
82 
83 #endif // OPM_SIMULATORREPORT_HEADER_INCLUDED
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27
A struct for returning timing data from a simulator to its caller.
Definition: SimulatorReport.hpp:31
SimulatorReportSingle()
Default constructor initializing all times to 0.0.
Definition: SimulatorReport.cpp:34
void reportStep(std::ostringstream &os) const
Print a report suitable for a single simulation step.
Definition: SimulatorReport.cpp:89
void reportFullyImplicit(std::ostream &os, const SimulatorReportSingle *failedReport=nullptr) const
Print a report suitable for the end of a fully implicit case, leaving out the pressure/transport time...
Definition: SimulatorReport.cpp:102
void operator+=(const SimulatorReportSingle &sr)
Increment this report's times by those in sr.
Definition: SimulatorReport.cpp:60
Definition: SimulatorReport.hpp:70