SimulatorReport.hpp
1 /*
2  Copyright 2012 SINTEF ICT, Applied Mathematics.
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 
23 #include <iosfwd>
24 
25 namespace Opm
26 {
27 
30  {
31  double pressure_time;
32  double transport_time;
33  double total_time;
34  double solver_time;
35  double assemble_time;
36  double linear_solve_time;
37  double update_time;
38  double output_write_time;
39 
40  unsigned int total_well_iterations;
41  unsigned int total_linearizations;
42  unsigned int total_newton_iterations;
43  unsigned int total_linear_iterations;
44 
45  bool converged;
46 
48  SimulatorReport(bool verbose=true);
50  SimulatorReport(const SimulatorReport&) = default;
52  void operator+=(const SimulatorReport& sr);
54  void report(std::ostream& os);
56  void reportFullyImplicit(std::ostream& os, const SimulatorReport* failedReport = nullptr);
57  void reportParam(std::ostream& os);
58  private:
59  // Whether to print statistics to std::cout
60  bool verbose_;
61  };
62 
63 } // namespace Opm
64 
65 #endif // OPM_SIMULATORREPORT_HEADER_INCLUDED
void reportFullyImplicit(std::ostream &os, const SimulatorReport *failedReport=nullptr)
Print a report, leaving out the transport time.
Definition: SimulatorReport.cpp:73
Definition: AnisotropicEikonal.cpp:446
void report(std::ostream &os)
Print a report to the given stream.
Definition: SimulatorReport.cpp:60
void operator+=(const SimulatorReport &sr)
Increment this report&#39;s times by those in sr.
Definition: SimulatorReport.cpp:44
A struct for returning timing data from a simulator to its caller.
Definition: SimulatorReport.hpp:29
SimulatorReport(bool verbose=true)
Default constructor initializing all times to 0.0.
Definition: SimulatorReport.cpp:26