20#ifndef OPM_WRITESYSTEMMATRIXHELPER_HEADER_INCLUDED
21#define OPM_WRITESYSTEMMATRIXHELPER_HEADER_INCLUDED
23#include <dune/istl/matrixmarket.hh>
24#include <opm/simulators/linalg/MatrixMarketSpecializations.hpp>
33 template <
class SimulatorType,
class MatrixType,
class VectorType,
class Communicator>
35 const MatrixType& matrix,
36 const VectorType& rhs,
39 std::string dir = simulator.problem().outputDir();
42 }
else if (!dir.empty() && dir.back() !=
'/') {
45 namespace fs = ::std::filesystem;
47 fs::path
subdir(
"reports");
53 std::ostringstream
oss;
54 oss <<
"prob_" << simulator.episodeIndex() <<
"_time_";
55 oss << std::setprecision(15) << std::setw(12) << std::setfill(
'0') << simulator.time() <<
"_";
56 int nit = simulator.model().newtonMethod().numIterations();
57 oss <<
"_nit_" <<
nit <<
"_";
64 if (comm !=
nullptr) {
65 Dune::storeMatrixMarket(matrix,
filename, *comm,
true);
69 Dune::storeMatrixMarket(matrix,
filename +
".mm");
75 if (comm !=
nullptr) {
76 Dune::storeMatrixMarket(rhs,
filename, *comm,
true);
80 Dune::storeMatrixMarket(rhs,
filename +
".mm");
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