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
76
81 void reportStep(std::ostream& os) const;
83 void reportFullyImplicit(std::ostream& os, const SimulatorReportSingle* failedReport = nullptr) const;
84 void reportNLDD(std::ostream& os, const SimulatorReportSingle* failedReport = nullptr) const;
85 template<class Serializer>
86 void serializeOp(Serializer& serializer)
87 {
88 serializer(pressure_time);
89 serializer(transport_time);
90 serializer(total_time);
91 serializer(solver_time);
92 serializer(assemble_time);
93 serializer(pre_post_time);
94 serializer(assemble_time_well);
95 serializer(linear_solve_setup_time);
96 serializer(linear_solve_time);
97 serializer(local_solve_time);
98 serializer(update_time);
99 serializer(output_write_time);
100 serializer(total_well_iterations);
101 serializer(total_linearizations);
102 serializer(total_newton_iterations);
103 serializer(total_linear_iterations);
104 serializer(min_linear_iterations);
105 serializer(max_linear_iterations);
106 serializer(relaxed_cnv_acceptances);
107 serializer(converged);
108 serializer(time_step_rejected);
109 serializer(well_group_control_changed);
110 serializer(exit_status);
111 serializer(global_time);
112 serializer(timestep_length);
113 serializer(num_domains);
114 serializer(num_wells);
115 serializer(num_overlap_cells);
116 serializer(num_owned_cells);
117 serializer(converged_domains);
118 serializer(unconverged_domains);
120 serializer(skipped_domains);
121 }
122 };
123
125 {
128 std::vector<SimulatorReportSingle> stepreports;
129
131
132 bool operator==(const SimulatorReport&) const;
135 void reportFullyImplicit(std::ostream& os) const;
136 void reportNLDD(std::ostream& os) const;
137 void fullReports(std::ostream& os) const;
138
139 template<class Serializer>
140 void serializeOp(Serializer& serializer)
141 {
142 serializer(success);
143 serializer(failure);
144 serializer(stepreports);
145 }
146 };
147
148 } // namespace Opm
149
150#endif // OPM_SIMULATORREPORT_HEADER_INCLUDED
Definition: blackoilbioeffectsmodules.hh:45
Definition: SimulatorReport.hpp:125
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:128
void serializeOp(Serializer &serializer)
Definition: SimulatorReport.hpp:140
SimulatorReportSingle success
Definition: SimulatorReport.hpp:126
SimulatorReportSingle failure
Definition: SimulatorReport.hpp:127
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:67
int skipped_domains
Definition: SimulatorReport.hpp:73
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
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: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 update_time
Definition: SimulatorReport.hpp:45
int num_owned_cells
Definition: SimulatorReport.hpp:69
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
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:86
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 output_write_time
Definition: SimulatorReport.hpp:46
unsigned int relaxed_cnv_acceptances
Definition: SimulatorReport.hpp:55
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