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 local_solve_time = 0.0;
45 double update_time = 0.0;
46 double output_write_time = 0.0;
47
48 unsigned int total_well_iterations = 0;
49 unsigned int total_linearizations = 0;
50 unsigned int total_newton_iterations = 0;
51 unsigned int total_linear_iterations = 0;
52 unsigned int min_linear_iterations = std::numeric_limits<unsigned int>::max();
53 unsigned int max_linear_iterations = 0;
54
55 bool converged = false;
56 bool time_step_rejected = false;
58 int exit_status = EXIT_SUCCESS;
59
60 double global_time = 0.0;
61 double timestep_length = 0.0;
62
63 // NLDD specific data
64 int num_domains = 0;
65 int num_wells = 0;
72
74
79 void reportStep(std::ostream& os) const;
81 void reportFullyImplicit(std::ostream& os, const SimulatorReportSingle* failedReport = nullptr) const;
82 void reportNLDD(std::ostream& os, const SimulatorReportSingle* failedReport = nullptr) const;
83 template<class Serializer>
84 void serializeOp(Serializer& serializer)
85 {
86 serializer(pressure_time);
87 serializer(transport_time);
88 serializer(total_time);
89 serializer(solver_time);
90 serializer(assemble_time);
91 serializer(pre_post_time);
92 serializer(assemble_time_well);
93 serializer(linear_solve_setup_time);
94 serializer(linear_solve_time);
95 serializer(local_solve_time);
96 serializer(update_time);
97 serializer(output_write_time);
98 serializer(total_well_iterations);
99 serializer(total_linearizations);
100 serializer(total_newton_iterations);
101 serializer(total_linear_iterations);
102 serializer(min_linear_iterations);
103 serializer(max_linear_iterations);
104 serializer(converged);
105 serializer(time_step_rejected);
106 serializer(well_group_control_changed);
107 serializer(exit_status);
108 serializer(global_time);
109 serializer(timestep_length);
110 serializer(num_domains);
111 serializer(num_wells);
112 serializer(num_overlap_cells);
113 serializer(num_owned_cells);
114 serializer(converged_domains);
115 serializer(unconverged_domains);
117 serializer(skipped_domains);
118 }
119 };
120
122 {
125 std::vector<SimulatorReportSingle> stepreports;
126
128
129 bool operator==(const SimulatorReport&) const;
132 void reportFullyImplicit(std::ostream& os) const;
133 void reportNLDD(std::ostream& os) const;
134 void fullReports(std::ostream& os) const;
135
136 template<class Serializer>
137 void serializeOp(Serializer& serializer)
138 {
139 serializer(success);
140 serializer(failure);
141 serializer(stepreports);
142 }
143 };
144
145 } // namespace Opm
146
147#endif // OPM_SIMULATORREPORT_HEADER_INCLUDED
Definition: blackoilboundaryratevector.hh:39
Definition: SimulatorReport.hpp:122
void fullReports(std::ostream &os) const
void reportNLDD(std::ostream &os) const
void operator+=(const SimulatorReport &sr)
static SimulatorReport serializationTestObject()
void operator+=(const SimulatorReportSingle &sr)
std::vector< SimulatorReportSingle > stepreports
Definition: SimulatorReport.hpp:125
void serializeOp(Serializer &serializer)
Definition: SimulatorReport.hpp:137
SimulatorReportSingle success
Definition: SimulatorReport.hpp:123
SimulatorReportSingle failure
Definition: SimulatorReport.hpp:124
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
int num_wells
Definition: SimulatorReport.hpp:65
int skipped_domains
Definition: SimulatorReport.hpp:71
double assemble_time
Definition: SimulatorReport.hpp:39
bool operator==(const SimulatorReportSingle &) const
void reportNLDD(std::ostream &os, const SimulatorReportSingle *failedReport=nullptr) const
double assemble_time_well
Definition: SimulatorReport.hpp:41
double solver_time
Definition: SimulatorReport.hpp:38
bool converged
Definition: SimulatorReport.hpp:55
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()
int unconverged_domains
Definition: SimulatorReport.hpp:69
unsigned int min_linear_iterations
Definition: SimulatorReport.hpp:52
int accepted_unconverged_domains
Definition: SimulatorReport.hpp:70
unsigned int total_newton_iterations
Definition: SimulatorReport.hpp:50
double transport_time
Definition: SimulatorReport.hpp:36
double global_time
Definition: SimulatorReport.hpp:60
unsigned int total_well_iterations
Definition: SimulatorReport.hpp:48
double update_time
Definition: SimulatorReport.hpp:45
int num_owned_cells
Definition: SimulatorReport.hpp:67
unsigned int max_linear_iterations
Definition: SimulatorReport.hpp:53
int num_overlap_cells
Definition: SimulatorReport.hpp:66
bool well_group_control_changed
Definition: SimulatorReport.hpp:57
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:84
double local_solve_time
Definition: SimulatorReport.hpp:44
int num_domains
Definition: SimulatorReport.hpp:64
double timestep_length
Definition: SimulatorReport.hpp:61
int exit_status
Definition: SimulatorReport.hpp:58
int converged_domains
Definition: SimulatorReport.hpp:68
bool time_step_rejected
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:46
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:49
unsigned int total_linear_iterations
Definition: SimulatorReport.hpp:51