The box module keeps the edge lengths of the simulation box, and implements periodic boundary conditions for use in other modules. At present the module supports cuboid box geometries.
Example:
local box = halmd.mdsim.box({length = {100, 100, 10})
Construct box.
| Parameters: |
|
|---|---|
| Returns: | instance of box |
Warning
Non-cuboid geometries are not implemented, edges must be a diagonal matrix.
Space dimension of the simulation box as a number.
Edge vectors as a matrix.
For a cuboid simulation domain, edges is equal to
{{length[1], 0, 0},
{0, length[2], 0},
{0, 0, length[3]}}
Edge lengths as a sequence.
Coordinates of the lowest corner of the box.
Write box specification to file.
http://nongnu.org/h5md/draft.html#box-specification
| Parameters: | file – instance of file writer |
|---|---|
| Returns: | instance of group writer |
Note that the box specification will not be written immediately, but upon the start of the simulation. The writer is connected to the on_start signal of sampler.
Read edge vectors of simulation domain from H5MD file.
http://nongnu.org/h5md/draft.html#box-specification
| Parameters: | file – instance of halmd.io.readers.h5md |
|---|---|
| Returns: | edge vectors |
The return value may be used to restore the domain:
local file = readers.h5md({path = args.trajectory})
local edges = mdsim.box.reader(file)
local box = mdsim.box({edges = edges})