Convert domdec code to C++

Used std:: versions of at least some calls to min, max, sqrt and pow,
eliminated unused variables, used a named floating-point constant,
used a static_cast to make clear that we intend to truncate to integer
in one place, made some iteration variables local to their block,
protected some uses of fplog and fshift.

Eliminated some redundant #ifdef GMX_MPI, changed the range of others
to declare variables only where used.

Converted some neighbour-search constants to be static const real,
rather than macros, with the side effect of not having to deal
with overloaded std::sqrt for constants.

Introduced one work-around (duplicating the code of add_ifunc) for
dealing with the way that nral is a complicated function of
ftype. Static analysis was not being consistent in the way it was
choosing code paths with possible values of nral in different
functions. Co-locating two loops over nral resolves the issue.

Added assertions that help static analysis understand that settles are
kinds of constraints and that sane things happen elsewhere, so that
code paths that look like they might be called when only
inter-charge-group settles exist are actually well formed.

Added yet more assertions to reassure the analyzer that we handle
memory allocation with charge-group linking correctly.

Clarified a PBC-related variable name.

Change-Id: I5d1cf06c866098d183d7fe5aa023a292ca3d109b