Output and Logging
These helpers write HDF5 visualization files and keep redirected logs responsive during long runs.
HDF5 Output
FermiSea.save_mesh_native — Function
save_mesh_native(u_or_sol, semi, filename; refine=4) -> filenameSave the DG solution to filename (HDF5) on a mesh-native visualization grid. Each element is subdivided refine times in each reference direction, giving (refine+1)² points and 2·refine² triangles per element.
Datasets: x, y, triangles (0-based Int32), and by default the leading hydrodynamic variables named by varnames(equations) (e.g. "a0", "a1", "b1").
Attributes: grid_type = "mesh_native_triangles", refine, time.
FermiSea.save_cartesian — Function
save_cartesian(u_or_sol, semi, filename; nvisnodes=200) -> filenameSave the DG solution to filename (HDF5) on a uniform Cartesian grid (nvisnodes × nvisnodes) covering the mesh bounding box. Points outside the domain are NaN; the boolean mask dataset marks in-domain points.
Datasets: x, y, mask, and by default the leading hydrodynamic variables named by varnames(equations) (e.g. "a0", "a1", "b1").
Attributes: grid_type = "uniform_cartesian", nvisnodes, time.
Logging
FermiSea.FlushOutputCallback — Function
FlushOutputCallback(; interval=100)This is just a lightweight callback that flushes stdout and stderr every interval iterations. I was trying to run simulations on the cluster and wanted the logs to show up immediately in the log files, but Julia seems to aggressively buffer output
FermiSea.MonitorCallback — Function
MonitorCallback(; interval=100)Backward-compatible alias for FlushOutputCallback.
Historically this callback only flushed IO; it does not perform solution analysis.
FermiSea.make_flushing_logger — Function
make_flushing_logger(io=stderr; min_level=Logging.Info)Create a logger that forwards messages to io and flushes the stream after each message.
This is useful for batch jobs where stdout or stderr is redirected to a log file and buffered output would otherwise appear late.