diff --git a/Applications/CLI/ogs.cpp b/Applications/CLI/ogs.cpp index 1440d0035dbb7e0d64ca985b2074ad64e182e4ea..1b35788142ca575773bf2533d08b1bfe90a5a652 100644 --- a/Applications/CLI/ogs.cpp +++ b/Applications/CLI/ogs.cpp @@ -83,13 +83,19 @@ int main(int argc, char *argv[]) (*p_it)->initialize(); } + std::string const output_file_name(project.getOutputFilePrefix() + "_result.dat"); + DBUG("Create output file %s", output_file_name.c_str()); + std::ofstream output_file(output_file_name); + INFO("Solve processes."); for (auto p_it = project.processesBegin(); p_it != project.processesEnd(); ++p_it) { (*p_it)->solve(); - (*p_it)->post(); + (*p_it)->post(output_file); } + output_file.close(); + delete fmt; delete logog_cout; LOGOG_SHUTDOWN(); diff --git a/ProcessLib/GroundwaterFlowProcess.h b/ProcessLib/GroundwaterFlowProcess.h index 7fe8be2841d0d7d9cad41da06428bb1ccdb3b10e..07423a5af2b96e08d920e1a5ac1b0ed499c08184 100644 --- a/ProcessLib/GroundwaterFlowProcess.h +++ b/ProcessLib/GroundwaterFlowProcess.h @@ -133,7 +133,7 @@ public: _linearSolver->solve(*_rhs, *_x); } - void post() + void post(std::ostream& os) { DBUG("Postprocessing GroundwaterFlowProcess."); // Postprocessing of the linear system of equations solver results: diff --git a/ProcessLib/Process.h b/ProcessLib/Process.h index 1fdc4df7bd9dd42c8f650c766c444bf1da31017b..b7cb012aae9495a569502f8e17b0477cba89475d 100644 --- a/ProcessLib/Process.h +++ b/ProcessLib/Process.h @@ -28,7 +28,10 @@ public: virtual void initialize() = 0; virtual void solve() = 0; - virtual void post() = 0; + + /// Postprocessing after solve(). + /// The output stream is dedicated for the ascii result output. + virtual void post(std::ostream& os) = 0; protected: MeshLib::Mesh const& _mesh;