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 
49  bool converged;
50  int exit_status;
51 
52  double global_time;
53  double timestep_length;
54 
58  void operator+=(const SimulatorReportSingle& sr);
60  void reportStep(std::ostringstream& os) const;
62  void reportFullyImplicit(std::ostream& os, const SimulatorReportSingle* failedReport = nullptr) const;
63  };
64 
66  {
67  SimulatorReportSingle success;
68  SimulatorReportSingle failure;
69  std::vector<SimulatorReportSingle> stepreports;
70 
71  void operator+=(const SimulatorReportSingle& sr);
72  void operator+=(const SimulatorReport& sr);
73  void reportFullyImplicit(std::ostream& os) const;
74  void fullReports(std::ostream& os) const;
75  };
76 
77  } // namespace Opm
78 
79 #endif // OPM_SIMULATORREPORT_HEADER_INCLUDED
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:26
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:33
void reportStep(std::ostringstream &os) const
Print a report suitable for a single simulation step.
Definition: SimulatorReport.cpp:80
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:93
void operator+=(const SimulatorReportSingle &sr)
Increment this report's times by those in sr.
Definition: SimulatorReport.cpp:56
Definition: SimulatorReport.hpp:66