fixed DD charge group displacement error check

One of the two checks for large charge group displacement during
domain decomposition mixed the dimension index and the dimension.
The check was correct for decomposition in x, xy or xyz. Other setups
could lead to false positives and false negatives (unlikely).
Fixes #959

Change-Id: I9e38c43f931e6ca8149faae40f49f675a7ae9664
Fix Segfaults in Genion

Introduced by babdd87c and c7a82654f

Change-Id: Id42042966931f3b7dfbd2eebcde29d659f80c0f0
Fixes: 982
Fix in when to call the constraints for andersen.

Change-Id: Ifa7eebd3a23312cb5abe66f7bf0d7a3299740f9a
Clarified reasons for termination of EM

"Step size too small" can be misinterpreted as nsteps is too small,
and so the error message is now more explicit.

Change-Id: I5680b3d13f34f7186ce28c553ac5736c4a74818e
Merge "Clarified reasons for termination of EM" into release-4-6
Added a check for efep that was missing.

Fixes #983

Change-Id: Icdc1dd68f782fd6385fd55b616993fadea0c4448
Fix use after free memory error with adress

Change-Id: I481a55704a0a93235df531269bbbe40240dd12dc
Add note about SD integrator and t-coupling

Change-Id: I6c2bd1a332abbaf5312c9ad46de24bcd7205a085
Fix overlapping memcpy

The memcpy were not neccessary.

Fixes #984

Change-Id: Iea1d34756444cba2493940ab3f2252e7c108323f
Fixed segv in essential dynamics module

Change-Id: Ia5657a535e7e31d55bf2b310a20dfee2a5e3b7f4
Merge "Fixed segv in essential dynamics module" into release-4-5-patches
Remove share/tutor

Not up-to-date and better tutorials exists.

Fixes #811

Change-Id: I52708a534e641039ccb05538e0a5387079370761
Added comment in get_structure about which structures are included

This patch just adds a comment and refactors natoms -> nav to better
clarify when we deal with the AVERAGE and when with the REFERENCE (fit)
structure. 'natoms' is not a good choice if we are talking about
the number of atoms in the average structure only.

Change-Id: I7025fb6ea59af0a7bcd7953a25abd09be0dd2979
Fixed calculation of projection for STAR and/or SORI

Both for STAR and for SORI, if provided to make_edi, the
fit structure and the average structure can be the same
(in these cases the old code works fine), or one can do
the fit on another (possibly larger) part of the molecule.
In the latter case, STAR (or SORI) contains first the fit and
then the average structure (concatenated). Here, the fit has to
be performed using the fit structure while the projection(s) have
to be calculated using the average structure. This is now
taken care of by the 'avindex' index variable.

Change-Id: Id97235030f3394df2931e30249083ad439dbe791
Merge "Added comment in get_structure about which structures are included" into release-4-5-patches
fixed incorrect TPI results with dynamic box

TPI with a box in the -rerun file different from the tpr gave systematic
errors. In Gromacs 4.0 there was a minor error, but not systematic.
Now TPI with any box setup is fully correct. Fixes #799

Change-Id: I69279874c2d1192e63efa224a0f035d43e919e88
Fixed essential dynamics / flooding group PBC serial

In former versions, the PBC representation of essential dynamics /
flooding group atoms could be incorrect in serial runs if the ED group
contained more than a single molecule. In multi-molecule cases, the required
steps to choose the correct PBC image in communicate_group_positions()
therefore need to be performed also in serial runs. Since the PBC representation
can only change in neigborsearching steps, we only need to check the
shifts then. In parallel, NS is signalled by the bUpdateShifts
variable, which is set in dd_make_local_ed_indices(). The latter
function is however not called in serial runs; but still we can pass
the bNS boolean to do_flood() to signal the NS status. For essential
dynamics, unfortunately, since do_edsam() is called from constrain(), there
is no information about the NS status at that point. Until someone
comes up with a better idea, we therefore do the PBC check in every step
in serial essential dynamics - the performance impact will be negligible
anyway.

Change-Id: I86336a5e34131bdeac7e28f35b1ccb633450e54e
Merge "fixed incorrect TPI results with dynamic box" into release-4-5-patches
fixed trjconv not writing velocities with cpt input

Fixes #930

Change-Id: I554dd729484a4238620f2773b5c3b3672cab72ee
Added TIP4P back into CHARMM27

I think Par erroneously removed this in 73b6d636a

Change-Id: Ie9f64636b1b28030ec86248649acad343b7c9a76