OGS
|
Manages writing the solution of processes to disk.
This class decides at which timesteps output is written and initiates the writing process.
#include <Output.h>
Public Member Functions | |
Output (std::unique_ptr< OutputFormat > &&output_format, bool const output_nonlinear_iteration_results, OutputDataSpecification &&output_data_specification, std::vector< std::string > &&mesh_names_for_output, std::vector< std::unique_ptr< MeshLib::Mesh > > const &meshes) | |
Output (Output const &other)=delete | |
Output (Output &&other)=default | |
Output & | operator= (Output const &src)=delete |
Output & | operator= (Output &&src)=default |
~Output ()=default | |
void | addProcess (ProcessLib::Process const &process) |
TODO doc. Opens a PVD file for each process. | |
void | doNotProjectFromBulkMeshToSubmeshes (std::string const &property_name, MeshLib::MeshItemType const mesh_item_type) |
void | doOutput (Process const &process, const int process_id, int const timestep, const NumLib::Time &t, int const iteration, std::vector< GlobalVector * > const &xs) const |
void | doOutputLastTimestep (Process const &process, const int process_id, int const timestep, const NumLib::Time &t, int const iteration, std::vector< GlobalVector * > const &xs) const |
void | doOutputAlways (Process const &process, const int process_id, int const timestep, const NumLib::Time &t, int const iteration, std::vector< GlobalVector * > const &xs) const |
void | doOutputNonlinearIteration (Process const &process, const int process_id, int const timestep, const NumLib::Time &t, const int iteration, std::vector< GlobalVector * > const &xs) const |
bool | isOutputStep (int const timestep, NumLib::Time const &t) const |
Tells if output will be written at the specified timestep/time. | |
std::vector< double > const & | getFixedOutputTimes () const |
std::vector< std::string > | getFileNamesForOutput () const |
Private Member Functions | |
bool | isOutputProcess (int const process_id, Process const &process) const |
void | outputMeshes (int const timestep, const double t, int const iteration, std::vector< std::reference_wrapper< const MeshLib::Mesh > > const &meshes) const |
MeshLib::Mesh const & | prepareSubmesh (std::string const &submesh_output_name, Process const &process, const int process_id, NumLib::Time const &t, std::vector< GlobalVector * > const &xs) const |
Private Attributes | |
std::unique_ptr< OutputFormat > | _output_format |
bool | _output_nonlinear_iteration_results |
OutputDataSpecification | _output_data_specification |
std::vector< std::reference_wrapper< Process const > > | _output_processes |
std::vector< std::string > | _mesh_names_for_output |
std::reference_wrapper< std::vector< std::unique_ptr< MeshLib::Mesh > > const > | _meshes |
std::set< std::pair< std::string, MeshLib::MeshItemType > > | _do_not_project_from_bulk_mesh_to_submeshes |
Friends | |
std::ostream & | operator<< (std::ostream &os, Output const &output) |
ProcessLib::Output::Output | ( | std::unique_ptr< OutputFormat > && | output_format, |
bool const | output_nonlinear_iteration_results, | ||
OutputDataSpecification && | output_data_specification, | ||
std::vector< std::string > && | mesh_names_for_output, | ||
std::vector< std::unique_ptr< MeshLib::Mesh > > const & | meshes ) |
Definition at line 147 of file Output.cpp.
|
delete |
|
default |
|
default |
void ProcessLib::Output::addProcess | ( | ProcessLib::Process const & | process | ) |
TODO doc. Opens a PVD file for each process.
Definition at line 160 of file Output.cpp.
References _mesh_names_for_output, _output_processes, ProcessLib::Process::getMesh(), and MeshLib::Mesh::getName().
void ProcessLib::Output::doNotProjectFromBulkMeshToSubmeshes | ( | std::string const & | property_name, |
MeshLib::MeshItemType const | mesh_item_type ) |
Declare that the specified mesh property should not be projected from the bulk mesh to submeshes during submesh output.
Definition at line 169 of file Output.cpp.
References _do_not_project_from_bulk_mesh_to_submeshes.
void ProcessLib::Output::doOutput | ( | Process const & | process, |
const int | process_id, | ||
int const | timestep, | ||
const NumLib::Time & | t, | ||
int const | iteration, | ||
std::vector< GlobalVector * > const & | xs ) const |
Writes output for the given process
if it should be written in the given timestep
.
Definition at line 336 of file Output.cpp.
References _output_format, InSituLib::CoProcess(), doOutputAlways(), ProcessLib::Process::getMesh(), and isOutputStep().
Referenced by ProcessLib::TimeLoop::calculateNextTimeStep(), and ProcessLib::TimeLoop::initialize().
void ProcessLib::Output::doOutputAlways | ( | Process const & | process, |
const int | process_id, | ||
int const | timestep, | ||
const NumLib::Time & | t, | ||
int const | iteration, | ||
std::vector< GlobalVector * > const & | xs ) const |
Writes output for the given process
. This method will always write. It is intended to write output in error handling routines.
Definition at line 289 of file Output.cpp.
References _mesh_names_for_output, _output_data_specification, ProcessLib::addProcessDataToMesh(), ProcessLib::createProcessOutputData(), BaseLib::RunTime::elapsed(), ProcessLib::Process::getMesh(), MeshLib::Mesh::getName(), INFO(), isOutputProcess(), outputMeshes(), prepareSubmesh(), and BaseLib::RunTime::start().
Referenced by doOutput(), and doOutputLastTimestep().
void ProcessLib::Output::doOutputLastTimestep | ( | Process const & | process, |
const int | process_id, | ||
int const | timestep, | ||
const NumLib::Time & | t, | ||
int const | iteration, | ||
std::vector< GlobalVector * > const & | xs ) const |
Writes output for the given process
if it has not been written yet. This method is intended for doing output after the last timestep in order to make sure that its results are written.
Definition at line 355 of file Output.cpp.
References _output_format, InSituLib::CoProcess(), doOutputAlways(), ProcessLib::Process::getMesh(), and isOutputStep().
Referenced by ProcessLib::TimeLoop::outputLastTimeStep().
void ProcessLib::Output::doOutputNonlinearIteration | ( | Process const & | process, |
const int | process_id, | ||
int const | timestep, | ||
const NumLib::Time & | t, | ||
const int | iteration, | ||
std::vector< GlobalVector * > const & | xs ) const |
Writes output for the given process
. To be used for debug output after an iteration of the nonlinear solver.
Definition at line 372 of file Output.cpp.
References _output_data_specification, _output_format, _output_nonlinear_iteration_results, ProcessLib::addProcessDataToMesh(), ProcessLib::createProcessOutputData(), ProcessLib::OutputVTKFormat::data_mode, DBUG(), BaseLib::RunTime::elapsed(), ProcessLib::Process::getMesh(), MeshLib::Mesh::getName(), INFO(), isOutputProcess(), BaseLib::joinPaths(), ProcessLib::outputMeshVtk(), and BaseLib::RunTime::start().
std::vector< std::string > ProcessLib::Output::getFileNamesForOutput | ( | ) | const |
Definition at line 423 of file Output.cpp.
References _mesh_names_for_output, and _output_format.
|
inline |
Definition at line 93 of file Output.h.
References _output_data_specification, and ProcessLib::OutputDataSpecification::fixed_output_times.
|
private |
Determines if output should be written for the given process.
With staggered coupling not every process writes output.
Definition at line 135 of file Output.cpp.
References _output_processes, and ProcessLib::Process::isMonolithicSchemeUsed().
Referenced by doOutputAlways(), and doOutputNonlinearIteration().
bool ProcessLib::Output::isOutputStep | ( | int const | timestep, |
NumLib::Time const & | t ) const |
Tells if output will be written at the specified timestep/time.
Definition at line 418 of file Output.cpp.
References _output_data_specification, and ProcessLib::OutputDataSpecification::isOutputStep().
Referenced by doOutput(), and doOutputLastTimestep().
|
private |
Definition at line 177 of file Output.cpp.
References _output_data_specification, _output_format, and ProcessLib::OutputDataSpecification::output_variables.
Referenced by doOutputAlways().
|
private |
Definition at line 215 of file Output.cpp.
References _do_not_project_from_bulk_mesh_to_submeshes, _meshes, _output_data_specification, ProcessLib::addBulkMeshPropertyToSubMesh(), ProcessLib::addProcessDataToMesh(), ProcessLib::createProcessOutputData(), DBUG(), MeshLib::findMeshByName(), ProcessLib::Process::getMesh(), MeshLib::Mesh::getProperties(), and MeshLib::Properties::getPropertyVectorNames().
Referenced by doOutputAlways().
|
friend |
Definition at line 447 of file Output.cpp.
|
private |
Definition at line 136 of file Output.h.
Referenced by doNotProjectFromBulkMeshToSubmeshes(), and prepareSubmesh().
|
private |
Definition at line 124 of file Output.h.
Referenced by addProcess(), doOutputAlways(), and getFileNamesForOutput().
|
private |
Definition at line 133 of file Output.h.
Referenced by prepareSubmesh().
|
private |
Definition at line 122 of file Output.h.
Referenced by doOutputAlways(), doOutputNonlinearIteration(), getFixedOutputTimes(), isOutputStep(), outputMeshes(), and prepareSubmesh().
|
private |
Definition at line 118 of file Output.h.
Referenced by doOutput(), doOutputLastTimestep(), doOutputNonlinearIteration(), getFileNamesForOutput(), and outputMeshes().
|
private |
Definition at line 120 of file Output.h.
Referenced by doOutputNonlinearIteration().
|
private |
Definition at line 123 of file Output.h.
Referenced by addProcess(), and isOutputProcess().