Burst¶
- class hoomd.write.Burst(trigger, filename, filter=hoomd.filter.All(), mode='ab', dynamic=None, logger=None, max_burst_size=-1, write_at_start=False)¶
Bases:
GSDWrite the last stored frames in the GSD format.
When triggered,
Burstadds a frame (up the last frames) in a buffer. Calldumpto write the frames to the file. When the the next frame would result in frames being stored, the oldest frame is removed and the new frame is added.- Parameters:
trigger (hoomd.trigger.trigger_like) – Select the timesteps to store in the buffer.
filename (str) – File name to write.
filter (hoomd.filter.filter_like) – Select the particles to write. Defaults to
hoomd.filter.All.mode (str) – The file open mode. Defaults to
'ab'.dynamic (list[str]) – Field names and/or field categores to save in all frames. Defaults to
['property'].logger (hoomd.logging.Logger) – Provide log quantities to write. Defaults to
None.max_burst_size (int) – The maximum number of frames to store before between writes. -1 represents no limit. Defaults to -1.
write_at_start (bool) – When
Trueand the file does not exist or has 0 frames: write one frame with the current state of the system whenhoomd.Simulation.runis called. Defaults toFalse.clear_whole_buffer_after_dump (bool) – When
Truethe buffer is emptied after callingdumpeach time. WhenFalse,dumpremoves frames from the buffer until theendindex. Defaults toTrue.precision (str) – Write precision for floating-point data. One of
'single'or'double'. Defaults to'single'.
Warning
Bursterrors when attempting to create a file or writing to one with zero frames whenwrite_at_startisFalse.Note
When analyzing files created by
Burst, generally the first frame is not associated with the call toBurst.dump.Example:
burst = hoomd.write.Burst( trigger=hoomd.trigger.Periodic(1_000), filename=burst_filename, max_burst_size=100, write_at_start=True, ) simulation.operations.writers.append(burst)
See also
The base class
hoomd.write.GSDMembers inherited from
AutotunedObject:- property kernel_parameters¶
Kernel parameters.
Read more...
- property is_tuning_complete¶
Check if kernel parameter tuning is complete.
Read more...
- tune_kernel_parameters()¶
Start tuning kernel parameters.
Read more...
Members inherited from
TriggeredOperation:- trigger¶
The trigger to activate this operation.
Read more...
Members inherited from
GSD:- filename¶
File name to write (read-only).
Read more...
- filter¶
Select the particles to write (read-only).
Read more...
- mode¶
The file open mode (read-only).
Read more...
- dynamic¶
Field names and/or field categores to save in all frames.
Read more...
- write_diameter¶
When
False, do not writeparticles/diameter. Set toTrueto write non-default particle diameters.Read more...
- maximum_write_buffer_size¶
Size (in bytes) to buffer in memory before writing to the file.
Read more...
- auto_flush_period¶
Time (in seconds) to wait between automatic calls to
flush().Read more...
- property logger¶
Provide log quantities to write.
Read more...
- flush()¶
Flush the write buffer to the file.
Read more...
Members defined in
Burst:- max_burst_size¶
The maximum number of frames to store before between writes. -1 represents no limit.
Example:
burst.max_burst_size = 200
- Type:
- write_at_start¶
When
Trueand the file does not exist or has 0 frames: write one frame with the current state of the system whenhoomd.Simulation.runis called (read only).Example:
write_at_start = burst.write_at_start
- Type:
- clear_whole_buffer_after_dump¶
When
Truethe buffer is emptied after callingdumpeach time. WhenFalse,dumpremoves frames from the buffer until theendindex.Example:
burst.clear_buffer_after_dump = False
- Type:
- __len__()¶
Get the current length of the internal frame buffer.
Example:
buffered_frames = len(burst)
- dump(start=0, end=-1)¶
Write stored frames in range to the file and empties the buffer.
This method alllows for custom writing of frames at user specified conditions.
- Parameters:
Example:
burst.dump()