SimulatorReport.hpp
Go to the documentation of this file.
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
23#include <cassert>
24#include <cstdlib>
25#include <iosfwd>
26#include <limits>
27#include <vector>
28
29namespace Opm
30{
31
34 {
35 double pressure_time = 0.0;
36 double transport_time = 0.0;
37 double total_time = 0.0;
38 double solver_time = 0.0;
39 double assemble_time = 0.0;
40 double pre_post_time = 0.0;
41 double assemble_time_well = 0.0;
43 double linear_solve_time = 0.0;
44 double update_time = 0.0;
45 double output_write_time = 0.0;
46
47 unsigned int total_well_iterations = 0;
48 unsigned int total_linearizations = 0;
49 unsigned int total_newton_iterations = 0;
50 unsigned int total_linear_iterations = 0;
51 unsigned int min_linear_iterations = std::numeric_limits<unsigned int>::max();
52 unsigned int max_linear_iterations = 0;
53
54 bool converged = false;
56 int exit_status = EXIT_SUCCESS;
57
58 double global_time = 0.0;
59 double timestep_length = 0.0;
60
62
67 void reportStep(std::ostream& os) const;
69 void reportFullyImplicit(std::ostream& os, const SimulatorReportSingle* failedReport = nullptr) const;
70
71 template<class Serializer>
72 void serializeOp(Serializer& serializer)
73 {
74 serializer(pressure_time);
75 serializer(transport_time);
76 serializer(total_time);
77 serializer(solver_time);
78 serializer(assemble_time);
79 serializer(pre_post_time);
80 serializer(assemble_time_well);
81 serializer(linear_solve_setup_time);
82 serializer(linear_solve_time);
83 serializer(update_time);
84 serializer(output_write_time);
85 serializer(total_well_iterations);
86 serializer(total_linearizations);
87 serializer(total_newton_iterations);
88 serializer(total_linear_iterations);
89 serializer(min_linear_iterations);
90 serializer(max_linear_iterations);
91 serializer(converged);
93 serializer(exit_status);
94 serializer(global_time);
95 serializer(timestep_length);
96 }
97 };
98
100 {
103 std::vector<SimulatorReportSingle> stepreports;
104
106
107 bool operator==(const SimulatorReport&) const;
110 void reportFullyImplicit(std::ostream& os) const;
111 void fullReports(std::ostream& os) const;
112
113 template<class Serializer>
114 void serializeOp(Serializer& serializer)
115 {
116 serializer(success);
117 serializer(failure);
118 serializer(stepreports);
119 }
120 };
121
122 } // namespace Opm
123
124#endif // OPM_SIMULATORREPORT_HEADER_INCLUDED
Definition: BlackoilPhases.hpp:27
Definition: SimulatorReport.hpp:100
void fullReports(std::ostream &os) const
void operator+=(const SimulatorReport &sr)
static SimulatorReport serializationTestObject()
void operator+=(const SimulatorReportSingle &sr)
std::vector< SimulatorReportSingle > stepreports
Definition: SimulatorReport.hpp:103
void serializeOp(Serializer &serializer)
Definition: SimulatorReport.hpp:114
SimulatorReportSingle success
Definition: SimulatorReport.hpp:101
SimulatorReportSingle failure
Definition: SimulatorReport.hpp:102
bool operator==(const SimulatorReport &) const
void reportFullyImplicit(std::ostream &os) const
A struct for returning timing data from a simulator to its caller.
Definition: SimulatorReport.hpp:34
double linear_solve_time
Definition: SimulatorReport.hpp:43
double assemble_time
Definition: SimulatorReport.hpp:39
bool operator==(const SimulatorReportSingle &) const
double assemble_time_well
Definition: SimulatorReport.hpp:41
double solver_time
Definition: SimulatorReport.hpp:38
bool converged
Definition: SimulatorReport.hpp:54
double pre_post_time
Definition: SimulatorReport.hpp:40
double total_time
Definition: SimulatorReport.hpp:37
double linear_solve_setup_time
Definition: SimulatorReport.hpp:42
static SimulatorReportSingle serializationTestObject()
unsigned int min_linear_iterations
Definition: SimulatorReport.hpp:51
unsigned int total_newton_iterations
Definition: SimulatorReport.hpp:49
double transport_time
Definition: SimulatorReport.hpp:36
double global_time
Definition: SimulatorReport.hpp:58
unsigned int total_well_iterations
Definition: SimulatorReport.hpp:47
double update_time
Definition: SimulatorReport.hpp:44
unsigned int max_linear_iterations
Definition: SimulatorReport.hpp:52
bool well_group_control_changed
Definition: SimulatorReport.hpp:55
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...
void serializeOp(Serializer &serializer)
Definition: SimulatorReport.hpp:72
double timestep_length
Definition: SimulatorReport.hpp:59
int exit_status
Definition: SimulatorReport.hpp:56
void reportStep(std::ostream &os) const
Print a report suitable for a single simulation step.
double output_write_time
Definition: SimulatorReport.hpp:45
double pressure_time
Definition: SimulatorReport.hpp:35
void operator+=(const SimulatorReportSingle &sr)
Increment this report's times by those in sr.
unsigned int total_linearizations
Definition: SimulatorReport.hpp:48
unsigned int total_linear_iterations
Definition: SimulatorReport.hpp:50