Commit afe874cf authored by Gregor Olenik's avatar Gregor Olenik
Browse files

Add timestep to matrix name when exporting

parent 3888a208
......@@ -10,19 +10,19 @@
namespace Foam {
void export_system(const word fieldName, const mtx *A, const vec *x,
const vec *b)
const vec *b, const word time)
{
std::string fn_mtx{fieldName + "_A.mtx"};
std::string fn_mtx{time + "_" + fieldName + "_A.mtx"};
std::ofstream stream{fn_mtx};
std::cerr << "Writing " << fn_mtx << std::endl;
gko::write(stream, A, gko::layout_type::coordinate);
std::string fn_b{fieldName + "_b.mtx"};
std::string fn_b{time + "_" + fieldName + "_b.mtx"};
std::ofstream stream_b{fn_b};
std::cerr << "Writing " << fn_b << std::endl;
gko::write(stream_b, b);
std::string fn_x{fieldName + "_x.mtx"};
std::string fn_x{time + "_" + fieldName + "_x0.mtx"};
std::ofstream stream_x{fn_x};
std::cerr << "Writing " << fn_x << std::endl;
gko::write(stream_x, x);
......
......@@ -173,7 +173,7 @@ public:
};
void export_system(const word fieldName, const mtx *A, const vec *x,
const vec *b);
const vec *b, const word time);
// Logs the number of iteration executed
......@@ -409,7 +409,8 @@ public:
if (get_export())
export_system(this->fieldName(), gko::lend(gkomatrix),
gko::lend(x[0]), gko::lend(b));
gko::lend(x[0]), gko::lend(b),
this->matrix().mesh().thisDb().time().timeName());
solverPerf.initialResidual() = this->get_init_res_norm();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment