Version bump for 5.0
[alexxy/gromacs.git] / src / gromacs / fileio / tngio_for_tools.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 2013,2014, by the GROMACS development team, led by
5  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6  * and including many others, as listed in the AUTHORS file in the
7  * top-level source directory and at http://www.gromacs.org.
8  *
9  * GROMACS is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public License
11  * as published by the Free Software Foundation; either version 2.1
12  * of the License, or (at your option) any later version.
13  *
14  * GROMACS is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with GROMACS; if not, see
21  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
22  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
23  *
24  * If you want to redistribute modifications to GROMACS, please
25  * consider that scientific software is very special. Version
26  * control is crucial - bugs must be traceable. We will be happy to
27  * consider code for inclusion in the official distribution, but
28  * derived work must not be called official GROMACS. Details are found
29  * in the README & COPYING files - if they are missing, get the
30  * official version at http://www.gromacs.org.
31  *
32  * To help us fund GROMACS development, we humbly ask that you cite
33  * the research papers on the package. Check out http://www.gromacs.org.
34  */
35
36 #ifndef GMX_FILEIO_TNGIO_FOR_TOOLS_H
37 #define GMX_FILEIO_TNGIO_FOR_TOOLS_H
38
39 #include "gromacs/legacyheaders/typedefs.h"
40 #include "tng/tng_io_fwd.h"
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 #if 0
46 }
47 #endif
48
49 /*! \brief Prepare to write TNG output from trajectory conversion tools */
50 void gmx_prepare_tng_writing(const char              *filename,
51                              char                     mode,
52                              tng_trajectory_t        *in,
53                              tng_trajectory_t        *out,
54                              int                      nAtoms,
55                              const gmx_mtop_t        *mtop,
56                              const atom_id           *index,
57                              const char              *indexGroupName);
58
59 /*! \brief Write a trxframe to a TNG file
60  *
61  * \param output Trajectory to write to
62  * \param frame  Frame data to write
63  * \param natoms Number of atoms to actually write
64  *
65  * The natoms field in frame is the number of atoms in the system. The
66  * parameter natoms supports writing an index-group subset of the
67  * atoms.
68  */
69 void gmx_write_tng_from_trxframe(tng_trajectory_t        output,
70                                  t_trxframe             *frame,
71                                  int                     natoms);
72
73 /*! \brief Creates a molecule containing only the indexed atoms and sets
74  * the number of all other molecules to 0. Works similar to a
75  * selection group. */
76 void gmx_tng_setup_atom_subgroup(tng_trajectory_t tng,
77                                  const int        nind,
78                                  const atom_id   *ind,
79                                  const char      *name);
80
81 /*! \brief Read the first/next TNG frame. */
82 gmx_bool gmx_read_next_tng_frame(tng_trajectory_t            input,
83                                  t_trxframe                 *fr,
84                                  gmx_int64_t                *requestedIds,
85                                  int                         numRequestedIds);
86
87 /*! \brief Print the molecule system to stream */
88 void gmx_print_tng_molecule_system(tng_trajectory_t input,
89                                    FILE            *stream);
90
91 /*! \brief Get a list of block IDs present in the next frame with data. */
92 gmx_bool gmx_get_tng_data_block_types_of_next_frame(tng_trajectory_t     input,
93                                                     int                  frame,
94                                                     int                  nRequestedIds,
95                                                     gmx_int64_t         *requestedIds,
96                                                     gmx_int64_t         *nextFrame,
97                                                     gmx_int64_t         *nBlocks,
98                                                     gmx_int64_t        **blockIds);
99
100 /*! \brief Get data of the next frame with data from the data block
101  * with the specified block ID. */
102 gmx_bool gmx_get_tng_data_next_frame_of_block_type(tng_trajectory_t     input,
103                                                    gmx_int64_t          blockId,
104                                                    real               **values,
105                                                    gmx_int64_t         *frameNumber,
106                                                    double              *frameTime,
107                                                    gmx_int64_t         *nValuesPerFrame,
108                                                    gmx_int64_t         *nAtoms,
109                                                    real                *prec,
110                                                    char                *name,
111                                                    int                  maxLen,
112                                                    gmx_bool            *bOK);
113
114 #ifdef __cplusplus
115 }
116 #endif
117
118 #endif