biod.pnpi.spb.ru
/
alexxy
/
gromacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into pygromacs
[alexxy/gromacs.git]
/
src
/
gromacs
/
gmxana
/
gmx_tcaf.cpp
diff --git
a/src/gromacs/gmxana/gmx_tcaf.c
b/src/gromacs/gmxana/gmx_tcaf.cpp
similarity index 96%
rename from
src/gromacs/gmxana/gmx_tcaf.c
rename to
src/gromacs/gmxana/gmx_tcaf.cpp
index eef238878a838552fa2f93d21d61225212536ad0..c139df52ed8f72004f8d0ed337995a33d6847b8f 100644
(file)
--- a/
src/gromacs/gmxana/gmx_tcaf.c
+++ b/
src/gromacs/gmxana/gmx_tcaf.cpp
@@
-36,9
+36,9
@@
*/
#include "gmxpre.h"
*/
#include "gmxpre.h"
-#include <
math.
h>
-#include <
stdio.h
>
-#include <
string.h
>
+#include <
cmat
h>
+#include <
cstdio
>
+#include <
cstring
>
#include "gromacs/commandline/pargs.h"
#include "gromacs/correlationfunctions/autocorr.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/correlationfunctions/autocorr.h"
@@
-59,6
+59,7
@@
#include "gromacs/topology/index.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
#include "gromacs/topology/index.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/futil.h"
+#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/smalloc.h"
#define NK 24
#include "gromacs/utility/smalloc.h"
#define NK 24
@@
-106,9
+107,9
@@
static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
}
ncorr = (nframes+1)/2;
}
ncorr = (nframes+1)/2;
- if (ncorr >
(int)
(5*wt/dt+0.5))
+ if (ncorr >
static_cast<int>
(5*wt/dt+0.5))
{
{
- ncorr =
(int)
(5*wt/dt+0.5)+1;
+ ncorr =
static_cast<int>
(5*wt/dt+0.5)+1;
}
snew(tcaf, nk);
for (k = 0; k < nk; k++)
}
snew(tcaf, nk);
for (k = 0; k < nk; k++)
@@
-126,7
+127,7
@@
static void process_tcaf(int nframes, real dt, int nkc, real **tc, rvec *kfac,
snew(sig, ncorr);
for (i = 0; i < ncorr; i++)
{
snew(sig, ncorr);
for (i = 0; i < ncorr; i++)
{
- sig[i] = exp(0.5*i*dt/wt);
+ sig[i] =
std::
exp(0.5*i*dt/wt);
}
low_do_autocorr(fn_tca, oenv, "Transverse Current Autocorrelation Functions",
}
low_do_autocorr(fn_tca, oenv, "Transverse Current Autocorrelation Functions",
@@
-306,7
+307,7
@@
int gmx_tcaf(int argc, char *argv[])
int ePBC;
t_trxframe fr;
matrix box;
int ePBC;
t_trxframe fr;
matrix box;
- gmx_bool bT
PS, bTop; /* ,bCubic; */
+ gmx_bool bT
op;
int gnx;
atom_id *index, *atndx = NULL, at;
char *grpname;
int gnx;
atom_id *index, *atndx = NULL, at;
char *grpname;
@@
-316,7
+317,7
@@
int gmx_tcaf(int argc, char *argv[])
int nframes, n_alloc, i, j, k, d;
rvec mv_mol, cm_mol, kfac[NK];
int nkc, nk, ntc;
int nframes, n_alloc, i, j, k, d;
rvec mv_mol, cm_mol, kfac[NK];
int nkc, nk, ntc;
- real **
c1, **
tc;
+ real **tc;
output_env_t oenv;
#define NHISTO 360
output_env_t oenv;
#define NHISTO 360
@@
-402,14
+403,9
@@
int gmx_tcaf(int argc, char *argv[])
n_alloc = 0;
nframes = 0;
rho = 0;
n_alloc = 0;
nframes = 0;
rho = 0;
- /* bCubic = TRUE; */
+
do
{
do
{
- /*
- bCubic = bCubic && !TRICLINIC(fr.box) &&
- fabs(fr.box[XX][XX]-fr.box[YY][YY]) < 0.001*fr.box[XX][XX] &&
- fabs(fr.box[XX][XX]-fr.box[ZZ][ZZ]) < 0.001*fr.box[XX][XX];
- */
if (nframes >= n_alloc)
{
if (nframes >= n_alloc)
{
@@
-466,8
+462,8
@@
int gmx_tcaf(int argc, char *argv[])
j = 0;
for (k = 0; k < nk; k++)
{
j = 0;
for (k = 0; k < nk; k++)
{
- sx = sin(iprod(kfac[k], cm_mol));
- cx = cos(iprod(kfac[k], cm_mol));
+ sx = s
td::s
in(iprod(kfac[k], cm_mol));
+ cx =
std::
cos(iprod(kfac[k], cm_mol));
tc[j][nframes] += sx*iprod(v1[k], mv_mol);
j++;
tc[j][nframes] += cx*iprod(v1[k], mv_mol);
tc[j][nframes] += sx*iprod(v1[k], mv_mol);
j++;
tc[j][nframes] += cx*iprod(v1[k], mv_mol);