16#ifndef OPM_PRINTLINEARSOLVERPARAMETERS_HEADER_INCLUDED
17#define OPM_PRINTLINEARSOLVERPARAMETERS_HEADER_INCLUDED
22#include <opm/common/OpmLog/OpmLog.hpp>
23#include <opm/simulators/linalg/FlowLinearSolverParameters.hpp>
24#include <opm/simulators/linalg/PropertyTree.hpp>
32inline void writeJsonToStream(
const Opm::PropertyTree& prm, std::ostream& os)
41inline void writeJsonToStream(
const std::vector<Opm::PropertyTree>& prms, std::ostream& os)
44 for (
const auto& p : prms) {
45 writeJsonToStream(p, os);
59template <
class VectorOrSingle,
class Comm>
61printLinearSolverParameters(
const FlowLinearSolverParameters& parameters,
62 const VectorOrSingle& prm,
66 const bool on_io_rank = comm.rank() == 0;
67 if (on_io_rank && parameters.linear_solver_print_json_definition_) {
68 std::ostringstream os;
69 os <<
"\nProperty tree for linear solvers:\n";
70 writeJsonToStream(prm, os);
72 OpmLog::note(os.str());
89printLinearSolverParameters(
const std::vector<FlowLinearSolverParameters>& parameters,
91 const std::vector<Opm::PropertyTree>& prm,
94 printLinearSolverParameters(parameters[activeSolverNum], prm, comm);
void write_json(std::ostream &os, bool pretty) const
Emit a textual representation of the property tree in JSON form.
Definition PropertyTree.cpp:76