TNG API
1.8.0
A flexible binary trajectory format
|
Functions | |
tng_function_status DECLSPECDLLEXPORT | tng_util_trajectory_open (const char *filename, const char mode, tng_trajectory_t *tng_data_p) |
High-level function for opening and initializing a TNG trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_trajectory_close (tng_trajectory_t *tng_data_p) |
High-level function for closing a TNG trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_time_of_frame_get (const tng_trajectory_t tng_data, const int64_t frame_nr, double *time) |
High-level function for getting the time (in seconds) of a frame. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_pos_read (const tng_trajectory_t tng_data, float **positions, int64_t *stride_length) |
High-level function for reading the positions of all particles from all frames. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_vel_read (const tng_trajectory_t tng_data, float **velocities, int64_t *stride_length) |
High-level function for reading the velocities of all particles from all frames. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_force_read (const tng_trajectory_t tng_data, float **forces, int64_t *stride_length) |
High-level function for reading the forces of all particles from all frames. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_box_shape_read (const tng_trajectory_t tng_data, float **box_shape, int64_t *stride_length) |
High-level function for reading the box shape from all frames. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_particle_data_next_frame_read (const tng_trajectory_t tng_data, const int64_t block_id, void **values, char *data_type, int64_t *retrieved_frame_number, double *retrieved_time) |
High-level function for reading the next frame of particle-dependent data of a specific type. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_non_particle_data_next_frame_read (const tng_trajectory_t tng_data, const int64_t block_id, void **values, char *data_type, int64_t *retrieved_frame_number, double *retrieved_time) |
High-level function for reading the next frame of non-particle-dependent data of a specific type. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_pos_read_range (const tng_trajectory_t tng_data, const int64_t first_frame, const int64_t last_frame, float **positions, int64_t *stride_length) |
High-level function for reading the positions of all particles from a specific range of frames. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_vel_read_range (const tng_trajectory_t tng_data, const int64_t first_frame, const int64_t last_frame, float **velocities, int64_t *stride_length) |
High-level function for reading the velocities of all particles from a specific range of frames. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_force_read_range (const tng_trajectory_t tng_data, const int64_t first_frame, const int64_t last_frame, float **forces, int64_t *stride_length) |
High-level function for reading the forces of all particles from a specific range of frames. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_box_shape_read_range (const tng_trajectory_t tng_data, const int64_t first_frame, const int64_t last_frame, float **box_shape, int64_t *stride_length) |
High-level function for reading the box shape from a specific range of frames. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_generic_write_interval_set (const tng_trajectory_t tng_data, const int64_t i, const int64_t n_values_per_frame, const int64_t block_id, const char *block_name, const char particle_dependency, const char compression) |
High-level function for setting the writing interval of data blocks. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_generic_write_interval_double_set (const tng_trajectory_t tng_data, const int64_t i, const int64_t n_values_per_frame, const int64_t block_id, const char *block_name, const char particle_dependency, const char compression) |
High-level function for setting the writing interval of data blocks containing double precision data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_generic_write_frequency_set (const tng_trajectory_t tng_data, const int64_t i, const int64_t n_values_per_frame, const int64_t block_id, const char *block_name, const char particle_dependency, const char compression) |
High-level function for setting the writing interval of data blocks. Obsolete! Use tng_util_generic_write_interval_set() More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_pos_write_interval_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of position data blocks. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_pos_write_interval_double_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of position data blocks containing double precision data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_pos_write_frequency_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of position data blocks. Obsolete! Use tng_util_pos_write_interval_set() More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_vel_write_interval_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of velocity data blocks. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_vel_write_interval_double_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of velocity data blocks containing double precision data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_vel_write_frequency_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of velocity data blocks. Obsolete! Use tng_util_vel_write_interval_set() More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_force_write_interval_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of force data blocks. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_force_write_interval_double_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of force data blocks containing double precision data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_force_write_frequency_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of force data blocks. Obsolete! Use tng_util_force_write_interval_set() More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_box_shape_write_interval_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of box shape data blocks. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_box_shape_write_interval_double_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of box shape data blocks containing double precision data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_box_shape_write_frequency_set (const tng_trajectory_t tng_data, const int64_t i) |
High-level function for setting the writing interval of velocity data blocks. Obsolete! Use tng_util_box_shape_write_interval_set() More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_generic_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const float *values, const int64_t n_values_per_frame, const int64_t block_id, const char *block_name, const char particle_dependency, const char compression) |
High-level function for writing data of one frame to a data block. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_generic_double_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double *values, const int64_t n_values_per_frame, const int64_t block_id, const char *block_name, const char particle_dependency, const char compression) |
High-level function for writing data of one frame to a double precision data block. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_pos_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const float *positions) |
High-level function for adding data to positions data blocks. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_pos_double_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double *positions) |
High-level function for adding data to positions data blocks at double precision. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_vel_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const float *velocities) |
High-level function for adding data to velocities data blocks. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_vel_double_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double *velocities) |
High-level function for adding data to velocities data blocks at double precision. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_force_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const float *forces) |
High-level function for adding data to forces data blocks. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_force_double_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double *forces) |
High-level function for adding data to forces data blocks at double precision. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_box_shape_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const float *box_shape) |
High-level function for adding data to box shape data blocks. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_box_shape_double_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double *box_shape) |
High-level function for adding data to box shape data blocks at double precision. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_generic_with_time_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double time, const float *values, const int64_t n_values_per_frame, const int64_t block_id, const char *block_name, const char particle_dependency, const char compression) |
High-level function for writing data of one frame to a data block. If the frame is at the beginning of a frame set the time stamp of the frame set is set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_generic_with_time_double_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double time, const double *values, const int64_t n_values_per_frame, const int64_t block_id, const char *block_name, const char particle_dependency, const char compression) |
High-level function for writing data of one frame to a double precision data block. If the frame is at the beginning of a frame set the time stamp of the frame set is set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_pos_with_time_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double time, const float *positions) |
High-level function for adding data to positions data blocks. If the frame is at the beginning of a frame set the time stamp of the frame set is set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_pos_with_time_double_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double time, const double *positions) |
High-level function for adding data to positions data blocks at double precision. If the frame is at the beginning of a frame set the time stamp of the frame set is set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_vel_with_time_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double time, const float *velocities) |
High-level function for adding data to velocities data blocks. If the frame is at the beginning of a frame set the time stamp of the frame set is set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_vel_with_time_double_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double time, const double *velocities) |
High-level function for adding data to velocities data blocks at double precision. If the frame is at the beginning of a frame set the time stamp of the frame set is set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_force_with_time_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double time, const float *forces) |
High-level function for adding data to forces data blocks. If the frame is at the beginning of a frame set the time stamp of the frame set is set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_force_with_time_double_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double time, const double *forces) |
High-level function for adding data to forces data blocks at double precision. If the frame is at the beginning of a frame set the time stamp of the frame set is set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_box_shape_with_time_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double time, const float *box_shape) |
High-level function for adding data to box shape data blocks. If the frame is at the beginning of a frame set the time stamp of the frame set is set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_box_shape_with_time_double_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const double time, const double *box_shape) |
High-level function for adding data to box shape data blocks at double precision. If the frame is at the beginning of a frame set the time stamp of the frame set is set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_frame_current_compression_get (const tng_trajectory_t tng_data, const int64_t block_id, int64_t *codec_id, double *factor) |
High-level function for getting the compression method and multiplication factor of the last read frame of a specific data block. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_trajectory_next_frame_present_data_blocks_find (const tng_trajectory_t tng_data, int64_t current_frame, const int64_t n_requested_data_block_ids, const int64_t *requested_data_block_ids, int64_t *next_frame, int64_t *n_data_blocks_in_next_frame, int64_t **data_block_ids_in_next_frame) |
High-level function for determining the next frame with data and what data blocks have data for that frame. The search can be limited to certain data blocks. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_prepare_append_after_frame (const tng_trajectory_t tng_data, const int64_t prev_frame) |
Finds the frame set of the specified frame in order to prepare for writing after it. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_util_num_frames_with_data_of_block_id_get (const tng_trajectory_t tng_data, const int64_t block_id, int64_t *n_frames) |
Get the number of frames containing data of a specific type. More... | |
These functions make it easier to access and output TNG data. They are recommended unless there is a special reason to use the more detailed functions available in the low-level API.
tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_double_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double * | box_shape | ||
) |
High-level function for adding data to box shape data blocks at double precision.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. If frame_nr < 0 the data is written as non-trajectory data. |
box_shape | is a 1D array of data to add. The array should be of length 9. |
This function uses tng_util_generic_write() and will create a box shape data block if none exists. Box shapes are stored as 9 values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_read | ( | const tng_trajectory_t | tng_data, |
float ** | box_shape, | ||
int64_t * | stride_length | ||
) |
High-level function for reading the box shape from all frames.
tng_data | is the trajectory to read from. |
box_shape | will be set to point at a 1-dimensional array of floats, which will contain the box shape. The data is stored sequentially in order of frames. The variable may point at already allocated memory or be a NULL pointer. If the box shape is not modified during the trajectory, but as general data, that will be returned instead. |
stride_length | will be set to the writing interval of the stored data. |
This function should only be used if number of values used to specify the box shape is known (by default TNG uses 9 values) since it does not return the number of values in the array. It is recommended to use tng_data_vector_interval_get() instead.
tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_read_range | ( | const tng_trajectory_t | tng_data, |
const int64_t | first_frame, | ||
const int64_t | last_frame, | ||
float ** | box_shape, | ||
int64_t * | stride_length | ||
) |
High-level function for reading the box shape from a specific range of frames.
tng_data | is the trajectory to read from. |
first_frame | is the first frame to return position data from. |
last_frame | is the last frame to return position data from. |
box_shape | will be set to point at a 1-dimensional array of floats, which will contain the box shape. The data is stored sequentially in order of frames. If the box shape is not modified during the trajectory, but as general data, that will be returned instead. The variable may point at already allocated memory or be a NULL pointer. The memory must be freed afterwards. |
stride_length | will be set to the writing interval of the stored data. |
This function should only be used if number of values used to specify the box shape is known (by default TNG uses 9 values) since it does not return the number of values in the array. It is recommended to use tng_data_vector_interval_get() instead.
tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_with_time_double_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double | time, | ||
const double * | box_shape | ||
) |
High-level function for adding data to box shape data blocks at double precision. If the frame is at the beginning of a frame set the time stamp of the frame set is set.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. |
time | is the time stamp of the frame (in seconds). |
box_shape | is a 1D array of data to add. The array should be of length 9. |
This function uses tng_util_generic_with_time_double_write() and will create a box shape data block if none exists. Box shapes are stored as 9 values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_with_time_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double | time, | ||
const float * | box_shape | ||
) |
High-level function for adding data to box shape data blocks. If the frame is at the beginning of a frame set the time stamp of the frame set is set.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. |
time | is the time stamp of the frame (in seconds). |
box_shape | is a 1D array of data to add. The array should be of length 9. |
This function uses tng_util_generic_with_time_write() and will create a box shape data block if none exists. Box shapes are stored as 9 values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const float * | box_shape | ||
) |
High-level function for adding data to box shape data blocks.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. If frame_nr < 0 the data is written as non-trajectory data. |
box_shape | is a 1D array of data to add. The array should be of length 9. |
This function uses tng_util_generic_write() and will create a box shape data block if none exists. Box shapes are stored as 9 values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_write_frequency_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of velocity data blocks. Obsolete! Use tng_util_box_shape_write_interval_set()
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a box shape data block if none exists. This function is replaced by the more correcly named tng_util_box_shape_write_interval_set(), but is kept for compatibility.
tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_write_interval_double_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of box shape data blocks containing double precision data.
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a box shape data block if none exists.
tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_write_interval_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of box shape data blocks.
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a box shape data block if none exists.
tng_function_status DECLSPECDLLEXPORT tng_util_force_double_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double * | forces | ||
) |
High-level function for adding data to forces data blocks at double precision.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. If frame_nr < 0 the data is written as non-trajectory data. |
forces | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_write() and will create a forces data block if none exists. Forces are stored as three values per frame and compressed using gzip compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_force_read | ( | const tng_trajectory_t | tng_data, |
float ** | forces, | ||
int64_t * | stride_length | ||
) |
High-level function for reading the forces of all particles from all frames.
tng_data | is the trajectory to read from. |
forces | will be set to point at a 1-dimensional array of floats, which will contain the forces. The data is stored sequentially in order of frames. For each frame the forces (in x, y and z) are stored. The variable may point at already allocated memory or be a NULL pointer. The memory must be freed afterwards. |
stride_length | will be set to the writing interval of the stored data. |
tng_function_status DECLSPECDLLEXPORT tng_util_force_read_range | ( | const tng_trajectory_t | tng_data, |
const int64_t | first_frame, | ||
const int64_t | last_frame, | ||
float ** | forces, | ||
int64_t * | stride_length | ||
) |
High-level function for reading the forces of all particles from a specific range of frames.
tng_data | is the trajectory to read from. |
first_frame | is the first frame to return position data from. |
last_frame | is the last frame to return position data from. |
forces | will be set to point at a 1-dimensional array of floats, which will contain the forces. The data is stored sequentially in order of frames. For each frame the forces (in x, y and z) are stored. The variable may point at already allocated memory or be a NULL pointer. The memory must be freed afterwards. |
stride_length | will be set to the writing interval of the stored data. |
tng_function_status DECLSPECDLLEXPORT tng_util_force_with_time_double_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double | time, | ||
const double * | forces | ||
) |
High-level function for adding data to forces data blocks at double precision. If the frame is at the beginning of a frame set the time stamp of the frame set is set.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. |
time | is the time stamp of the frame (in seconds). |
forces | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_with_time_double_write() and will create a forces data block if none exists. Forces are stored as three values per frame and compressed using gzip compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_force_with_time_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double | time, | ||
const float * | forces | ||
) |
High-level function for adding data to forces data blocks. If the frame is at the beginning of a frame set the time stamp of the frame set is set.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. |
time | is the time stamp of the frame (in seconds). |
forces | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_with_time_write() and will create a forces data block if none exists. Forces are stored as three values per frame and compressed using gzip compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_force_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const float * | forces | ||
) |
High-level function for adding data to forces data blocks.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. If frame_nr < 0 the data is written as non-trajectory data. |
forces | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_write() and will create a forces data block if none exists. Forces are stored as three values per frame and compressed using gzip compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_force_write_frequency_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of force data blocks. Obsolete! Use tng_util_force_write_interval_set()
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a forces data block if none exists. This function is replaced by the more correcly named tng_util_force_write_interval_set(), but is kept for compatibility.
tng_function_status DECLSPECDLLEXPORT tng_util_force_write_interval_double_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of force data blocks containing double precision data.
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a forces data block if none exists.
tng_function_status DECLSPECDLLEXPORT tng_util_force_write_interval_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of force data blocks.
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a forces data block if none exists.
tng_function_status DECLSPECDLLEXPORT tng_util_frame_current_compression_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
int64_t * | codec_id, | ||
double * | factor | ||
) |
High-level function for getting the compression method and multiplication factor of the last read frame of a specific data block.
tng_data | is the trajectory to use. |
block_id | is the ID number of the block containing the data of interest. |
codec_id | will be set to the value of the codec_id of the compression of the data block. See tng_compression for more details. |
factor | will be set to the multiplication factor applied to the values before compression, in order to get integers from them. factor is 1/precision. |
tng_function_status DECLSPECDLLEXPORT tng_util_generic_double_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double * | values, | ||
const int64_t | n_values_per_frame, | ||
const int64_t | block_id, | ||
const char * | block_name, | ||
const char | particle_dependency, | ||
const char | compression | ||
) |
High-level function for writing data of one frame to a double precision data block.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. If frame_nr < 0 the data is written as non-trajectory data. |
values | is a 1D array of data to add. The array should be of length n_particles * n_values_per_frame if writing particle related data, otherwise it should be n_values_per_frame. |
n_values_per_frame | is the number of values to store per frame. If the data is particle dependent there will be n_values_per_frame stored per particle each frame. |
block_id | is the ID of the block, of which to set the output interval. |
block_name | is a string that will be used as name of the block. Only required if the block did not exist, i.e. a new block is created. |
particle_dependency | should be TNG_NON_PARTICLE_BLOCK_DATA (0) if the data is not related to specific particles (e.g. box shape) or TNG_PARTICLE_BLOCK_DATA (1) is it is related to specific particles (e.g. positions). Only required if the block did not exist, i.e. a new block is created. |
compression | is the compression routine to use when writing the data. Only required if the block did not exist, i.e. a new block is created. |
n_values_per_frame, block_name, particle_dependency and compression are only used if the data block did not exist before calling this function, in which case it is created. N.b. Data is written a whole block at a time. The data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_generic_with_time_double_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double | time, | ||
const double * | values, | ||
const int64_t | n_values_per_frame, | ||
const int64_t | block_id, | ||
const char * | block_name, | ||
const char | particle_dependency, | ||
const char | compression | ||
) |
High-level function for writing data of one frame to a double precision data block. If the frame is at the beginning of a frame set the time stamp of the frame set is set.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. |
time | is the time stamp of the frame (in seconds). |
values | is a 1D array of data to add. The array should be of length n_particles * n_values_per_frame if writing particle related data, otherwise it should be n_values_per_frame. |
n_values_per_frame | is the number of values to store per frame. If the data is particle dependent there will be n_values_per_frame stored per particle each frame. |
block_id | is the ID of the block, of which to set the output interval. |
block_name | is a string that will be used as name of the block. Only required if the block did not exist, i.e. a new block is created. |
particle_dependency | should be TNG_NON_PARTICLE_BLOCK_DATA (0) if the data is not related to specific particles (e.g. box shape) or TNG_PARTICLE_BLOCK_DATA (1) is it is related to specific particles (e.g. positions). Only required if the block did not exist, i.e. a new block is created. |
compression | is the compression routine to use when writing the data. Only required if the block did not exist, i.e. a new block is created. |
n_values_per_frame, block_name, particle_dependency and compression are only used if the data block did not exist before calling this function, in which case it is created. N.b. Data is written a whole block at a time. The data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_generic_with_time_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double | time, | ||
const float * | values, | ||
const int64_t | n_values_per_frame, | ||
const int64_t | block_id, | ||
const char * | block_name, | ||
const char | particle_dependency, | ||
const char | compression | ||
) |
High-level function for writing data of one frame to a data block. If the frame is at the beginning of a frame set the time stamp of the frame set is set.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. |
time | is the time stamp of the frame (in seconds). |
values | is a 1D array of data to add. The array should be of length n_particles * n_values_per_frame if writing particle related data, otherwise it should be n_values_per_frame. |
n_values_per_frame | is the number of values to store per frame. If the data is particle dependent there will be n_values_per_frame stored per particle each frame. |
block_id | is the ID of the block, of which to set the output interval. |
block_name | is a string that will be used as name of the block. Only required if the block did not exist, i.e. a new block is created. |
particle_dependency | should be TNG_NON_PARTICLE_BLOCK_DATA (0) if the data is not related to specific particles (e.g. box shape) or TNG_PARTICLE_BLOCK_DATA (1) is it is related to specific particles (e.g. positions). Only required if the block did not exist, i.e. a new block is created. |
compression | is the compression routine to use when writing the data. Only required if the block did not exist, i.e. a new block is created. |
n_values_per_frame, block_name, particle_dependency and compression are only used if the data block did not exist before calling this function, in which case it is created. N.b. Data is written a whole block at a time. The data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_generic_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const float * | values, | ||
const int64_t | n_values_per_frame, | ||
const int64_t | block_id, | ||
const char * | block_name, | ||
const char | particle_dependency, | ||
const char | compression | ||
) |
High-level function for writing data of one frame to a data block.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. If frame_nr < 0 the data is written as non-trajectory data. |
values | is a 1D array of data to add. The array should be of length n_particles * n_values_per_frame if writing particle related data, otherwise it should be n_values_per_frame. |
n_values_per_frame | is the number of values to store per frame. If the data is particle dependent there will be n_values_per_frame stored per particle each frame. |
block_id | is the ID of the block, of which to set the output interval. |
block_name | is a string that will be used as name of the block. Only required if the block did not exist, i.e. a new block is created. |
particle_dependency | should be TNG_NON_PARTICLE_BLOCK_DATA (0) if the data is not related to specific particles (e.g. box shape) or TNG_PARTICLE_BLOCK_DATA (1) is it is related to specific particles (e.g. positions). Only required if the block did not exist, i.e. a new block is created. |
compression | is the compression routine to use when writing the data. Only required if the block did not exist, i.e. a new block is created. |
n_values_per_frame, block_name, particle_dependency and compression are only used if the data block did not exist before calling this function, in which case it is created. N.b. Data is written a whole block at a time. The data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_generic_write_frequency_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i, | ||
const int64_t | n_values_per_frame, | ||
const int64_t | block_id, | ||
const char * | block_name, | ||
const char | particle_dependency, | ||
const char | compression | ||
) |
High-level function for setting the writing interval of data blocks. Obsolete! Use tng_util_generic_write_interval_set()
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
n_values_per_frame | is the number of values to store per frame. If the data is particle dependent there will be n_values_per_frame stored per particle each frame. |
block_id | is the ID of the block, of which to set the output interval. |
block_name | is a string that will be used as name of the block. Only required if the block did not exist, i.e. a new block is created. |
particle_dependency | should be TNG_NON_PARTICLE_BLOCK_DATA (0) if the data is not related to specific particles (e.g. box shape) or TNG_PARTICLE_BLOCK_DATA (1) is it is related to specific particles (e.g. positions). Only required if the block did not exist, i.e. a new block is created. |
compression | is the compression routine to use when writing the data. Only required if the block did not exist, i.e. a new block is created. |
n_values_per_frame, block_name, particle_dependency and compression are only used if the data block did not exist before calling this function, in which case it is created. This function is replaced by the more correcly named tng_util_generic_write_interval_set(), but is kept for compatibility.
tng_function_status DECLSPECDLLEXPORT tng_util_generic_write_interval_double_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i, | ||
const int64_t | n_values_per_frame, | ||
const int64_t | block_id, | ||
const char * | block_name, | ||
const char | particle_dependency, | ||
const char | compression | ||
) |
High-level function for setting the writing interval of data blocks containing double precision data.
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
n_values_per_frame | is the number of values to store per frame. If the data is particle dependent there will be n_values_per_frame stored per particle each frame. |
block_id | is the ID of the block, of which to set the output interval. |
block_name | is a string that will be used as name of the block. Only required if the block did not exist, i.e. a new block is created. |
particle_dependency | should be TNG_NON_PARTICLE_BLOCK_DATA (0) if the data is not related to specific particles (e.g. box shape) or TNG_PARTICLE_BLOCK_DATA (1) is it is related to specific particles (e.g. positions). Only required if the block did not exist, i.e. a new block is created. |
compression | is the compression routine to use when writing the data. Only required if the block did not exist, i.e. a new block is created. |
n_values_per_frame, block_name, particle_dependency and compression are only used if the data block did not exist before calling this function, in which case it is created.
tng_function_status DECLSPECDLLEXPORT tng_util_generic_write_interval_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i, | ||
const int64_t | n_values_per_frame, | ||
const int64_t | block_id, | ||
const char * | block_name, | ||
const char | particle_dependency, | ||
const char | compression | ||
) |
High-level function for setting the writing interval of data blocks.
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
n_values_per_frame | is the number of values to store per frame. If the data is particle dependent there will be n_values_per_frame stored per particle each frame. |
block_id | is the ID of the block, of which to set the output interval. |
block_name | is a string that will be used as name of the block. Only required if the block did not exist, i.e. a new block is created. |
particle_dependency | should be TNG_NON_PARTICLE_BLOCK_DATA (0) if the data is not related to specific particles (e.g. box shape) or TNG_PARTICLE_BLOCK_DATA (1) is it is related to specific particles (e.g. positions). Only required if the block did not exist, i.e. a new block is created. |
compression | is the compression routine to use when writing the data. Only required if the block did not exist, i.e. a new block is created. |
n_values_per_frame, block_name, particle_dependency and compression are only used if the data block did not exist before calling this function, in which case it is created.
tng_function_status DECLSPECDLLEXPORT tng_util_non_particle_data_next_frame_read | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
void ** | values, | ||
char * | data_type, | ||
int64_t * | retrieved_frame_number, | ||
double * | retrieved_time | ||
) |
High-level function for reading the next frame of non-particle-dependent data of a specific type.
tng_data | is the trajectory to read from. |
block_id | is the ID number of the block containing the data of interest. |
values | will be set to point at a 1-dimensional array containing the requested data. The variable may point at already allocated memory or be a NULL pointer. The memory must be freed afterwards. |
data_type | will be pointing to a character indicating the size of the data of the returned values, e.g. TNG_INT_DATA, TNG_FLOAT_DATA or TNG_DOUBLE_DATA. |
retrieved_frame_number | will be pointing at the frame number of the returned frame. |
retrieved_time | will be pointing at the time stamp of the returned frame. |
tng_function_status DECLSPECDLLEXPORT tng_util_num_frames_with_data_of_block_id_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
int64_t * | n_frames | ||
) |
Get the number of frames containing data of a specific type.
tng_data | is the trajectory to use. |
block_id | is the id of the block of the data type. |
n_frames | is set to the number of frames containing data of the requested data type. |
tng_function_status DECLSPECDLLEXPORT tng_util_particle_data_next_frame_read | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
void ** | values, | ||
char * | data_type, | ||
int64_t * | retrieved_frame_number, | ||
double * | retrieved_time | ||
) |
High-level function for reading the next frame of particle-dependent data of a specific type.
tng_data | is the trajectory to read from. |
block_id | is the ID number of the block containing the data of interest. |
values | will be set to point at a 1-dimensional array containing the requested data. The variable may point at already allocated memory (which will be reallocated with realloc()), or be a NULL pointer. The calling code must free the memory afterwards. |
data_type | will be pointing to a character indicating the size of the data of the returned values, e.g. TNG_INT_DATA, TNG_FLOAT_DATA or TNG_DOUBLE_DATA. |
retrieved_frame_number | will be pointing at the frame number of the returned frame. |
retrieved_time | will be pointing at the time stamp of the returned frame. |
If no frame has been read before the first frame of the trajectory is read.
tng_function_status DECLSPECDLLEXPORT tng_util_pos_double_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double * | positions | ||
) |
High-level function for adding data to positions data blocks at double precision.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. If frame_nr < 0 the data is written as non-trajectory data. |
positions | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_write() and will create a positions data block if none exists. Positions are stored as three values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_pos_read | ( | const tng_trajectory_t | tng_data, |
float ** | positions, | ||
int64_t * | stride_length | ||
) |
High-level function for reading the positions of all particles from all frames.
tng_data | is the trajectory to read from. |
positions | will be set to point at a 1-dimensional array of floats, which will contain the positions. The data is stored sequentially in order of frames. For each frame the positions (x, y and z coordinates) are stored. The variable may point at already allocated memory or be a NULL pointer. The memory must be freed afterwards. |
stride_length | will be set to the writing interval of the stored data. |
tng_function_status DECLSPECDLLEXPORT tng_util_pos_read_range | ( | const tng_trajectory_t | tng_data, |
const int64_t | first_frame, | ||
const int64_t | last_frame, | ||
float ** | positions, | ||
int64_t * | stride_length | ||
) |
High-level function for reading the positions of all particles from a specific range of frames.
tng_data | is the trajectory to read from. |
first_frame | is the first frame to return position data from. |
last_frame | is the last frame to return position data from. |
positions | will be set to point at a 1-dimensional array of floats, which will contain the positions. The data is stored sequentially in order of frames. For each frame the positions (x, y and z coordinates) are stored. The variable may point at already allocated memory or be a NULL pointer. The memory must be freed afterwards. |
stride_length | will be set to the writing interval of the stored data. |
tng_function_status DECLSPECDLLEXPORT tng_util_pos_with_time_double_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double | time, | ||
const double * | positions | ||
) |
High-level function for adding data to positions data blocks at double precision. If the frame is at the beginning of a frame set the time stamp of the frame set is set.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. |
time | is the time stamp of the frame (in seconds). |
positions | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_with_time_double_write() and will create a positions data block if none exists. Positions are stored as three values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_pos_with_time_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double | time, | ||
const float * | positions | ||
) |
High-level function for adding data to positions data blocks. If the frame is at the beginning of a frame set the time stamp of the frame set is set.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. |
time | is the time stamp of the frame (in seconds). |
positions | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_with_time_write() and will create a positions data block if none exists. Positions are stored as three values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_pos_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const float * | positions | ||
) |
High-level function for adding data to positions data blocks.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. If frame_nr < 0 the data is written as non-trajectory data. |
positions | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_write() and will create a positions data block if none exists. Positions are stored as three values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_pos_write_frequency_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of position data blocks. Obsolete! Use tng_util_pos_write_interval_set()
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a positions data block if none exists. This function is replaced by the more correcly named tng_util_pos_write_interval_set(), but is kept for compatibility.
tng_function_status DECLSPECDLLEXPORT tng_util_pos_write_interval_double_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of position data blocks containing double precision data.
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a positions data block if none exists.
tng_function_status DECLSPECDLLEXPORT tng_util_pos_write_interval_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of position data blocks.
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a positions data block if none exists.
tng_function_status DECLSPECDLLEXPORT tng_util_prepare_append_after_frame | ( | const tng_trajectory_t | tng_data, |
const int64_t | prev_frame | ||
) |
Finds the frame set of the specified frame in order to prepare for writing after it.
tng_data | is the trajectory to use. |
prev_frame | is the frame after which to start appending. |
tng_function_status DECLSPECDLLEXPORT tng_util_time_of_frame_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
double * | time | ||
) |
High-level function for getting the time (in seconds) of a frame.
tng_data | is the trajectory containing the frame. |
frame_nr | is the frame number of which to get the time. |
time | is set to the time (in seconds) of the specified frame. |
tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_close | ( | tng_trajectory_t * | tng_data_p | ) |
High-level function for closing a TNG trajectory.
tng_data_p | is a pointer to the trajectory to close. The memory will be freed after finalising the writing. |
tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_next_frame_present_data_blocks_find | ( | const tng_trajectory_t | tng_data, |
int64_t | current_frame, | ||
const int64_t | n_requested_data_block_ids, | ||
const int64_t * | requested_data_block_ids, | ||
int64_t * | next_frame, | ||
int64_t * | n_data_blocks_in_next_frame, | ||
int64_t ** | data_block_ids_in_next_frame | ||
) |
High-level function for determining the next frame with data and what data blocks have data for that frame. The search can be limited to certain data blocks.
tng_data | is the trajectory to use. |
current_frame | is the frame that was last read, from where to start looking for data. |
n_requested_data_block_ids | is the number of data blocks listed in requested_data_block_ids. If this is 0 all data blocks will be taken into account. |
requested_data_block_ids | is an array of data blocks to look for. |
next_frame | will be set to the next frame with data. |
n_data_blocks_in_next_frame | is set to the number of data blocks with data for next_frame. |
data_block_ids_in_next_frame | is set to an array (of length n_data_blocks_in_next_frame) that lists the data block IDs with data for next_frame. It must be pointing at NULL or previously allocated memory. Memory for the array is reallocated by this function using realloc(). The memory must be freed by the client afterwards or there will be a memory leak. |
tng_function_status DECLSPECDLLEXPORT tng_util_trajectory_open | ( | const char * | filename, |
const char | mode, | ||
tng_trajectory_t * | tng_data_p | ||
) |
High-level function for opening and initializing a TNG trajectory.
filename | is a string containing the name of the trajectory to open. |
mode | specifies the file mode of the trajectory. Can be set to 'r', 'w' or 'a' for reading, writing or appending respectively. |
tng_data_p | is a pointer to the opened trajectory. This will be allocated by the TNG library. The trajectory must be closed by the user, whereby memory is freed. |
tng_function_status DECLSPECDLLEXPORT tng_util_vel_double_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double * | velocities | ||
) |
High-level function for adding data to velocities data blocks at double precision.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. If frame_nr < 0 the data is written as non-trajectory data. |
velocities | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_write() and will create a velocities data block if none exists. Velocities are stored as three values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_vel_read | ( | const tng_trajectory_t | tng_data, |
float ** | velocities, | ||
int64_t * | stride_length | ||
) |
High-level function for reading the velocities of all particles from all frames.
tng_data | is the trajectory to read from. |
velocities | will be set to point at a 1-dimensional array of floats, which will contain the velocities. The data is stored sequentially in order of frames. For each frame the velocities (in x, y and z) are stored. The variable may point at already allocated memory or be a NULL pointer. The memory must be freed afterwards. |
stride_length | will be set to the writing interval of the stored data. |
tng_function_status DECLSPECDLLEXPORT tng_util_vel_read_range | ( | const tng_trajectory_t | tng_data, |
const int64_t | first_frame, | ||
const int64_t | last_frame, | ||
float ** | velocities, | ||
int64_t * | stride_length | ||
) |
High-level function for reading the velocities of all particles from a specific range of frames.
tng_data | is the trajectory to read from. |
first_frame | is the first frame to return position data from. |
last_frame | is the last frame to return position data from. |
velocities | will be set to point at a 1-dimensional array of floats, which will contain the velocities. The data is stored sequentially in order of frames. For each frame the velocities (in x, y and z) are stored. The variable may point at already allocated memory or be a NULL pointer. The memory must be freed afterwards. |
stride_length | will be set to the writing interval of the stored data. |
tng_function_status DECLSPECDLLEXPORT tng_util_vel_with_time_double_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double | time, | ||
const double * | velocities | ||
) |
High-level function for adding data to velocities data blocks at double precision. If the frame is at the beginning of a frame set the time stamp of the frame set is set.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. |
time | is the time stamp of the frame (in seconds). |
velocities | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_with_time_double_write() and will create a velocities data block if none exists. Velocities are stored as three values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_vel_with_time_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const double | time, | ||
const float * | velocities | ||
) |
High-level function for adding data to velocities data blocks. If the frame is at the beginning of a frame set the time stamp of the frame set is set.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. |
time | is the time stamp of the frame (in seconds). |
velocities | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_with_time_write() and will create a velocities data block if none exists. Velocities are stored as three values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_vel_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const float * | velocities | ||
) |
High-level function for adding data to velocities data blocks.
tng_data | is the trajectory to use. |
frame_nr | is the frame number of the data. If frame_nr < 0 the data is written as non-trajectory data. |
velocities | is a 1D array of data to add. The array should be of length n_particles * 3. |
This function uses tng_util_generic_write() and will create a velocities data block if none exists. Velocities are stored as three values per frame and compressed using TNG compression. N.b. Since compressed data is written a whole block at a time the data is not actually written to disk until the frame set is finished or the TNG trajectory is closed.
tng_function_status DECLSPECDLLEXPORT tng_util_vel_write_frequency_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of velocity data blocks. Obsolete! Use tng_util_vel_write_interval_set()
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a velocities data block if none exists. This function is replaced by the more correcly named tng_util_vel_write_interval_set(), but is kept for compatibility.
tng_function_status DECLSPECDLLEXPORT tng_util_vel_write_interval_double_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of velocity data blocks containing double precision data.
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a velocities data block if none exists.
tng_function_status DECLSPECDLLEXPORT tng_util_vel_write_interval_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | i | ||
) |
High-level function for setting the writing interval of velocity data blocks.
tng_data | is the trajectory to use. |
i | is the output interval, i.e. i == 10 means data written every 10th frame. |
This function uses tng_util_generic_write_interval_set() and will create a velocities data block if none exists.