https://mooseframework.inl.gov
Loading...
Searching...
No Matches
JSONOutput.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "nlohmann/json.h"
13#include "AdvancedOutput.h"
14
16{
17public:
20
21protected:
22 virtual void initialSetup() override;
23 virtual void output() override;
24 virtual void outputReporters() override;
25 virtual void outputSystemInformation() override;
26 virtual void timestepSetup() override;
27 virtual std::string filename() override;
29
30private:
33
35 const std::vector<ReporterName> * const _reporters;
36
38 nlohmann::json & _json;
39
41 bool _has_distributed = false;
42};
43
44template <>
45void dataStore(std::ostream & stream, nlohmann::json & json, void * context);
46template <>
47void dataLoad(std::istream & stream, nlohmann::json & json, void * context);
void dataLoad(std::istream &stream, nlohmann::json &json, void *context)
Definition JSONOutput.C:245
void dataStore(std::ostream &stream, nlohmann::json &json, void *context)
Definition JSONOutput.C:238
Based class for output objects.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
virtual std::string filename() override
The filename for the output file.
Definition JSONOutput.C:59
virtual void initialSetup() override
Call init() method on setup.
Definition JSONOutput.C:50
const std::vector< ReporterName > *const _reporters
The names of the specific reporters to output (if any)
Definition JSONOutput.h:35
bool _has_distributed
True when distributed data exists for output.
Definition JSONOutput.h:41
virtual void timestepSetup() override
Gets called at the beginning of the timestep before this object is asked to do its job.
Definition JSONOutput.C:87
nlohmann::json & _json
The root JSON node for output.
Definition JSONOutput.h:38
const ReporterData & _reporter_data
Definition JSONOutput.h:28
const bool _one_file_per_timestep
Flag to create a file for each time step.
Definition JSONOutput.h:32
static InputParameters validParams()
Definition JSONOutput.C:22
virtual void outputReporters() override
Output Reporter values.
Definition JSONOutput.C:95
virtual void output() override
A single call to this function should output all the necessary data for a single timestep.
Definition JSONOutput.C:225
virtual void outputSystemInformation() override
Definition JSONOutput.C:81
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
This is a helper class for managing the storage of declared Reporter object values.