2 * This file is part of the GROMACS molecular simulation package.
4 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5 * Copyright (c) 2001-2004, The GROMACS development team.
6 * Copyright (c) 2013,2014,2015,2016,2017,2018,2019, by the GROMACS development team, led by
7 * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8 * and including many others, as listed in the AUTHORS file in the
9 * top-level source directory and at http://www.gromacs.org.
11 * GROMACS is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
16 * GROMACS is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * Lesser General Public License for more details.
21 * You should have received a copy of the GNU Lesser General Public
22 * License along with GROMACS; if not, see
23 * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 * If you want to redistribute modifications to GROMACS, please
27 * consider that scientific software is very special. Version
28 * control is crucial - bugs must be traceable. We will be happy to
29 * consider code for inclusion in the official distribution, but
30 * derived work must not be called official GROMACS. Details are found
31 * in the README & COPYING files - if they are missing, get the
32 * official version at http://www.gromacs.org.
34 * To help us fund GROMACS development, we humbly ask that you cite
35 * the research papers on the package. Check out http://www.gromacs.org.
37 #ifndef GMX_FILEIO_CONFIO_H
38 #define GMX_FILEIO_CONFIO_H
40 #include "gromacs/math/vectypes.h"
41 #include "gromacs/utility/basedefinitions.h"
43 /* For reading coordinate files it is assumed that enough memory
44 * has been allocated beforehand.
51 void write_sto_conf_indexed(const char* outfile,
60 /* like write_sto_conf, but indexed */
62 void write_sto_conf(const char* outfile,
69 /* write atoms, x, v (if .gro and not NULL) and box (if not NULL)
70 * to an STO (.gro or .pdb) file */
72 void write_sto_conf_mtop(const char* outfile,
74 const gmx_mtop_t* mtop,
79 /* As write_sto_conf, but uses a gmx_mtop_t struct */
81 /*! \brief Read a configuration and, when available, a topology from a tpr or structure file.
83 * When reading from a tpr file, the complete topology is returned in \p mtop.
84 * When reading from a structure file, only the atoms struct in \p mtop contains data.
86 * \param[in] infile Input file name
87 * \param[out] haveTopology true when a topology was read and stored in mtop
88 * \param[out] mtop The topology, either complete or only atom data
89 * \param[out] ePBC Enum reporting the type of PBC
90 * \param[in,out] x Coordinates will be stored when *x!=NULL
91 * \param[in,out] v Velocities will be stored when *v!=NULL
92 * \param[out] box Box dimensions
94 void readConfAndTopology(const char* infile,
102 /*! \brief Read a configuration from a structure file.
104 * This should eventually be superseded by TopologyInformation
106 * \param[in] infile Input file name
107 * \param[out] symtab The symbol table
108 * \param[out] name The title of the molecule, e.g. from pdb TITLE record
109 * \param[out] atoms The global t_atoms struct
110 * \param[out] ePBC Enum reporting the type of PBC
111 * \param[in,out] x Coordinates will be stored when *x!=NULL
112 * \param[in,out] v Velocities will be stored when *v!=NULL
113 * \param[out] box Box dimensions
115 void readConfAndAtoms(const char* infile,
124 /*! \brief Read a configuration and, when available, a topology from a tpr or structure file.
126 * Deprecated, superseded by readConfAndTopology().
127 * When \p requireMasses = TRUE, this routine must return a topology with
128 * mass data. Masses are either read from a tpr input file, or otherwise
129 * looked up from the mass database, and when such lookup fails a fatal error
131 * When \p requireMasses = FALSE, masses will still be read from tpr input and
132 * their presence is signaled with the \p haveMass flag in t_atoms of \p top.
134 * \param[in] infile Input file name
135 * \param[out] top The topology, either complete or only atom data. Caller is
136 * responsible for calling done_top(). \param[out] ePBC Enum reporting the type of PBC
137 * \param[in,out] x Coordinates will be stored when *x!=NULL
138 * \param[in,out] v Velocities will be stored when *v!=NULL
139 * \param[out] box Box dimensions
140 * \param[in] requireMasses Require masses to be present, either from tpr or from the mass
141 * database \returns if a topology is available
143 gmx_bool read_tps_conf(const char* infile,
144 struct t_topology* top,
149 gmx_bool requireMasses);