14#define JoinWordsA(x, y) x##y
16#define JoinWordsB(x, y) JoinWordsA(x, y)
18std::shared_ptr<chi::PPPrinterSubscribeHelper>
20 std::make_shared<PPPrinterSubscribeHelper>(
21 PostProcessorPrinter::GetInstance());
23static char JoinWordsB(unique_var_name_ppp_, __COUNTER__) =
32 : printer_ref_(printer_ref)
45 : events_on_which_to_print_postprocs_({
"SolverInitialized",
66 auto subscriber_ptr = std::dynamic_pointer_cast<EventSubscriber>(helper_ptr);
70 "Failure to cast chi::PPPrinterSubscribeHelper to chi::EventSubscriber");
72 publisher.AddSubscriber(subscriber_ptr);
85 const std::vector<std::string>& events)
137 auto it = std::find(vec.begin(), vec.end(), event.
Name());
180 const std::vector<const PostProcessor*>& pp_list)
const
182 std::stringstream outstr;
184 typedef std::pair<std::string, std::string> PPNameAndVal;
185 std::vector<PPNameAndVal> scalar_ppnames_and_vals;
186 for (
const auto& pp : pp_list)
188 const auto& value = pp->GetValue();
189 const auto value_str = pp->ConvertValueToString(value);
191 scalar_ppnames_and_vals.emplace_back(pp->Name(), value_str);
194 if (not scalar_ppnames_and_vals.empty())
#define ChiLogicalErrorIf(condition, message)
const std::string & Name() const
PPPrinterSubscribeHelper(PostProcessorPrinter &printer_ref)
PostProcessorPrinter & printer_ref_
void ReceiveEventUpdate(const Event &event) override
void SetPrintScalarTimeHistory(bool value)
static std::shared_ptr< PPPrinterSubscribeHelper > helper_ptr_
bool per_column_size_vectors_
ScalarPPTableFormat scalar_pp_table_format_
static std::vector< const PostProcessor * > GetVectorPostProcessorsList(const Event &event)
static PostProcessorPrinter & GetInstance()
static std::string PrintPPsVertical(const std::vector< std::pair< std::string, std::string > > &scalar_ppnames_and_vals, int event_code)
static std::vector< const PostProcessor * > GetScalarPostProcessorsList(const Event &event)
void SetTimeHistoryLimit(size_t limit)
static char SubscribeToSystemWideEventPublisher()
void SetScalarPerColumnSize(bool value)
void ReceiveEventUpdate(const Event &event)
bool print_vector_time_history_
void PrintCSVFile(const Event &event) const
void SetPrintVectorTimeHistory(bool value)
void PrintPPsLatestValuesOnly(const std::string &pps_typename, const std::vector< const PostProcessor * > &pp_list, const Event &event) const
void SetCSVFilename(const std::string &csv_filename)
bool print_scalar_time_history_
static std::string PrintPPsHorizontal(const std::vector< std::pair< std::string, std::string > > &scalar_ppnames_and_vals, int)
bool per_column_size_scalars_
void PrintPostProcessors(const Event &event) const
std::string csv_filename_
std::string GetPrintedPostProcessors(const std::vector< const PostProcessor * > &pp_list) const
void SetScalarPPTableFormat(ScalarPPTableFormat format)
void SetTableColumnLimit(size_t limit)
void PrintPPsTimeHistory(const std::string &pps_typename, const std::vector< const PostProcessor * > &pp_list, const Event &event, bool per_column_sizes=false) const
size_t time_history_limit_
std::vector< std::string > events_on_which_to_print_postprocs_
void SetEventsOnWhichPrintPPs(const std::vector< std::string > &events)
size_t table_column_limit_
void SetVectorPerColumnSize(bool value)
static SystemWideEventPublisher & GetInstance()