/*
* This file is part of the GROMACS molecular simulation package.
*
- * Copyright (c) 2010,2011,2013, by the GROMACS development team, led by
+ * Copyright (c) 2010,2011,2013,2014, 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 research papers on the package. Check out http://www.gromacs.org.
*/
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
+#include "gmxpre.h"
-#include "smalloc.h"
+#include "gromacs/utility/smalloc.h"
#include "gromacs/fft/fft.h"
-#include "gmx_fatal.h"
-#include "gromacs/fileio/futil.h"
+#include "gromacs/utility/fatalerror.h"
+#include "gromacs/utility/futil.h"
#include "interf.h"
#include "powerspect.h"
/*Prepare data structures for FFT, with time averaging of power spectrum*/
if ( (status = gmx_fft_init_2d_real(&fftp, xbins, ybins, GMX_FFT_FLAG_NONE) ) != 0)
{
- free(fftp);
gmx_fatal(status, __FILE__, __LINE__, "Error allocating FFT");
}
}
/*Print out average energy-spectrum to outfiles[0] and outfiles[1];*/
- datfile1 = ffopen(outfiles[0], "w");
- datfile2 = ffopen(outfiles[1], "w");
+ datfile1 = gmx_ffopen(outfiles[0], "w");
+ datfile2 = gmx_ffopen(outfiles[1], "w");
/*Filling dat files with spectral data*/
fprintf(datfile1, "%s\n", "kx\t ky\t\tPower(kx,ky)");
fprintf(datfile1, "%d\t%d\t %8.6f\n", (n / fy), (n % fy), pspectavg1[n]);
fprintf(datfile2, "%d\t%d\t %8.6f\n", (n /fy), (n % fy), pspectavg2[n]);
}
- ffclose(datfile1);
- ffclose(datfile2);
+ gmx_ffclose(datfile1);
+ gmx_ffclose(datfile2);
- free(ftspect1);
- free(ftspect2);
+ sfree(ftspect1);
+ sfree(ftspect2);
}