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> 41 inline void writeJsonToStream(
const std::vector<Opm::PropertyTree>& prms, std::ostream& os)
44 for (
const auto& p : prms) {
45 writeJsonToStream(p, os);
59 template <
class VectorOrSingle,
class Comm>
61 printLinearSolverParameters(
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());
89 printLinearSolverParameters(
const std::vector<FlowLinearSolverParameters>& parameters,
91 const std::vector<Opm::PropertyTree>& prm,
94 printLinearSolverParameters(parameters[activeSolverNum], prm, comm);
99 #endif // OPM_PRINTLINEARSOLVERPARAMETERS_HEADER_INCLUDED Definition: alignedallocator.hh:32
void write_json(std::ostream &os, bool pretty) const
Emit a textual representation of the property tree in JSON form.
Definition: PropertyTree.cpp:76
Hierarchical collection of key/value pairs.
Definition: PropertyTree.hpp:38