SimulatorConvergenceOutput.hpp
Go to the documentation of this file.
1/*
2 Copyright 2013, 2015, 2020 SINTEF Digital, Mathematics and Cybernetics.
3 Copyright 2015 Andreas Lauser
4 Copyright 2017 IRIS
5
6 This file is part of the Open Porous Media project (OPM).
7
8 OPM is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 OPM is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with OPM. If not, see <http://www.gnu.org/licenses/>.
20*/
21
22#ifndef OPM_SIMULATOR_CONVERGENCE_OUTPUT_HEADER_INCLUDED
23#define OPM_SIMULATOR_CONVERGENCE_OUTPUT_HEADER_INCLUDED
24
26
27#include <cstddef>
28#include <optional>
29#include <string_view>
30#include <thread>
31#include <vector>
32
33namespace Opm {
34
35 class EclipseState;
36 struct StepReport;
37
38} // namespace Opm
39
40namespace Opm {
41
44{
45public:
61 void startThread(const EclipseState& eclState,
62 std::string_view convOutputOptions,
63 std::string_view optionName,
65
77 void write(const std::vector<StepReport>& reports);
78
83 void endThread();
84
85private:
87 std::vector<StepReport>::size_type alreadyReportedSteps_ = 0;
88
94 std::optional<ConvergenceReportQueue> convergenceOutputQueue_{};
95
100 std::optional<ConvergenceOutputThread> convergenceOutputObject_{};
101
109 std::optional<std::thread> convergenceOutputThread_{};
110};
111
112} // namespace Opm
113
114#endif // OPM_SIMULATOR_CONVERGENCE_OUTPUT_HEADER_INCLUDED
std::function< std::string_view(int)> ComponentToPhaseName
Definition: ExtraConvergenceOutputThread.hpp:109
Class handling convergence history output for a simulator.
Definition: SimulatorConvergenceOutput.hpp:44
void write(const std::vector< StepReport > &reports)
void startThread(const EclipseState &eclState, std::string_view convOutputOptions, std::string_view optionName, ConvergenceOutputThread::ComponentToPhaseName getPhaseName)
Definition: blackoilboundaryratevector.hh:39