Convert ewald module to C++
commitbef6f8ee3e07a19ee85a179eeb482a702b8df7d4
authorMark Abraham <mark.j.abraham@gmail.com>
Sun, 12 Oct 2014 18:21:18 +0000 (12 20:21 +0200)
committerMark Abraham <mark.j.abraham@gmail.com>
Tue, 26 May 2015 14:01:34 +0000 (26 16:01 +0200)
treebb7834d329df5722629628e11ada9a03e2852535
parent44e025b8da8436da4b61531266bdf1658c5002b3
Convert ewald module to C++

Used std::min/max/pow, some static casts, eliminated unused variables,
defined module, added some Doxygen, initialized some tensors directly
with zero. Removed all C++ ifdef guards, since this module and all its
callers all now compile as C++!

Reworked the implementations of gmx_pme_pp_init(),
gmx_pme_send_force_vir_ener() and gmx_pme_recv_coeffs_coords() to
handle unused-variable warnings better. Such functions can only ever
be used when MPI is configured, but in that case, the old
implementations had variables whose values had to propagate across
ifdef-ed regions. Now, more of the function bodies are behind an ifdef
and the unused values are marked as such only on the code path where
they are unused.

Simplified logic in long-range-correction.cpp so that humans and the
clang static-analyzer can understand what is going on. Fortunately,
the death of the group scheme will eliminate much of the horror of the
ewald_LRcorrection() function, because calc_excl_corr will be always
false.

Replaced use of undocumented conjmul(a,b) with cmul(a, conjugate(b))
since the latter two are static functions in gmxcomplex.h.

Renamed tabulate_eir() as tabulateStructureFactors().

Removed mpi_type in favour of existing GMX_MPI_REAL

Replaced some macros with constants.

Converted comments into basic Doxygen, plus a suppression in
pme-internal.h because Doxygen seems to think struct fields are public
documentation no matter what you tell it.

Change-Id: Ic9f219cc73dbb586c58a78cdfcd17e2bc1fd7a19
27 files changed:
src/gromacs/ewald/CMakeLists.txt
src/gromacs/ewald/calculate-spline-moduli.cpp [moved from src/gromacs/ewald/calculate-spline-moduli.c with 98% similarity]
src/gromacs/ewald/calculate-spline-moduli.h
src/gromacs/ewald/ewald.cpp [moved from src/gromacs/ewald/ewald.c with 90% similarity]
src/gromacs/ewald/ewald.h
src/gromacs/ewald/long-range-correction.cpp [moved from src/gromacs/ewald/long-range-correction.c with 97% similarity]
src/gromacs/ewald/long-range-correction.h
src/gromacs/ewald/pme-gather.cpp
src/gromacs/ewald/pme-gather.h
src/gromacs/ewald/pme-grid.cpp [moved from src/gromacs/ewald/pme-grid.c with 98% similarity]
src/gromacs/ewald/pme-grid.h
src/gromacs/ewald/pme-internal.h
src/gromacs/ewald/pme-load-balancing.cpp [moved from src/gromacs/ewald/pme-load-balancing.c with 79% similarity]
src/gromacs/ewald/pme-load-balancing.h
src/gromacs/ewald/pme-only.cpp [moved from src/gromacs/ewald/pme-only.c with 98% similarity]
src/gromacs/ewald/pme-pp.cpp [moved from src/gromacs/ewald/pme-pp.c with 80% similarity]
src/gromacs/ewald/pme-redistribute.cpp [moved from src/gromacs/ewald/pme-redistribute.c with 97% similarity]
src/gromacs/ewald/pme-redistribute.h
src/gromacs/ewald/pme-solve.cpp [moved from src/gromacs/ewald/pme-solve.c with 98% similarity]
src/gromacs/ewald/pme-solve.h
src/gromacs/ewald/pme-spline-work.cpp [moved from src/gromacs/ewald/pme-spline-work.c with 98% similarity]
src/gromacs/ewald/pme-spline-work.h
src/gromacs/ewald/pme-spread.cpp
src/gromacs/ewald/pme-spread.h
src/gromacs/ewald/pme.cpp [moved from src/gromacs/ewald/pme.c with 95% similarity]
src/gromacs/ewald/pme.h
src/programs/mdrun/md.cpp