summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-15 15:05:22 (GMT)
committerMagnus Lundborg <lundborg.magnus@gmail.com>2013-11-15 15:05:22 (GMT)
commitdb418d967bac5453b9c7c9d1d2450c7f13a7f791 (patch)
tree7804cfbb381a8ed1eedf1278eb3df68472917cd6
parentb6140664d54e948ddfada3a5dc0ec0be7a159525 (diff)
Added tng_num_molecule_types_get()
-rw-r--r--include/tng_io.h13
-rw-r--r--src/lib/tng_io.c12
2 files changed, 25 insertions, 0 deletions
diff --git a/include/tng_io.h b/include/tng_io.h
index 6ce98d0..50eb3dd 100644
--- a/include/tng_io.h
+++ b/include/tng_io.h
@@ -1145,6 +1145,19 @@ tng_function_status DECLSPECDLLEXPORT tng_num_particles_get
int64_t *n);
/**
+ * @brief Get the number of molecule types (length of tng_data->molecules).
+ * @param tng_data is the trajectory from which to get the number of molecules.
+ * @param n is pointing to a value set to the number of molecule types.
+ * @pre \code tng_data != 0 \endcode The trajectory container (tng_data)
+ * must be initialised before using it.
+ * @pre \code n != 0 \endcode The pointer to n must not be a NULL pointer.
+ * @return TNG_SUCCESS (0) if successful.
+ */
+tng_function_status DECLSPECDLLEXPORT tng_num_molecules_types_get
+ (const tng_trajectory_t tng_data,
+ int64_t *n);
+
+/**
* @brief Get the current total number of molecules.
* @param tng_data is the trajectory from which to get the number of molecules.
* @param n is pointing to a value set to the number of molecules.
diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c
index 364df13..850c4ef 100644
--- a/src/lib/tng_io.c
+++ b/src/lib/tng_io.c
@@ -9849,6 +9849,18 @@ tng_function_status DECLSPECDLLEXPORT tng_num_particles_get
return(TNG_SUCCESS);
}
+tng_function_status DECLSPECDLLEXPORT tng_num_molecule_types_get
+ (const tng_trajectory_t tng_data,
+ int64_t *n)
+{
+ TNG_ASSERT(tng_data, "TNG library: Trajectory container not properly setup.");
+ TNG_ASSERT(n, "TNG library: n must not be a NULL pointer");
+
+ *n = tng_data->n_molecules;
+
+ return(TNG_SUCCESS);
+}
+
tng_function_status DECLSPECDLLEXPORT tng_num_molecules_get
(const tng_trajectory_t tng_data,
int64_t *n)
contact: Jan Huwald // Impressum