X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=blobdiff_plain;f=src%2Fgromacs%2Fgmxana%2Fgmx_h2order.cpp;fp=src%2Fgromacs%2Fgmxana%2Fgmx_h2order.c;h=2e0ab2655f67e202e79e0b811816cb69d02bd9b6;hb=3a5934fccd489925ab5e80aeb4bf703040137071;hp=bab0785283cc3abd0d298345679ab18d53d11918;hpb=6ecd5d46bf94b6ef898e8fac4a7770bd7b2ee5d5;p=alexxy%2Fgromacs.git diff --git a/src/gromacs/gmxana/gmx_h2order.c b/src/gromacs/gmxana/gmx_h2order.cpp similarity index 96% rename from src/gromacs/gmxana/gmx_h2order.c rename to src/gromacs/gmxana/gmx_h2order.cpp index bab0785283..2e0ab2655f 100644 --- a/src/gromacs/gmxana/gmx_h2order.c +++ b/src/gromacs/gmxana/gmx_h2order.cpp @@ -36,8 +36,8 @@ */ #include "gmxpre.h" -#include -#include +#include +#include #include "gromacs/commandline/pargs.h" #include "gromacs/fileio/trxio.h" @@ -92,7 +92,7 @@ void calc_h2order(const char *fn, atom_id index[], int ngx, rvec **slDipole, if (!*nslices) { - *nslices = (int)(box[axis][axis] * 10); /* default value */ + *nslices = static_cast(box[axis][axis] * 10); /* default value */ } @@ -172,9 +172,9 @@ void calc_h2order(const char *fn, atom_id index[], int ngx, rvec **slDipole, */ if (bMicel) - { /* this is for spherical interfaces */ - rvec_sub(com, x0[index[3*i]], normal); /* vector from Oxygen to COM */ - slice = norm(normal)/(*slWidth); /* spherical slice */ + { /* this is for spherical interfaces */ + rvec_sub(com, x0[index[3*i]], normal); /* vector from Oxygen to COM */ + slice = static_cast(norm(normal)/(*slWidth)); /* spherical slice */ sum[slice] += iprod(dipole, normal) / (norm(dipole) * norm(normal)); frame[slice] += iprod(dipole, normal) / (norm(dipole) * norm(normal)); @@ -186,7 +186,7 @@ void calc_h2order(const char *fn, atom_id index[], int ngx, rvec **slDipole, /* this is for flat interfaces */ /* determine which slice atom is in */ - slice = (x0[index[3*i]][axis] / (*slWidth)); + slice = static_cast(x0[index[3*i]][axis] / (*slWidth)); if (slice < 0 || slice >= *nslices) { fprintf(stderr, "Coordinate: %f ", x0[index[3*i]][axis]);