This module provides a file writer for the H5MD format.
Construct H5MD writer.
| Parameters: |
|
|---|---|
| Returns: | instance of file writer |
Create the output file and writes the H5MD attribute group.
http://nongnu.org/h5md/draft.html#global-attributes
Warning
The output file will be truncated if it exists.
The file may be flushed to disk by sending the USR2 signal to the process:
killall -USR2 halmd
This yields a consistent snapshot on disk (until the next sample is written), which is useful to peek at output data during the simulation.
Construct a group writer.
| Parameters: |
|
|---|---|
| Returns: | instance of group writer |
Example for creating and using a truncate writer:
local writer = file:writer({location = {"trajectory", "box"}, mode = "truncate"})
writer:on_write(box.origin, {"offset"})
writer:on_write(box.edges, {"edges"})
local sampler = require("halmd.observables.sampler")
sampler:on_start(writer.write)
Example for creating and using an append writer:
local writer = file:writer({location = {"observables"}, mode = "append"})
writer:on_prepend_write(observable.sample)
writer:on_write(observable.en_pot, {"potential_energy"})
writer:on_write(observable.en_kin, {"kinetic_energy"})
writer:on_write(observable.en_tot, {"total_energy"})
local sampler = require("halmd.observables.sampler")
sampler:on_start(writer.write)
Flush the output file to disk.
HDF5 root group of the file.
Filename of the file.
Returns sequence of integers with major and minor H5MD version.