Class OutputManagerAscii

Inheritance Relationships

Base Type

Class Documentation

class OutputManagerAscii : public io::OutputManager

Ascii-output specialization of OutputManager.

Public Functions

explicit OutputManagerAscii(const SimControls &simControls)

Open the output file and write its header.

simControls is stored by reference, so the object passed in must outlive this OutputManagerAscii.

Parameters:

simControls – Simulation controls (physics settings and control-flow settings together)

~OutputManagerAscii() override

Close the cluster output file, if it was opened.

OutputManagerAscii(const OutputManagerAscii&) = delete
auto operator=(const OutputManagerAscii&) -> OutputManagerAscii& = delete
OutputManagerAscii(OutputManagerAscii&&) = delete
auto operator=(OutputManagerAscii&&) -> OutputManagerAscii& = delete
virtual void writeCluster(unsigned long trial, const core::Cluster &cluster) override

Write a cluster’s data as a row of the cluster output file.

If cluster output was not enabled for this simulation, this is a no-op.

Parameters:
  • trial – Trial number to which this cluster belongs

  • cluster – The cluster whose data should be written

virtual void writeClusterSpec(unsigned long trial, double time, core::Cluster &cluster) override

Write a cluster’s spectrum.

If spectral synthesis was not enabled for this simulation (the cluster-spectra file was not opened), or the cluster has disrupted, this is a no-op. Otherwise writes one line per wavelength, each holding trial, time, uid, wavelength, and specific luminosity (plus, if requested, extincted and/or nebular-inclusive specific luminosity), to the cluster-spectra file, then calls writeClusterNebLines() to do the same for each nebular emission line’s own luminosity, if a nebular emission grid was requested.

Parameters:
  • trial – Trial number to which this cluster belongs

  • time – The output time at which the cluster’s spectrum was computed, in yr

  • cluster – The cluster whose spectrum should be written

virtual void writeClusterPhot(unsigned long trial, double time, core::Cluster &cluster) override

Write a cluster’s photometry.

If no filter collection or bolometric luminosity was requested for this simulation (the cluster-photometry file was not opened), or the cluster has disrupted, this is a no-op. Otherwise writes one line, holding trial, time, uid, one column per filter, and (if requested) a final “Lbol” column, followed by extincted and/or nebular-inclusive filter columns if requested, to the cluster-photometry file.

Parameters:
  • trial – Trial number to which this cluster belongs

  • time – The output time at which the cluster’s photometry was computed, in yr

  • cluster – The cluster whose photometry should be written

virtual void writeClusterYields(unsigned long trial, double time, core::Cluster &cluster) override

Write a cluster’s nucleosynthetic yields.

If no yield channels were requested for this simulation (the cluster-yields file was not opened), this is a no-op – unlike writeClusterSpec()/writeClusterPhot(), a disrupted cluster’s own row is still written (see OutputManager::writeClusterYields()’s own comment for why). Otherwise writes one line, holding trial, time, uid, and one column per isotope (or per channel-isotope pair, if SimControls::yieldsChannelDecomposed()), to the cluster-yields file – see buildYieldsColumnNames()’s own comment for the exact column-naming convention.

Parameters:
  • trial – Trial number to which this cluster belongs

  • time – The output time at which this row was recorded, in yr

  • cluster – The cluster whose yields should be written

virtual void writeGalaxy(unsigned long trial, double time, core::Galaxy &galaxy) override

Write a galaxy’s data as a row of the galaxy output file.

If galaxy output was not enabled for this simulation (the galaxy file was not opened), this is a no-op. Otherwise, after writing this row, also calls writeCluster() on every currently-alive (non-disrupted) cluster in galaxy.

Parameters:
  • trial – Trial number to which this galaxy belongs

  • time – The output time at which this row was recorded, in yr

  • galaxy – The galaxy whose data should be written

virtual void writeGalaxySpec(unsigned long trial, double time, core::Galaxy &galaxy) override

Write a galaxy’s spectrum.

If spectral synthesis was not enabled for this simulation (the galaxy-spectra file was not opened), this is a no-op. Otherwise writes one line per wavelength, each holding trial, time, wavelength, and specific luminosity (plus, if requested, extincted and/or nebular-inclusive specific luminosity), to the galaxy-spectra file, then calls writeGalaxyNebLines() to do the same for each nebular emission line’s own luminosity, if a nebular emission grid was requested, then calls writeClusterSpec() on every currently-alive (non-disrupted) cluster in galaxy.

Parameters:
  • trial – Trial number to which this galaxy belongs

  • time – The output time at which the galaxy’s spectrum was computed, in yr

  • galaxy – The galaxy whose spectrum should be written

virtual void writeGalaxyPhot(unsigned long trial, double time, core::Galaxy &galaxy) override

Write a galaxy’s photometry.

If no filter collection or bolometric luminosity was requested for this simulation (the galaxy-photometry file was not opened), this is a no-op. Otherwise writes one line, holding trial, time, one column per filter, and (if requested) a final “Lbol” column, followed by extincted and/or nebular-inclusive filter columns if requested, to the galaxy-photometry file, then calls writeClusterPhot() on every currently-alive (non-disrupted) cluster in galaxy.

Parameters:
  • trial – Trial number to which this galaxy belongs

  • time – The output time at which the galaxy’s photometry was computed, in yr

  • galaxy – The galaxy whose photometry should be written

virtual void writeGalaxyYields(unsigned long trial, double time, core::Galaxy &galaxy) override

Write a galaxy’s nucleosynthetic yields.

Writing the galaxy’s own line – trial, time, and one column per isotope (or per channel-isotope pair, mirroring writeClusterYields()’s own column layout) – is a no-op if the galaxy-yields file was not opened (no yield channels were requested, or output.write_galaxy_yields is false). writeClusterYields() is still called on every currently-alive (non-disrupted) cluster in galaxy regardless, since output.write_cluster_yields is independently togglable (see OutputManagerH5::writeGalaxyYields()’s own comment).

Parameters:
  • trial – Trial number to which this galaxy belongs

  • time – The output time at which this row was recorded, in yr

  • galaxy – The galaxy whose yields should be written

virtual void writeClusterFeedback(unsigned long trial, double time, core::Cluster &cluster) override

Write a cluster’s feedback (supernovae and stellar winds)

If output.write_cluster_feedback is false (the cluster-feedback file was not opened), this is a no-op. Like writeClusterYields(), a disrupted cluster’s own row is still written (see OutputManager::writeClusterFeedback()’s own comment for why). Otherwise writes one line, holding trial, time, uid, n_sn, mdot_wind, pdot_wind, and edot_wind (see OutputManager::feedbackRow()), to the cluster-feedback file.

Parameters:
  • trial – Trial number to which this cluster belongs

  • time – The output time at which this row was recorded, in yr

  • cluster – The cluster whose feedback should be written

virtual void writeGalaxyFeedback(unsigned long trial, double time, core::Galaxy &galaxy) override

Write a galaxy’s feedback (supernovae and stellar winds)

Writes one line, laid out as writeClusterFeedback()’s but with no uid column, to the galaxy-feedback file, if it was opened; then, regardless, calls writeClusterFeedback() on every currently-alive (non-disrupted) cluster in galaxy, for the same reason as writeGalaxyYields().

Parameters:
  • trial – Trial number to which this galaxy belongs

  • time – The output time at which this row was recorded, in yr

  • galaxy – The galaxy whose feedback should be written

virtual void checkpoint(unsigned long trialsCompleted) override

Not supported for ascii output.

Ascii output has no way to reopen/append to a file it has already finished writing the way OutputManagerH5 rolls over to a new HDF5 file, so checkpointing is only ever supported with HDF5 output – see OutputManager::checkpoint()’s own comment for why this still needs to exist (and fail loudly) rather than simply not being overridden here at all.

Parameters:

trialsCompleted – Unused; present only to satisfy OutputManager::checkpoint()’s own signature

Throws:

std::runtime_error – always

virtual auto restartTrialsDone() const -> unsigned long override

Not supported for ascii output.

Restarting resumes from a checkpoint, and ascii output never produces checkpoints in the first place (see checkpoint()’s own comment) – see OutputManager::restartTrialsDone()’s own comment for why this still needs to exist (and fail loudly) rather than simply not being overridden here at all.

Throws:

std::runtime_error – always

virtual auto restartMaxTrial() const -> unsigned long override

Not supported for ascii output.

See restartTrialsDone()’s own comment – the same reasoning applies here.

Throws:

std::runtime_error – always

virtual void notifyEarlyTermination(unsigned long trialsCompleted) override

A no-op for ascii output.

Unlike checkpoint()/restartTrialsDone() above, this does not throw: see OutputManager::notifyEarlyTermination()’s own comment for why there is simply nothing for ascii output to correct on an early exit.

Parameters:

trialsCompleted – Unused; present only to satisfy OutputManager::notifyEarlyTermination()’s own signature