My Project
Loading...
Searching...
No Matches
SimulatorReport.hpp
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;
42 double linear_solve_setup_time = 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 well_group_control_changed = false;
57 int exit_status = EXIT_SUCCESS;
58
59 double global_time = 0.0;
60 double timestep_length = 0.0;
61
62 // NLDD specific data
63 int num_domains = 0;
64 int num_wells = 0;
65 int num_overlap_cells = 0;
66 int num_owned_cells = 0;
67 int converged_domains = 0;
68 int unconverged_domains = 0;
69 int accepted_unconverged_domains = 0;
70
71
72 static SimulatorReportSingle serializationTestObject();
73
74 bool operator==(const SimulatorReportSingle&) const;
78 void reportStep(std::ostream& os) const;
80 void reportFullyImplicit(std::ostream& os, const SimulatorReportSingle* failedReport = nullptr) const;
81 void reportNLDD(std::ostream& os, const SimulatorReportSingle* failedReport = nullptr) const;
82 template<class Serializer>
83 void serializeOp(Serializer& serializer)
84 {
85 serializer(pressure_time);
86 serializer(transport_time);
87 serializer(total_time);
88 serializer(solver_time);
89 serializer(assemble_time);
90 serializer(pre_post_time);
91 serializer(assemble_time_well);
92 serializer(linear_solve_setup_time);
93 serializer(linear_solve_time);
94 serializer(local_solve_time);
95 serializer(update_time);
96 serializer(output_write_time);
97 serializer(total_well_iterations);
98 serializer(total_linearizations);
99 serializer(total_newton_iterations);
100 serializer(total_linear_iterations);
101 serializer(min_linear_iterations);
102 serializer(max_linear_iterations);
103 serializer(converged);
104 serializer(well_group_control_changed);
105 serializer(exit_status);
106 serializer(global_time);
107 serializer(timestep_length);
108 serializer(num_domains);
109 serializer(num_wells);
110 serializer(num_overlap_cells);
111 serializer(num_owned_cells);
112 serializer(converged_domains);
113 serializer(unconverged_domains);
114 serializer(accepted_unconverged_domains);
115 }
116 };
117
119 {
120 SimulatorReportSingle success;
121 SimulatorReportSingle failure;
122 std::vector<SimulatorReportSingle> stepreports;
123
124 static SimulatorReport serializationTestObject();
125
126 bool operator==(const SimulatorReport&) const;
127 void operator+=(const SimulatorReportSingle& sr);
128 void operator+=(const SimulatorReport& sr);
129 void reportFullyImplicit(std::ostream& os) const;
130 void reportNLDD(std::ostream& os) const;
131 void fullReports(std::ostream& os) const;
132
133 template<class Serializer>
134 void serializeOp(Serializer& serializer)
135 {
136 serializer(success);
137 serializer(failure);
138 serializer(stepreports);
139 }
140 };
141
142 } // namespace Opm
143
144#endif // OPM_SIMULATORREPORT_HEADER_INCLUDED
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
A struct for returning timing data from a simulator to its caller.
Definition SimulatorReport.hpp:34
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...
Definition SimulatorReport.cpp:131
void reportStep(std::ostream &os) const
Print a report suitable for a single simulation step.
Definition SimulatorReport.cpp:110
void operator+=(const SimulatorReportSingle &sr)
Increment this report's times by those in sr.
Definition SimulatorReport.cpp:76
Definition SimulatorReport.hpp:119