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 // Accepted substeps whose CNV criterion was met only under a relaxed tolerance.
55 unsigned int relaxed_cnv_acceptances = 0;
56
57 bool converged = false;
58 bool time_step_rejected = false;
60 int exit_status = EXIT_SUCCESS;
61
62 double global_time = 0.0;
63 double timestep_length = 0.0;
64
65 // NLDD specific data
66 int num_domains = 0;
67 int num_wells = 0;
74
77 double props_time = 0.0;
83 double output_eval_time = 0.0;
85 double tracer_solve_time = 0.0;
95 double precond_setup_time = 0.0;
98 double precond_apply_time = 0.0;
103 double well_solve_time = 0.0;
111 double gaslift_time = 0.0;
115 double well_facility_time = 0.0;
119 double group_control_time = 0.0;
126 unsigned int total_network_iterations = 0;
127
129
134 void reportStep(std::ostream& os) const;
137 void reportFullyImplicit(std::ostream& os,
138 const SimulatorReportSingle* failedReport = nullptr,
139 bool performance_details = false) const;
140 void reportNLDD(std::ostream& os, const SimulatorReportSingle* failedReport = nullptr) const;
141 template<class Serializer>
142 void serializeOp(Serializer& serializer)
143 {
144 serializer(pressure_time);
145 serializer(transport_time);
146 serializer(total_time);
147 serializer(solver_time);
148 serializer(assemble_time);
149 serializer(pre_post_time);
150 serializer(assemble_time_well);
151 serializer(linear_solve_setup_time);
152 serializer(linear_solve_time);
153 serializer(local_solve_time);
154 serializer(update_time);
155 serializer(output_write_time);
156 serializer(total_well_iterations);
157 serializer(total_linearizations);
158 serializer(total_newton_iterations);
159 serializer(total_linear_iterations);
160 serializer(min_linear_iterations);
161 serializer(max_linear_iterations);
162 serializer(relaxed_cnv_acceptances);
163 serializer(converged);
164 serializer(time_step_rejected);
165 serializer(well_group_control_changed);
166 serializer(exit_status);
167 serializer(global_time);
168 serializer(timestep_length);
169 serializer(num_domains);
170 serializer(num_wells);
171 serializer(num_overlap_cells);
172 serializer(num_owned_cells);
173 serializer(converged_domains);
174 serializer(unconverged_domains);
176 serializer(skipped_domains);
177 serializer(props_time);
178 serializer(convergence_check_time);
179 serializer(output_eval_time);
180 serializer(tracer_solve_time);
181 serializer(temperature_solve_time);
182 serializer(output_disk_write_time);
183 serializer(linear_solve_apply_time);
184 serializer(precond_setup_time);
185 serializer(precond_apply_time);
186 serializer(well_solve_time);
187 serializer(well_potential_solve_time);
188 serializer(well_solve_assemble_time);
190 serializer(well_control_network_time);
191 serializer(gaslift_time);
192 serializer(well_facility_time);
193 serializer(group_control_time);
194 serializer(network_balance_time);
195 serializer(control_well_solve_time);
197 serializer(total_network_iterations);
198 }
199 };
200
202 {
205 std::vector<SimulatorReportSingle> stepreports;
206
208
209 bool operator==(const SimulatorReport&) const;
212 void reportFullyImplicit(std::ostream& os, bool performance_details = false) const;
213 void reportNLDD(std::ostream& os) const;
214 void fullReports(std::ostream& os) const;
215
216 template<class Serializer>
217 void serializeOp(Serializer& serializer)
218 {
219 serializer(success);
220 serializer(failure);
221 serializer(stepreports);
222 }
223 };
224
225 } // namespace Opm
226
227#endif // OPM_SIMULATORREPORT_HEADER_INCLUDED
Definition: blackoilbioeffectsmodules.hh:45
Definition: SimulatorReport.hpp:202
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)
void reportFullyImplicit(std::ostream &os, bool performance_details=false) const
std::vector< SimulatorReportSingle > stepreports
Definition: SimulatorReport.hpp:205
void serializeOp(Serializer &serializer)
Definition: SimulatorReport.hpp:217
SimulatorReportSingle success
Definition: SimulatorReport.hpp:203
SimulatorReportSingle failure
Definition: SimulatorReport.hpp:204
bool operator==(const SimulatorReport &) 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:67
int skipped_domains
Definition: SimulatorReport.hpp:73
void reportFullyImplicit(std::ostream &os, const SimulatorReportSingle *failedReport=nullptr, bool performance_details=false) const
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:57
unsigned int total_well_potential_iterations
Definition: SimulatorReport.hpp:125
double pre_post_time
Definition: SimulatorReport.hpp:40
double total_time
Definition: SimulatorReport.hpp:37
double linear_solve_setup_time
Definition: SimulatorReport.hpp:42
double precond_apply_time
Definition: SimulatorReport.hpp:98
double well_solve_time
Definition: SimulatorReport.hpp:103
double temperature_solve_time
Definition: SimulatorReport.hpp:88
static SimulatorReportSingle serializationTestObject()
int unconverged_domains
Definition: SimulatorReport.hpp:71
unsigned int min_linear_iterations
Definition: SimulatorReport.hpp:52
int accepted_unconverged_domains
Definition: SimulatorReport.hpp:72
unsigned int total_newton_iterations
Definition: SimulatorReport.hpp:50
double transport_time
Definition: SimulatorReport.hpp:36
double global_time
Definition: SimulatorReport.hpp:62
unsigned int total_well_iterations
Definition: SimulatorReport.hpp:48
double gaslift_time
Part of well_control_network_time used for gas lift optimization.
Definition: SimulatorReport.hpp:111
double update_time
Definition: SimulatorReport.hpp:45
double well_facility_time
Definition: SimulatorReport.hpp:115
unsigned int total_network_iterations
Definition: SimulatorReport.hpp:126
int num_owned_cells
Definition: SimulatorReport.hpp:69
double convergence_check_time
Definition: SimulatorReport.hpp:80
unsigned int max_linear_iterations
Definition: SimulatorReport.hpp:53
int num_overlap_cells
Definition: SimulatorReport.hpp:68
bool well_group_control_changed
Definition: SimulatorReport.hpp:59
double tracer_solve_time
Part of pre_post_time used for solving the tracer equations.
Definition: SimulatorReport.hpp:85
double output_disk_write_time
Time used by the actual (possibly asynchronous) output writes.
Definition: SimulatorReport.hpp:90
double props_time
Definition: SimulatorReport.hpp:77
double precond_setup_time
Definition: SimulatorReport.hpp:95
double well_solve_assemble_time
Definition: SimulatorReport.hpp:105
void serializeOp(Serializer &serializer)
Definition: SimulatorReport.hpp:142
double network_balance_time
Part of well_control_network_time used for balancing the network.
Definition: SimulatorReport.hpp:121
double linear_solve_apply_time
Part of linear_solve_time spent in the actual solver apply.
Definition: SimulatorReport.hpp:92
double local_solve_time
Definition: SimulatorReport.hpp:44
int num_domains
Definition: SimulatorReport.hpp:66
double timestep_length
Definition: SimulatorReport.hpp:63
int exit_status
Definition: SimulatorReport.hpp:60
int converged_domains
Definition: SimulatorReport.hpp:70
bool time_step_rejected
Definition: SimulatorReport.hpp:58
void reportStep(std::ostream &os) const
Print a report suitable for a single simulation step.
double group_control_time
Definition: SimulatorReport.hpp:119
double output_write_time
Definition: SimulatorReport.hpp:46
double well_control_network_time
Definition: SimulatorReport.hpp:109
unsigned int relaxed_cnv_acceptances
Definition: SimulatorReport.hpp:55
double output_eval_time
Definition: SimulatorReport.hpp:83
double pressure_time
Definition: SimulatorReport.hpp:35
void operator+=(const SimulatorReportSingle &sr)
Increment this report's times by those in sr.
double well_potential_solve_time
Definition: SimulatorReport.hpp:104
unsigned int total_linearizations
Definition: SimulatorReport.hpp:49
double control_well_solve_time
Definition: SimulatorReport.hpp:124
double well_solve_linear_solve_time
Definition: SimulatorReport.hpp:106
unsigned int total_linear_iterations
Definition: SimulatorReport.hpp:51