TNG API
1.8.2
A flexible binary trajectory format
|
These functions give detailed control of the TNG data management. Most things can be done using the more convenient high-level API functions instead. More...
Functions | |
tng_function_status DECLSPECDLLEXPORT | tng_version_major (const tng_trajectory_t tng_data, int *version) |
Get the major version of the TNG library. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_version_minor (const tng_trajectory_t tng_data, int *version) |
Get the minor version of the TNG library. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_version_patchlevel (const tng_trajectory_t tng_data, int *patch_level) |
Get the patch level of the TNG library. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_version (const tng_trajectory_t tng_data, char *version, const int max_len) |
Get the full version string of the TNG library. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_trajectory_init (tng_trajectory_t *tng_data_p) |
Setup a trajectory data container. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_trajectory_destroy (tng_trajectory_t *tng_data_p) |
Clean up a trajectory data container. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_trajectory_init_from_src (const tng_trajectory_t src, tng_trajectory_t *dest_p) |
Copy a trajectory data container (dest is setup as well). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_input_file_get (const tng_trajectory_t tng_data, char *file_name, const int max_len) |
Get the name of the input file. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_input_file_set (const tng_trajectory_t tng_data, const char *file_name) |
Set the name of the input file. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_output_file_get (const tng_trajectory_t tng_data, char *file_name, const int max_len) |
Get the name of the output file. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_output_file_set (const tng_trajectory_t tng_data, const char *file_name) |
Set the name of the output file. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_output_append_file_set (const tng_trajectory_t tng_data, const char *file_name) |
Set the name of the output file for appending. The output file will not be overwritten. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_output_file_endianness_get (const tng_trajectory_t tng_data, tng_file_endianness *endianness) |
Get the endianness of the output file. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_output_file_endianness_set (const tng_trajectory_t tng_data, const tng_file_endianness endianness) |
Set the endianness of the output file. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_first_program_name_get (const tng_trajectory_t tng_data, char *name, const int max_len) |
Get the name of the program used when creating the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_first_program_name_set (const tng_trajectory_t tng_data, const char *new_name) |
Set the name of the program used when creating the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_last_program_name_get (const tng_trajectory_t tng_data, char *name, const int max_len) |
Get the name of the program used when last modifying the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_last_program_name_set (const tng_trajectory_t tng_data, const char *new_name) |
Set the name of the program used when last modifying the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_first_user_name_get (const tng_trajectory_t tng_data, char *name, const int max_len) |
Get the name of the user who created the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_first_user_name_set (const tng_trajectory_t tng_data, const char *new_name) |
Set the name of the user who created the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_last_user_name_get (const tng_trajectory_t tng_data, char *name, const int max_len) |
Get the name of the user who last modified the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_last_user_name_set (const tng_trajectory_t tng_data, const char *new_name) |
Set the name of the user who last modified the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_first_computer_name_get (const tng_trajectory_t tng_data, char *name, const int max_len) |
Get the name of the computer used when creating the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_first_computer_name_set (const tng_trajectory_t tng_data, const char *new_name) |
Set the name of the computer used when creating the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_last_computer_name_get (const tng_trajectory_t tng_data, char *name, const int max_len) |
Get the name of the computer used when last modifying the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_last_computer_name_set (const tng_trajectory_t tng_data, const char *new_name) |
Set the name of the computer used when last modifying the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_first_signature_get (const tng_trajectory_t tng_data, char *signature, const int max_len) |
Get the pgp_signature of the user creating the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_first_signature_set (const tng_trajectory_t tng_data, const char *signature) |
Set the pgp_signature of the user creating the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_last_signature_get (const tng_trajectory_t tng_data, char *signature, const int max_len) |
Get the pgp_signature of the user last modifying the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_last_signature_set (const tng_trajectory_t tng_data, const char *signature) |
Set the pgp_signature of the user last modifying the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_forcefield_name_get (const tng_trajectory_t tng_data, char *name, const int max_len) |
Get the name of the forcefield used in the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_forcefield_name_set (const tng_trajectory_t tng_data, const char *new_name) |
Set the name of the forcefield used in the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_medium_stride_length_get (const tng_trajectory_t tng_data, int64_t *len) |
Get the medium stride length of the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_medium_stride_length_set (const tng_trajectory_t tng_data, const int64_t len) |
Set the medium stride length of the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_long_stride_length_get (const tng_trajectory_t tng_data, int64_t *len) |
Get the long stride length of the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_long_stride_length_set (const tng_trajectory_t tng_data, const int64_t len) |
Set the long stride length of the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_time_per_frame_get (const tng_trajectory_t tng_data, double *time) |
Get the current time per frame of the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_time_per_frame_set (const tng_trajectory_t tng_data, const double time) |
Set the time per frame of the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_input_file_len_get (const tng_trajectory_t tng_data, int64_t *len) |
Get the length of the input file. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_num_frames_get (const tng_trajectory_t tng_data, int64_t *n) |
Get the number of frames in the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_compression_precision_get (const tng_trajectory_t tng_data, double *precision) |
Get the precision of lossy compression. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_compression_precision_set (const tng_trajectory_t tng_data, const double precision) |
Set the precision of lossy compression. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_implicit_num_particles_set (const tng_trajectory_t tng_data, const int64_t n) |
Set the number of particles, in the case no molecular system is used. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_num_particles_get (const tng_trajectory_t tng_data, int64_t *n) |
Get the current number of particles. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_num_particles_variable_get (const tng_trajectory_t tng_data, char *variable) |
Get if the number of particle can be varied during the simulation. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_num_molecule_types_get (const tng_trajectory_t tng_data, int64_t *n) |
Get the number of molecule types (length of tng_data->molecules). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_num_molecules_get (const tng_trajectory_t tng_data, int64_t *n) |
Get the current total number of molecules. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_cnt_list_get (const tng_trajectory_t tng_data, int64_t **mol_cnt_list) |
Get the list of the count of each molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_distance_unit_exponential_get (const tng_trajectory_t tng_data, int64_t *exp) |
Get the exponent used for distances in the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_distance_unit_exponential_set (const tng_trajectory_t tng_data, const int64_t exp) |
Set the exponent used for distances in the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_num_frames_per_frame_set_get (const tng_trajectory_t tng_data, int64_t *n) |
Get the number of frames per frame set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_num_frames_per_frame_set_set (const tng_trajectory_t tng_data, const int64_t n) |
Set the number of frames per frame set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_num_frame_sets_get (const tng_trajectory_t tng_data, int64_t *n) |
Get the number of frame sets. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_current_frame_set_get (const tng_trajectory_t tng_data, tng_trajectory_frame_set_t *frame_set_p) |
Get the current trajectory frame set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_nr_find (const tng_trajectory_t tng_data, const int64_t nr) |
Find the requested frame set number. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_of_frame_find (const tng_trajectory_t tng_data, const int64_t frame) |
Find the frame set containing a specific frame. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_next_frame_set_file_pos_get (const tng_trajectory_t tng_data, const tng_trajectory_frame_set_t frame_set, int64_t *pos) |
Get the file position of the next frame set in the input file. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_prev_frame_set_file_pos_get (const tng_trajectory_t tng_data, const tng_trajectory_frame_set_t frame_set, int64_t *pos) |
Get the file position of the previous frame set in the input file. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_frame_range_get (const tng_trajectory_t tng_data, const tng_trajectory_frame_set_t frame_set, int64_t *first_frame, int64_t *last_frame) |
Get the first and last frames of the frame set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_alloc (const tng_trajectory_t tng_data, tng_molecule_t *molecule_p) |
Allocate memory for and setup a molecule container. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_free (const tng_trajectory_t tng_data, tng_molecule_t *molecule_p) |
Clean up a molecule container and free its allocated memory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_init (const tng_trajectory_t tng_data, const tng_molecule_t molecule) |
Setup a molecule container. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_destroy (const tng_trajectory_t tng_data, const tng_molecule_t molecule) |
Clean up a molecule container. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_add (const tng_trajectory_t tng_data, const char *name, tng_molecule_t *molecule) |
Add a molecule to the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_w_id_add (const tng_trajectory_t tng_data, const char *name, const int64_t id, tng_molecule_t *molecule) |
Add a molecule with a specific ID to the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_existing_add (const tng_trajectory_t tng_data, tng_molecule_t *molecule) |
Add an existing molecule (from a molecule container) to the trajectory. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_name_get (const tng_trajectory_t tng_data, const tng_molecule_t molecule, char *name, const int max_len) |
Get the name of a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_name_set (const tng_trajectory_t tng_data, const tng_molecule_t molecule, const char *new_name) |
Set the name of a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_cnt_get (const tng_trajectory_t tng_data, const tng_molecule_t molecule, int64_t *cnt) |
Get the count of a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_cnt_set (const tng_trajectory_t tng_data, const tng_molecule_t molecule, const int64_t cnt) |
Set the count of a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_find (const tng_trajectory_t tng_data, const char *name, const int64_t id, tng_molecule_t *molecule) |
Find a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_of_index_get (const tng_trajectory_t tng_data, const int64_t index, tng_molecule_t *molecule) |
Retrieve the molecule with specified index in the list of molecules. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_system_copy (const tng_trajectory_t tng_data_src, const tng_trajectory_t tng_data_dest) |
Copy all molecules and the molecule counts from one TNG trajectory to another. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_num_chains_get (const tng_trajectory_t tng_data, const tng_molecule_t molecule, int64_t *n) |
Get the number of chains in a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_chain_of_index_get (const tng_trajectory_t tng_data, const tng_molecule_t molecule, const int64_t index, tng_chain_t *chain) |
Retrieve the chain of a molecule with specified index in the list of chains. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_num_residues_get (const tng_trajectory_t tng_data, const tng_molecule_t molecule, int64_t *n) |
Get the number of residues in a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_residue_of_index_get (const tng_trajectory_t tng_data, const tng_molecule_t molecule, const int64_t index, tng_residue_t *residue) |
Retrieve the residue of a molecule with specified index in the list of chains. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_num_atoms_get (const tng_trajectory_t tng_data, const tng_molecule_t molecule, int64_t *n) |
Get the number of atoms in a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_atom_of_index_get (const tng_trajectory_t tng_data, const tng_molecule_t molecule, const int64_t index, tng_atom_t *atom) |
Retrieve the atom of a molecule with specified index in the list of atoms. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_chain_find (const tng_trajectory_t tng_data, const tng_molecule_t molecule, const char *name, const int64_t id, tng_chain_t *chain) |
Find a chain in a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_chain_add (const tng_trajectory_t tng_data, const tng_molecule_t molecule, const char *name, tng_chain_t *chain) |
Add a chain to a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_chain_w_id_add (const tng_trajectory_t tng_data, const tng_molecule_t molecule, const char *name, const int64_t id, tng_chain_t *chain) |
Add a chain with a specific id to a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_bond_add (const tng_trajectory_t tng_data, const tng_molecule_t molecule, const int64_t from_atom_id, const int64_t to_atom_id, tng_bond_t *bond) |
Add a bond between two atoms to a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_atom_find (const tng_trajectory_t tng_data, const tng_molecule_t molecule, const char *name, const int64_t id, tng_atom_t *atom) |
Find an atom in a molecule. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_chain_name_get (const tng_trajectory_t tng_data, const tng_chain_t chain, char *name, const int max_len) |
Get the name of a chain. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_chain_name_set (const tng_trajectory_t tng_data, const tng_chain_t chain, const char *new_name) |
Set the name of a chain. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_chain_num_residues_get (const tng_trajectory_t tng_data, const tng_chain_t chain, int64_t *n) |
Get the number of residues in a molecule chain. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_chain_residue_of_index_get (const tng_trajectory_t tng_data, const tng_chain_t chain, const int64_t index, tng_residue_t *residue) |
Retrieve the residue of a chain with specified index in the list of residues. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_chain_residue_find (const tng_trajectory_t tng_data, const tng_chain_t chain, const char *name, const int64_t id, tng_residue_t *residue) |
Find a residue in a chain. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_chain_residue_add (const tng_trajectory_t tng_data, const tng_chain_t chain, const char *name, tng_residue_t *residue) |
Add a residue to a chain. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_chain_residue_w_id_add (const tng_trajectory_t tng_data, const tng_chain_t chain, const char *name, const int64_t id, tng_residue_t *residue) |
Add a residue with a specific ID to a chain. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_residue_name_get (const tng_trajectory_t tng_data, const tng_residue_t residue, char *name, const int max_len) |
Get the name of a residue. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_residue_name_set (const tng_trajectory_t tng_data, const tng_residue_t residue, const char *new_name) |
Set the name of a residue. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_residue_num_atoms_get (const tng_trajectory_t tng_data, const tng_residue_t residue, int64_t *n) |
Get the number of atoms in a residue. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_residue_atom_of_index_get (const tng_trajectory_t tng_data, const tng_residue_t residue, const int64_t index, tng_atom_t *atom) |
Retrieve the atom of a residue with specified index in the list of atoms. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_residue_atom_add (const tng_trajectory_t tng_data, const tng_residue_t residue, const char *atom_name, const char *atom_type, tng_atom_t *atom) |
Add an atom to a residue. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_residue_atom_w_id_add (const tng_trajectory_t tng_data, const tng_residue_t residue, const char *atom_name, const char *atom_type, const int64_t id, tng_atom_t *atom) |
Add an atom with a specific ID to a residue. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_atom_residue_get (const tng_trajectory_t tng_data, const tng_atom_t atom, tng_residue_t *residue) |
Get the residue of an atom. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_atom_name_get (const tng_trajectory_t tng_data, const tng_atom_t atom, char *name, const int max_len) |
Get the name of an atom. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_atom_name_set (const tng_trajectory_t tng_data, const tng_atom_t atom, const char *new_name) |
Set the name of an atom. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_atom_type_get (const tng_trajectory_t tng_data, const tng_atom_t atom, char *type, const int max_len) |
Get the type of an atom. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_atom_type_set (const tng_trajectory_t tng_data, const tng_atom_t atom, const char *new_type) |
Set the atom type of an atom. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_name_of_particle_nr_get (const tng_trajectory_t tng_data, const int64_t nr, char *name, const int max_len) |
Get the molecule name of real particle number (number in mol system). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molecule_id_of_particle_nr_get (const tng_trajectory_t tng_data, const int64_t nr, int64_t *id) |
Get the molecule id of real particle number (number in mol system). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_molsystem_bonds_get (const tng_trajectory_t tng_data, int64_t *n_bonds, int64_t **from_atoms, int64_t **to_atoms) |
Get the bonds of the current molecular system. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_chain_name_of_particle_nr_get (const tng_trajectory_t tng_data, const int64_t nr, char *name, const int max_len) |
Get the chain name of real particle number (number in mol system). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_residue_name_of_particle_nr_get (const tng_trajectory_t tng_data, const int64_t nr, char *name, const int max_len) |
Get the residue name of real particle number (number in mol system). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_residue_id_of_particle_nr_get (const tng_trajectory_t tng_data, const int64_t nr, int64_t *id) |
Get the residue id (local to molecule) of real particle number (number in mol system). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_global_residue_id_of_particle_nr_get (const tng_trajectory_t tng_data, const int64_t nr, int64_t *id) |
Get the residue id (based on other molecules and molecule counts) of real particle number (number in mol system). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_atom_name_of_particle_nr_get (const tng_trajectory_t tng_data, const int64_t nr, char *name, const int max_len) |
Get the atom name of real particle number (number in mol system). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_atom_type_of_particle_nr_get (const tng_trajectory_t tng_data, const int64_t nr, char *type, const int max_len) |
Get the atom type of real particle number (number in mol system). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_particle_mapping_add (const tng_trajectory_t tng_data, const int64_t num_first_particle, const int64_t n_particles, const int64_t *mapping_table) |
Add a particle mapping table. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_particle_mapping_free (const tng_trajectory_t tng_data) |
Remove all particle mappings (in memory) from the current frame set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_file_headers_read (const tng_trajectory_t tng_data, const char hash_mode) |
Read the header blocks from the input_file of tng_data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_file_headers_write (const tng_trajectory_t tng_data, const char hash_mode) |
Write the header blocks to the output_file of tng_data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_block_read_next (const tng_trajectory_t tng_data, const tng_gen_block_t block_data, const char hash_mode) |
Read one (the next) block (of any kind) from the input_file of tng_data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_read (const tng_trajectory_t tng_data, const char hash_mode) |
Read one frame set, including all particle mapping blocks and data blocks, starting from the current file position. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_read_current_only_data_from_block_id (const tng_trajectory_t tng_data, const char hash_mode, const int64_t block_id) |
Read data from the current frame set from the input_file. Only read particle mapping and data blocks matching the specified block_id. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_read_next (const tng_trajectory_t tng_data, const char hash_mode) |
Read one (the next) frame set, including particle mapping and related data blocks from the input_file of tng_data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_read_next_only_data_from_block_id (const tng_trajectory_t tng_data, const char hash_mode, const int64_t block_id) |
Read one (the next) frame set, including particle mapping and data blocks with a specific block id from the input_file of tng_data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_write (const tng_trajectory_t tng_data, const char hash_mode) |
Write one frame set, including mapping and related data blocks to the output_file of tng_data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_premature_write (const tng_trajectory_t tng_data, const char hash_mode) |
Write one frame set even if it does not have as many frames as expected. The function also writes mapping and related data blocks to the output_file of tng_data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_new (const tng_trajectory_t tng_data, const int64_t first_frame, const int64_t n_frames) |
Create and initialise a frame set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_with_time_new (const tng_trajectory_t tng_data, const int64_t first_frame, const int64_t n_frames, const double first_frame_time) |
Create and initialise a frame set with the time of the first frame specified. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_set_first_frame_time_set (const tng_trajectory_t tng_data, const double first_frame_time) |
Set the time stamp of the first frame of the current frame set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_first_frame_nr_of_next_frame_set_get (const tng_trajectory_t tng_data, int64_t *frame) |
Read the number of the first frame of the next frame set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_data_block_add (const tng_trajectory_t tng_data, const int64_t id, const char *block_name, const char datatype, const char block_type_flag, int64_t n_frames, const int64_t n_values_per_frame, int64_t stride_length, const int64_t codec_id, void *new_data) |
Add a non-particle dependent data block. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_particle_data_block_add (const tng_trajectory_t tng_data, const int64_t id, const char *block_name, const char datatype, const char block_type_flag, int64_t n_frames, const int64_t n_values_per_frame, int64_t stride_length, const int64_t num_first_particle, const int64_t n_particles, const int64_t codec_id, void *new_data) |
Add a particle dependent data block. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_data_block_name_get (const tng_trajectory_t tng_data, const int64_t block_id, char *name, const int max_len) |
Get the name of a data block of a specific ID. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_data_block_dependency_get (const tng_trajectory_t tng_data, const int64_t block_id, int *block_dependency) |
Get the dependency of a data block of a specific ID. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_data_block_num_values_per_frame_get (const tng_trajectory_t tng_data, const int64_t block_id, int64_t *n_values_per_frame) |
Get the number of values per frame of a data block of a specific ID. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_data_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const int64_t block_id, const void *values, const char hash_mode) |
Write data of one trajectory frame to the output_file of tng_data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_frame_particle_data_write (const tng_trajectory_t tng_data, const int64_t frame_nr, const int64_t block_id, const int64_t val_first_particle, const int64_t val_n_particles, const void *values, const char hash_mode) |
Write particle data of one trajectory frame to the output_file of tng_data. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_data_values_free (const tng_trajectory_t tng_data, union data_values **values, const int64_t n_frames, const int64_t n_values_per_frame, const char type) |
Free data of an array of values (2D). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_particle_data_values_free (const tng_trajectory_t tng_data, union data_values ***values, const int64_t n_frames, const int64_t n_particles, const int64_t n_values_per_frame, const char type) |
Free data of an array of values (3D). More... | |
tng_function_status DECLSPECDLLEXPORT | tng_data_get (const tng_trajectory_t tng_data, const int64_t block_id, union data_values ***values, int64_t *n_frames, int64_t *n_values_per_frame, char *type) |
Retrieve non-particle data, from the last read frame set. Obsolete! More... | |
tng_function_status DECLSPECDLLEXPORT | tng_data_vector_get (const tng_trajectory_t tng_data, const int64_t block_id, void **values, int64_t *n_frames, int64_t *stride_length, int64_t *n_values_per_frame, char *type) |
Retrieve a vector (1D array) of non-particle data, from the last read frame set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_data_interval_get (const tng_trajectory_t tng_data, const int64_t block_id, const int64_t start_frame_nr, const int64_t end_frame_nr, const char hash_mode, union data_values ***values, int64_t *n_values_per_frame, char *type) |
Read and retrieve non-particle data, in a specific interval. Obsolete! More... | |
tng_function_status DECLSPECDLLEXPORT | tng_data_vector_interval_get (const tng_trajectory_t tng_data, const int64_t block_id, const int64_t start_frame_nr, const int64_t end_frame_nr, const char hash_mode, void **values, int64_t *stride_length, int64_t *n_values_per_frame, char *type) |
Read and retrieve a vector (1D array) of non-particle data, in a specific interval. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_particle_data_get (const tng_trajectory_t tng_data, const int64_t block_id, union data_values ****values, int64_t *n_frames, int64_t *n_particles, int64_t *n_values_per_frame, char *type) |
Retrieve particle data, from the last read frame set. Obsolete! More... | |
tng_function_status DECLSPECDLLEXPORT | tng_particle_data_vector_get (const tng_trajectory_t tng_data, const int64_t block_id, void **values, int64_t *n_frames, int64_t *stride_length, int64_t *n_particles, int64_t *n_values_per_frame, char *type) |
Retrieve a vector (1D array) of particle data, from the last read frame set. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_particle_data_interval_get (const tng_trajectory_t tng_data, const int64_t block_id, const int64_t start_frame_nr, const int64_t end_frame_nr, const char hash_mode, union data_values ****values, int64_t *n_particles, int64_t *n_values_per_frame, char *type) |
Read and retrieve particle data, in a specific interval. Obsolete! More... | |
tng_function_status DECLSPECDLLEXPORT | tng_particle_data_vector_interval_get (const tng_trajectory_t tng_data, const int64_t block_id, const int64_t start_frame_nr, const int64_t end_frame_nr, const char hash_mode, void **values, int64_t *n_particles, int64_t *stride_length, int64_t *n_values_per_frame, char *type) |
Read and retrieve a vector (1D array) particle data, in a specific interval. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_data_get_stride_length (const tng_trajectory_t tng_data, const int64_t block_id, int64_t frame, int64_t *stride_length) |
Get the stride length of a specific data (particle dependency does not matter) block, either in the current frame set or of a specific frame. More... | |
tng_function_status DECLSPECDLLEXPORT | tng_time_get_str (const tng_trajectory_t tng_data, char *time) |
Get the date and time of initial file creation in ISO format (string). More... | |
These functions give detailed control of the TNG data management. Most things can be done using the more convenient high-level API functions instead.
tng_function_status DECLSPECDLLEXPORT tng_atom_name_get | ( | const tng_trajectory_t | tng_data, |
const tng_atom_t | atom, | ||
char * | name, | ||
const int | max_len | ||
) |
Get the name of an atom.
tng_data | the trajectory containing the atom. |
atom | the atom of which to get the name. |
name | the string to fill with the name of the atom, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_atom_name_of_particle_nr_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | nr, | ||
char * | name, | ||
const int | max_len | ||
) |
Get the atom name of real particle number (number in mol system).
tng_data | is the trajectory data container containing the atom. |
nr | is the real number of the particle in the molecular system. |
name | is a string, which is set to the name of the atom. Memory must be reserved beforehand. |
max_len | is the maximum length of name. |
tng_function_status DECLSPECDLLEXPORT tng_atom_name_set | ( | const tng_trajectory_t | tng_data, |
const tng_atom_t | atom, | ||
const char * | new_name | ||
) |
Set the name of an atom.
tng_data | is the trajectory data container containing the atom. |
atom | is the atom to rename. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_atom_residue_get | ( | const tng_trajectory_t | tng_data, |
const tng_atom_t | atom, | ||
tng_residue_t * | residue | ||
) |
Get the residue of an atom.
tng_data | the trajectory containing the atom. |
atom | the atom of which to get the name. |
residue | is set to the residue of the atom. |
tng_function_status DECLSPECDLLEXPORT tng_atom_type_get | ( | const tng_trajectory_t | tng_data, |
const tng_atom_t | atom, | ||
char * | type, | ||
const int | max_len | ||
) |
Get the type of an atom.
tng_data | the trajectory containing the atom. |
atom | the atom of which to get the type. |
type | the string to fill with the type of the atom, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for type. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_atom_type_of_particle_nr_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | nr, | ||
char * | type, | ||
const int | max_len | ||
) |
Get the atom type of real particle number (number in mol system).
tng_data | is the trajectory data container containing the atom. |
nr | is the real number of the particle in the molecular system. |
type | is a string, which is set to the type of the atom. Memory must be reserved beforehand. |
max_len | is the maximum length of type. |
tng_function_status DECLSPECDLLEXPORT tng_atom_type_set | ( | const tng_trajectory_t | tng_data, |
const tng_atom_t | atom, | ||
const char * | new_type | ||
) |
Set the atom type of an atom.
tng_data | is the trajectory data container containing the atom. |
atom | is the atom to change. |
new_type | is a string containing the atom type. |
tng_function_status DECLSPECDLLEXPORT tng_block_read_next | ( | const tng_trajectory_t | tng_data, |
const tng_gen_block_t | block_data, | ||
const char | hash_mode | ||
) |
Read one (the next) block (of any kind) from the input_file of tng_data.
tng_data | is a trajectory data container. |
tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened.
block_data | is a pointer to the struct which will be populated with the data. |
If block_data->input_file_pos > 0 it is the position from where the reading starts otherwise it starts from the current position.
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the written md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
tng_function_status DECLSPECDLLEXPORT tng_chain_name_get | ( | const tng_trajectory_t | tng_data, |
const tng_chain_t | chain, | ||
char * | name, | ||
const int | max_len | ||
) |
Get the name of a chain.
tng_data | the trajectory containing the chain. |
chain | the chain of which to get the name. |
name | the string to fill with the name of the chain, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_chain_name_of_particle_nr_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | nr, | ||
char * | name, | ||
const int | max_len | ||
) |
Get the chain name of real particle number (number in mol system).
tng_data | is the trajectory data container containing the atom. |
nr | is the real number of the particle in the molecular system. |
name | is a string, which is set to the name of the chain. Memory must be reserved beforehand. |
max_len | is the maximum length of name. |
tng_function_status DECLSPECDLLEXPORT tng_chain_name_set | ( | const tng_trajectory_t | tng_data, |
const tng_chain_t | chain, | ||
const char * | new_name | ||
) |
Set the name of a chain.
tng_data | is the trajectory data container containing the atom.. |
chain | is the chain to rename. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_chain_num_residues_get | ( | const tng_trajectory_t | tng_data, |
const tng_chain_t | chain, | ||
int64_t * | n | ||
) |
Get the number of residues in a molecule chain.
tng_data | is the trajectory containing the chain. |
chain | is the chain of which to get the number of residues. |
n | is pointing to a value set to the number of residues. |
tng_function_status DECLSPECDLLEXPORT tng_chain_residue_add | ( | const tng_trajectory_t | tng_data, |
const tng_chain_t | chain, | ||
const char * | name, | ||
tng_residue_t * | residue | ||
) |
Add a residue to a chain.
tng_data | is the trajectory data container containing the chain.. |
chain | is the chain to add a residue to. |
name | is a string containing the name of the residue. |
residue | is a pointer to the newly created residue. |
tng_function_status DECLSPECDLLEXPORT tng_chain_residue_find | ( | const tng_trajectory_t | tng_data, |
const tng_chain_t | chain, | ||
const char * | name, | ||
const int64_t | id, | ||
tng_residue_t * | residue | ||
) |
Find a residue in a chain.
tng_data | is the trajectory data container containing the chain. |
chain | is the chain in which to search for the residue. |
name | is a string containing the name of the residue. If name is an empty string only id will be used for searching. |
id | is the id of the residue to find. If id == -1 the first residue that matches the specified name will be found. |
residue | is a pointer to the residue if it was found - otherwise 0. |
If name is an empty string and id == -1 the first residue will be found.
tng_function_status DECLSPECDLLEXPORT tng_chain_residue_of_index_get | ( | const tng_trajectory_t | tng_data, |
const tng_chain_t | chain, | ||
const int64_t | index, | ||
tng_residue_t * | residue | ||
) |
Retrieve the residue of a chain with specified index in the list of residues.
tng_data | is the trajectory data container containing the chain. |
index | is the index (in chain->residues) of the residue to return |
chain | is the chain from which to get the residue. |
residue | is a pointer to the residue if it was found - otherwise 0. |
tng_function_status DECLSPECDLLEXPORT tng_chain_residue_w_id_add | ( | const tng_trajectory_t | tng_data, |
const tng_chain_t | chain, | ||
const char * | name, | ||
const int64_t | id, | ||
tng_residue_t * | residue | ||
) |
Add a residue with a specific ID to a chain.
tng_data | is the trajectory data container containing the chain.. |
chain | is the chain to add a residue to. |
name | is a string containing the name of the residue. |
id | is the ID of the created residue. |
residue | is a pointer to the newly created residue. |
tng_function_status DECLSPECDLLEXPORT tng_compression_precision_get | ( | const tng_trajectory_t | tng_data, |
double * | precision | ||
) |
Get the precision of lossy compression.
tng_data | is the trajectory of which to get the compression precision. |
precision | will be pointing to the retrieved compression precision. |
A compression precision of 0.001 (the default) means that the compressed values are accurate to the third decimal. This function does not check actual precision of compressed data, but just returns what has previously been set using tng_compression_precision_set().
tng_function_status DECLSPECDLLEXPORT tng_compression_precision_set | ( | const tng_trajectory_t | tng_data, |
const double | precision | ||
) |
Set the precision of lossy compression.
tng_data | is the trajectory of which to set the compression precision. |
precision | is the new compression precision. |
A compression precision of 0.001 (the default) means that the compressed values are accurate to the third decimal.
tng_function_status DECLSPECDLLEXPORT tng_current_frame_set_get | ( | const tng_trajectory_t | tng_data, |
tng_trajectory_frame_set_t * | frame_set_p | ||
) |
Get the current trajectory frame set.
tng_data | is the trajectory from which to get the frame set. |
frame_set_p | will be set to point at the memory position of the found frame set. |
tng_function_status DECLSPECDLLEXPORT tng_data_block_add | ( | const tng_trajectory_t | tng_data, |
const int64_t | id, | ||
const char * | block_name, | ||
const char | datatype, | ||
const char | block_type_flag, | ||
int64_t | n_frames, | ||
const int64_t | n_values_per_frame, | ||
int64_t | stride_length, | ||
const int64_t | codec_id, | ||
void * | new_data | ||
) |
Add a non-particle dependent data block.
tng_data | is the trajectory data container in which to add the data block |
id | is the block ID of the block to add. |
block_name | is a descriptive name of the block to add |
datatype | is the datatype of the data in the block (e.g. int/float) |
block_type_flag | indicates if this is a non-trajectory block (added directly to tng_data) or if it is a trajectory block (added to the frame set) |
n_frames | is the number of frames of the data block (automatically set to 1 if adding a non-trajectory data block) |
n_values_per_frame | is how many values a stored each frame (e.g. 9 for a box shape block) |
stride_length | is how many frames are between each entry in the data block |
codec_id | is the ID of the codec to compress the data. |
new_data | is an array of data values to add. |
tng_function_status DECLSPECDLLEXPORT tng_data_block_dependency_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
int * | block_dependency | ||
) |
Get the dependency of a data block of a specific ID.
tng_data | is the trajectory data container. |
block_id | is the ID of the data block of which to get the name. |
block_dependency | is a pointer to the dependency of the data block. If the block is frame dependent it will be set to TNG_FRAME_DEPENDENT, if it is particle dependent it will be set to TNG_PARTICLE_DEPENDENT and if it is both it will be set to TNG_FRAME_DEPENDENT & TNG_PARTICLE_DEPENDENT. |
tng_function_status DECLSPECDLLEXPORT tng_data_block_name_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
char * | name, | ||
const int | max_len | ||
) |
Get the name of a data block of a specific ID.
tng_data | is the trajectory data container. |
block_id | is the ID of the data block of which to get the name. |
name | is a string, which is set to the name of the data block. Memory must be reserved beforehand. |
max_len | is the maximum length of name. |
tng_function_status DECLSPECDLLEXPORT tng_data_block_num_values_per_frame_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
int64_t * | n_values_per_frame | ||
) |
Get the number of values per frame of a data block of a specific ID.
tng_data | is the trajectory data container. |
block_id | is the ID of the data block of which to get the name. |
n_values_per_frame | is a pointer set to the number of values per frame. |
tng_function_status DECLSPECDLLEXPORT tng_data_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
union data_values *** | values, | ||
int64_t * | n_frames, | ||
int64_t * | n_values_per_frame, | ||
char * | type | ||
) |
Retrieve non-particle data, from the last read frame set. Obsolete!
tng_data | is a trajectory data container. tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened. |
block_id | is the id number of the particle data block to read. |
values | is a pointer to a 2-dimensional array (memory unallocated), which will be filled with data. The array will be sized (n_frames * n_values_per_frame). Since ***values is allocated in this function it is the callers responsibility to free the memory. |
n_frames | is set to the number of frames in the returned data. This is needed to properly reach and/or free the data afterwards. |
n_values_per_frame | is set to the number of values per frame in the data. This is needed to properly reach and/or free the data afterwards. |
type | is set to the data type of the data in the array. |
This function is obsolete and only retained for compatibility. Use tng_data_vector_get() instead.
tng_function_status DECLSPECDLLEXPORT tng_data_get_stride_length | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
int64_t | frame, | ||
int64_t * | stride_length | ||
) |
Get the stride length of a specific data (particle dependency does not matter) block, either in the current frame set or of a specific frame.
tng_data | is the trajectory data container. |
block_id | is the block ID of the data block, of which to retrieve the stride length of the data. |
frame | is the frame from which to get the stride length. If frame is set to -1 no specific frame will be used, but instead the first frame, starting from the last read frame set, containing the data block will be used. |
stride_length | is set to the value of the stride length of the data block. |
tng_function_status DECLSPECDLLEXPORT tng_data_interval_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
const int64_t | start_frame_nr, | ||
const int64_t | end_frame_nr, | ||
const char | hash_mode, | ||
union data_values *** | values, | ||
int64_t * | n_values_per_frame, | ||
char * | type | ||
) |
Read and retrieve non-particle data, in a specific interval. Obsolete!
tng_data | is a trajectory data container. tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened. |
block_id | is the id number of the particle data block to read. |
start_frame_nr | is the index number of the first frame to read. |
end_frame_nr | is the index number of the last frame to read. |
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
values | is a pointer to a 2-dimensional array (memory unallocated), which will be filled with data. The array will be sized (n_frames * n_values_per_frame). Since ***values is allocated in this function it is the callers responsibility to free the memory. |
n_values_per_frame | is set to the number of values per frame in the data. This is needed to properly reach and/or free the data afterwards. |
type | is set to the data type of the data in the array. |
This function is obsolete and only retained for compatibility. Use tng_data_vector_interval_get() instead.
tng_function_status DECLSPECDLLEXPORT tng_data_values_free | ( | const tng_trajectory_t | tng_data, |
union data_values ** | values, | ||
const int64_t | n_frames, | ||
const int64_t | n_values_per_frame, | ||
const char | type | ||
) |
Free data of an array of values (2D).
tng_data | is a trajectory data container. |
values | is the 2D array to free and will be set to 0 afterwards. |
n_frames | is the number of frames in the data array. |
n_values_per_frame | is the number of values per frame in the data array. |
type | is the data type of the data in the array (e.g. int/float/char). |
This function should not be used. The data_values union is obsolete. This function also causes memory leaks, but its signature cannot be changed without disturbing the API.
tng_function_status DECLSPECDLLEXPORT tng_data_vector_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
void ** | values, | ||
int64_t * | n_frames, | ||
int64_t * | stride_length, | ||
int64_t * | n_values_per_frame, | ||
char * | type | ||
) |
Retrieve a vector (1D array) of non-particle data, from the last read frame set.
tng_data | is a trajectory data container. tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened. |
block_id | is the id number of the particle data block to read. |
values | is a pointer to a 1-dimensional array (memory unallocated), which will be filled with data. The length of the array will be (n_frames_with_data (see stride_length) * n_values_per_frame). Since **values is allocated in this function it is the callers responsibility to free the memory. |
n_frames | is set to the number of particles in the returned data. This is needed to properly reach and/or free the data afterwards. |
stride_length | is set to the stride length of the returned data. |
n_values_per_frame | is set to the number of values per frame in the data. This is needed to properly reach and/or free the data afterwards. |
type | is set to the data type of the data in the array. |
This does only work for numerical (int, float, double) data.
tng_function_status DECLSPECDLLEXPORT tng_data_vector_interval_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
const int64_t | start_frame_nr, | ||
const int64_t | end_frame_nr, | ||
const char | hash_mode, | ||
void ** | values, | ||
int64_t * | stride_length, | ||
int64_t * | n_values_per_frame, | ||
char * | type | ||
) |
Read and retrieve a vector (1D array) of non-particle data, in a specific interval.
tng_data | is a trajectory data container. tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened. |
block_id | is the id number of the particle data block to read. |
start_frame_nr | is the index number of the first frame to read. |
end_frame_nr | is the index number of the last frame to read. |
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
values | is a pointer to a 1-dimensional array (memory unallocated), which will be filled with data. The length of the array will be (n_frames_with_data (see stride_length) * n_values_per_frame). Since **values is allocated in this function it is the callers responsibility to free the memory. |
stride_length | is set to the stride length (writing interval) of the data. |
n_values_per_frame | is set to the number of values per frame in the data. This is needed to properly reach and/or free the data afterwards. |
type | is set to the data type of the data in the array. |
This does only work for numerical (int, float, double) data.
tng_function_status DECLSPECDLLEXPORT tng_distance_unit_exponential_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | exp | ||
) |
Get the exponent used for distances in the trajectory.
tng_data | is the trajectory from which to get the information. |
exp | is pointing to a value set to the distance unit exponent. |
Example: If the distances are specified in nm (default) exp is -9. If the distances are specified in Ã… exp is -10.
tng_function_status DECLSPECDLLEXPORT tng_distance_unit_exponential_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | exp | ||
) |
Set the exponent used for distances in the trajectory.
tng_data | is the trajectory of which to set the unit exponent. |
exp | is the distance unit exponent to use. |
Example: If the distances are specified in nm (default) exp is -9. If the distances are specified in Ã… exp is -10.
tng_function_status DECLSPECDLLEXPORT tng_file_headers_read | ( | const tng_trajectory_t | tng_data, |
const char | hash_mode | ||
) |
Read the header blocks from the input_file of tng_data.
The trajectory blocks must be read separately and iteratively in chunks to fit in memory.
tng_data | is a trajectory data container. |
tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened.
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the written md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
tng_function_status DECLSPECDLLEXPORT tng_file_headers_write | ( | const tng_trajectory_t | tng_data, |
const char | hash_mode | ||
) |
Write the header blocks to the output_file of tng_data.
The trajectory blocks must be written separately and iteratively in chunks to fit in memory.
tng_data | is a trajectory data container. |
tng_data->output_file_path specifies which file to write to. If the file (output_file) is not open it will be opened.
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH an md5 hash for each header block will be generated. |
tng_function_status DECLSPECDLLEXPORT tng_first_computer_name_get | ( | const tng_trajectory_t | tng_data, |
char * | name, | ||
const int | max_len | ||
) |
Get the name of the computer used when creating the trajectory.
tng_data | the trajectory of which to get the computer name. |
name | the string to fill with the name of the computer, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_first_computer_name_set | ( | const tng_trajectory_t | tng_data, |
const char * | new_name | ||
) |
Set the name of the computer used when creating the trajectory.
tng_data | the trajectory of which to set the computer name. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_first_frame_nr_of_next_frame_set_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | frame | ||
) |
Read the number of the first frame of the next frame set.
tng_data | is the trajectory containing the frame set. |
frame | is set to the frame number of the first frame in the next frame set. |
tng_function_status DECLSPECDLLEXPORT tng_first_program_name_get | ( | const tng_trajectory_t | tng_data, |
char * | name, | ||
const int | max_len | ||
) |
Get the name of the program used when creating the trajectory.
tng_data | the trajectory of which to get the program name. |
name | the string to fill with the name of the program, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_first_program_name_set | ( | const tng_trajectory_t | tng_data, |
const char * | new_name | ||
) |
Set the name of the program used when creating the trajectory.
tng_data | the trajectory of which to set the program name. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_first_signature_get | ( | const tng_trajectory_t | tng_data, |
char * | signature, | ||
const int | max_len | ||
) |
Get the pgp_signature of the user creating the trajectory.
tng_data | the trajectory of which to get the computer name. |
signature | the string to fill with the signature, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_first_signature_set | ( | const tng_trajectory_t | tng_data, |
const char * | signature | ||
) |
Set the pgp_signature of the user creating the trajectory.
tng_data | the trajectory of which to set the computer name. |
signature | is a string containing the pgp_signature. |
tng_function_status DECLSPECDLLEXPORT tng_first_user_name_get | ( | const tng_trajectory_t | tng_data, |
char * | name, | ||
const int | max_len | ||
) |
Get the name of the user who created the trajectory.
tng_data | the trajectory of which to get the user name. |
name | the string to fill with the name of the user, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_first_user_name_set | ( | const tng_trajectory_t | tng_data, |
const char * | new_name | ||
) |
Set the name of the user who created the trajectory.
tng_data | the trajectory of which to set the user name. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_forcefield_name_get | ( | const tng_trajectory_t | tng_data, |
char * | name, | ||
const int | max_len | ||
) |
Get the name of the forcefield used in the trajectory.
tng_data | the trajectory of which to get the forcefield name. |
name | the string to fill with the name of the forcefield, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_forcefield_name_set | ( | const tng_trajectory_t | tng_data, |
const char * | new_name | ||
) |
Set the name of the forcefield used in the trajectory.
tng_data | the trajectory of which to set the forcefield name. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_frame_data_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const int64_t | block_id, | ||
const void * | values, | ||
const char | hash_mode | ||
) |
Write data of one trajectory frame to the output_file of tng_data.
tng_data | is a trajectory data container. tng_data->output_file_path specifies which file to write to. If the file (output_file) is not open it will be opened. |
frame_nr | is the index number of the frame to write. |
block_id | is the ID of the data block to write the data to. |
values | is an array of data to write. The length of the array should equal n_values_per_frame. |
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the written md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
tng_function_status DECLSPECDLLEXPORT tng_frame_particle_data_write | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame_nr, | ||
const int64_t | block_id, | ||
const int64_t | val_first_particle, | ||
const int64_t | val_n_particles, | ||
const void * | values, | ||
const char | hash_mode | ||
) |
Write particle data of one trajectory frame to the output_file of tng_data.
tng_data | is a trajectory data container. tng_data->output_file_path specifies which file to write to. If the file (output_file) is not open it will be opened. |
frame_nr | is the index number of the frame to write. |
block_id | is the ID of the data block to write the data to. |
val_first_particle | is the number of the first particle in the data array. |
val_n_particles | is the number of particles in the data array. |
values | is a 1D-array of data to write. The length of the array should equal n_particles * n_values_per_frame. |
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the written md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_first_frame_time_set | ( | const tng_trajectory_t | tng_data, |
const double | first_frame_time | ||
) |
Set the time stamp of the first frame of the current frame set.
tng_data | is the trajectory containing the frame set. |
first_frame_time | is the time stamp of the first frame in the frame set. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_frame_range_get | ( | const tng_trajectory_t | tng_data, |
const tng_trajectory_frame_set_t | frame_set, | ||
int64_t * | first_frame, | ||
int64_t * | last_frame | ||
) |
Get the first and last frames of the frame set.
tng_data | is a trajectory data container. |
frame_set | is the frame set of which to get the frame range. |
first_frame | is set to the first frame of the frame set. |
last_frame | is set to the last frame of the frame set. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_new | ( | const tng_trajectory_t | tng_data, |
const int64_t | first_frame, | ||
const int64_t | n_frames | ||
) |
Create and initialise a frame set.
Particle mappings are retained from previous frame set (if any). To explicitly clear particle mappings use tng_frame_set_particle_mapping_free().
tng_data | is the trajectory data container in which to add the frame set. |
first_frame | is the first frame of the frame set. |
n_frames | is the number of frames in the frame set. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_next_frame_set_file_pos_get | ( | const tng_trajectory_t | tng_data, |
const tng_trajectory_frame_set_t | frame_set, | ||
int64_t * | pos | ||
) |
Get the file position of the next frame set in the input file.
tng_data | is a trajectory data container. |
frame_set | is the frame set of which to get the position of the following frame set. |
pos | is pointing to a value set to the file position. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_nr_find | ( | const tng_trajectory_t | tng_data, |
const int64_t | nr | ||
) |
Find the requested frame set number.
tng_data | is the trajectory from which to get the frame set. |
nr | is the frame set number to search for. |
tng_data->current_trajectory_frame_set will contain the found trajectory if successful.
tng_function_status DECLSPECDLLEXPORT tng_frame_set_of_frame_find | ( | const tng_trajectory_t | tng_data, |
const int64_t | frame | ||
) |
Find the frame set containing a specific frame.
tng_data | is the trajectory from which to get the frame set. |
frame | is the frame number to search for. |
tng_data->current_trajectory_frame_set will contain the found trajectory if successful.
tng_function_status DECLSPECDLLEXPORT tng_frame_set_particle_mapping_free | ( | const tng_trajectory_t | tng_data | ) |
Remove all particle mappings (in memory) from the current frame set.
Clears the currently setup particle mappings of the current frame set.
tng_data | is the trajectory, with the frame set of which to clear all particle mappings. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_premature_write | ( | const tng_trajectory_t | tng_data, |
const char | hash_mode | ||
) |
Write one frame set even if it does not have as many frames as expected. The function also writes mapping and related data blocks to the output_file of tng_data.
tng_data | is a trajectory data container. |
tng_data->output_file_path specifies which file to write to. If the file (output_file) is not open it will be opened.
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH an md5 hash for each header block will be generated. |
The number of frames in the frame set is set to the number of frames of the data blocks before writing it to disk.
tng_function_status DECLSPECDLLEXPORT tng_frame_set_prev_frame_set_file_pos_get | ( | const tng_trajectory_t | tng_data, |
const tng_trajectory_frame_set_t | frame_set, | ||
int64_t * | pos | ||
) |
Get the file position of the previous frame set in the input file.
tng_data | is a trajectory data container. |
frame_set | is the frame set of which to get the position of the previous frame set. |
pos | is pointing to a value set to the file position. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_read | ( | const tng_trajectory_t | tng_data, |
const char | hash_mode | ||
) |
Read one frame set, including all particle mapping blocks and data blocks, starting from the current file position.
tng_data | is a trajectory data container. |
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the written md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_read_current_only_data_from_block_id | ( | const tng_trajectory_t | tng_data, |
const char | hash_mode, | ||
const int64_t | block_id | ||
) |
Read data from the current frame set from the input_file. Only read particle mapping and data blocks matching the specified block_id.
tng_data | is a trajectory data container. |
tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened.
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the written md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
block_id | is the ID of the data block to read from file. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_read_next | ( | const tng_trajectory_t | tng_data, |
const char | hash_mode | ||
) |
Read one (the next) frame set, including particle mapping and related data blocks from the input_file of tng_data.
tng_data | is a trajectory data container. |
tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened.
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the written md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_read_next_only_data_from_block_id | ( | const tng_trajectory_t | tng_data, |
const char | hash_mode, | ||
const int64_t | block_id | ||
) |
Read one (the next) frame set, including particle mapping and data blocks with a specific block id from the input_file of tng_data.
tng_data | is a trajectory data container. |
tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened.
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the written md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
block_id | is the ID number of the blocks that should be read from file. |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_with_time_new | ( | const tng_trajectory_t | tng_data, |
const int64_t | first_frame, | ||
const int64_t | n_frames, | ||
const double | first_frame_time | ||
) |
Create and initialise a frame set with the time of the first frame specified.
tng_data | is the trajectory data container in which to add the frame set. |
first_frame | is the first frame of the frame set. |
n_frames | is the number of frames in the frame set. |
first_frame_time | is the time stamp of the first frame (in seconds). |
tng_function_status DECLSPECDLLEXPORT tng_frame_set_write | ( | const tng_trajectory_t | tng_data, |
const char | hash_mode | ||
) |
Write one frame set, including mapping and related data blocks to the output_file of tng_data.
tng_data | is a trajectory data container. |
tng_data->output_file_path specifies which file to write to. If the file (output_file) is not open it will be opened.
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH an md5 hash for each header block will be generated. |
tng_function_status DECLSPECDLLEXPORT tng_global_residue_id_of_particle_nr_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | nr, | ||
int64_t * | id | ||
) |
Get the residue id (based on other molecules and molecule counts) of real particle number (number in mol system).
tng_data | is the trajectory data container containing the atom. |
nr | is the real number of the particle in the molecular system. |
id | is a pointer to the variable, which will be set to the ID. |
tng_function_status DECLSPECDLLEXPORT tng_implicit_num_particles_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | n | ||
) |
Set the number of particles, in the case no molecular system is used.
tng_data | is the trajectory of which to get the number of particles. |
n | is the number of particles to use. |
When creating a molecular system the number of particles are set automatically. This should only be used when there is no molecular system specified or if the number of atoms needs to be overridden for some reason.
tng_function_status DECLSPECDLLEXPORT tng_input_file_get | ( | const tng_trajectory_t | tng_data, |
char * | file_name, | ||
const int | max_len | ||
) |
Get the name of the input file.
tng_data | the trajectory of which to get the input file name. |
file_name | the string to fill with the name of the input file, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for file_name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_input_file_len_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | len | ||
) |
Get the length of the input file.
tng_data | is the trajectory from which to get the input file length. |
len | is pointing to a value set to the file length. |
tng_function_status DECLSPECDLLEXPORT tng_input_file_set | ( | const tng_trajectory_t | tng_data, |
const char * | file_name | ||
) |
Set the name of the input file.
tng_data | the trajectory of which to set the input file name. |
file_name | the name of the input file. |
tng_function_status DECLSPECDLLEXPORT tng_last_computer_name_get | ( | const tng_trajectory_t | tng_data, |
char * | name, | ||
const int | max_len | ||
) |
Get the name of the computer used when last modifying the trajectory.
tng_data | the trajectory of which to get the computer name. |
name | the string to fill with the name of the computer, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_last_computer_name_set | ( | const tng_trajectory_t | tng_data, |
const char * | new_name | ||
) |
Set the name of the computer used when last modifying the trajectory.
tng_data | the trajectory of which to set the computer name. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_last_program_name_get | ( | const tng_trajectory_t | tng_data, |
char * | name, | ||
const int | max_len | ||
) |
Get the name of the program used when last modifying the trajectory.
tng_data | the trajectory of which to get the program name. |
name | the string to fill with the name of the program, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_last_program_name_set | ( | const tng_trajectory_t | tng_data, |
const char * | new_name | ||
) |
Set the name of the program used when last modifying the trajectory.
tng_data | the trajectory of which to set the program name. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_last_signature_get | ( | const tng_trajectory_t | tng_data, |
char * | signature, | ||
const int | max_len | ||
) |
Get the pgp_signature of the user last modifying the trajectory.
tng_data | the trajectory of which to get the computer name. |
signature | the string to fill with the signature, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_last_signature_set | ( | const tng_trajectory_t | tng_data, |
const char * | signature | ||
) |
Set the pgp_signature of the user last modifying the trajectory.
tng_data | the trajectory of which to set the computer name. |
signature | is a string containing the pgp_signature. |
tng_function_status DECLSPECDLLEXPORT tng_last_user_name_get | ( | const tng_trajectory_t | tng_data, |
char * | name, | ||
const int | max_len | ||
) |
Get the name of the user who last modified the trajectory.
tng_data | the trajectory of which to get the user name. |
name | the string to fill with the name of the user, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_last_user_name_set | ( | const tng_trajectory_t | tng_data, |
const char * | new_name | ||
) |
Set the name of the user who last modified the trajectory.
tng_data | the trajectory of which to set the user name. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_long_stride_length_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | len | ||
) |
Get the long stride length of the trajectory.
tng_data | is the trajectory from which to get the stride length. |
len | is pointing to a value set to the stride length. |
tng_function_status DECLSPECDLLEXPORT tng_long_stride_length_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | len | ||
) |
Set the long stride length of the trajectory.
tng_data | is the trajectory of which to set the stride length. |
len | is the wanted long stride length. |
tng_function_status DECLSPECDLLEXPORT tng_medium_stride_length_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | len | ||
) |
Get the medium stride length of the trajectory.
tng_data | is the trajectory from which to get the stride length. |
len | is pointing to a value set to the stride length. |
tng_function_status DECLSPECDLLEXPORT tng_medium_stride_length_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | len | ||
) |
Set the medium stride length of the trajectory.
tng_data | is the trajectory of which to set the stride length. |
len | is the wanted medium stride length. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_add | ( | const tng_trajectory_t | tng_data, |
const char * | name, | ||
tng_molecule_t * | molecule | ||
) |
Add a molecule to the trajectory.
tng_data | is the trajectory data container containing the block.. |
name | is a pointer to the string containing the name of the new molecule. |
molecule | is a pointer to the newly created molecule. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_alloc | ( | const tng_trajectory_t | tng_data, |
tng_molecule_t * | molecule_p | ||
) |
Allocate memory for and setup a molecule container.
tng_data | is a trajectory data container. |
molecule_p | is a pointer to molecule to allocate and initialise. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_atom_find | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
const char * | name, | ||
const int64_t | id, | ||
tng_atom_t * | atom | ||
) |
Find an atom in a molecule.
tng_data | is the trajectory data container containing the molecule. |
molecule | is the molecule in which to search for the atom. |
name | is a string containing the name of the atom. If name is an empty string only id will be used for searching. |
id | is the id of the atom to find. If id == -1 the first atom that matches the specified name will be found. |
atom | is a pointer to the atom if it was found - otherwise 0. |
If name is an empty string and id == -1 the first residue will be found.
tng_function_status DECLSPECDLLEXPORT tng_molecule_atom_of_index_get | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
const int64_t | index, | ||
tng_atom_t * | atom | ||
) |
Retrieve the atom of a molecule with specified index in the list of atoms.
tng_data | is the trajectory data container containing the molecule. |
index | is the index (in molecule->atoms) of the atom to return |
molecule | is the molecule from which to get the atom. |
atom | is a pointer to the atom if it was found - otherwise 0. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_bond_add | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
const int64_t | from_atom_id, | ||
const int64_t | to_atom_id, | ||
tng_bond_t * | bond | ||
) |
Add a bond between two atoms to a molecule.
tng_data | is the trajectory data container containing the molecule. |
molecule | is the molecule containing the atoms to connect. |
from_atom_id | is the id of one of the two atoms in the bond. |
to_atom_id | is the id of the other atom in the bond. |
bond | is a pointer to the newly created bond. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_add | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
const char * | name, | ||
tng_chain_t * | chain | ||
) |
Add a chain to a molecule.
tng_data | is the trajectory data container containing the molecule.. |
molecule | is the molecule to add a chain to. |
name | is a string containing the name of the chain. |
chain | is a pointer to the newly created chain. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_find | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
const char * | name, | ||
const int64_t | id, | ||
tng_chain_t * | chain | ||
) |
Find a chain in a molecule.
tng_data | is the trajectory data container containing the molecule. |
molecule | is the molecule in which to search for the chain. |
name | is a string containing the name of the chain. If name is empty only id will be used for finding the chain. |
id | is the id of the chain to look for. If id is -1 only the name of the chain will be used for finding the chain. |
chain | is a pointer to the chain if it was found - otherwise 0. |
If name is an empty string and id == -1 the first residue will be found.
tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_of_index_get | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
const int64_t | index, | ||
tng_chain_t * | chain | ||
) |
Retrieve the chain of a molecule with specified index in the list of chains.
tng_data | is the trajectory data container containing the molecule. |
index | is the index (in molecule->chains) of the chain to return |
molecule | is the molecule from which to get the chain. |
chain | is a pointer to the chain if it was found - otherwise 0. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_chain_w_id_add | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
const char * | name, | ||
const int64_t | id, | ||
tng_chain_t * | chain | ||
) |
Add a chain with a specific id to a molecule.
tng_data | is the trajectory data container containing the molecule.. |
molecule | is the molecule to add a chain to. |
name | is a string containing the name of the chain. |
id | is the ID of the created chain. |
chain | is a pointer to the newly created chain. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_cnt_get | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
int64_t * | cnt | ||
) |
Get the count of a molecule.
tng_data | is the trajectory data container containing the molecule.. |
molecule | is the molecule of which to get the count. |
cnt | is a pointer to the variable to be populated with the count. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_cnt_list_get | ( | const tng_trajectory_t | tng_data, |
int64_t ** | mol_cnt_list | ||
) |
Get the list of the count of each molecule.
tng_data | is the trajectory from which to get the molecule count list. |
mol_cnt_list | is a list of the count of each molecule in the mol system. This is a pointer to the list in the TNG container, which means that it should be handled carefully, e.g. not freed. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_cnt_set | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
const int64_t | cnt | ||
) |
Set the count of a molecule.
tng_data | is the trajectory data container containing the molecule.. |
molecule | is the molecule of which to set the count. |
cnt | is the number of instances of this molecule. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_destroy | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule | ||
) |
Clean up a molecule container.
tng_data | is a trajectory data container. |
molecule | is the molecule to destroy. |
All allocated memory in the data structure is freed, but not the memory of molecule itself.
tng_function_status DECLSPECDLLEXPORT tng_molecule_existing_add | ( | const tng_trajectory_t | tng_data, |
tng_molecule_t * | molecule | ||
) |
Add an existing molecule (from a molecule container) to the trajectory.
tng_data | is the trajectory data container containing the block.. |
molecule | is a pointer to the molecule to add to the trajectory and will afterwards point to the molecule in the trajectory. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_find | ( | const tng_trajectory_t | tng_data, |
const char * | name, | ||
const int64_t | id, | ||
tng_molecule_t * | molecule | ||
) |
Find a molecule.
tng_data | is the trajectory data container containing the molecule. |
name | is a string containing the name of the molecule. If name is empty only id will be used for finding the molecule. |
id | is the id of the molecule to look for. If id is -1 only the name of the molecule will be used for finding the molecule. |
molecule | is a pointer to the molecule if it was found - otherwise 0. |
If name is an empty string and id == -1 the first residue will be found.
tng_function_status DECLSPECDLLEXPORT tng_molecule_free | ( | const tng_trajectory_t | tng_data, |
tng_molecule_t * | molecule_p | ||
) |
Clean up a molecule container and free its allocated memory.
tng_data | is a trajectory data container. |
molecule_p | is the molecule to destroy. |
All allocated memory in the data structure is freed and also the memory of the molecule itself.
tng_function_status DECLSPECDLLEXPORT tng_molecule_id_of_particle_nr_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | nr, | ||
int64_t * | id | ||
) |
Get the molecule id of real particle number (number in mol system).
tng_data | is the trajectory data container containing the atom. |
nr | is the real number of the particle in the molecular system. |
id | is will be set to the id of the molecule. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_init | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule | ||
) |
Setup a molecule container.
tng_data | is a trajectory data container. |
molecule | is the molecule to initialise. Memory must be preallocated. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_name_get | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
char * | name, | ||
const int | max_len | ||
) |
Get the name of a molecule.
tng_data | the trajectory containing the molecule. |
molecule | the molecule of which to get the name. |
name | the string to fill with the name of the molecule, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_name_of_particle_nr_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | nr, | ||
char * | name, | ||
const int | max_len | ||
) |
Get the molecule name of real particle number (number in mol system).
tng_data | is the trajectory data container containing the atom. |
nr | is the real number of the particle in the molecular system. |
name | is a string, which is set to the name of the molecule. Memory must be reserved beforehand. |
max_len | is the maximum length of name. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_name_set | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
const char * | new_name | ||
) |
Set the name of a molecule.
tng_data | is the trajectory data container containing the molecule.. |
molecule | is the molecule to rename. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_num_atoms_get | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
int64_t * | n | ||
) |
Get the number of atoms in a molecule.
tng_data | is the trajectory containing the molecule. |
molecule | is the molecule of which to get the number of atoms. |
n | is pointing to a value set to the number of atoms. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_num_chains_get | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
int64_t * | n | ||
) |
Get the number of chains in a molecule.
tng_data | is the trajectory containing the molecule. |
molecule | is the molecule of which to get the number of chains. |
n | is pointing to a value set to the number of chains. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_num_residues_get | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
int64_t * | n | ||
) |
Get the number of residues in a molecule.
tng_data | is the trajectory containing the molecule. |
molecule | is the molecule of which to get the number residues. |
n | is pointing to a value set to the number of residues. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_of_index_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | index, | ||
tng_molecule_t * | molecule | ||
) |
Retrieve the molecule with specified index in the list of molecules.
tng_data | is the trajectory data container containing the molecule. |
index | is the index (in tng_data->molecules) of the molecule to return |
molecule | is a pointer to the molecule if it was found - otherwise 0. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_residue_of_index_get | ( | const tng_trajectory_t | tng_data, |
const tng_molecule_t | molecule, | ||
const int64_t | index, | ||
tng_residue_t * | residue | ||
) |
Retrieve the residue of a molecule with specified index in the list of chains.
tng_data | is the trajectory data container containing the molecule. |
index | is the index (in molecule->residues) of the residue to return |
molecule | is the molecule from which to get the residue. |
residue | is a pointer to the residue if it was found - otherwise 0. |
tng_function_status DECLSPECDLLEXPORT tng_molecule_system_copy | ( | const tng_trajectory_t | tng_data_src, |
const tng_trajectory_t | tng_data_dest | ||
) |
Copy all molecules and the molecule counts from one TNG trajectory to another.
tng_data_src | is the source trajectory containing the molecular system to copy. |
tng_data_dest | is the destination trajectory. |
The molecular system in tng_data_dest will be overwritten.
tng_function_status DECLSPECDLLEXPORT tng_molecule_w_id_add | ( | const tng_trajectory_t | tng_data, |
const char * | name, | ||
const int64_t | id, | ||
tng_molecule_t * | molecule | ||
) |
Add a molecule with a specific ID to the trajectory.
tng_data | is the trajectory data container containing the block.. |
name | is a pointer to the string containing the name of the new molecule. |
id | is the ID of the created molecule. |
molecule | is a pointer to the newly created molecule. |
tng_function_status DECLSPECDLLEXPORT tng_molsystem_bonds_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | n_bonds, | ||
int64_t ** | from_atoms, | ||
int64_t ** | to_atoms | ||
) |
Get the bonds of the current molecular system.
tng_data | is the trajectory data container containing the molecular system. |
n_bonds | is set to the number of bonds in the molecular system and thereby also the lengths of the two lists: from_atoms and to_atoms. |
from_atoms | is a list (memory reserved by this function) of atoms (number of atom in mol system) in bonds. |
to_atoms | is a list (memory reserved by this function) of atoms (number of atom in mol system) in bonds. |
The two lists of atoms use the same index, i.e. from_atoms[0] and to_atoms[0] are linked with a bond. Since memory is reserved in this function it must be freed afterwards.
tng_function_status DECLSPECDLLEXPORT tng_num_frame_sets_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | n | ||
) |
Get the number of frame sets.
This updates tng_data->n_trajectory_frame_sets before returning it.
tng_data | is the trajectory from which to get the number of frame sets. |
n | is pointing to a value set to the number of frame sets. |
tng_function_status DECLSPECDLLEXPORT tng_num_frames_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | n | ||
) |
Get the number of frames in the trajectory.
tng_data | is the trajectory of which to get the number of frames. |
n | is pointing to a value set to the number of frames. |
tng_function_status DECLSPECDLLEXPORT tng_num_frames_per_frame_set_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | n | ||
) |
Get the number of frames per frame set.
tng_data | is the trajectory from which to get the number of frames per frame set. |
n | is pointing to a value set to the number of frames per frame set. |
tng_function_status DECLSPECDLLEXPORT tng_num_frames_per_frame_set_set | ( | const tng_trajectory_t | tng_data, |
const int64_t | n | ||
) |
Set the number of frames per frame set.
tng_data | is the trajectory of which to set the number of frames per frame set. |
n | is the number of frames per frame set. |
This does not affect already existing frame sets. For consistency the number of frames per frame set should be set betfore creating any frame sets.
tng_function_status DECLSPECDLLEXPORT tng_num_molecule_types_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | n | ||
) |
Get the number of molecule types (length of tng_data->molecules).
tng_data | is the trajectory from which to get the number of molecules. |
n | is pointing to a value set to the number of molecule types. |
tng_function_status DECLSPECDLLEXPORT tng_num_molecules_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | n | ||
) |
Get the current total number of molecules.
tng_data | is the trajectory from which to get the number of molecules. |
n | is pointing to a value set to the number of molecules. |
If variable number of particles are used this function will return the total number of molecules in the current frame set.
tng_function_status DECLSPECDLLEXPORT tng_num_particles_get | ( | const tng_trajectory_t | tng_data, |
int64_t * | n | ||
) |
Get the current number of particles.
tng_data | is the trajectory from which to get the number of particles. |
n | is pointing to a value set to the number of particles. |
If variable number of particles are used this function will return the number of particles in the current frame set.
tng_function_status DECLSPECDLLEXPORT tng_num_particles_variable_get | ( | const tng_trajectory_t | tng_data, |
char * | variable | ||
) |
Get if the number of particle can be varied during the simulation.
tng_data | is the trajectory from which to get the number of particles. |
variable | is pointing to a value set to TNG_CONSTANT_N_ATOMS if the number of particles cannot change or TNG_VARIABLE_N_ATOMS if the number of particles can change. |
tng_function_status DECLSPECDLLEXPORT tng_output_append_file_set | ( | const tng_trajectory_t | tng_data, |
const char * | file_name | ||
) |
Set the name of the output file for appending. The output file will not be overwritten.
tng_data | the trajectory of which to set the output file name. |
file_name | the name of the output file to append to. |
tng_function_status DECLSPECDLLEXPORT tng_output_file_endianness_get | ( | const tng_trajectory_t | tng_data, |
tng_file_endianness * | endianness | ||
) |
Get the endianness of the output file.
tng_data | the trajectory of which to get the endianness of the current output file. |
endianness | will contain the enumeration of the endianness. |
tng_function_status DECLSPECDLLEXPORT tng_output_file_endianness_set | ( | const tng_trajectory_t | tng_data, |
const tng_file_endianness | endianness | ||
) |
Set the endianness of the output file.
tng_data | the trajectory of which to set the endianness of the current output file. |
endianness | the enumeration of the endianness, can be either TNG_BIG_ENDIAN (0) or TNG_LITTLE_ENDIAN (1). |
The endianness cannot be changed after file output has started.
tng_function_status DECLSPECDLLEXPORT tng_output_file_get | ( | const tng_trajectory_t | tng_data, |
char * | file_name, | ||
const int | max_len | ||
) |
Get the name of the output file.
tng_data | the trajectory of which to get the input file name. |
file_name | the string to fill with the name of the output file, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for file_name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_output_file_set | ( | const tng_trajectory_t | tng_data, |
const char * | file_name | ||
) |
Set the name of the output file.
tng_data | the trajectory of which to set the output file name. |
file_name | the name of the output file. |
tng_function_status DECLSPECDLLEXPORT tng_particle_data_block_add | ( | const tng_trajectory_t | tng_data, |
const int64_t | id, | ||
const char * | block_name, | ||
const char | datatype, | ||
const char | block_type_flag, | ||
int64_t | n_frames, | ||
const int64_t | n_values_per_frame, | ||
int64_t | stride_length, | ||
const int64_t | num_first_particle, | ||
const int64_t | n_particles, | ||
const int64_t | codec_id, | ||
void * | new_data | ||
) |
Add a particle dependent data block.
tng_data | is the trajectory data container in which to add the data block |
id | is the block ID of the block to add. |
block_name | is a descriptive name of the block to add |
datatype | is the datatype of the data in the block (e.g. int/float) |
block_type_flag | indicates if this is a non-trajectory block (added directly to tng_data) or if it is a trajectory block (added to the frame set) |
n_frames | is the number of frames of the data block (automatically set to 1 if adding a non-trajectory data block) |
n_values_per_frame | is how many values a stored each frame (e.g. 9 for a box shape block) |
stride_length | is how many frames are between each entry in the data block |
num_first_particle | is the number of the first particle stored in this data block |
n_particles | is the number of particles stored in this data block |
codec_id | is the ID of the codec to compress the data. |
new_data | is an array of data values to add. |
tng_function_status DECLSPECDLLEXPORT tng_particle_data_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
union data_values **** | values, | ||
int64_t * | n_frames, | ||
int64_t * | n_particles, | ||
int64_t * | n_values_per_frame, | ||
char * | type | ||
) |
Retrieve particle data, from the last read frame set. Obsolete!
The particle dimension of the returned values array is translated to real particle numbering, i.e. the numbering of the actual molecular system.
tng_data | is a trajectory data container. tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened. |
block_id | is the id number of the particle data block to read. |
values | is a pointer to a 3-dimensional array (memory unallocated), which will be filled with data. The array will be sized (n_frames * n_particles * n_values_per_frame). Since ****values is allocated in this function it is the callers responsibility to free the memory. |
n_frames | is set to the number of frames in the returned data. This is needed to properly reach and/or free the data afterwards. |
n_particles | is set to the number of particles in the returned data. This is needed to properly reach and/or free the data afterwards. |
n_values_per_frame | is set to the number of values per frame in the data. This is needed to properly reach and/or free the data afterwards. |
type | is set to the data type of the data in the array. |
This function is obsolete and only retained for compatibility. Use tng_particle_data_vector_get() instead.
tng_function_status DECLSPECDLLEXPORT tng_particle_data_interval_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
const int64_t | start_frame_nr, | ||
const int64_t | end_frame_nr, | ||
const char | hash_mode, | ||
union data_values **** | values, | ||
int64_t * | n_particles, | ||
int64_t * | n_values_per_frame, | ||
char * | type | ||
) |
Read and retrieve particle data, in a specific interval. Obsolete!
The particle dimension of the returned values array is translated to real particle numbering, i.e. the numbering of the actual molecular system.
tng_data | is a trajectory data container. tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened. |
block_id | is the id number of the particle data block to read. |
start_frame_nr | is the index number of the first frame to read. |
end_frame_nr | is the index number of the last frame to read. |
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
values | is a pointer to a 3-dimensional array (memory unallocated), which will be filled with data. The array will be sized (n_frames * n_particles * n_values_per_frame). Since ****values is allocated in this function it is the callers responsibility to free the memory. |
n_particles | is set to the number of particles in the returned data. This is needed to properly reach and/or free the data afterwards. |
n_values_per_frame | is set to the number of values per frame in the data. This is needed to properly reach and/or free the data afterwards. |
type | is set to the data type of the data in the array. |
This function is obsolete and only retained for compatibility. Use tng_particle_data_vector_interval_get() instead.
tng_function_status DECLSPECDLLEXPORT tng_particle_data_values_free | ( | const tng_trajectory_t | tng_data, |
union data_values *** | values, | ||
const int64_t | n_frames, | ||
const int64_t | n_particles, | ||
const int64_t | n_values_per_frame, | ||
const char | type | ||
) |
Free data of an array of values (3D).
tng_data | is a trajectory data container. |
values | is the array to free and will be set to 0 afterwards. |
n_frames | is the number of frames in the data array. |
n_particles | is the number of particles in the data array. |
n_values_per_frame | is the number of values per frame in the data array. |
type | is the data type of the data in the array (e.g. int/float/char). |
This function should not be used. The data_values union is obsolete. This function also causes memory leaks, but its signature cannot be changed without disturbing the API.
tng_function_status DECLSPECDLLEXPORT tng_particle_data_vector_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
void ** | values, | ||
int64_t * | n_frames, | ||
int64_t * | stride_length, | ||
int64_t * | n_particles, | ||
int64_t * | n_values_per_frame, | ||
char * | type | ||
) |
Retrieve a vector (1D array) of particle data, from the last read frame set.
The particle dimension of the returned values array is translated to real particle numbering, i.e. the numbering of the actual molecular system.
tng_data | is a trajectory data container. tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened. |
block_id | is the id number of the particle data block to read. |
values | is a pointer to a 1-dimensional array (memory unallocated), which will be filled with data. The length of the array will be (n_frames_with_data (see stride_length) * n_particles * n_values_per_frame). Since **values is allocated in this function it is the callers responsibility to free the memory. |
n_frames | is set to the number of frames in the returned data. This is needed to properly reach and/or free the data afterwards. |
stride_length | is set to the stride length of the returned data. |
n_particles | is set to the number of particles in the returned data. This is needed to properly reach and/or free the data afterwards. |
n_values_per_frame | is set to the number of values per frame in the data. This is needed to properly reach and/or free the data afterwards. |
type | is set to the data type of the data in the array. |
This does only work for numerical (int, float, double) data.
tng_function_status DECLSPECDLLEXPORT tng_particle_data_vector_interval_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | block_id, | ||
const int64_t | start_frame_nr, | ||
const int64_t | end_frame_nr, | ||
const char | hash_mode, | ||
void ** | values, | ||
int64_t * | n_particles, | ||
int64_t * | stride_length, | ||
int64_t * | n_values_per_frame, | ||
char * | type | ||
) |
Read and retrieve a vector (1D array) particle data, in a specific interval.
The particle dimension of the returned values array is translated to real particle numbering, i.e. the numbering of the actual molecular system.
tng_data | is a trajectory data container. tng_data->input_file_path specifies which file to read from. If the file (input_file) is not open it will be opened. |
block_id | is the id number of the particle data block to read. |
start_frame_nr | is the index number of the first frame to read. |
end_frame_nr | is the index number of the last frame to read. |
hash_mode | is an option to decide whether to use the md5 hash or not. If hash_mode == TNG_USE_HASH the md5 hash in the file will be compared to the md5 hash of the read contents to ensure valid data. |
values | is a pointer to a 1-dimensional array (memory unallocated), which will be filled with data. The length of the array will be (n_frames_with_data (see stride_length) * n_particles * n_values_per_frame). Since **values is allocated in this function it is the callers responsibility to free the memory. |
stride_length | is set to the stride length (writing interval) of the data. |
n_particles | is set to the number of particles in the returned data. This is needed to properly reach and/or free the data afterwards. |
n_values_per_frame | is set to the number of values per frame in the data. This is needed to properly reach and/or free the data afterwards. |
type | is set to the data type of the data in the array. |
This does only work for numerical (int, float, double) data.
tng_function_status DECLSPECDLLEXPORT tng_particle_mapping_add | ( | const tng_trajectory_t | tng_data, |
const int64_t | num_first_particle, | ||
const int64_t | n_particles, | ||
const int64_t * | mapping_table | ||
) |
Add a particle mapping table.
Each particle mapping table will be written as a separate block, followed by the data blocks for the corresponding particles. In most cases there is one particle mapping block for each thread writing the trajectory.
tng_data | is the trajectory, with the frame set to which to add the mapping block. |
The mapping information is added to the currently active frame set of tng_data
num_first_particle | is the first particle number of this mapping block. |
n_particles | is the number of particles in this mapping block. |
mapping_table | is a list of the real particle numbers (i.e. the numbers used in the molecular system). The list is n_particles long. |
mapping_table[0] is the real particle number of the first particle in the following data blocks.
tng_function_status DECLSPECDLLEXPORT tng_residue_atom_add | ( | const tng_trajectory_t | tng_data, |
const tng_residue_t | residue, | ||
const char * | atom_name, | ||
const char * | atom_type, | ||
tng_atom_t * | atom | ||
) |
Add an atom to a residue.
tng_data | is the trajectory containing the residue. |
residue | is the residue to add an atom to. |
atom_name | is a string containing the name of the atom. |
atom_type | is a string containing the atom type of the atom. |
atom | is a pointer to the newly created atom. |
tng_function_status DECLSPECDLLEXPORT tng_residue_atom_of_index_get | ( | const tng_trajectory_t | tng_data, |
const tng_residue_t | residue, | ||
const int64_t | index, | ||
tng_atom_t * | atom | ||
) |
Retrieve the atom of a residue with specified index in the list of atoms.
tng_data | is the trajectory data container containing the residue. |
index | is the index (in residue->atoms) of the atom to return |
residue | is the residue from which to get the atom. |
atom | is a pointer to the atom if it was found - otherwise 0. |
tng_function_status DECLSPECDLLEXPORT tng_residue_atom_w_id_add | ( | const tng_trajectory_t | tng_data, |
const tng_residue_t | residue, | ||
const char * | atom_name, | ||
const char * | atom_type, | ||
const int64_t | id, | ||
tng_atom_t * | atom | ||
) |
Add an atom with a specific ID to a residue.
tng_data | is the trajectory containing the residue. |
residue | is the residue to add an atom to. |
atom_name | is a string containing the name of the atom. |
atom_type | is a string containing the atom type of the atom. |
id | is the ID of the created atom. |
atom | is a pointer to the newly created atom. |
tng_function_status DECLSPECDLLEXPORT tng_residue_id_of_particle_nr_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | nr, | ||
int64_t * | id | ||
) |
Get the residue id (local to molecule) of real particle number (number in mol system).
tng_data | is the trajectory data container containing the atom. |
nr | is the real number of the particle in the molecular system. |
id | is a pointer to the variable, which will be set to the ID. |
tng_function_status DECLSPECDLLEXPORT tng_residue_name_get | ( | const tng_trajectory_t | tng_data, |
const tng_residue_t | residue, | ||
char * | name, | ||
const int | max_len | ||
) |
Get the name of a residue.
tng_data | the trajectory containing the residue. |
residue | the residue of which to get the name. |
name | the string to fill with the name of the residue, memory must be allocated before. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for name. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_residue_name_of_particle_nr_get | ( | const tng_trajectory_t | tng_data, |
const int64_t | nr, | ||
char * | name, | ||
const int | max_len | ||
) |
Get the residue name of real particle number (number in mol system).
tng_data | is the trajectory data container containing the atom. |
nr | is the real number of the particle in the molecular system. |
name | is a string, which is set to the name of the residue. Memory must be reserved beforehand. |
max_len | is the maximum length of name. |
tng_function_status DECLSPECDLLEXPORT tng_residue_name_set | ( | const tng_trajectory_t | tng_data, |
const tng_residue_t | residue, | ||
const char * | new_name | ||
) |
Set the name of a residue.
tng_data | is the trajectory data container containing the residue. |
residue | is the residue to rename. |
new_name | is a string containing the wanted name. |
tng_function_status DECLSPECDLLEXPORT tng_residue_num_atoms_get | ( | const tng_trajectory_t | tng_data, |
const tng_residue_t | residue, | ||
int64_t * | n | ||
) |
Get the number of atoms in a residue.
tng_data | is the trajectory containing the residue. |
residue | is the residue of which to get the number atoms. |
n | is pointing to a value set to the number of atoms. |
tng_function_status DECLSPECDLLEXPORT tng_time_get_str | ( | const tng_trajectory_t | tng_data, |
char * | time | ||
) |
Get the date and time of initial file creation in ISO format (string).
tng_data | is a trajectory data container. |
time | is a pointer to the string in which the date will be stored. Memory must be reserved beforehand. |
tng_function_status DECLSPECDLLEXPORT tng_time_per_frame_get | ( | const tng_trajectory_t | tng_data, |
double * | time | ||
) |
Get the current time per frame of the trajectory.
tng_data | is the trajectory from which to get the time per frame. |
time | is pointing to a value set to the time per frame. |
tng_function_status DECLSPECDLLEXPORT tng_time_per_frame_set | ( | const tng_trajectory_t | tng_data, |
const double | time | ||
) |
Set the time per frame of the trajectory.
tng_data | is the trajectory of which to set the time per frame. |
time | is the new time per frame. |
tng_function_status DECLSPECDLLEXPORT tng_trajectory_destroy | ( | tng_trajectory_t * | tng_data_p | ) |
Clean up a trajectory data container.
tng_data_p | a pointer to the trajectory data to destroy. |
All allocated memory in the data structure is freed, as well as tng_data_p itself.
tng_function_status DECLSPECDLLEXPORT tng_trajectory_init | ( | tng_trajectory_t * | tng_data_p | ) |
Setup a trajectory data container.
tng_data_p | a pointer to memory to initialise as a trajectory. |
Memory is allocated during initialisation.
tng_function_status DECLSPECDLLEXPORT tng_trajectory_init_from_src | ( | const tng_trajectory_t | src, |
tng_trajectory_t * | dest_p | ||
) |
Copy a trajectory data container (dest is setup as well).
This initialises dest and copies only what is absolute necessary for parallel i/o. This can be used inside pragma omp for setting up a thread local copy of src. It can be freed (using tng_trajectory_destroy) at the end of the parallel block.
src | the original trajectory. |
dest_p | a pointer to memory to initialise as a trajectory. |
Memory is allocated during initialisation.
tng_function_status DECLSPECDLLEXPORT tng_version | ( | const tng_trajectory_t | tng_data, |
char * | version, | ||
const int | max_len | ||
) |
Get the full version string of the TNG library.
tng_data | is a trajectory data container, it does not have to be initialized beforehand. |
version | is pointing to a value set to the major version of the library. |
max_len | maximum char length of the string, i.e. how much memory has been reserved for version. This includes \0 terminating character. |
tng_function_status DECLSPECDLLEXPORT tng_version_major | ( | const tng_trajectory_t | tng_data, |
int * | version | ||
) |
Get the major version of the TNG library.
tng_data | is a trajectory data container, it does not have to be initialized beforehand. |
version | is pointing to a value set to the major version of the library. |
tng_function_status DECLSPECDLLEXPORT tng_version_minor | ( | const tng_trajectory_t | tng_data, |
int * | version | ||
) |
Get the minor version of the TNG library.
tng_data | is a trajectory data container, it does not have to be initialized beforehand. |
version | is pointing to a value set to the minor version of the library. |
tng_function_status DECLSPECDLLEXPORT tng_version_patchlevel | ( | const tng_trajectory_t | tng_data, |
int * | patch_level | ||
) |
Get the patch level of the TNG library.
tng_data | is a trajectory data container, it does not have to be initialized beforehand. |
patch_level | is the string to fill with the full version, memory must be allocated before. |