#include "gbutil.h"
#include "gromacs/math/vec.h"
#include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/gmxfio.h"
typedef struct {
int resnr;
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include <string.h>
#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
#include "gromacs/fileio/xdrf.h"
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/math/vec.h"
int file_version;
int i;
- gmx_fio_checktype(ef->fio);
-
xdr = gmx_fio_getxdr(ef->fio);
if (!xdr_int(xdr, &magic))
if (mode[0] == 'r')
{
ef->fio = gmx_fio_open(fn, mode);
- gmx_fio_checktype(ef->fio);
gmx_fio_setprecision(ef->fio, FALSE);
do_enxnms(ef, &nre, &nms);
snew(fr, 1);
else
{
gmx_fio_rewind(ef->fio);
- gmx_fio_checktype(ef->fio);
gmx_fio_setprecision(ef->fio, TRUE);
do_enxnms(ef, &nre, &nms);
do_eheader(ef, &file_version, fr, nre, &bWrongPrecision, &bOK);
fr->e_size = fr->nre*sizeof(fr->ener[0].e)*4;
/*d_size = fr->ndisre*(sizeof(real)*2);*/
}
- gmx_fio_checktype(ef->fio);
if (!do_eheader(ef, &file_version, fr, -1, NULL, &bOK))
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#ifndef GMX_FILEIO_ENXIO_H
#define GMX_FILEIO_ENXIO_H
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/xdr_datatype.h"
#include "gromacs/legacyheaders/types/energy.h"
#include "gromacs/legacyheaders/types/inputrec.h"
#endif
struct gmx_groups_t;
+struct t_fileio;
/**************************************************************
* These are the base datatypes + functions for reading and
ener_file_t open_enx(const char *fn, const char *mode);
-t_fileio *enx_file_pointer(const ener_file_t ef);
+struct t_fileio *enx_file_pointer(const ener_file_t ef);
void close_enx(ener_file_t ef);
*/
#include "gmxpre.h"
+#include "gmxfio-xdr.h"
+
+#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "gmxfio-impl.h"
+/* Enumerated for data types in files */
+enum {
+ eioREAL, eioFLOAT, eioDOUBLE, eioINT, eioINT64,
+ eioUCHAR, eioNUCHAR, eioUSHORT,
+ eioRVEC, eioNRVEC, eioIVEC, eioSTRING, eioNR
+};
+
static const char *eioNames[eioNR] =
{
"REAL", "INT", "GMX_STE_T", "UCHAR", "NUCHAR", "USHORT", "RVEC", "NRVEC",
"IVEC", "STRING"
};
+XDR *gmx_fio_getxdr(t_fileio *fio)
+{
+ XDR *ret = NULL;
+ gmx_fio_lock(fio);
+ assert(fio->xdr != NULL);
+ ret = fio->xdr;
+ gmx_fio_unlock(fio);
+ return ret;
+}
+
/* check the number of items given against the type */
static void gmx_fio_check_nitem(int eio, int nitem, const char *file, int line)
{
}
}
-
/* output a data type error. */
static void gmx_fio_fe(t_fileio *fio, int eio, const char *desc,
const char *srcfile, int line)
double d = 0;
float f = 0;
+ assert(fio->xdr != NULL);
gmx_fio_check_nitem(eio, nitem, srcfile, line);
switch (eio)
{
--- /dev/null
+/*
+ * This file is part of the GROMACS molecular simulation package.
+ *
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, The GROMACS development team.
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
+ * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
+ * and including many others, as listed in the AUTHORS file in the
+ * top-level source directory and at http://www.gromacs.org.
+ *
+ * GROMACS is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1
+ * of the License, or (at your option) any later version.
+ *
+ * GROMACS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with GROMACS; if not, see
+ * http://www.gnu.org/licenses, or write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * If you want to redistribute modifications to GROMACS, please
+ * consider that scientific software is very special. Version
+ * control is crucial - bugs must be traceable. We will be happy to
+ * consider code for inclusion in the official distribution, but
+ * derived work must not be called official GROMACS. Details are found
+ * in the README & COPYING files - if they are missing, get the
+ * official version at http://www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the research papers on the package. Check out http://www.gromacs.org.
+ */
+#ifndef GMX_FILEIO_GMXFIO_XDR_H
+#define GMX_FILEIO_GMXFIO_XDR_H
+
+#include "gromacs/fileio/xdrf.h"
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct t_fileio;
+
+XDR *gmx_fio_getxdr(struct t_fileio *fio);
+/* Return the file pointer itself */
+
+gmx_bool gmx_fio_writee_string(struct t_fileio *fio, const char *item,
+ const char *desc, const char *srcfile, int line);
+
+/* reading or writing, depending on the file's opening mode string */
+gmx_bool gmx_fio_doe_real(struct t_fileio *fio, real *item,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_float(struct t_fileio *fio, float *item,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_double(struct t_fileio *fio, double *item,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_gmx_bool(struct t_fileio *fio, gmx_bool *item,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_int(struct t_fileio *fio, int *item,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_int64(struct t_fileio *fio, gmx_int64_t *item,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_uchar(struct t_fileio *fio, unsigned char *item,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_ushort(struct t_fileio *fio, unsigned short *item,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_rvec(struct t_fileio *fio, rvec *item,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_ivec(struct t_fileio *fio, ivec *item,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_doe_string(struct t_fileio *fio, char *item,
+ const char *desc, const char *srcfile, int line);
+
+/* array reading & writing */
+gmx_bool gmx_fio_ndoe_real(struct t_fileio *fio, real *item, int n,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_float(struct t_fileio *fio, float *item, int n,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_double(struct t_fileio *fio, double *item, int n,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_gmx_bool(struct t_fileio *fio, gmx_bool *item, int n,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_int(struct t_fileio *fio, int *item, int n,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_int64(struct t_fileio *fio, gmx_int64_t *item, int n,
+ const char *desc, const char *srcfile,
+ int line);
+gmx_bool gmx_fio_ndoe_uchar(struct t_fileio *fio, unsigned char *item, int n,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_ushort(struct t_fileio *fio, unsigned short *item, int n,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_rvec(struct t_fileio *fio, rvec *item, int n,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_ivec(struct t_fileio *fio, ivec *item, int n,
+ const char *desc, const char *srcfile, int line);
+gmx_bool gmx_fio_ndoe_string(struct t_fileio *fio, char *item[], int n,
+ const char *desc, const char *srcfile, int line);
+
+
+
+/* convenience macros */
+#define gmx_fio_write_string(fio, item) gmx_fio_writee_string(fio, item, (#item), __FILE__, __LINE__)
+
+#define gmx_fio_do_real(fio, item) gmx_fio_doe_real(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_float(fio, item) gmx_fio_doe_float(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_double(fio, item) gmx_fio_doe_double(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_gmx_bool(fio, item) gmx_fio_doe_gmx_bool(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_int(fio, item) gmx_fio_doe_int(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_int64(fio, item) gmx_fio_doe_int64(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_uchar(fio, item) gmx_fio_doe_uchar(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_ushort(fio, item) gmx_fio_doe_ushort(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_rvec(fio, item) gmx_fio_doe_rvec(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_ivec(fio, item) gmx_fio_doe_ivec(fio, &item, (#item), __FILE__, __LINE__)
+#define gmx_fio_do_string(fio, item) gmx_fio_doe_string(fio, item, (#item), __FILE__, __LINE__)
+
+
+#define gmx_fio_ndo_real(fio, item, n) gmx_fio_ndoe_real(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_float(fio, item, n) gmx_fio_ndoe_float(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_double(fio, item, n) gmx_fio_ndoe_double(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_gmx_bool(fio, item, n) gmx_fio_ndoe_gmx_bool(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_int(fio, item, n) gmx_fio_ndoe_int(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_int64(fio, item, n) gmx_fio_ndoe_int64(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_uchar(fio, item, n) gmx_fio_ndoe_uchar(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_ushort(fio, item, n) gmx_fio_ndoe_ushort(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_rvec(fio, item, n) gmx_fio_ndoe_rvec(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_ivec(fio, item, n) gmx_fio_ndoe_ivec(fio, item, n, (#item), __FILE__, __LINE__)
+#define gmx_fio_ndo_string(fio, item, n) gmx_fio_ndoe_string(fio, item, n, (#item), __FILE__, __LINE__)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
}
-void gmx_fio_checktype(t_fileio *fio)
-{
- if (!ftp_is_xdr(fio->iFTP))
- {
- gmx_fatal(FARGS, "Can not read/write topologies to file type %s",
- ftp2ext(fio->iFTP));
- }
-
-}
-
-
void gmx_fio_setprecision(t_fileio *fio, gmx_bool bDouble)
{
gmx_fio_lock(fio);
return ret;
}
-XDR *gmx_fio_getxdr(t_fileio* fio)
-{
- XDR *ret = NULL;
-
- gmx_fio_lock(fio);
- if (fio->xdr)
- {
- ret = fio->xdr;
- }
- gmx_fio_unlock(fio);
-
- return ret;
-}
-
gmx_bool gmx_fio_getread(t_fileio* fio)
{
gmx_bool ret;
#ifdef __cplusplus
extern "C" {
#endif
-/* types */
-
-/* Enumerated for data types in files */
-enum {
- eioREAL, eioFLOAT, eioDOUBLE, eioINT, eioINT64,
- eioUCHAR, eioNUCHAR, eioUSHORT,
- eioRVEC, eioNRVEC, eioIVEC, eioSTRING, eioNR
-};
typedef struct t_fileio t_fileio;
gmx_bool gmx_fio_getread(t_fileio *fio);
/* Return whether read mode is on in fio */
-
-void gmx_fio_checktype(t_fileio *fio);
-/* Check whether the fio is of a sane type */
-
/***************************************************
* FILE Operations
***************************************************/
* If you do not have it on some other platform you do not have largefile
* support at all, and you can define it to int (or better, find out how to
* enable large files). */
-typedef struct
+typedef struct gmx_file_position_t
{
char filename[STRLEN];
gmx_off_t offset;
int xtc_seek_time(t_fileio *fio, real time, int natoms, gmx_bool bSeekForwardOnly);
-/********************************************************
- * Read and write
- ********************************************************/
-
-
-gmx_bool gmx_fio_writee_string(t_fileio *fio, const char *item,
- const char *desc, const char *srcfile, int line);
-
-/* reading or writing, depending on the file's opening mode string */
-gmx_bool gmx_fio_doe_real(t_fileio *fio, real *item,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_float(t_fileio *fio, float *item,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_double(t_fileio *fio, double *item,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_gmx_bool(t_fileio *fio, gmx_bool *item,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_int(t_fileio *fio, int *item,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_int64(t_fileio *fio, gmx_int64_t *item,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_uchar(t_fileio *fio, unsigned char *item,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_ushort(t_fileio *fio, unsigned short *item,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_rvec(t_fileio *fio, rvec *item,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_ivec(t_fileio *fio, ivec *item,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_doe_string(t_fileio *fio, char *item,
- const char *desc, const char *srcfile, int line);
-
-/* array reading & writing */
-gmx_bool gmx_fio_ndoe_real(t_fileio *fio, real *item, int n,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_float(t_fileio *fio, float *item, int n,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_double(t_fileio *fio, double *item, int n,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_gmx_bool(t_fileio *fio, gmx_bool *item, int n,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_int(t_fileio *fio, int *item, int n,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_int64(t_fileio *fio, gmx_int64_t *item, int n,
- const char *desc, const char *srcfile,
- int line);
-gmx_bool gmx_fio_ndoe_uchar(t_fileio *fio, unsigned char *item, int n,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_ushort(t_fileio *fio, unsigned short *item, int n,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_rvec(t_fileio *fio, rvec *item, int n,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_ivec(t_fileio *fio, ivec *item, int n,
- const char *desc, const char *srcfile, int line);
-gmx_bool gmx_fio_ndoe_string(t_fileio *fio, char *item[], int n,
- const char *desc, const char *srcfile, int line);
-
-
-
-/* convenience macros */
-#define gmx_fio_write_string(fio, item) gmx_fio_writee_string(fio, item, (#item), __FILE__, __LINE__)
-
-#define gmx_fio_do_real(fio, item) gmx_fio_doe_real(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_float(fio, item) gmx_fio_doe_float(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_double(fio, item) gmx_fio_doe_double(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_gmx_bool(fio, item) gmx_fio_doe_gmx_bool(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_int(fio, item) gmx_fio_doe_int(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_int64(fio, item) gmx_fio_doe_int64(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_uchar(fio, item) gmx_fio_doe_uchar(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_ushort(fio, item) gmx_fio_doe_ushort(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_rvec(fio, item) gmx_fio_doe_rvec(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_ivec(fio, item) gmx_fio_doe_ivec(fio, &item, (#item), __FILE__, __LINE__)
-#define gmx_fio_do_string(fio, item) gmx_fio_doe_string(fio, item, (#item), __FILE__, __LINE__)
-
-
-#define gmx_fio_ndo_real(fio, item, n) gmx_fio_ndoe_real(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_float(fio, item, n) gmx_fio_ndoe_float(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_double(fio, item, n) gmx_fio_ndoe_double(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_gmx_bool(fio, item, n) gmx_fio_ndoe_gmx_bool(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_int(fio, item, n) gmx_fio_ndoe_int(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_int64(fio, item, n) gmx_fio_ndoe_int64(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_uchar(fio, item, n) gmx_fio_ndoe_uchar(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_ushort(fio, item, n) gmx_fio_ndoe_ushort(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_rvec(fio, item, n) gmx_fio_ndoe_rvec(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_ivec(fio, item, n) gmx_fio_ndoe_ivec(fio, item, n, (#item), __FILE__, __LINE__)
-#define gmx_fio_ndo_string(fio, item, n) gmx_fio_ndoe_string(fio, item, n, (#item), __FILE__, __LINE__)
-
#ifdef __cplusplus
}
#endif
#include "mdoutf.h"
#include "gromacs/domdec/domdec.h"
+#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/tngio.h"
#include "gromacs/fileio/trajectory_writing.h"
#include "gromacs/fileio/trnio.h"
*/
#include "gromacs/fileio/gmxfio.h"
-#include "gromacs/fileio/xdrf.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
#include "gromacs/linearalgebra/sparsematrix.h"
#include "gromacs/utility/baseversion.h"
#include "gromacs/utility/fatalerror.h"
gmx_sparsematrix_t * sparse_matrix)
{
t_fileio *fio;
- XDR * xd;
int i, j, prec;
gmx_bool bDum = TRUE;
gmx_bool bRead = FALSE;
}
fio = gmx_fio_open(filename, "w");
- gmx_fio_checktype(fio);
- xd = gmx_fio_getxdr(fio);
/* Write magic number */
i = GMX_MTXIO_MAGIC_NUMBER;
gmx_sparsematrix_t ** sparse_matrix)
{
t_fileio *fio;
- XDR * xd;
int i, j, prec;
gmx_bool bDum = TRUE;
gmx_bool bRead = TRUE;
size_t sz;
fio = gmx_fio_open(filename, "r");
- gmx_fio_checktype(fio);
- xd = gmx_fio_getxdr(fio);
/* Read and check magic number */
i = GMX_MTXIO_MAGIC_NUMBER;
#include "tng/tng_io.h"
#endif
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/legacyheaders/copyrite.h"
#include "gromacs/legacyheaders/types/ifunc.h"
#include "gromacs/math/units.h"
#include "gromacs/topology/topology.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/programcontext.h"
#include "gromacs/utility/sysinfo.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/filenm.h"
#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
#include "gromacs/legacyheaders/copyrite.h"
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/legacyheaders/names.h"
int idum = 0;
real rdum = 0;
- gmx_fio_checktype(fio);
gmx_fio_setdebug(fio, bDebugMode());
/* XDR binary topology file */
return ePBC;
}
-/************************************************************
- *
- * The following routines are the exported ones
- *
- ************************************************************/
-
-t_fileio *open_tpx(const char *fn, const char *mode)
+static t_fileio *open_tpx(const char *fn, const char *mode)
{
return gmx_fio_open(fn, mode);
}
-void close_tpx(t_fileio *fio)
+static void close_tpx(t_fileio *fio)
{
gmx_fio_close(fio);
}
+/************************************************************
+ *
+ * The following routines are the exported ones
+ *
+ ************************************************************/
+
void read_tpxheader(const char *fn, t_tpxheader *tpx, gmx_bool TopOnlyOK,
int *file_version, int *file_generation)
{
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*
* The routines in the corresponding c-file tpxio.c
* are based on the lower level routines in gmxfio.c
- * The integer file pointer returned from open_tpx
- * can also be used with the routines in gmxfio.h
*
**************************************************************/
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/legacyheaders/types/inputrec.h"
#include "gromacs/legacyheaders/types/state.h"
* These routines handle reading and writing of preprocessed
* topology files in any of the following formats:
* TPR : topology in XDR format, portable accross platforms
- * TRR : trajectory in XDR format (non compressed)
*
* Files are written in the precision with which the source are compiled,
* but double and single precision can be read by either.
*/
-t_fileio *open_tpx(const char *fn, const char *mode);
-/* Return an file pointer corresponding to the file you have just opened */
-
-void close_tpx(t_fileio *fio);
-/* Close the file corresponding to fio */
-
void read_tpxheader(const char *fn, t_tpxheader *tpx, gmx_bool TopOnlyOK,
int *version, int *generation);
/* Read the header from a tpx file and then close it again.
#include <string.h>
#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
#include "gromacs/legacyheaders/names.h"
#include "gromacs/legacyheaders/txtdump.h"
#include "gromacs/utility/fatalerror.h"
*bOK = TRUE;
- gmx_fio_checktype(fio);
-
if (!gmx_fio_do_int(fio, magic) || magic != GROMACS_MAGIC)
{
return FALSE;
#ifndef GMX_FILEIO_TRNIO_H
#define GMX_FILEIO_TRNIO_H
+#include "gromacs/math/vectypes.h"
+#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/real.h"
+
/**************************************************************
*
* These routines handle trr (trajectory) I/O, they read and
*
**************************************************************/
-#include "gromacs/fileio/gmxfio.h"
-
#ifdef __cplusplus
extern "C" {
#endif
+struct t_fileio;
+
typedef struct /* This struct describes the order and the */
/* sizes of the structs in a trjfile, sizes are given in bytes. */
{
int fep_state; /* Current value of alchemical state */
} t_trnheader;
-t_fileio *open_trn(const char *fn, const char *mode);
+struct t_fileio *open_trn(const char *fn, const char *mode);
/* Open a trr / trr file */
-void close_trn(t_fileio *fio);
+void close_trn(struct t_fileio *fio);
/* Close it */
-gmx_bool fread_trnheader(t_fileio *fio, t_trnheader *trn, gmx_bool *bOK);
+gmx_bool fread_trnheader(struct t_fileio *fio, t_trnheader *trn, gmx_bool *bOK);
/* Read the header of a trn file. Return FALSE if there is no frame.
* bOK will be FALSE when the header is incomplete.
*/
/* Read the header of a trn file from fn, and close the file afterwards.
*/
-void fwrite_trn(t_fileio *fio, int step, real t, real lambda,
+void fwrite_trn(struct t_fileio *fio, int step, real t, real lambda,
rvec *box, int natoms, rvec *x, rvec *v, rvec *f);
/* Write a trn frame to file fp, box, x, v, f may be NULL */
-gmx_bool fread_htrn(t_fileio *fio, t_trnheader *sh,
+gmx_bool fread_htrn(struct t_fileio *fio, t_trnheader *sh,
rvec *box, rvec *x, rvec *v, rvec *f);
/* Extern read a frame except the header (that should be pre-read,
* using routine read_trnheader, see above) from a trn file.
* Return FALSE on error
*/
-gmx_bool fread_trn(t_fileio *fio, int *step, real *t, real *lambda,
+gmx_bool fread_trn(struct t_fileio *fio, int *step, real *t, real *lambda,
rvec *box, int *natoms, rvec *x, rvec *v, rvec *f);
/* Read a trn frame, including the header from fp. box, x, v, f may
* be NULL, in which case the data will be skipped over.
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/fileio/timecontrol.h"
#include "gromacs/fileio/tngio.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#define GMX_FILEIO_TRXIO_H
#include "gromacs/fileio/filenm.h"
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/pdbio.h"
#include "gromacs/legacyheaders/oenv.h"
#include "gromacs/legacyheaders/readinp.h"
struct gmx_mtop_t;
struct t_atoms;
+struct t_fileio;
struct t_topology;
struct t_trxframe;
t_trxstatus *open_trx(const char *outfile, const char *filemode);
/* Open a TRX file and return an allocated status pointer */
-t_fileio *trx_get_fileio(t_trxstatus *status);
+struct t_fileio *trx_get_fileio(t_trxstatus *status);
/* get a fileio from a trxstatus */
float trx_get_time_of_final_frame(t_trxstatus *status);
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
extern "C" {
#endif
-struct t_fileio;
-
/* Read or write reduced precision *float* coordinates */
int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision);
int xdr_xtc_get_last_frame_number(FILE *fp, XDR *xdrs, int natoms, gmx_bool * bOK);
-
-/* Defined in gmxfio.c.
- * TODO: It would be nice to decouple this header from t_fileio completely,
- * and not need the XDR struct in gmxfio.h, but that would require some
- * extra code that is not warranted for this single function.
- * Can be reconsidered if the file I/O gets refactored in the future.
- */
-XDR *gmx_fio_getxdr(struct t_fileio *fio);
-/* Return the file pointer itself */
-
#ifdef __cplusplus
}
#endif
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include <string.h>
#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
#include "gromacs/fileio/xdrf.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/fatalerror.h"
}
}
-int xtc_check(const char *str, gmx_bool bResult, const char *file, int line)
+static int xtc_check(const char *str, gmx_bool bResult, const char *file, int line)
{
if (!bResult)
{
return 1;
}
-void xtc_check_fat_err(const char *str, gmx_bool bResult, const char *file, int line)
-{
- if (!bResult)
- {
- gmx_fatal(FARGS, "XTC read/write of %s failed, "
- "source file %s, line %d\n", str, file, line);
- }
-}
+#define XTC_CHECK(s, b) xtc_check(s, b, __FILE__, __LINE__)
static int xtc_header(XDR *xd, int *magic, int *natoms, int *step, real *time,
gmx_bool bRead, gmx_bool *bOK)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#ifndef GMX_FILEIO_XTCIO_H
#define GMX_FILEIO_XTCIO_H
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/math/vectypes.h"
#include "gromacs/utility/basedefinitions.h"
#include "gromacs/utility/real.h"
extern "C" {
#endif
+struct t_fileio;
+
/* All functions return 1 if successful, 0 otherwise
* bOK tells if a frame is not corrupted
*/
-t_fileio *open_xtc(const char *filename, const char *mode);
+struct t_fileio *open_xtc(const char *filename, const char *mode);
/* Open a file for xdr I/O */
-void close_xtc(t_fileio *fio);
+void close_xtc(struct t_fileio *fio);
/* Close the file for xdr I/O */
-int read_first_xtc(t_fileio *fio,
+int read_first_xtc(struct t_fileio *fio,
int *natoms, int *step, real *time,
matrix box, rvec **x, real *prec, gmx_bool *bOK);
/* Open xtc file, read xtc file first time, allocate memory for x */
-int read_next_xtc(t_fileio *fio,
+int read_next_xtc(struct t_fileio *fio,
int natoms, int *step, real *time,
matrix box, rvec *x, real *prec, gmx_bool *bOK);
/* Read subsequent frames */
-int write_xtc(t_fileio *fio,
+int write_xtc(struct t_fileio *fio,
int natoms, int step, real time,
matrix box, rvec *x, real prec);
/* Write a frame to xtc file */
-int xtc_check(const char *str, gmx_bool bResult, const char *file, int line);
-#define XTC_CHECK(s, b) xtc_check(s, b, __FILE__, __LINE__)
-
-void xtc_check_fat_err(const char *str, gmx_bool bResult, const char *file, int line);
-#define XTC_CHECK_FAT_ERR(s, b) xtc_check_fat_err(s, b, __FILE__, __LINE__)
-
#ifdef __cplusplus
}
#endif
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
int *nvec, int **eignr,
rvec ***eigvec, real **eigval)
{
- t_trnheader head;
- int i, snew_size;
- t_fileio *status;
- rvec *x;
- matrix box;
- gmx_bool bOK;
+ t_trnheader head;
+ int i, snew_size;
+ struct t_fileio *status;
+ rvec *x;
+ matrix box;
+ gmx_bool bOK;
*bDMR = FALSE;
int WriteXref, rvec *xref, gmx_bool bDMR,
rvec xav[], gmx_bool bDMA, real eigval[])
{
- t_fileio *trnout;
- int ndim, i, j, d, vec;
- matrix zerobox;
- rvec *x;
+ struct t_fileio *trnout;
+ int ndim, i, j, d, vec;
+ matrix zerobox;
+ rvec *x;
ndim = natoms*DIM;
clear_mat(zerobox);
(WriteXref == eWXR_YES) ? "reference, " : "",
begin, end, trnname);
- trnout = open_tpx(trnname, "w");
+ trnout = open_trn(trnname, "w");
if (WriteXref == eWXR_YES)
{
/* misuse lambda: 0/1 mass weighted fit no/yes */
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
static void dump_dih_trn(int nframes, int nangles, real **dih, const char *fn,
real *time)
{
- int i, j, k, l, m, na;
- t_fileio *trn;
- rvec *x;
- matrix box = {{2, 0, 0}, {0, 2, 0}, {0, 0, 2}};
+ int i, j, k, l, m, na;
+ struct t_fileio *trn;
+ rvec *x;
+ matrix box = {{2, 0, 0}, {0, 2, 0}, {0, 0, 2}};
na = (nangles*2);
if ((na % 3) != 0)
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
#include "gromacs/topology/residuetypes.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/index.h"
#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/statistics/statistics.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/random/random.h"
#include "gromacs/statistics/statistics.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/topology/index.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
typedef struct {
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/dir_separator.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
static int strip_dssp(char *dsspfile, int nres,
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2011,2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/correlationfunctions/integrate.h"
#include "gromacs/fft/fft.h"
#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxana/gmx_ana.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/index.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
int gmx_dyecoupl(int argc, char *argv[])
if (bDatout)
{
- datfp = fopen(out_datfile, "w");
+ datfp = gmx_ffopen(out_datfile, "w");
}
if (bRKout)
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/atomprop.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
typedef struct
#include "gromacs/legacyheaders/names.h"
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/correlationfunctions/autocorr.h"
#include "gromacs/fileio/enxio.h"
+#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/fileio/xvgr.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/legacyheaders/typedefs.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/do_fit.h"
#include "gromacs/topology/atoms.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/math/vec.h"
#include "gromacs/random/random.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/math/units.h"
#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/pbc.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxomp.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
static const double bohr = 0.529177249; /* conversion factor to compensate for VMD plugin conversion... */
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/baseversion.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
/* Enum for situations that can occur during log file parsing, the
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/random/random.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/gmxomp.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/legacyheaders/viewit.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/listed-forces/bonded.h"
#include "gromacs/pbcutil/rmpbc.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "sfactor.h"
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/strdb.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
#include "gromacs/topology/index.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "buildinfo.h"
#include "gromacs/fileio/filenm.h"
#include "gromacs/fileio/gmxfio.h"
+#include "gromacs/fileio/gmxfio-xdr.h"
#include "gromacs/fileio/xdr_datatype.h"
#include "gromacs/fileio/xdrf.h"
#include "gromacs/legacyheaders/copyrite.h"
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/legacyheaders/types/commrec.h"
#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
#include "gromacs/random/random.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/fileio/confio.h"
#include "gromacs/fileio/enxio.h"
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trnio.h"
#include "gromacs/fileio/trxio.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include <stdlib.h>
#include <string.h>
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/gmxpreprocess/fflibutil.h"
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/utility/cstringutil.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/math/vec.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
static void rd_nm2type_file(const char *fn, int *nnm, t_nm2type **nmp)
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/legacyheaders/names.h"
#include "gromacs/legacyheaders/txtdump.h"
#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#endif
#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/imd/imdsocket.h"
#include "gromacs/legacyheaders/gmx_ga2la.h"
#ifndef _checkpoint_h
#define _checkpoint_h
-
#include "gromacs/fileio/filenm.h"
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/legacyheaders/typedefs.h"
#ifdef __cplusplus
extern "C" {
#endif
+struct gmx_file_position_t;
+struct t_fileio;
+
/* the name of the environment variable to disable fsync failure checks with */
#define GMX_IGNORE_FSYNC_FAILURE_ENV "GMX_IGNORE_FSYNC_FAILURE"
gmx_int64_t *step, double *t, t_state *state);
/* Read everything that can be stored in t_trxframe from a checkpoint file */
-void read_checkpoint_trxframe(t_fileio *fp, t_trxframe *fr);
+void read_checkpoint_trxframe(struct t_fileio *fp, t_trxframe *fr);
/* Print the complete contents of checkpoint file fn to out */
void list_checkpoint(const char *fn, FILE *out);
* \param[out] outputfiles Pointer to array of output file names from the previous run. Pointer is allocated in this function.
*/
void
-read_checkpoint_simulation_part_and_filenames(t_fileio *fp,
- int *simulation_part,
- int *nfiles,
- gmx_file_position_t **outputfiles);
+read_checkpoint_simulation_part_and_filenames(struct t_fileio *fp,
+ int *simulation_part,
+ int *nfiles,
+ struct gmx_file_position_t **outputfiles);
#ifdef __cplusplus
}
#include <algorithm>
#include "gromacs/domdec/domdec.h"
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/legacyheaders/constr.h"
#include "gromacs/legacyheaders/copyrite.h"
#include "gromacs/legacyheaders/gmx_omp_nthreads.h"
#include "gromacs/topology/block.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/utility/bitmask.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxomp.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/math/units.h"
#include "gromacs/math/vec.h"
#include "gromacs/random/random.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2012,2014, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/math/units.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/mshift.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/timing/wallcycle.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/simd/simd.h"
#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include <string.h>
#include "gromacs/fileio/enxio.h"
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/legacyheaders/mdebin.h"
#include "gromacs/legacyheaders/typedefs.h"
#include "gromacs/utility/fatalerror.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2008, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/pbcutil/mshift.h"
#include "gromacs/pbcutil/pbc.h"
#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include <string.h>
#include "gromacs/domdec/domdec.h"
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/trnio.h"
#include "gromacs/fileio/xtcio.h"
#include "gromacs/legacyheaders/checkpoint.h"
#include <math.h>
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/legacyheaders/force.h"
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/math/units.h"
#include "gromacs/math/utilities.h"
#include "gromacs/math/vec.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/domdec/domdec.h"
#include "gromacs/ewald/pme.h"
#include "gromacs/fileio/confio.h"
-#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/trxio.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/gmxlib/conformation-utilities.h"
#include "gromacs/timing/wallcycle.h"
#include "gromacs/timing/walltime_accounting.h"
#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/math/vec.h"
#include "gromacs/topology/atoms.h"
#include "gromacs/topology/topology.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
#include <time.h>
#include "gromacs/fileio/confio.h"
+#include "gromacs/fileio/gmxfio.h"
#include "gromacs/fileio/xvgr.h"
#include "gromacs/legacyheaders/copyrite.h"
#include "gromacs/legacyheaders/macros.h"
#include "gromacs/topology/index.h"
#include "gromacs/topology/mtop_util.h"
#include "gromacs/topology/topology.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/utility/smalloc.h"
};
const char *top_fn, *frame_fn;
- t_fileio *fp;
+ struct t_fileio *fp;
ener_file_t fp_ener = NULL;
t_trnheader head;
int i;
static void list_trn(const char *fn)
{
- t_fileio *fpread, *fpwrite;
+ t_fileio *fpread;
int nframe, indent;
char buf[256];
rvec *x, *v, *f;
gmx_bool bOK;
fpread = open_trn(fn, "r");
- fpwrite = open_tpx(NULL, "w");
- gmx_fio_setdebug(fpwrite, TRUE);
nframe = 0;
while (fread_trnheader(fpread, &trn, &bOK))
fprintf(stderr, "\nWARNING: Incomplete frame header: nr %d, t=%g\n",
nframe, trn.t);
}
- close_tpx(fpwrite);
close_trn(fpread);
}
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
- * Copyright (c) 2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/legacyheaders/txtdump.h"
#include "gromacs/utility/basedefinitions.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2012,2013,2014, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2012,2013,2014,2015, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
#include "gromacs/selection/selectionfileoption.h"
#include "gromacs/topology/topology.h"
#include "gromacs/trajectoryanalysis/analysissettings.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/programcontext.h"
#include "gromacs/swap/swapcoords.h"
#include "gromacs/timing/wallcycle.h"
#include "gromacs/topology/mtop_util.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/gmxmpi.h"
#include "gromacs/utility/smalloc.h"