Skip to content

Commit 8100980

Browse files
committed
Merge remote-tracking branch 'origin/pgrete/user-output' into pgrete/next-opmd-ncycle
2 parents 6bec73e + bdb997a commit 8100980

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/outputs/outputs.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Outputs::Outputs(Mesh *pm, ParameterInput *pin, SimTime *tm) {
225225

226226
// set output variable and optional data format string used in formatted writes
227227
if ((op.file_type != "hst") && (op.file_type != "rst") &&
228-
(op.file_type != "ascent") && (op.file_type != "histogram")) {
228+
(op.file_type != "ascent") && (op.file_type != "histogram") && (op.file_type != "user")) {
229229
// differentiating here whether a block exists or not to not add an empty
230230
// parameter to the input file (which might interfere with restarts)
231231
if (pin->DoesParameterExist(pib->block_name, "variables")) {
@@ -303,6 +303,8 @@ Outputs::Outputs(Mesh *pm, ParameterInput *pin, SimTime *tm) {
303303
<< std::endl;
304304
PARTHENON_FAIL(msg);
305305
#endif // ifdef ENABLE_HDF5
306+
} else if (op.file_type == "user") {
307+
pnew_type = new UserOutput(op);
306308
} else if (is_hdf5_output) {
307309
const bool restart = (op.file_type == "rst");
308310
if (restart) {

src/outputs/outputs.hpp

+15
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,21 @@ class HistogramOutput : public OutputType {
265265
};
266266
#endif // ifdef ENABLE_HDF5
267267

268+
//----------------------------------------------------------------------------------------
269+
//! \class UserOutput
270+
// \brief derived OutputType class for User enrolled outputs
271+
272+
class UserOutput : public OutputType {
273+
public:
274+
explicit UserOutput(const OutputParameters &oparams) : OutputType(oparams) {}
275+
void WriteOutputFile(Mesh *pm, ParameterInput *pin, SimTime *tm,
276+
const SignalHandler::OutputSignal signal) override;
277+
278+
private:
279+
std::string GenerateFilename_(ParameterInput *pin, SimTime *tm,
280+
const SignalHandler::OutputSignal signal);
281+
};
282+
268283
//----------------------------------------------------------------------------------------
269284
//! \class Outputs
270285

0 commit comments

Comments
 (0)