Output and Logging

These helpers write HDF5 visualization files and keep redirected logs responsive during long runs.

HDF5 Output

FermiSea.save_mesh_nativeFunction
save_mesh_native(u_or_sol, semi, filename; refine=4) -> filename

Save 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.

source
FermiSea.save_cartesianFunction
save_cartesian(u_or_sol, semi, filename; nvisnodes=200) -> filename

Save 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.

source

Logging

FermiSea.FlushOutputCallbackFunction
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

source
FermiSea.make_flushing_loggerFunction
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.

source