Commit a46087e8 authored by Steffen Schotthöfer's avatar Steffen Schotthöfer
Browse files

terminal output fixed.

parent c3a02db0
Pipeline #118591 passed with stage
in 12 minutes and 54 seconds
......@@ -96,15 +96,18 @@ class Solver
virtual void PrepareVolumeOutput() = 0;
/*! @brief Function that prepares VTK export and csv export of the current solver iteration */
virtual void WriteVolumeOutput( unsigned iteration ) = 0;
/*! @brief Save Output solution at given energy (pseudo time) to VTK file */
/*! @brief Save Output solution at given energy (pseudo time) to VTK file. Write frequency is given by
option VOLUME_OUTPUT_FREQUENCY. Always prints last iteration without iteration affix.*/
void PrintVolumeOutput( int currEnergy ) const;
/*! @brief: Initialized the output fields and their Names for the Screenoutput */
/*! @brief: Initialized the output fields and their Names for the screenoutput */
void PrepareScreenOutput();
/*! @brief Function that writes screen and history output fields */
void WriteScalarOutput( unsigned iteration );
/*! @brief Prints ScreenOutputFields to Screen and to logger */
/*! @brief Prints ScreenOutputFields to Screen and to logger. Write frequency is given by
option SCREEN_OUTPUT_FREQUENCY. Always prints last iteration. */
void PrintScreenOutput( unsigned iteration );
/*! @brief: Initialized the historyOutputFields and their Names for Historyoutput */
/*! @brief: Initialized the historyOutputFields and their Names for history output. Write frequency is given by
option HISTORY_OUTPUT_FREQUENCY. Always prints last iteration. */
void PrepareHistoryOutput();
/*! @brief Prints HistoryOutputFields to logger */
void PrintHistoryOutput( unsigned iteration );
......@@ -125,6 +128,6 @@ class Solver
virtual void Solve();
/*! @brief Save Output solution to VTK file */
void PrintVolumeOutput() const;
void PrintVolumeOutput() const; // Only for debugging purposes.
};
#endif // SOLVER_H
......@@ -798,13 +798,6 @@ void Config::InitLogger() {
if( spdlog::get( "tabular" ) == nullptr ) {
// create sinks if level is not off
std::vector<spdlog::sink_ptr> sinks;
if( terminalLogLvl != spdlog::level::off ) {
// create spdlog terminal sink
auto terminalSink = std::make_shared<spdlog::sinks::stdout_sink_mt>();
terminalSink->set_level( terminalLogLvl );
terminalSink->set_pattern( "%v" );
sinks.push_back( terminalSink );
}
if( fileLogLvl != spdlog::level::off ) {
// define filename on root
int pe;
......
......@@ -152,6 +152,9 @@ void Solver::PrintVolumeOutput( int currEnergy ) const {
if( _settings->GetVolumeOutputFrequency() != 0 && currEnergy % (unsigned)_settings->GetVolumeOutputFrequency() == 0 ) {
ExportVTK( _settings->GetOutputFile() + "_" + std::to_string( currEnergy ), _outputFields, _outputFieldNames, _mesh );
}
if( currEnergy == _nEnergies - 1 ) { // Last iteration write without suffix.
ExportVTK( _settings->GetOutputFile(), _outputFields, _outputFieldNames, _mesh );
}
}
// --- Helper ---
......@@ -342,7 +345,7 @@ void Solver::PrintScreenOutput( unsigned iteration ) {
if( _settings->GetScreenOutputFrequency() != 0 && iteration % (unsigned)_settings->GetScreenOutputFrequency() == 0 ) {
log->info( lineToPrint );
}
if( iteration == _nEnergies - 1 ) { // Always print last iteration
else if( iteration == _nEnergies - 1 ) { // Always print last iteration
log->info( lineToPrint );
}
}
......@@ -394,7 +397,7 @@ void Solver::PrintHistoryOutput( unsigned iteration ) {
if( _settings->GetHistoryOutputFrequency() != 0 && iteration % (unsigned)_settings->GetHistoryOutputFrequency() == 0 ) {
log->info( lineToPrint );
}
if( iteration == _nEnergies - 1 ) { // Always print last iteration
else if( iteration == _nEnergies - 1 ) { // Always print last iteration
log->info( lineToPrint );
}
}
......
Supports Markdown
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