# Binary and library suffix options
include(gmxManageSuffixes)
-##################################################################
+################################################################
# Shared library settings
-##################################################################
-if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+################################################################
+if((NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin") OR ((CMAKE_SYSTEM_VERSION VERSION_GREATER 8.0) AND (CMAKE_VERSION VERSION_GREATER 2.8.11)))
if(GMX_LIB_INSTALL_DIR STREQUAL "lib")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()
- set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${GMX_LIB_INSTALL_DIR}")
+ if(NOT CMAKE_SYSTEM_NAME STREQUAL "Darwin")
+ set(CMAKE_INSTALL_RPATH "\$ORIGIN/../${GMX_LIB_INSTALL_DIR}")
+ else()
+ set(CMAKE_INSTALL_RPATH "@executable_path/../${GMX_LIB_INSTALL_DIR}")
+ endif()
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ set(CMAKE_MACOSX_RPATH 1)
else()
+ # We are on Darwin/OSX, and cmake cannot handle proper RPATHs
if(CMAKE_SYSTEM_VERSION VERSION_GREATER 8.0) #rpath supported for >10.4
set(CMAKE_INSTALL_NAME_DIR "@rpath")
set(GMX_EXE_LINKER_FLAGS ${GMX_EXE_LINKER_FLAGS} "-Wl,-rpath,@executable_path/../${GMX_LIB_INSTALL_DIR}")
#######################
## uninstall target
#######################
- CONFIGURE_FILE(
- "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
- IMMEDIATE @ONLY)
+CONFIGURE_FILE( "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
+ IMMEDIATE @ONLY)
###########################
ADD_CUSTOM_TARGET(uninstall
"${CMAKE_COMMAND}" -P
"${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")
###########################
+set_directory_properties(PROPERTIES
+ ADDITIONAL_MAKE_CLEAN_FILES "install_manifest.txt")
########################################################################
# Manual #
#
# To help us fund GROMACS development, we humbly ask that you cite
# the research papers on the package. Check out http://www.gromacs.org.
-
-set(CMAKE_C_COMPILER "icc")
-set(CMAKE_CXX_COMPILER "icpc")
+if(NOT GMX_MPI)
+ set(CMAKE_C_COMPILER "icc")
+ set(CMAKE_CXX_COMPILER "icpc")
+else()
+ set(CMAKE_C_COMPILER "mpiicc")
+ set(CMAKE_CXX_COMPILER "mpiicpc")
+ set(GMX_PREFER_STATIC_LIBS ON CACHE BOOL "Shared libraries on Xeon Phi with MPI don't work.")
+endif()
set(CMAKE_CXX_FLAGS "-mmic" CACHE STRING "Flags used by the compiler during all build types.")
set(CMAKE_C_FLAGS "-mmic" CACHE STRING "Flags used by the compiler during all build types.")
set(GMX_FFT_LIBRARY "mkl" CACHE STRING "FFT library")
unsigned int level = 0;
/* Test gcc inline asm for x86 */
-#if defined (__x86_64__) || defined (_M_X64)
+#if defined (__LP64__) || defined (_M_X64)
__asm__("push %%rbx \n\t"
"cpuid \n\t"
"movl %%ebx, %1 \n\t"
# reference values in the Gromacs regression tests.
set( CMAKE_CXX_FLAGS_REFERENCE "-O0 -g" CACHE STRING "C++ flags for regressiontests reference runs." FORCE)
set( CMAKE_C_FLAGS_REFERENCE "-O0 -g" CACHE STRING "C flags for regressiontests reference runs." FORCE)
+set( CMAKE_EXE_LINKER_FLAGS_REFERENCE "" CACHE STRING "Linker flags for regressiontests reference runs.")
mark_as_advanced( CMAKE_CXX_FLAGS_REFERENCE CMAKE_C_FLAGS_REFERENCE)
# turn off all fancy options for the regressiontests reference build
string(REGEX REPLACE "[/-][dD][^/-]*NDEBUG" "" CMAKE_CXX_FLAGS_RELWITHASSERT_INIT "${CMAKE_CXX_FLAGS_RELEASE_INIT}")
set( CMAKE_C_FLAGS_RELWITHASSERT "${CMAKE_C_FLAGS_RELWITHASSERT_INIT}" CACHE STRING "C flags for release with assert builds.")
set( CMAKE_CXX_FLAGS_RELWITHASSERT "${CMAKE_CXX_FLAGS_RELWITHASSERT_INIT}" CACHE STRING "C++ flags for release with assert builds.")
+set( CMAKE_EXE_LINKER_FLAGS_RELWITHASSERT "" CACHE STRING "Linker flags for release with assert builds.")
mark_as_advanced( CMAKE_CXX_FLAGS_RELWITHASSERT CMAKE_C_FLAGS_RELWITHASSERT)
# unreferenced local variable (only C)
# conversion from 'size_t' to 'int', possible loss of data
# conversion from 'const char*' to 'void*', different 'const' qualifiers (only C)
- GMX_TEST_CFLAG(CFLAGS_WARN "/wd4800 /wd4355 /wd4996 /wd4305 /wd4244 /wd4101 /wd4267 /wd4090" GMXC_CFLAGS)
- GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/wd4800 /wd4355 /wd4996 /wd4305 /wd4244 /wd4267" GMXC_CXXFLAGS)
+ if(NOT CMAKE_CONFIGURATION_TYPES)
+ GMX_TEST_CFLAG(CFLAGS_WARN "/wd4800 /wd4355 /wd4996 /wd4305 /wd4244 /wd4101 /wd4267 /wd4090" GMXC_CFLAGS)
+ GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/wd4800 /wd4355 /wd4996 /wd4305 /wd4244 /wd4267" GMXC_CXXFLAGS)
+ else() #Projects only use the C++ flags
+ GMX_TEST_CXXFLAG(CXXFLAGS_WARN "/wd4800 /wd4355 /wd4996 /wd4305 /wd4244 /wd4101 /wd4267 /wd4090" GMXC_CXXFLAGS)
+ endif()
endif()
if (CMAKE_C_COMPILER_ID MATCHES "Clang")
foreach(_testflag ${ARGN} "")
message(STATUS "Try ${DESCRIPTION} = [${_testflag}]")
set(CMAKE_REQUIRED_FLAGS "${${CFLAGSVAR}} ${_testflag}")
- # make a valid variable name from the flag string: replace all non-alphanumerical chars
- string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" COMPILE_VARIABLE "C_FLAG_${_testflag}")
- check_c_source_compiles("${SOURCE}" ${COMPILE_VARIABLE})
- if(${${COMPILE_VARIABLE}})
+ # make valid variable names from the flag string: replace all non-alphanumerical chars
+ string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" COMPILE_FLAG_VARIABLE "C_FLAG_${_testflag}")
+ string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" COMPILE_SIMD_VARIABLE "C_SIMD_COMPILES_FLAG_${_testflag}")
+
+ # Check that the flag itself is fine, and that is does not generate warnings either
+ check_c_compiler_flag("${_testflag}" ${COMPILE_FLAG_VARIABLE})
+
+ if(${COMPILE_FLAG_VARIABLE})
+ # Check that we can compile SIMD source (this does not catch warnings)
+ check_c_source_compiles("${SOURCE}" ${COMPILE_SIMD_VARIABLE})
+ endif(${COMPILE_FLAG_VARIABLE})
+
+ if(${COMPILE_FLAG_VARIABLE} AND ${COMPILE_SIMD_VARIABLE})
set(${VARIABLE}_FLAG "${_testflag}" CACHE INTERNAL "${DESCRIPTION}")
set(${VARIABLE} 1 CACHE INTERNAL "Result of test for ${DESCRIPTION}" FORCE)
break()
foreach(_testflag ${ARGN} "")
message(STATUS "Try ${DESCRIPTION} = [${_testflag}]")
set(CMAKE_REQUIRED_FLAGS "${${CXXFLAGSVAR}} ${_testflag}")
- # make a valid variable name from the flag string: replace all non-alphanumerical chars
- string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" COMPILE_VARIABLE "CXX_FLAG_${_testflag}")
- check_cxx_source_compiles("${SOURCE}" ${COMPILE_VARIABLE})
- if(${${COMPILE_VARIABLE}})
+ # make valid variable names from the flag string: replace all non-alphanumerical chars
+ string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" COMPILE_FLAG_VARIABLE "CXX_FLAG_${_testflag}")
+ string(REGEX REPLACE "[^a-zA-Z0-9]+" "_" COMPILE_SIMD_VARIABLE "CXX_SIMD_COMPILES_FLAG_${_testflag}")
+
+ # Check that the flag itself is fine, and that is does not generate warnings either
+ check_cxx_compiler_flag("${_testflag}" ${COMPILE_FLAG_VARIABLE})
+
+ if(${COMPILE_FLAG_VARIABLE})
+ # Check that we can compile SIMD source (this does not catch warnings)
+ check_cxx_source_compiles("${SOURCE}" ${COMPILE_SIMD_VARIABLE})
+ endif(${COMPILE_FLAG_VARIABLE})
+
+ if(${COMPILE_FLAG_VARIABLE} AND ${COMPILE_SIMD_VARIABLE})
set(${VARIABLE}_FLAG "${_testflag}" CACHE INTERNAL "${DESCRIPTION}")
set(${VARIABLE} 1 CACHE INTERNAL "Result of test for ${DESCRIPTION}" FORCE)
break()
else()
find_package(CUDA 4.0 ${FIND_CUDA_QUIETLY})
endif()
+ # Cmake 2.8.12 (and CMake 3.0) introduced a new bug where the cuda
+ # library dir is added twice as an rpath on APPLE, which in turn causes
+ # the install_name_tool to wreck the binaries when it tries to remove this
+ # path. Since this is set inside the cuda module, we remove the extra rpath
+ # added in the library string - an rpath is not a library anyway, and at
+ # least for Gromacs this works on all CMake versions. This should be
+ # reasonably future-proof, since newer versions of CMake appear to handle
+ # the rpath automatically based on the provided library path, meaning
+ # the explicit rpath specification is no longer needed.
+ if(APPLE AND (CMAKE_VERSION VERSION_GREATER 2.8.11))
+ foreach(elem ${CUDA_LIBRARIES})
+ if(elem MATCHES "-Wl,.*")
+ list(REMOVE_ITEM CUDA_LIBRARIES ${elem})
+ endif()
+ endforeach(elem)
+ endif()
endif()
# Depending on the current vale of GMX_GPU and GMX_GPU_AUTO:
mark_as_advanced(CUDA_HOST_COMPILER CUDA_HOST_COMPILER_OPTIONS)
endif()
+ if(APPLE AND CMAKE_C_COMPILER_ID MATCHES "GNU")
+ # Some versions of gcc-4.8 and gcc-4.9 produce errors (in particular on OS X)
+ # if we do not use -D__STRICT_ANSI__. It is harmless, so we might as well add it for all versions.
+ set(CUDA_HOST_COMPILER_OPTIONS "${CUDA_HOST_COMPILER_OPTIONS}-D__STRICT_ANSI__;")
+ endif()
+
# on Linux we need to add -fPIC when building shared gmx libs
# Note: will add -fPIC for any compiler that supports it as it shouldn't hurt
if(BUILD_SHARED_LIBS)
gmx_find_cflag_for_source(CFLAGS_SSE2 "C compiler SSE2 flag"
"#include<xmmintrin.h>
- int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_rsqrt_ps(x);return 0;}"
+ int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_rsqrt_ps(x);return _mm_movemask_ps(x);}"
SIMD_C_FLAGS
"-msse2" "/arch:SSE2" "-hgnu")
gmx_find_cxxflag_for_source(CXXFLAGS_SSE2 "C++ compiler SSE2 flag"
"#include<xmmintrin.h>
- int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_rsqrt_ps(x);return 0;}"
+ int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_rsqrt_ps(x);return _mm_movemask_ps(x);}"
SIMD_CXX_FLAGS
"-msse2" "/arch:SSE2" "-hgnu")
# Note: MSVC enables SSE4.1 with the SSE2 flag, so we include that in testing.
gmx_find_cflag_for_source(CFLAGS_SSE4_1 "C compiler SSE4.1 flag"
"#include<smmintrin.h>
- int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_dp_ps(x,x,0x77);return 0;}"
+ int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_dp_ps(x,x,0x77);return _mm_movemask_ps(x);}"
SIMD_C_FLAGS
"-msse4.1" "/arch:SSE4.1" "/arch:SSE2" "-hgnu")
gmx_find_cxxflag_for_source(CXXFLAGS_SSE4_1 "C++ compiler SSE4.1 flag"
"#include<smmintrin.h>
- int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_dp_ps(x,x,0x77);return 0;}"
+ int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_dp_ps(x,x,0x77);return _mm_movemask_ps(x);}"
SIMD_CXX_FLAGS
"-msse4.1" "/arch:SSE4.1" "/arch:SSE2" "-hgnu")
"#include<immintrin.h>
${INCLUDE_X86INTRIN_H}
${INCLUDE_INTRIN_H}
-int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_macc_ps(x,x,x);return 0;}"
+int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_macc_ps(x,x,x);return _mm_movemask_ps(x);}"
SIMD_C_FLAGS
"-mfma4" "-hgnu")
gmx_find_cxxflag_for_source(CXXFLAGS_AVX_128_FMA "C++ compiler AVX (128 bit) FMA4 flag"
"#include<immintrin.h>
${INCLUDE_X86INTRIN_H}
${INCLUDE_INTRIN_H}
-int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_macc_ps(x,x,x);return 0;}"
+int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_macc_ps(x,x,x);return _mm_movemask_ps(x);}"
SIMD_CXX_FLAGS
"-mfma4" "-hgnu")
"#include<immintrin.h>
${INCLUDE_X86INTRIN_H}
${INCLUDE_INTRIN_H}
-int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_frcz_ps(x);return 0;}"
+int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_frcz_ps(x);return _mm_movemask_ps(x);}"
SIMD_C_FLAGS
"-mxop")
gmx_find_cxxflag_for_source(CXXFLAGS_AVX_128_XOP "C++ compiler AVX (128 bit) XOP flag"
"#include<immintrin.h>
${INCLUDE_X86INTRIN_H}
${INCLUDE_INTRIN_H}
-int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_frcz_ps(x);return 0;}"
+int main(){__m128 x=_mm_set1_ps(0.5);x=_mm_frcz_ps(x);return _mm_movemask_ps(x);}"
SIMD_CXX_FLAGS
"-mxop")
gmx_find_cflag_for_source(CFLAGS_AVX "C compiler AVX (256 bit) flag"
"#include<immintrin.h>
- int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_add_ps(x,x);return 0;}"
+ int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_add_ps(x,x);return _mm256_movemask_ps(x);}"
SIMD_C_FLAGS
"-mavx" "/arch:AVX" "-hgnu")
gmx_find_cxxflag_for_source(CXXFLAGS_AVX "C++ compiler AVX (256 bit) flag"
"#include<immintrin.h>
- int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_add_ps(x,x);return 0;}"
+ int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_add_ps(x,x);return _mm256_movemask_ps(x);}"
SIMD_CXX_FLAGS
"-mavx" "/arch:AVX" "-hgnu")
gmx_find_cflag_for_source(CFLAGS_AVX2 "C compiler AVX2 flag"
"#include<immintrin.h>
- int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_fmadd_ps(x,x,x);return 0;}"
+ int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_fmadd_ps(x,x,x);return _mm256_movemask_ps(x);}"
SIMD_C_FLAGS
"-march=core-avx2" "-mavx2" "/arch:AVX" "-hgnu") # no AVX2-specific flag for MSVC yet
gmx_find_cxxflag_for_source(CXXFLAGS_AVX2 "C++ compiler AVX2 flag"
"#include<immintrin.h>
- int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_fmadd_ps(x,x,x);return 0;}"
+ int main(){__m256 x=_mm256_set1_ps(0.5);x=_mm256_fmadd_ps(x,x,x);return _mm256_movemask_ps(x);}"
SIMD_CXX_FLAGS
"-march=core-avx2" "-mavx2" "/arch:AVX" "-hgnu") # no AVX2-specific flag for MSVC yet
256, but each atom can only belong to six different groups, one
each of the following:
\begin{description}
-\item[temperature-coupling group \swapindex{temperature-coupling}{group}]
+\item[\swapindex{temperature-coupling}{group}]
The \normindex{temperature coupling} parameters (reference
temperature, time constant, number of degrees of freedom, see
\ssecref{update}) can be defined for each T-coupling group
$\ve{F}_i = \sum_j \ve{F}_{ij}$ \\
plus the forces due to bonded interactions (which may depend on 1, 2,
3, or 4 atoms), plus restraining and/or external forces. \\
-The potential and kinetic energies and the pressure tensor are computed. \\
+The potential and kinetic energies and the pressure tensor may be computed. \\
$\Downarrow$\\
{\bf 3. Update configuration} \\[1ex]
The movement of the atoms is simulated by numerically solving Newton's
performance and feature support. The group scheme can be made to work
(almost) like the Verlet scheme, but this will lead to a decrease in
performance. The group scheme is especially fast for water molecules,
-which are abundant in many simulations.
+which are abundant in many simulations, but on the most recent x86
+processors, this advantage is negated by the better instruction-level
+parallelism available in the Verlet-scheme implementation. The group
+scheme is deprecated in version 5.0, and will be removed in a future
+version.
In the group scheme, a neighbor list is generated consisting of pairs
of groups of at least one atom. These groups were originally
also uses clusters of atoms, but these are not static as in the group
scheme. Rather, the clusters are defined spatially and consist of 4 or
8 atoms, which is convenient for stream computing, using e.g. SSE, AVX
-or CUDA on GPUs. At neighbor search steps, an atom pair list (or
-cluster pair list, but that's an implementation detail) is created
-with a Verlet buffer. Thus the pair-list cut-off is larger than the
+or CUDA on GPUs. At neighbor search steps, a pair list is created
+with a Verlet buffer, ie. the pair-list cut-off is larger than the
interaction cut-off. In the non-bonded force kernels, forces are only
added when an atom pair is within the cut-off distance at that
particular time step. This ensures that as atoms move between pair
search steps, forces between nearly all atoms within the cut-off
distance are calculated. We say {\em nearly} all atoms, because
{\gromacs} uses a fixed pair list update frequency for
-efficiency. There is a small chance that an atom pair distance is
-decreased to within the cut-off in this fixed number of steps. This
-small chance results in a small energy drift. When temperature
+efficiency. An atom-pair, whose distance was outside the cut-off,
+could possibly move enough during this fixed number of
+steps that its distance is now within the cut-off. This
+small chance results in a small energy drift, and the size of the
+chance depends on the temperature. When temperature
coupling is used, the buffer size can be determined automatically,
-given a certain limit on the energy drift.
+given a certain tolerance on the energy drift.
-The Verlet scheme specific settings in the {\tt mdp} file are:
+The {\tt mdp} file settings specific to the Verlet scheme are:
\begin{verbatim}
cutoff-scheme = Verlet
verlet-buffer-tolerance = 0.005
errors in pair energies cancel and the effect on the total energy drift
is usually at least an order of magnitude smaller than the tolerance.
Furthermore, the drift of the total energy is affected by many other
-factors, the constraint contribution is often the dominating one.
-For constant energy (NVE) simulations, this drift should be set to -1
-and a buffer has to be set manually by specifying {\tt rlist} $>$ {\tt
- rcoulomb}. The simplest way to get a reasonable buffer size is to
-use an NVT {\tt mdp} file with the target temperature set to what you
+factors; often, the contribution from the constraint algorithm dominates.
+
+For constant-energy (NVE) simulations, the buffer size will be
+inferred from the temperature that corresponds to the velocities
+(either those generated, if applicable, or those found in the input
+configuration). Alternatively, the tolerance can be set to -1 and a
+buffer set manually by specifying {\tt rlist} $>$ {\tt max(rcoulomb,
+ rvdw)}. The simplest way to get a reasonable buffer size is to use
+an NVT {\tt mdp} file with the target temperature set to what you
expect in your NVE simulation, and transfer the buffer size printed by
{\tt grompp} to your NVE {\tt mdp} file.
to SIMD units which can perform multiple floating operations at once
(e.g. SSE, AVX, CUDA on GPUs, BlueGene FPUs). These non-bonded kernels
are much faster than the kernels used in the group scheme for most
-types of systems, except for water molecules when not using a buffered
-pair list. This latter case is quite common for (bio-)molecular
-simulations, so for greatest speed, it is worth comparing the
-performance of both schemes.
+types of systems, except for water molecules on processors with short
+SIMD widths when not using a buffered pair list. This latter case is
+common for (bio-)molecular simulations, so for greatest speed, it is
+worth comparing the performance of both schemes.
As the Verlet cut-off scheme was introduced in version 4.6, not
all features of the group scheme are supported yet. The Verlet scheme
\dline
Non-bonded interaction feature & group & Verlet \\
\dline
-unbuffered cut-off scheme & $\surd$ & \\
+unbuffered cut-off scheme & $\surd$ & not by default \\
exact cut-off & shift/switch & $\surd$ \\
shifted interactions & force+energy & energy \\
-switched forces & $\surd$ & \\
+switched potential & $\surd$ & $\surd$ \\
+switched forces & $\surd$ & $\surd$ \\
non-periodic systems & $\surd$ & Z + walls \\
implicit solvent & $\surd$ & \\
-free energy perturbed non-bondeds & $\surd$ & \\
+free energy perturbed non-bondeds & $\surd$ & $\surd$ \\
group energy contributions & $\surd$ & CPU (not on GPU) \\
energy group exclusions & $\surd$ & \\
AdResS multi-scale & $\surd$ & \\
OpenMP multi-threading & only PME & $\surd$ \\
native GPU support & & $\surd$ \\
+Lennard-Jones PME & $\surd$ & $\surd$ \\
\dline
\end{tabular}
}
\ifthenelse{\equal{\gmxlite}{1}}{}{
\subsubsection{Energy drift and pair-list buffering}
-For a canonical ensemble, the average energy error caused by the
+For a canonical (NVT) ensemble, the average energy error caused by the
finite Verlet buffer size can be determined from the atomic
displacements and the shape of the potential at the cut-off.
%Since we are interested in the small drift regime, we will assume
\subsubsection{Cut-off artifacts and switched interactions}
With the Verlet scheme, the pair potentials are shifted to be zero at
-the cut-off, such that the potential is the integral of the force.
-Note that in the group scheme this is not possible, because no exact
-cut-off distance is used. There can still be energy drift from
-non-zero forces at the cut-off. This effect is extremely small and
-often not noticeable, as other integration errors may dominate. To
+the cut-off, which makes the potential the integral of the force.
+This is only possible in the group scheme if the shape of the potential
+is such that its value is zero at the cut-off distance.
+However, there can still be energy drift when the
+forces are non-zero at the cut-off. This effect is extremely small and
+often not noticeable, as other integration errors (e.g. from constraints)
+may dominate. To
completely avoid cut-off artifacts, the non-bonded forces can be
switched exactly to zero at some distance smaller than the neighbor
list cut-off (there are several ways to do this in {\gromacs}, see
\secref{mod_nb_int}). One then has a buffer with the size equal to the
-neighbor list cut-off less the longest interaction cut-off. With the
-group cut-off scheme, one can then also choose to let {\tt mdrun} only
+neighbor list cut-off less the longest interaction cut-off.
+
+With the
+group cut-off scheme, one can also choose to let {\tt mdrun} only
update the neighbor list when required. That is when one or more
particles have moved more than half the buffer size from the center of
geometry of the \swapindex{charge}{group} to which they belong (see
cost, since the neighbor list update frequency will be determined by
just one or two particles moving slightly beyond the half buffer
length (which not even necessarily implies that the neighbor list is
-invalid), while 99.99\% of the particles are fine. } % Brace matches
-ifthenelse test for gmxlite
+invalid), while 99.99\% of the particles are fine.
+
+} % Brace matches ifthenelse test for gmxlite
\subsubsection{Simple search\swapindexquiet{simple}{search}}
Due to \eqnsref{box_rot}{simplerc}, the vector $\rvij$
out of the neighbor list. This reduces the cut-off effects from
the charge-charge level to the dipole-dipole level, which decay
much faster. With the advent of full range electrostatics methods,
-such as particle mesh Ewald (\secref{pme}), the use of charge groups is
+such as particle-mesh Ewald (\secref{pme}), the use of charge groups is
no longer required for accuracy. It might even have a slight negative effect
on the accuracy or efficiency, depending on how the neighbor list is made
and the interactions are calculated.
-But there is still an important reason for using ``charge groups'': efficiency.
+But there is still an important reason for using ``charge groups'': efficiency with the group cut-off scheme.
Where applicable, neighbor searching is carried out on the basis of
charge groups which are defined in the molecular topology.
If the nearest image distance between the {\em
this is relatively easy, as one can simply put hydrogen atoms, and in some
case oxygen atoms, in the same charge group as the heavy atom they
are connected to; for example: CH$_3$, CH$_2$, CH, NH$_2$, NH, OH, CO$_2$, CO.
+
+With the Verlet cut-off scheme, charge groups are ignored.
+
} % Brace matches ifthenelse test for gmxlite
\subsection{Compute forces}
\eeq
From this the absolute temperature $T$ can be computed using:
\beq
-\half N_{df} kT = E_{kin}
+\half N_{\mathrm{df}} kT = E_{\mathrm{kin}}
\label{eqn:E-T}
\eeq
where $k$ is Boltzmann's constant and $N_{df}$ is the number of
degrees of freedom which can be computed from:
\beq
-N_{df} ~=~ 3 N - N_c - N_{com}
+N_{\mathrm{df}} ~=~ 3 N - N_c - N_{\mathrm{com}}
\eeq
Here $N_c$ is the number of {\em \normindex{constraints}} imposed on the system.
-When performing molecular dynamics $N_{com}=3$ additional degrees of
+When performing molecular dynamics $N_{\mathrm{com}}=3$ additional degrees of
freedom must be removed, because the three
center-of-mass velocities are constants of the motion, which are usually
set to zero. When simulating in vacuo, the rotation around the center of mass
-can also be removed, in this case $N_{com}=6$.
+can also be removed, in this case $N_{\mathrm{com}}=6$.
When more than one temperature-coupling group\index{temperature-coupling group} is used, the number of degrees
of freedom for group $i$ is:
\beq
-N^i_{df} ~=~ (3 N^i - N^i_c) \frac{3 N - N_c - N_{com}}{3 N - N_c}
+N^i_{\mathrm{df}} ~=~ (3 N^i - N^i_c) \frac{3 N - N_c - N_{\mathrm{com}}}{3 N - N_c}
\eeq
The kinetic energy can also be written as a tensor, which is necessary
for pressure calculation in a triclinic system, or systems where shear
forces are imposed:
\beq
-{\bf E}_{kin} = \half \sum_i^N m_i \vvi \otimes \vvi
+{\bf E}_{\mathrm{kin}} = \half \sum_i^N m_i \vvi \otimes \vvi
\eeq
\subsubsection{Pressure and virial}
The \normindex{pressure}
tensor {\bf P} is calculated from the difference between
-kinetic energy $E_{kin}$ and the \normindex{virial} ${\bf \Xi}$:
+kinetic energy $E_{\mathrm{kin}}$ and the \normindex{virial} ${\bf \Xi}$:
\beq
-{\bf P} = \frac{2}{V} ({\bf E}_{kin}-{\bf \Xi})
+{\bf P} = \frac{2}{V} ({\bf E}_{\mathrm{kin}}-{\bf \Xi})
\label{eqn:P}
\eeq
where $V$ is the volume of the computational box.
a factor of 0.8. For 3-D domain decomposition this allows cells
to change their volume by about a factor of 0.5, which should allow
for compensation of a load imbalance of 100\%.
-The required scaling can be changed with the {\tt -dds} option of {\tt mdrun}.
+The minimum allowed scaling can be changed with the {\tt -dds}
+option of {\tt mdrun}.
\subsection{Constraints in parallel\index{constraints}}
\label{subsec:plincs}
\dline
interaction & range & option & default \\
\dline
-non-bonded & $r_c$ = max($r_{list}$,$r_{VdW}$,$r_{Coul}$) & {\tt mdp} file & \\
-two-body bonded & max($r_{mb}$,$r_c$) & {\tt mdrun -rdd} & starting conf. + 10\% \\
-multi-body bonded & $r_{mb}$ & {\tt mdrun -rdd} & starting conf. + 10\% \\
-constraints & $r_{con}$ & {\tt mdrun -rcon} & est. from bond lengths \\
-virtual sites & $r_{con}$ & {\tt mdrun -rcon} & 0 \\
+non-bonded & $r_c$ = max($r_{\mathrm{list}}$,$r_{\mathrm{VdW}}$,$r_{\mathrm{Coul}}$) & {\tt mdp} file & \\
+two-body bonded & max($r_{\mathrm{mb}}$,$r_c$) & {\tt mdrun -rdd} & starting conf. + 10\% \\
+multi-body bonded & $r_{\mathrm{mb}}$ & {\tt mdrun -rdd} & starting conf. + 10\% \\
+constraints & $r_{\mathrm{con}}$ & {\tt mdrun -rcon} & est. from bond lengths \\
+virtual sites & $r_{\mathrm{con}}$ & {\tt mdrun -rcon} & 0 \\
\dline
\end{tabular}
}
to stop with an error message of missing interactions.
The range for the bonded interactions is determined from the distance
between bonded charge-groups in the starting configuration, with 10\% added
-for headroom. For the constraints, the value of $r_{con}$ is determined by
+for headroom. For the constraints, the value of $r_{\mathrm{con}}$ is determined by
taking the maximum distance that ({\tt lincs_order + 1}) bonds can cover
when they all connect at angles of 120 degrees.
-The actual constraint communication is not limited by $r_{con}$,
+The actual constraint communication is not limited by $r_{\mathrm{con}}$,
but by the minimum cell size $L_C$, which has the following lower limit:
\beq
-L_C \geq \max(r_{mb},r_{con})
+L_C \geq \max(r_{\mathrm{mb}},r_{\mathrm{con}})
\eeq
Without dynamic load balancing the system is actually allowed to scale
beyond this limit when pressure scaling is used.
For rhombic dodecahedra this is a factor of $\sqrt{3/2}$ shorter
along $x$ and $y$.
-When $r_{mb} > r_c$, {\tt mdrun} employs a smart algorithm to reduce
+When $r_{\mathrm{mb}} > r_c$, {\tt mdrun} employs a smart algorithm to reduce
the communication. Simply communicating all charge groups within
-$r_{mb}$ would increase the amount of communication enormously.
+$r_{\mathrm{mb}}$ would increase the amount of communication enormously.
Therefore only charge-groups that are connected by bonded interactions
to charge groups which are not locally present are communicated.
This leads to little extra communication, but also to a slightly
increased cost for the domain decomposition setup.
In some cases, {\eg} coarse-grained simulations with a very short cut-off,
-one might want to set $r_{mb}$ by hand to reduce this cost.
+one might want to set $r_{\mathrm{mb}}$ by hand to reduce this cost.
\subsection{Multiple-Program, Multiple-Data PME parallelization\index{PME}}
\label{subsec:mpmd_pme}
generalized Born-formalism, and the Still~\cite{Still97}, HCT~\cite{Truhlar96},
and OBC~\cite{Case04} models are available for calculating the Born radii.
-Here, the free energy $G_{solv}$ of solvation is the sum of three terms,
-a solvent-solvent cavity term ($G_{cav}$), a solute-solvent van der
-Waals term ($G_{vdw}$), and finally a solvent-solute electrostatics
-polarization term ($G_{pol}$).
+Here, the free energy $G_{\mathrm{solv}}$ of solvation is the sum of three terms,
+a solvent-solvent cavity term ($G_{\mathrm{cav}}$), a solute-solvent van der
+Waals term ($G_{\mathrm{vdw}}$), and finally a solvent-solute electrostatics
+polarization term ($G_{\mathrm{pol}}$).
-The sum of $G_{cav}$ and $G_{vdw}$ corresponds to the (non-polar)
-free energy of solvation for a molecule from which all charges
-have been removed, and is commonly called $G_{np}$,
+The sum of $G_{\mathrm{cav}}$ and $G_{\mathrm{vdw}}$ corresponds to the (non-polar)
+free energy of solvation for a molecule from which all charges
+have been removed, and is commonly called $G_{\mathrm{np}}$,
calculated from the total solvent accessible surface area
multiplied with a surface tension.
The total expression for the solvation free energy then becomes:
\beq
-G_{solv} = G_{np} + G_{pol}
+G_{\mathrm{solv}} = G_{\mathrm{np}} + G_{\mathrm{pol}}
\label{eqn:gb_solv}
\eeq
-Under the generalized Born model, $G_{pol}$ is calculated from the generalized Born equation~\cite{Still97}:
+Under the generalized Born model, $G_{\mathrm{pol}}$ is calculated from the generalized Born equation~\cite{Still97}:
\beq
-G_{pol} = \left(1-\frac{1}{\epsilon}\right) \sum_{i=1}^n \sum_{j>i}^n \frac {q_i q_j}{\sqrt{r^2_{ij} + b_i b_j \exp\left(\frac{-r^2_{ij}}{4 b_i b_j}\right)}}
+G_{\mathrm{pol}} = \left(1-\frac{1}{\epsilon}\right) \sum_{i=1}^n \sum_{j>i}^n \frac {q_i q_j}{\sqrt{r^2_{ij} + b_i b_j \exp\left(\frac{-r^2_{ij}}{4 b_i b_j}\right)}}
\label{eqn:gb_still}
\eeq
In the end, the full re-formulation of~\ref{eqn:gb_still} becomes:
\beq
-G_{pol} = \left(1-\frac{1}{\epsilon}\right) \sum_{i=1}^n \sum_{j>i}^n \frac{q_i q_j}{\sqrt{b_i b_j}} ~\xi (x) = \left(1-\frac{1}{\epsilon}\right) \sum_{i=1}^n q_i c_i \sum_{j>i}^n q_j c_j~\xi (x)
+G_{\mathrm{pol}} = \left(1-\frac{1}{\epsilon}\right) \sum_{i=1}^n \sum_{j>i}^n \frac{q_i q_j}{\sqrt{b_i b_j}} ~\xi (x) = \left(1-\frac{1}{\epsilon}\right) \sum_{i=1}^n q_i c_i \sum_{j>i}^n q_j c_j~\xi (x)
\label{eqn:gb_final}
\eeq
-The non-polar part ($G_{np}$) of Equation~\ref{eqn:gb_solv} is calculated
+The non-polar part ($G_{\mathrm{np}}$) of Equation~\ref{eqn:gb_solv} is calculated
directly from the Born radius of each atom using a simple ACE type
approximation by Schaefer {\em et al.}~\cite{Karplus98}, including a
simple loop over all atoms.
See also \figref{shift}.
\begin{figure}
-\centerline{\includegraphics[angle=270,width=10cm]{plots/shiftf}}
+\centerline{\includegraphics[width=10cm]{plots/shiftf}}
\caption[The Coulomb Force, Shifted Force and Shift Function
$S(r)$,.]{The Coulomb Force, Shifted Force and Shift Function $S(r)$,
using r$_1$ = 2 and r$_c$ = 4.}
$i$ and $j$ is represented by a harmonic potential:
\begin{figure}
-\centerline{\raisebox{4cm}{\includegraphics[angle=270,width=5cm]{plots/bstretch}}\includegraphics[width=7cm]{plots/f-bond}}
+\centerline{\raisebox{2cm}{\includegraphics[width=5cm]{plots/bstretch}}\includegraphics[width=7cm]{plots/f-bond}}
\caption[Bond stretching.]{Principle of bond stretching (left), and the bond
stretching potential (right).}
\label{fig:bstretch1}
\ve{F}_i(\rvij) = k^b_{ij}(\rij^2-b_{ij}^2)~\rvij
\eeq
The force constants for this form of the potential are related to the usual
-harmonic force constant $k^{b,harm}$ (\secref{bondpot}) as
+harmonic force constant $k^{b,\mathrm{harm}}$ (\secref{bondpot}) as
\beq
-2 k^b b_{ij}^2 = k^{b,harm}
+2 k^b b_{ij}^2 = k^{b,\mathrm{harm}}
\eeq
The force constants are mostly derived from the harmonic ones used in
\gromosv{87}~\cite{biomos}. Although this form is computationally more
is also represented by a harmonic potential on the angle $\tijk$
\begin{figure}
-\centerline{\raisebox{4cm}{\includegraphics[angle=270,width=5cm]{plots/angle}}\includegraphics[width=7cm]{plots/f-angle}}
+\centerline{\raisebox{1cm}{\includegraphics[width=5cm]{plots/angle}}\includegraphics[width=7cm]{plots/f-angle}}
\caption[Angle vibration.]{Principle of angle vibration (left) and the
bond angle potential (right).}
\label{fig:angle}
\eeq
The corresponding force can be derived by partial differentiation with respect
to the atomic positions. The force constants in this function are related
-to the force constants in the harmonic form $k^{\theta,harm}$
+to the force constants in the harmonic form $k^{\theta,\mathrm{harm}}$
(\ssecref{harmonicangle}) by:
\beq
-k^{\theta} \sin^2(\tijk^0) = k^{\theta,harm}
+k^{\theta} \sin^2(\tijk^0) = k^{\theta,\mathrm{harm}}
\eeq
In the \gromosv{96} manual there is a much more complicated conversion formula
which is temperature dependent. The formulas are equivalent at 0 K
\normindex{mirror image}s, see \figref{imp}.
\begin {figure}
-\centerline{\includegraphics[angle=270,width=4cm]{plots/ring-imp}\hspace{1cm}
-\includegraphics[angle=270,width=3cm]{plots/subst-im}\hspace{1cm}\includegraphics[angle=270,width=3cm]{plots/tetra-im}}
+\centerline{\includegraphics[width=4cm]{plots/ring-imp}\hspace{1cm}
+\includegraphics[width=3cm]{plots/subst-im}\hspace{1cm}\includegraphics[width=3cm]{plots/tetra-im}}
\caption[Improper dihedral angles.]{Principle of improper
dihedral angles. Out of plane bending for rings (left), substituents
of rings (middle), out of tetrahedral (right). The improper dihedral
in the {\tt [ dihedraltypes ]} section.
\begin{figure}
-\centerline{\raisebox{4.5cm}{\includegraphics[angle=270,width=5cm]{plots/dih}}\includegraphics[width=7cm]{plots/f-dih}}
+\centerline{\raisebox{1cm}{\includegraphics[width=5cm]{plots/dih}}\includegraphics[width=7cm]{plots/f-dih}}
\caption[Proper dihedral angle.]{Principle of proper dihedral angle
(left, in {\em trans} form) and the dihedral angle potential (right).}
\label{fig:pdihf}
modified potential. Using:
\beq
\phi' = \left(\phi-\phi_0\right) ~{\rm MOD}~ 2\pi
+\label{eqn:dphi}
\eeq
where $\phi_0$ is the reference angle, the potential is defined as:
\beq
\begin{verbatim}
[ distance_restraints ]
-; ai aj type index type' low up1 up2 fac
+; ai aj type index type' low up1 up2 fac
10 16 1 0 1 0.0 0.3 0.4 1.0
10 28 1 1 1 0.0 0.3 0.4 1.0
10 46 1 1 1 0.0 0.3 0.4 1.0
sequentially, then the Coulombic interaction is turned off linearly,
rather than using soft core interactions, which should be less
statistically noisy in most cases. This behavior can be overwritten
-by using the mdp option {\tt sc-coul} to 'yes'. Additionally, the
+by using the mdp option {\tt sc-coul} to {\tt yes}. Additionally, the
soft-core interaction potential is only applied when either the A or B
state has zero interaction potential. If both A and B states have
nonzero interaction potential, default linear scaling described above
r_B &=& \left(\alpha \sigma_B^{48} \LL^p + r^{48} \right)^\frac{1}{48}
\eea
This ``1-1-48'' path is also implemented in {\gromacs}. Note that for this path the soft core $\alpha$
-should satisfy $0.001 < \alpha < 0.003$,rather than $\alpha \approx
+should satisfy $0.001 < \alpha < 0.003$, rather than $\alpha \approx
0.5$.
%} % Brace matches ifthenelse test for gmxlite
atoms {\bf i+1} and {\bf i+2} are called {\em \normindex{exclusions}} of atom {\bf i}.
\begin{figure}
-\centerline{\includegraphics[angle=270,width=8cm]{plots/chain}}
+\centerline{\includegraphics[width=8cm]{plots/chain}}
\caption{Atoms along an alkane chain.}
\label{fig:chain}
\end{figure}
the creation of charges, in which case you should consider using the
lattice sum methods provided by {\gromacs}.
-Consider a water molecule interacting with another atom. When we would apply
-the cut-off on an atom-atom basis we might include the atom-oxygen
+Consider a water molecule interacting with another atom. If we would apply
+a plain cut-off on an atom-atom basis we might include the atom-oxygen
interaction (with a charge of $-0.82$) without the compensating charge
of the protons, and as a result, induce a large dipole moment over the system.
Therefore, we have to keep groups of atoms with total charge
-0 together. These groups are called {\em charge groups}.
+0 together. These groups are called {\em charge groups}. Note that with
+a proper treatment of long-range electrostatics (e.g. particle-mesh Ewald
+(\secref{pme}), keeping charge groups together is not required.
-\subsection{Treatment of Cut-offs\index{cut-off}}
+\subsection{Treatment of Cut-offs in the group scheme\index{cut-off}}
\newcommand{\rs}{$r_{short}$}
\newcommand{\rl}{$r_{long}$}
{\gromacs} is quite flexible in treating cut-offs, which implies
slowly-converging sum \eqnref{totalcoulomb} into two
quickly-converging terms and a constant term:
\begin{eqnarray}
-V &=& V_{dir} + V_{rec} + V_{0} \\[0.5ex]
-V_{dir} &=& \frac{f}{2} \sum_{i,j}^{N}
+V &=& V_{\mathrm{dir}} + V_{\mathrm{rec}} + V_{0} \\[0.5ex]
+V_{\mathrm{dir}} &=& \frac{f}{2} \sum_{i,j}^{N}
\sum_{n_x}\sum_{n_y}
\sum_{n_{z}*} q_i q_j \frac{\mbox{erfc}(\beta {r}_{ij,{\bf n}} )}{{r}_{ij,{\bf n}}} \\[0.5ex]
-V_{rec} &=& \frac{f}{2 \pi V} \sum_{i,j}^{N} q_i q_j
+V_{\mathrm{rec}} &=& \frac{f}{2 \pi V} \sum_{i,j}^{N} q_i q_j
\sum_{m_x}\sum_{m_y}
\sum_{m_{z}*} \frac{\exp{\left( -(\pi {\bf m}/\beta)^2 + 2 \pi i
{\bf m} \cdot ({\bf r}_i - {\bf r}_j)\right)}}{{\bf m}^2} \\[0.5ex]
coulombtype = P3M-AD
\end{verbatim}
-\subsection{Optimizing Fourier transforms}
-To get the best possible performance you should try to avoid large
-prime numbers for grid dimensions.
-The FFT code used in {\gromacs} is
-optimized for grid sizes of the form $2^a 3^b 5^c 7^d 11^e 13^f$,
-where $e+f$ is $0$ or $1$ and the other exponents arbitrary. (See
-further the documentation of the FFT algorithms at
-\href{http://www.fftw.org}{www.fftw.org}.
+\subsection{Optimizing Fourier transforms and PME calculations}
+It is recommended to optimize the parameters for calculation of
+electrostatic interaction such as PME grid dimensions and cut-off radii.
+This is particularly relevant to do before launching long production runs.
-It is also possible to optimize the transforms for the current problem
-by performing some calculations at the start of the run. This is not
-done by default since it takes a couple of minutes, but for large
-runs it will save time. Turn it on by specifying
-
-\begin{verbatim}
-optimize-fft = yes
-\end{verbatim}
-in your {\tt .mdp} file.
-
-When running in parallel, the grid must be communicated several times,
-thus hurting scaling performance. With PME you can improve this
-by increasing grid spacing while simultaneously increasing the
-interpolation to {\eg} sixth order.
-Since the interpolation is entirely local, doing so will
-improve the scaling in most cases.
+{\gromacs} includes a special tool, {\tt g_tune_pme}, which automates the
+process of selecting the optimal size of the grid and number of PME-only
+notes.
%
% Temporarily removed since I am not sure about the state of the testlr
the Particle-mesh Ewald method as discussed for electrostatics above.
In this case the modified Ewald equations become
\begin{eqnarray}
-V &=& V_{dir} + V_{rec} + V_{0} \\[0.5ex]
-V_{dir} &=& -\frac{1}{2} \sum_{i,j}^{N}
+V &=& V_{\mathrm{dir}} + V_{\mathrm{rec}} + V_{0} \\[0.5ex]
+V_{\mathrm{dir}} &=& -\frac{1}{2} \sum_{i,j}^{N}
\sum_{n_x}\sum_{n_y}
\sum_{n_{z}*} \frac{C_{ij}^{(6)}g(\beta {r}_{ij,{\bf n}})}{{r_{ij,{\bf n}}}^6} \\[0.5ex]
-V_{rec} &=& \frac{{\pi}^{\frac{3}{2}} \beta^{3}}{2V} \sum_{m_x}\sum_{m_y}\sum_{m_{z}*}
+V_{\mathrm{rec}} &=& \frac{{\pi}^{\frac{3}{2}} \beta^{3}}{2V} \sum_{m_x}\sum_{m_y}\sum_{m_{z}*}
f(\pi |{\mathbf m}|/\beta) \times \sum_{i,j}^{N} C_{ij}^{(6)} {\mathrm{exp}}\left[-2\pi i {\bf m}\cdot({\bf r_i}-{\bf r_j})\right] \\[0.5ex]
V_{0} &=& -\frac{\beta^{6}}{12}\sum_{i}^{N} C_{ii}^{(6)},
\end{eqnarray}
all-atom parameters. That said, we describe the available options in
some detail.
-\subsection{GROMOS87\index{GROMOS87 force field}}
-The \gromosv{87} suite of programs and corresponding force
-field~\cite{biomos} formed the basis for the development of {\gromacs}
-in the early 1990s. The original GROMOS87 force field is not
-available in {\gromacs}. In previous versions ($<$ 3.3.2) there used
-to be the so-called ``{\gromacs} force field,'' which was based on
-\gromosv{87}~\cite{biomos}\index{GROMOS87}, with a small modification
-concerning the interaction between water oxygens and carbon
-atoms~\cite{Buuren93b,Mark94}, as well as 10 extra atom
-types~\cite{Jorgensen83,Buuren93a,Buuren93b,Mark94,Liu95}.
-
-Since version 5.0 this force field has been ``deprecated''. Should
-you have a justifiable reason to use this force field please
-use eariler versions of {\gromacs}.
-
\subsubsection{All-hydrogen force field}
The \gromosv{87}-based all-hydrogen force field is almost identical to the
normal \gromosv{87} force field, since the extra hydrogens have no
\subsection{AMBER\index{AMBER force field}}
-As of version 4.5, {\gromacs} provides native support for the following AMBER force fields:
+{\gromacs} provides native support for the following AMBER force fields:
\begin{itemize}
\item AMBER94~\cite{Cornell1995}
\subsection{CHARMM\index{CHARMM force field}}
\label{subsec:charmmff}
-As of version 4.5, {\gromacs} supports the CHARMM27 force field for proteins~\cite{mackerell04, mackerell98}, lipids~\cite{feller00} and nucleic acids~\cite{foloppe00}. The protein parameters (and to some extent the lipid and nucleic acid parameters) were thoroughly tested -- both by comparing potential energies between the port and the standard parameter set in the CHARMM molecular simulation package, as well by how the protein force field behaves together with {\gromacs}-specific techniques such as virtual sites (enabling long time steps) and a fast implicit solvent recently implemented~\cite{Larsson10} -- and the details and results are presented in the paper by Bjelkmar et al.~\cite{Bjelkmar10}. The nucleic acid parameters, as well as the ones for HEME, were converted and tested by Michel Cuendet.
+{\gromacs} supports the CHARMM force field for proteins~\cite{mackerell04, mackerell98}, lipids~\cite{feller00} and nucleic acids~\cite{foloppe00,Mac2000}. The protein parameters (and to some extent the lipid and nucleic acid parameters) were thoroughly tested -- both by comparing potential energies between the port and the standard parameter set in the CHARMM molecular simulation package, as well by how the protein force field behaves together with {\gromacs}-specific techniques such as virtual sites (enabling long time steps) and a fast implicit solvent recently implemented~\cite{Larsson10} -- and the details and results are presented in the paper by Bjelkmar et al.~\cite{Bjelkmar10}. The nucleic acid parameters, as well as the ones for HEME, were converted and tested by Michel Cuendet.
When selecting the CHARMM force field in {\tt \normindex{pdb2gmx}} the default option is to use \normindex{CMAP} (for torsional correction map). To exclude CMAP, use {\tt -nocmap}. The basic form of the CMAP term implemented in {\gromacs} is a function of the $\phi$ and $\psi$ backbone torsion angles. This term is defined in the {\tt .rtp} file by a {\tt [ cmap ]} statement at the end of each residue supporting CMAP. The following five atom names define the two torsional angles. Atoms 1-4 define $\phi$, and atoms 2-5 define $\psi$. The corresponding atom types are then matched to the correct CMAP type in the {\tt cmap.itp} file that contains the correction maps.
+A port of the CHARMM36 force field for use with GROMACS is also available at \url{http://mackerell.umaryland.edu/charmm_ff.shtml#gromacs}.
+
\subsection{Coarse-grained force-fields}
\index{force-field, coarse-grained}
\label{sec:cg-forcefields}
%
% This file is part of the GROMACS molecular simulation package.
%
-% Copyright (c) 2013, by the GROMACS development team, led by
+% Copyright (c) 2013,2014, by the GROMACS development team, led by
% Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
% and including many others, as listed in the AUTHORS file in the
% top-level source directory and at http://www.gromacs.org.
It is clear that only one iteration extra (in double
precision) is needed for a double-precision result.
-\section{Modifying GROMACS}
-The following files have to be edited in case you want to add a bonded
-potential of any type.
-\begin{enumerate}
-\item {\tt include/bondf.h}
-\item {\tt include/types/idef.h}
-\item {\tt include/types/nrnb.h}
-\item {\tt include/types/enums.h}
-\item {\tt include/grompp.h}
-\item {\tt src/kernel/topdirs.c}
-\item {\tt src/gmxlib/tpxio.c}
-\item {\tt src/gmxlib/bondfree.c}
-\item {\tt src/gmxlib/ifunc.c}
-\item {\tt src/gmxlib/nrnb.c}
-\item {\tt src/kernel/convparm.c}
-\item {\tt src/kernel/topdirs.c}
-\item {\tt src/kernel/topio.c}
-\end{enumerate}
-
% LocalWords: Virial virial triclinic intra mol mshift shiftvec sqrt SPC lj yf
% LocalWords: coul Fortran SGI AMD Raphson IEEE taylor epsr accy ieee yx fpdef
% LocalWords: lsb nr inversef src formulae GROMACS
pages = {2887--2899},
year = 2013
}
+
+@article {Mac2000,
+author = {MacKerell, Alexander D. and Banavali, Nilesh K.},
+title = {All-atom empirical force field for nucleic acids: {II.} Application to molecular dynamics simulations of {DNA} and {RNA} in solution},
+journal = BTjcc,
+volume = {21},
+number = {2},
+publisher = {John Wiley & Sons, Inc.},
+issn = {1096-987X},
+url = {http://dx.doi.org/10.1002/(SICI)1096-987X(20000130)21:2<105::AID-JCC3>3.0.CO;2-P},
+doi = {10.1002/(SICI)1096-987X(20000130)21:2<105::AID-JCC3>3.0.CO;2-P},
+pages = {105--120},
+keywords = {CHARMM, force field, molecular dynamics, parametrization, DNA, RNA},
+year = {2000},
+}
-%!PS-Adobe-2.0 EPSF
-%%Title: /tmp/xfig-fig008452
-%%Creator: fig2dev
-%%CreationDate: Thu Mar 9 17:17:56 1995
-%%For: spoel@rugmd17 (David van der Spoel,Room 17.14,4327)
-%%BoundingBox: 0 0 99 180
-%%Pages: 0
+%!PS-Adobe-3.0 EPSF-3.0
+%%Title: angle.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5d
+%%CreationDate: Fri Jun 13 15:51:52 2014
+%%BoundingBox: 0 0 191 105
+%Magnification: 1.0000
%%EndComments
-/$F2psDict 200 dict def
+%%BeginProlog
+/$F2psDict 200 dict def
$F2psDict begin
$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
/l {lineto} bind def
/m {moveto} bind def
-/s {stroke} bind def
+/rm {rmoveto} bind def
/n {newpath} bind def
-/gs {gsave} bind def
-/gr {grestore} bind def
-/clp {closepath} bind def
-/graycol {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
-4 -2 roll mul setrgbcolor} bind def
-/col-1 {} def
-/col0 {0 0 0 setrgbcolor} bind def
-/col1 {0 0 1 setrgbcolor} bind def
-/col2 {0 1 0 setrgbcolor} bind def
-/col3 {0 1 1 setrgbcolor} bind def
-/col4 {1 0 0 setrgbcolor} bind def
-/col5 {1 0 1 setrgbcolor} bind def
-/col6 {1 1 0 setrgbcolor} bind def
-/col7 {1 1 1 setrgbcolor} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
/DrawEllipse {
/endangle exch def
/startangle exch def
/y exch def
/x exch def
/savematrix mtrx currentmatrix def
- x y translate xrad yrad scale 0 0 1 startangle endangle arc
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
savematrix setmatrix
} def
- end
/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
/$F2psEnd {$F2psEnteredState restore end} def
-%%EndProlog
+/pageheader {
+save
+newpath 0 105 moveto 0 0 lineto 191 0 lineto 191 105 lineto closepath clip newpath
+-55.9 170.5 translate
+1 -1 scale
$F2psBegin
-0 setlinecap 0 setlinejoin
--63.0 -54.0 translate 90 rotate 0.900 -0.900 scale
-0.500 setlinewidth
-n 178.680 130.760 m 179.000 139.000 l 174.840 131.880 l gs 2 setlinejoin col-1 s gr
-n 143.160 131.880 m 139.000 139.000 l 139.320 130.760 l gs 2 setlinejoin col-1 s gr
-n 159.000 144.833 20.833 -163.741 -16.259 arc
+10 setmiterlimit
+0 slj 0 slc
+ 0.06299 0.06299 sc
+} bind def
+/pagefooter {
+$F2psEnd
+restore
+} bind def
+%%EndProlog
+pageheader
+%
+% Fig objects follow
+%
+%
+% here starts figure with depth 0
+% Arc
+7.500 slw
+0 slc
+gs clippath
+2607 1994 m 2680 2127 l 2733 2098 l 2660 1965 l 2660 1965 l 2692 2085 l 2607 1994 l cp
+2139 1965 m 2066 2098 l 2119 2127 l 2192 1994 l 2192 1994 l 2108 2085 l 2139 1965 l cp
+eoclip
+n 2400.0 2187.5 312.5 -163.7407 -16.2593 arc
gs col-1 s gr
+ gr
+
+% arrowhead
+0 slj
+n 2139 1965 m 2108 2085 l 2192 1994 l col-1 s
+% arrowhead
+n 2607 1994 m 2692 2085 l 2660 1965 l col-1 s
% Ellipse
-n 239 79 10 10 0 360 DrawEllipse gs 0.00 setgray fill gr
-gs col-1 s gr
+n 3600 1200 150 150 0 360 DrawEllipse gs 0.00 setgray ef gr gs col-1 s gr
+
% Ellipse
-n 79 79 10 10 0 360 DrawEllipse gs 0.00 setgray fill gr
-gs col-1 s gr
+n 1200 1200 150 150 0 360 DrawEllipse gs 0.00 setgray ef gr gs col-1 s gr
+
% Ellipse
-n 159 169 10 10 0 360 DrawEllipse gs 0.00 setgray fill gr
-gs col-1 s gr
-2.000 setlinewidth
+n 2400 2550 150 150 0 360 DrawEllipse gs 0.00 setgray ef gr gs col-1 s gr
+
% Polyline
-n 84 84 m 154 169 l gs col-1 s gr
+30.000 slw
+n 1275 1275 m
+ 2325 2550 l gs col-1 s gr
% Polyline
-n 164 169 m 234 84 l gs col-1 s gr
-0.500 setlinewidth
+n 2475 2550 m
+ 3525 1275 l gs col-1 s gr
% Polyline
-n 79 79 m 59 99 l gs col-1 s gr
-n 66.071 94.757 m 59.000 99.000 l 63.243 91.929 l gs 2 setlinejoin col-1 s gr
+7.500 slw
+gs clippath
+975 1381 m 868 1489 l 910 1531 l 1018 1424 l 1018 1424 l 912 1488 l 975 1381 l cp
+eoclip
+n 1200 1200 m
+ 900 1500 l gs col-1 s gr gr
+
+% arrowhead
+n 975 1381 m 912 1488 l 1018 1424 l col-1 s
% Polyline
-n 239 79 m 259 99 l gs col-1 s gr
-n 254.757 91.929 m 259.000 99.000 l 251.929 94.757 l gs 2 setlinejoin col-1 s gr
+gs clippath
+3781 1424 m 3889 1531 l 3931 1489 l 3824 1381 l 3824 1381 l 3888 1488 l 3781 1424 l cp
+eoclip
+n 3600 1200 m
+ 3900 1500 l gs col-1 s gr gr
+
+% arrowhead
+n 3781 1424 m 3888 1488 l 3824 1381 l col-1 s
% Polyline
-n 159 169 m 159 139 l gs col-1 s gr
-n 157.000 147.000 m 159.000 139.000 l 161.000 147.000 l gs 2 setlinejoin col-1 s gr
-/Symbol findfont 18.00 scalefont setfont
-149 109 m
-gs 1 -1 scale (q) col-1 show gr
-/Helvetica findfont 16.00 scalefont setfont
-159 114 m
-gs 1 -1 scale (0) col-1 show gr
-$F2psEnd
+gs clippath
+2430 2237 m 2430 2085 l 2370 2085 l 2370 2237 l 2370 2237 l 2400 2117 l 2430 2237 l cp
+eoclip
+n 2400 2550 m
+ 2400 2100 l gs col-1 s gr gr
+
+% arrowhead
+n 2430 2237 m 2400 2117 l 2370 2237 l col-1 s
+/Symbol ff 285.75 scf sf
+2250 1650 m
+gs 1 -1 sc (q) col-1 sh gr
+/Helvetica ff 254.00 scf sf
+2400 1725 m
+gs 1 -1 sc (0) col-1 sh gr
+% here ends figure;
+pagefooter
+showpage
+%%Trailer
+%EOF
-%!PS-Adobe-2.0 EPSF
-%%Title: /tmp/xfig-fig028754
-%%Creator: fig2dev
-%%CreationDate: Mon Nov 21 16:29:31 1994
-%%For: spoel@rugmd17 (David van der Spoel,Room 17.14,4327)
-%%BoundingBox: 0 0 146 224
-%%Pages: 0
+%!PS-Adobe-3.0 EPSF-3.0
+%%Title: dih.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5d
+%%CreationDate: Fri Jun 13 15:56:50 2014
+%%BoundingBox: 0 0 237 150
+%Magnification: 1.0000
%%EndComments
-/$F2psDict 200 dict def
+%%BeginProlog
+/$F2psDict 200 dict def
$F2psDict begin
$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
/l {lineto} bind def
/m {moveto} bind def
-/s {stroke} bind def
+/rm {rmoveto} bind def
/n {newpath} bind def
-/gs {gsave} bind def
-/gr {grestore} bind def
-/clp {closepath} bind def
-/graycol {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
-4 -2 roll mul setrgbcolor} bind def
-/col-1 {} def
-/col0 {0 0 0 setrgbcolor} bind def
-/col1 {0 0 1 setrgbcolor} bind def
-/col2 {0 1 0 setrgbcolor} bind def
-/col3 {0 1 1 setrgbcolor} bind def
-/col4 {1 0 0 setrgbcolor} bind def
-/col5 {1 0 1 setrgbcolor} bind def
-/col6 {1 1 0 setrgbcolor} bind def
-/col7 {1 1 1 setrgbcolor} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add
+ 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+ bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+ 4 -2 roll mul srgb} bind def
/DrawEllipse {
/endangle exch def
/startangle exch def
/y exch def
/x exch def
/savematrix mtrx currentmatrix def
- x y translate xrad yrad scale 0 0 1 startangle endangle arc
+ x y tr xrad yrad sc 0 0 1 startangle endangle arc
+ closepath
savematrix setmatrix
} def
- end
/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
/$F2psEnd {$F2psEnteredState restore end} def
-%%EndProlog
+/pageheader {
+save
+newpath 0 150 moveto 0 0 lineto 237 0 lineto 237 150 lineto closepath clip newpath
+-65.6 170.5 translate
+1 -1 scale
$F2psBegin
-0 setlinecap 0 setlinejoin
--16.0 -63.0 translate 90 rotate 0.900 -0.900 scale
-1.000 setlinewidth
-n 173.167 99.000 20.833 73.741 -73.741 arcn
+10 setmiterlimit
+0 slj 0 slc
+ 0.06299 0.06299 sc
+} bind def
+/pagefooter {
+$F2psEnd
+restore
+} bind def
+%%EndProlog
+pageheader
+%
+% Fig objects follow
+%
+%
+% here starts figure with depth 0
+% Arc
+15.000 slw
+0 slc
+n 2612.5 1500.0 312.5 73.7407 -73.7407 arcn
gs col-1 s gr
-0.500 setlinewidth
+
% Ellipse
-n 79 169 10 10 0 360 DrawEllipse gs 0.00 setgray fill gr
-gs col-1 s gr
+7.500 slw
+n 1200 2550 150 150 0 360 DrawEllipse gs 0.00 setgray ef gr gs col-1 s gr
+
% Ellipse
-n 119 99 10 10 0 360 DrawEllipse gs 0.00 setgray fill gr
-gs col-1 s gr
+n 1800 1500 150 150 0 360 DrawEllipse gs 0.00 setgray ef gr gs col-1 s gr
+
% Ellipse
-n 239 99 10 10 0 360 DrawEllipse gs 0.00 setgray fill gr
-gs col-1 s gr
+n 3600 1500 150 150 0 360 DrawEllipse gs 0.00 setgray ef gr gs col-1 s gr
+
% Ellipse
-n 299 39 10 10 0 360 DrawEllipse gs 0.00 setgray fill gr
-gs col-1 s gr
-1.000 setlinewidth
+n 4500 600 150 150 0 360 DrawEllipse gs 0.00 setgray ef gr gs col-1 s gr
+
% Polyline
-n 114 109 m 79 169 l gs col-1 s gr
+0 slj
+15.000 slw
+n 1725 1650 m
+ 1200 2550 l gs col-1 s gr
% Polyline
-n 129 99 m 229 99 l gs col-1 s gr
+n 1950 1500 m
+ 3450 1500 l gs col-1 s gr
% Polyline
-n 249 94 m 294 49 l gs col-1 s gr
+n 3750 1425 m
+ 4425 750 l gs col-1 s gr
% Polyline
-n 179 79 m 189 79 l gs col-1 s gr
+n 2700 1200 m
+ 2850 1200 l gs col-1 s gr
% Polyline
-n 179 79 m 184 84 l gs col-1 s gr
-/Helvetica-Bold findfont 14.00 scalefont setfont
-139 89 m
-gs 1 -1 scale (j) col-1 show gr
-/Helvetica-Bold findfont 14.00 scalefont setfont
-259 114 m
-gs 1 -1 scale (k) col-1 show gr
-/Helvetica-Bold findfont 14.00 scalefont setfont
-314 34 m
-gs 1 -1 scale (l) col-1 show gr
-/Helvetica-Bold findfont 14.00 scalefont setfont
-94 174 m
-gs 1 -1 scale (i) col-1 show gr
-$F2psEnd
+n 2700 1200 m
+ 2775 1275 l gs col-1 s gr
+/Helvetica-Bold ff 222.25 scf sf
+2100 1350 m
+gs 1 -1 sc (j) col-1 sh gr
+/Helvetica-Bold ff 222.25 scf sf
+3900 1725 m
+gs 1 -1 sc (k) col-1 sh gr
+/Helvetica-Bold ff 222.25 scf sf
+4725 525 m
+gs 1 -1 sc (l) col-1 sh gr
+/Helvetica-Bold ff 222.25 scf sf
+1425 2625 m
+gs 1 -1 sc (i) col-1 sh gr
+% here ends figure;
+pagefooter
+showpage
+%%Trailer
+%EOF
-%!PS-Adobe-3.0 EPSF-3.0
-%%BoundingBox: (atend)
+%!PS-Adobe-2.0 EPSF-2.0
+%%BoundingBox: 23 19 566 779
+%%HiResBoundingBox: 23.000000 19.000000 566.000000 779.000000
%%LanguageLevel: 2
-%%Creator: Grace-5.1.14
-%%CreationDate: Thu Mar 30 17:18:42 2006
+%%Creator: Grace-5.1.23
+%%CreationDate: Fri Jun 13 15:46:08 2014
%%DocumentData: Clean8Bit
-%%Orientation: Portrait
-%%Title: f_angle.xvg
-%%For: spoel
-%%DocumentNeededResources: (atend)
+%%PageOrder: Ascend
+%%Title: manual/plots/f-angle.xvg
+%%For: marklocal
%%EndComments
+% EPSF created by ps2eps 1.68
%%BeginProlog
+save
+countdictstack
+mark
+newpath
+/showpage {} def
+/setpagedevice {pop} def
+%%EndProlog
+%%Page 1 1
+%%BeginProlog
+/PAGE_OFFSET_X 0 def
+/PAGE_OFFSET_Y 0 def
/m {moveto} def
/l {lineto} def
/s {stroke} def
/Color13 {0.4039 0.0275 0.2824} def
/Color14 {0.2510 0.8784 0.8157} def
/Color15 {0.0000 0.5451 0.0000} def
+/Color16 {0.7529 0.7529 0.7529} def
+/Color17 {0.5059 0.5059 0.5059} def
+/Color18 {0.2588 0.2588 0.2588} def
/PTRN {
/pat_bits exch def
<<
] def
%%EndProlog
%%BeginSetup
-612.00 612.00 scale
%%EndSetup
+%%Page: 1 1
+PAGE_OFFSET_X PAGE_OFFSET_Y translate
+612.00 612.00 scale
+90 rotate
+0.0 -1.0 translate
n
0.0000 0.0000 m
0.0000 1.0000 l
/Encoding DefEncoding def
currentdict
end
-/Font4 exch definefont pop
-/Font4 FFSF
+/Font16 exch definefont pop
+/Font16 FFSF
0.1220 0.1157 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(100) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.3957 0.1157 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(110) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.6695 0.1157 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(120) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.9433 0.1157 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(130) show
GR
-/Font4 FFSF
+/Font16 FFSF
1.2171 0.1157 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(140) show
GR
/Symbol findfont
-/Font12 exch definefont pop
-/Font12 FFSF
+/Font37 exch definefont pop
+/Font37 FFSF
0.6876 0.0763 m
GS
[0.0414 0.0000 0.0000 0.0414 0 0] CC
1.2451 0.9500 m
1.2251 0.9500 l
s
-/Font4 FFSF
+/Font16 FFSF
0.1224 0.1382 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(0) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.1031 0.2982 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(10) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.1031 0.4582 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(20) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.1031 0.6182 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(30) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.1031 0.7782 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(40) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.1031 0.9382 m
GS
[0.0344 0.0000 0.0000 0.0344 0 0] CC
(50) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.0762 0.4263 m
GS
[0.0000 0.0414 -0.0414 0.0000 0 0] CC
(V) show
GR
-/Font12 FFSF
+/Font37 FFSF
0.0927 0.4537 m
GS
[0.0000 0.0293 -0.0293 0.0000 0 0] CC
(q) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.0762 0.4690 m
GS
[0.0000 0.0414 -0.0414 0.0000 0 0] CC
( \(kJ mole) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.0513 0.6373 m
GS
[0.0000 0.0293 -0.0293 0.0000 0 0] CC
(-1) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.0762 0.6631 m
GS
[0.0000 0.0414 -0.0414 0.0000 0 0] CC
0.1500 0.1500 l
c
s
+showpage
+%%PageTrailer
%%Trailer
-%%BoundingBox: 17 45 781 591
%%DocumentNeededResources: font Helvetica
%%+ font Symbol
+%%Trailer
+cleartomark
+countdictstack
+exch sub { end } repeat
+restore
%%EOF
-%!PS-Adobe-3.0 EPSF-3.0
-%%BoundingBox: (atend)
+%!PS-Adobe-2.0 EPSF-2.0
+%%BoundingBox: 179 53 432 703
+%%HiResBoundingBox: 179.000000 53.500000 431.500000 702.500000
%%LanguageLevel: 2
-%%Creator: Grace-5.1.22
-%%CreationDate: Fri Mar 9 09:37:59 2012
+%%Creator: Grace-5.1.23
+%%CreationDate: Fri Jun 13 16:01:20 2014
%%DocumentData: Clean8Bit
-%%Orientation: Portrait
-%%Title: fbposres.xvg
-%%For: jhub
-%%DocumentNeededResources: (atend)
+%%PageOrder: Ascend
+%%Title: manual/plots/fbposres.xvg
+%%For: marklocal
%%EndComments
+% EPSF created by ps2eps 1.68
%%BeginProlog
+save
+countdictstack
+mark
+newpath
+/showpage {} def
+/setpagedevice {pop} def
+%%EndProlog
+%%Page 1 1
+%%BeginProlog
+/PAGE_OFFSET_X 0 def
+/PAGE_OFFSET_Y 0 def
/m {moveto} def
/l {lineto} def
/s {stroke} def
/Color20 {0.5882 0.5882 1.0000} def
/Color21 {0.0000 0.6275 0.0000} def
/Color22 {0.0000 0.7059 0.0000} def
+/Color23 {0.7529 0.7529 0.7529} def
+/Color24 {0.5059 0.5059 0.5059} def
+/Color25 {0.2588 0.2588 0.2588} def
/PTRN {
/pat_bits exch def
<<
%%EndProlog
%%BeginSetup
%%EndSetup
+%%Page: 1 1
+PAGE_OFFSET_X PAGE_OFFSET_Y translate
612.00 612.00 scale
+90 rotate
+0.0 -1.0 translate
n
0.0000 0.0000 m
0.0000 1.0000 l
/Encoding DefEncoding def
currentdict
end
-/Font4 exch definefont pop
-/Font4 FFSF
+/Font16 exch definefont pop
+/Font16 FFSF
0.1427 0.3251 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(-1) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.2453 0.3251 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(-0.5) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.3706 0.3251 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(0) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.4746 0.3251 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(0.5) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.5981 0.3251 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(1) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.3499 0.2994 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
0.6019 0.7000 m
0.5819 0.7000 l
s
-/Font4 FFSF
+/Font16 FFSF
0.1294 0.3746 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(0) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.1176 0.4382 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(10) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.1176 0.5018 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(20) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.1176 0.5655 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(30) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.1176 0.6291 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(40) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.1176 0.6927 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(50) show
GR
-/Font4 FFSF
-0.1033 0.4691 m
+/Font16 FFSF
+0.1029 0.4691 m
GS
[0.0000 0.0210 -0.0210 0.0000 0 0] CC
(V\(r\) [kJ/mol]) show
1.1441 0.7000 m
1.1441 0.6800 l
s
-/Font4 FFSF
+/Font16 FFSF
0.6850 0.3251 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(-1) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.7876 0.3251 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(-0.5) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.9129 0.3251 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(0) show
GR
-/Font4 FFSF
+/Font16 FFSF
1.0168 0.3251 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(0.5) show
GR
-/Font4 FFSF
+/Font16 FFSF
1.1404 0.3251 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(1) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.8921 0.2994 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
1.1441 0.7000 m
1.1241 0.7000 l
s
-/Font4 FFSF
+/Font16 FFSF
0.6717 0.3746 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(0) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.6599 0.4382 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(10) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.6599 0.5018 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(20) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.6599 0.5655 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(30) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.6599 0.6291 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
(40) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.6599 0.6927 m
GS
[0.0210 0.0000 0.0000 0.0210 0 0] CC
0.4669 0.4449 l
0.4569 0.4499 l
s
-/Font4 FFSF
+/Font16 FFSF
0.3407 0.4816 m
GS
[0.0280 0.0000 0.0000 0.0280 0 0] CC
(2 r) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.3732 0.4704 m
GS
[0.0198 0.0000 0.0000 0.0198 0 0] CC
(fb) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.2169 0.6348 m
GS
[0.0280 0.0000 0.0000 0.0280 0 0] CC
(A) show
GR
-/Font4 FFSF
+/Font16 FFSF
0.7475 0.6324 m
GS
[0.0280 0.0000 0.0000 0.0280 0 0] CC
(B) show
GR
+showpage
+%%PageTrailer
%%Trailer
-%%BoundingBox: 52 179 704 435
%%DocumentNeededResources: font Helvetica
+%%Trailer
+cleartomark
+countdictstack
+exch sub { end } repeat
+restore
%%EOF
\newcommand{\ttss}{\tt \scriptsize}
\begin{landscape}
-\begin{longtable}{|l|lcc>{\raggedright}p{2.5in}cc|}
+\begin{longtable}{|p{1.8in}|lcc>{\raggedright}p{2.5in}cc|}
\caption{Details of {\tt [~moleculetype~]} directives}\\
\dline
Name of interaction & Topology file directive & num. & func. & Order of parameters and their units & use in & Cross- \\
\endhead
\dline
\endfoot
-\label{tab:topfile2}\footnotetext[1]{The required number of atom indices for this directive}\footnotetext[2]{The index to use to select this function type}\footnotetext[3]{Indicates which of the parameters for this interaction can be interpolated during free energy calculations}\footnotetext[4]{This interaction type will be used by {{\tts grompp}} for generating exclusions}\footnotetext[5]{This interaction type can be converted to constraints by {{\tts grompp}}}\footnotetext[7]{The combination rule determines the type of LJ parameters, see~\ssecref{nbpar}}\footnotetext[6]{No connection, and so no exclusions, are generated for this interaction}bond
- & {\tts bonds}\fnm{4},\fnm{5} & 2 & 1 & $b_0$ (nm); $k_b$ (\kJmolnm{-2}) & all & \ssecref{harmonicbond} \\
+% The footnotetext fields only work inside the body, and not from a
+% column with ``p'' formatting'!
+bond & {\tts bonds}\fnm{4},\fnm{5} & 2 & 1 & $b_0$ (nm); $k_b$ (\kJmolnm{-2}) & all & \ssecref{harmonicbond}
+\label{tab:topfile2} \footnotetext[1]{The required number of atom indices for this directive}\footnotetext[2]{The index to use to select this function type}\footnotetext[3]{Indicates which of the parameters for this interaction can be interpolated during free energy calculations}\footnotetext[4]{This interaction type will be used by {{\tts grompp}} for generating exclusions}\footnotetext[5]{This interaction type can be converted to constraints by {{\tts grompp}}}\footnotetext[7]{The combination rule determines the type of LJ parameters, see~\ssecref{nbpar}}\footnotetext[6]{No connection, and so no exclusions, are generated for this interaction}
+\\
G96 bond & {\tts bonds}\fnm{4},\fnm{5} & 2 & 2 & $b_0$ (nm); $k_b$ (\kJmolnm{-4}) & all & \ssecref{G96bond} \\
Morse & {\tts bonds}\fnm{4},\fnm{5} & 2 & 3 & $b_0$ (nm); $D$ (\kJmol); $\beta$ (nm$^{-1}$) & all & \ssecref{Morsebond} \\
cubic bond & {\tts bonds}\fnm{4},\fnm{5} & 2 & 4 & $b_0$ (nm); $C_{i=2,3}$ (\kJmolnm{-i}) & & \ssecref{cubicbond} \\
2 1 1000 0 1000 ; Restrain to a line (Y-axis)
3 1 1000 0 0 ; Restrain to a plane (Y-Z-plane)
+[ dihedral_restraints ]
+; ai aj ak al type label phi dphi kfac power
+ 3 6 1 2 1 1 180 0 1 2
+ 1 4 3 5 1 1 180 0 1 2
+
; Include TIP3P water topology
#include "amber99/tip3p.itp"
The reference positions are read from a
separate coordinate file by {\tt \normindex{grompp}}.
+
+{\bf {\tt [~dihedral_restraints~]} :} restrain selected dihedrals to a reference value.
+The implementation of dihedral restraints is described in section \ssecref{dihedralrestraint} of the manual.
+The parameters specified in the [dihedral_restraints] directive are as follows:
+\begin{itemize}
+\item {\tt type} has only one possible value which is 1
+\item {\tt label} is unused and has been removed from the code.
+\item {\tt phi} is the value of $\phi_0$ in \eqnref{dphi} and \eqnref{dihre} of the manual.
+\item {\tt dphi} is the value of $\Delta\phi$ in \eqnref{dihre} of the manual.
+\item {\tt kfac} is analogous to {\tt fac} in the implementation of distance restraints. It is the factor by which the force constant is multiplied. By doing so, different restraints can be maintained with different force constants.
+\item {\tt power} is unused and has been removed from the code.
+\end{itemize}
+
{\bf {\tt \#include "tip3p.itp"} :} includes a topology file that was already
constructed (see section~\ssecref{molitp}).
\label{subsec:fffiles}
Many force fields are available by default.
Force fields are detected by the presence of {\tt <name>.ff} directories
-in the {\gromacs} {\tt /share/top} sub-directory and/or the working directory.
+in the {\tt \$GMXLIB/share/gromacs/top} sub-directory and/or the working directory.
The information regarding the location of the force field files is printed
by {\tt pdb2gmx} so you can easily keep track of which version of a force field
is being called, in case you have made modifications in one location or another.
pbc = xyz
; nblist cut-off =
rlist = 0.8
-domain-decomposition = no
; OPTIONS FOR ELECTROSTATICS AND VDW =
; Method for doing electrostatics =
from the COM of the pull group has both a radial and an axial component.</dd>
</dl></dd>
<dt><b>pull-dim: (Y Y Y)</b></dt>
-<dd>the distance components to be used with geometry <b>distance</b>
-and <b>position</b>, and also sets which components are printed
+<dd>the distance components to be used with geometry <b>distance</b>,
+and also sets which components are printed
to the output files</dd>
<dt><b>pull-r1: (1) [nm]</b></dt>
<dd>the inner radius of the cylinder for geometry <b>cylinder</b></dd>
[ implicit_genborn_params ]
-
; atype sar st pi gbr hct
-C 0.172 1 1.554 0.1875 0.72 ; C
-CA 0.18 1 1.037 0.1875 0.72 ; C
-CB 0.172 0.012 1.554 0.1875 0.72 ; C
-CC 0.172 1 1.554 0.1875 0.72 ; C
-CN 0.172 0.012 1.554 0.1875 0.72 ; C
-CR 0.18 1 1.073 0.1875 0.72 ; C
-CT 0.18 1 1.276 0.190 0.72 ; C
-CV 0.18 1 1.073 0.1875 0.72 ; C
-CW 0.18 1 1.073 0.1875 0.72 ; C
-C* 0.172 0.012 1.554 0.1875 0.72 ; C
-H 0.1 1 1 0.115 0.85 ; H
-HC 0.1 1 1 0.125 0.85 ; H
-H0 0.1 1 1 0.125 0.85 ; H
-H1 0.1 1 1 0.125 0.85 ; H
-HA 0.1 1 1 0.125 0.85 ; H
-H4 0.1 1 1 0.115 0.85 ; H
-H5 0.1 1 1 0.125 0.85 ; H
-HO 0.1 1 1 0.105 0.85 ; H
-HS 0.1 1 1 0.125 0.85 ; H
-HP 0.1 1 1 0.125 0.85 ; H
-N 0.155 1 1.028 0.17063 0.79 ; N
-NA 0.155 1 1.028 0.17063 0.79 ; N
-NB 0.155 1 1.215 0.17063 0.79 ; N
-N2 0.16 1 1.215 0.17063 0.79 ; N
-N3 0.16 1 1.215 0.1625 0.79 ; N
-O 0.15 1 0.926 0.148 0.85 ; O
-OH 0.152 1 1.080 0.1535 0.85 ; O
-O2 0.17 1 0.922 0.148 0.85 ; O
-S 0.18 1 1.121 0.1775 0.96 ; S
-SH 0.18 1 1.121 0.1775 0.96 ; S
-
+;Br 0.1 1 1 0.125 0.85 ; H
+C 0.172 1 1.554 0.17 0.72 ; C
+CA 0.18 1 1.037 0.17 0.72 ; C
+CB 0.172 0.012 1.554 0.17 0.72 ; C
+CC 0.172 1 1.554 0.17 0.72 ; C
+CN 0.172 0.012 1.554 0.17 0.72 ; C
+CR 0.18 1 1.073 0.17 0.72 ; C
+CT 0.18 1 1.276 0.17 0.72 ; C
+CV 0.18 1 1.073 0.17 0.72 ; C
+CW 0.18 1 1.073 0.17 0.72 ; C
+C* 0.172 0.012 1.554 0.17 0.72 ; C
+H 0.1 1 1 0.13 0.85 ; H
+HC 0.1 1 1 0.12 0.85 ; H
+H1 0.1 1 1 0.12 0.85 ; H
+HA 0.1 1 1 0.12 0.85 ; H
+H4 0.1 1 1 0.12 0.85 ; H
+H5 0.1 1 1 0.12 0.85 ; H
+HO 0.1 1 1 0.12 0.85 ; H
+HS 0.1 1 1 0.12 0.85 ; H
+HP 0.1 1 1 0.12 0.85 ; H
+N 0.155 1 1.028 0.155 0.79 ; N
+NA 0.155 1 1.028 0.155 0.79 ; N
+NB 0.155 1 1.215 0.155 0.79 ; N
+N2 0.16 1 1.215 0.155 0.79 ; N
+N3 0.16 1 1.215 0.155 0.79 ; N
+O 0.15 1 0.926 0.15 0.85 ; O
+OH 0.152 1 1.080 0.15 0.85 ; O
+O2 0.17 1 0.922 0.15 0.85 ; O
+S 0.18 1 1.121 0.18 0.96 ; S
+SH 0.18 1 1.121 0.18 0.96 ; S
; masscenters for vsites do not have gbsa parameters
-
MNH3 0 0 0 0 0
MCH3 0 0 0 0 0
+; original reference: [M. W. Mahoney and W. L. Jorgensen, J. Chem. Phys. 112 , 2000]
+;
+; Note that there are various issues with tip5p and the different forcefields.
+; Discussion is here: http://redmine.gromacs.org/issues/1348
+
[ moleculetype ]
; molname nrexcl
SOL 2
tip3p TIP3P TIP 3-point, recommended
tip4p TIP4P TIP 4-point
tip4pew TIP4P-Ew TIP 4-point optimized with Ewald
+tip5p TIP5P TIP 5-point (see http://redmine.gromacs.org/issues/1348 for issues)
spc SPC simple point charge
spce SPC/E extended simple point charge
[ implicit_genborn_params ]
-
; atype sar st pi gbr hct
-;H0 0.1 1 1 0.125 0.85 ; H
-C 0.172 1 1.554 0.1875 0.72 ; C
-CA 0.18 1 1.037 0.1875 0.72 ; C
-CB 0.172 0.012 1.554 0.1875 0.72 ; C
-CC 0.172 1 1.554 0.1875 0.72 ; C
-CN 0.172 0.012 1.554 0.1875 0.72 ; C
-CR 0.18 1 1.073 0.1875 0.72 ; C
-CT 0.18 1 1.276 0.190 0.72 ; C
-CV 0.18 1 1.073 0.1875 0.72 ; C
-CW 0.18 1 1.073 0.1875 0.72 ; C
-C* 0.172 0.012 1.554 0.1875 0.72 ; C
-H 0.1 1 1 0.115 0.85 ; H
-HC 0.1 1 1 0.125 0.85 ; H
-H1 0.1 1 1 0.125 0.85 ; H
-HA 0.1 1 1 0.125 0.85 ; H
-H4 0.1 1 1 0.115 0.85 ; H
-H5 0.1 1 1 0.125 0.85 ; H
-HO 0.1 1 1 0.105 0.85 ; H
-HS 0.1 1 1 0.125 0.85 ; H
-HP 0.1 1 1 0.125 0.85 ; H
-N 0.155 1 1.028 0.17063 0.79 ; N
-NA 0.155 1 1.028 0.17063 0.79 ; N
-NB 0.155 1 1.215 0.17063 0.79 ; N
-N2 0.16 1 1.215 0.17063 0.79 ; N
-N3 0.16 1 1.215 0.1625 0.79 ; N
-O 0.15 1 0.926 0.148 0.85 ; O
-OH 0.152 1 1.080 0.1535 0.85 ; O
-O2 0.17 1 0.922 0.148 0.85 ; O
-S 0.18 1 1.121 0.1775 0.96 ; S
-SH 0.18 1 1.121 0.1775 0.96 ; S
-
+;Br 0.1 1 1 0.125 0.85 ; H
+C 0.172 1 1.554 0.17 0.72 ; C
+CA 0.18 1 1.037 0.17 0.72 ; C
+CB 0.172 0.012 1.554 0.17 0.72 ; C
+CC 0.172 1 1.554 0.17 0.72 ; C
+CN 0.172 0.012 1.554 0.17 0.72 ; C
+CR 0.18 1 1.073 0.17 0.72 ; C
+CT 0.18 1 1.276 0.17 0.72 ; C
+CV 0.18 1 1.073 0.17 0.72 ; C
+CW 0.18 1 1.073 0.17 0.72 ; C
+C* 0.172 0.012 1.554 0.17 0.72 ; C
+H 0.1 1 1 0.13 0.85 ; H
+HC 0.1 1 1 0.12 0.85 ; H
+H1 0.1 1 1 0.12 0.85 ; H
+HA 0.1 1 1 0.12 0.85 ; H
+H4 0.1 1 1 0.12 0.85 ; H
+H5 0.1 1 1 0.12 0.85 ; H
+HO 0.1 1 1 0.12 0.85 ; H
+HS 0.1 1 1 0.12 0.85 ; H
+HP 0.1 1 1 0.12 0.85 ; H
+N 0.155 1 1.028 0.155 0.79 ; N
+NA 0.155 1 1.028 0.155 0.79 ; N
+NB 0.155 1 1.215 0.155 0.79 ; N
+N2 0.16 1 1.215 0.155 0.79 ; N
+N3 0.16 1 1.215 0.155 0.79 ; N
+O 0.15 1 0.926 0.15 0.85 ; O
+OH 0.152 1 1.080 0.15 0.85 ; O
+O2 0.17 1 0.922 0.15 0.85 ; O
+S 0.18 1 1.121 0.18 0.96 ; S
+SH 0.18 1 1.121 0.18 0.96 ; S
; masscenters for vsites do not have gbsa parameters
-
MNH3 0 0 0 0 0
MCH3 0 0 0 0 0
+; original reference: [M. W. Mahoney and W. L. Jorgensen, J. Chem. Phys. 112 , 2000]
+;
+; Note that there are various issues with tip5p and the different forcefields.
+; Discussion is here: http://redmine.gromacs.org/issues/1348
+
[ moleculetype ]
; molname nrexcl
SOL 2
tip3p TIP3P TIP 3-point, recommended
tip4p TIP4P TIP 4-point
tip4pew TIP4P-Ew TIP 4-point optimized with Ewald
+tip5p TIP5P TIP 5-point (see http://redmine.gromacs.org/issues/1348 for issues)
spc SPC simple point charge
spce SPC/E extended simple point charge
[ implicit_genborn_params ]
-
; atype sar st pi gbr hct
-;H0 0.1 1 1 0.125 0.85 ; H
-C 0.172 1 1.554 0.1875 0.72 ; C
-CA 0.18 1 1.037 0.1875 0.72 ; C
-CB 0.172 0.012 1.554 0.1875 0.72 ; C
-CC 0.172 1 1.554 0.1875 0.72 ; C
-CN 0.172 0.012 1.554 0.1875 0.72 ; C
-CR 0.18 1 1.073 0.1875 0.72 ; C
-CT 0.18 1 1.276 0.190 0.72 ; C
-CV 0.18 1 1.073 0.1875 0.72 ; C
-CW 0.18 1 1.073 0.1875 0.72 ; C
-C* 0.172 0.012 1.554 0.1875 0.72 ; C
-H 0.1 1 1 0.115 0.85 ; H
-HC 0.1 1 1 0.125 0.85 ; H
-H1 0.1 1 1 0.125 0.85 ; H
-HA 0.1 1 1 0.125 0.85 ; H
-H4 0.1 1 1 0.115 0.85 ; H
-H5 0.1 1 1 0.125 0.85 ; H
-HO 0.1 1 1 0.105 0.85 ; H
-HS 0.1 1 1 0.125 0.85 ; H
-HP 0.1 1 1 0.125 0.85 ; H
-N 0.155 1 1.028 0.17063 0.79 ; N
-NA 0.155 1 1.028 0.17063 0.79 ; N
-NB 0.155 1 1.215 0.17063 0.79 ; N
-N2 0.16 1 1.215 0.17063 0.79 ; N
-N3 0.16 1 1.215 0.1625 0.79 ; N
-O 0.15 1 0.926 0.148 0.85 ; O
-OH 0.152 1 1.080 0.1535 0.85 ; O
-O2 0.17 1 0.922 0.148 0.85 ; O
-S 0.18 1 1.121 0.1775 0.96 ; S
-SH 0.18 1 1.121 0.1775 0.96 ; S
-
+;Br 0.1 1 1 0.125 0.85 ; H
+C 0.172 1 1.554 0.17 0.72 ; C
+CA 0.18 1 1.037 0.17 0.72 ; C
+CB 0.172 0.012 1.554 0.17 0.72 ; C
+CC 0.172 1 1.554 0.17 0.72 ; C
+CN 0.172 0.012 1.554 0.17 0.72 ; C
+CR 0.18 1 1.073 0.17 0.72 ; C
+CT 0.18 1 1.276 0.17 0.72 ; C
+CV 0.18 1 1.073 0.17 0.72 ; C
+CW 0.18 1 1.073 0.17 0.72 ; C
+C* 0.172 0.012 1.554 0.17 0.72 ; C
+H 0.1 1 1 0.13 0.85 ; H
+HC 0.1 1 1 0.12 0.85 ; H
+H1 0.1 1 1 0.12 0.85 ; H
+HA 0.1 1 1 0.12 0.85 ; H
+H4 0.1 1 1 0.12 0.85 ; H
+H5 0.1 1 1 0.12 0.85 ; H
+HO 0.1 1 1 0.12 0.85 ; H
+HS 0.1 1 1 0.12 0.85 ; H
+HP 0.1 1 1 0.12 0.85 ; H
+N 0.155 1 1.028 0.155 0.79 ; N
+NA 0.155 1 1.028 0.155 0.79 ; N
+NB 0.155 1 1.215 0.155 0.79 ; N
+N2 0.16 1 1.215 0.155 0.79 ; N
+N3 0.16 1 1.215 0.155 0.79 ; N
+O 0.15 1 0.926 0.15 0.85 ; O
+OH 0.152 1 1.080 0.15 0.85 ; O
+O2 0.17 1 0.922 0.15 0.85 ; O
+S 0.18 1 1.121 0.18 0.96 ; S
+SH 0.18 1 1.121 0.18 0.96 ; S
; masscenters for vsites do not have gbsa parameters
-
MNH3 0 0 0 0 0
MCH3 0 0 0 0 0
+; original reference: [M. W. Mahoney and W. L. Jorgensen, J. Chem. Phys. 112 , 2000]
+;
+; Note that there are various issues with tip5p and the different forcefields.
+; Discussion is here: http://redmine.gromacs.org/issues/1348
+
[ moleculetype ]
; molname nrexcl
SOL 2
tip3p TIP3P TIP 3-point, recommended
tip4p TIP4P TIP 4-point
tip4pew TIP4P-Ew TIP 4-point optimized with Ewald
+tip5p TIP5P TIP 5-point (see http://redmine.gromacs.org/issues/1348 for issues)
spc SPC simple point charge
spce SPC/E extended simple point charge
[ implicit_genborn_params ]
-
; atype sar st pi gbr hct
;Br 0.1 1 1 0.125 0.85 ; H
-C 0.172 1 1.554 0.1875 0.72 ; C
-CA 0.18 1 1.037 0.1875 0.72 ; C
-CB 0.172 0.012 1.554 0.1875 0.72 ; C
-CC 0.172 1 1.554 0.1875 0.72 ; C
-CN 0.172 0.012 1.554 0.1875 0.72 ; C
-CR 0.18 1 1.073 0.1875 0.72 ; C
-CT 0.18 1 1.276 0.190 0.72 ; C
-CV 0.18 1 1.073 0.1875 0.72 ; C
-CW 0.18 1 1.073 0.1875 0.72 ; C
-C* 0.172 0.012 1.554 0.1875 0.72 ; C
-H 0.1 1 1 0.115 0.85 ; H
-HC 0.1 1 1 0.125 0.85 ; H
-H1 0.1 1 1 0.125 0.85 ; H
-HA 0.1 1 1 0.125 0.85 ; H
-H4 0.1 1 1 0.115 0.85 ; H
-H5 0.1 1 1 0.125 0.85 ; H
-HO 0.1 1 1 0.105 0.85 ; H
-HS 0.1 1 1 0.125 0.85 ; H
-HP 0.1 1 1 0.125 0.85 ; H
-N 0.155 1 1.028 0.17063 0.79 ; N
-NA 0.155 1 1.028 0.17063 0.79 ; N
-NB 0.155 1 1.215 0.17063 0.79 ; N
-N2 0.16 1 1.215 0.17063 0.79 ; N
-N3 0.16 1 1.215 0.1625 0.79 ; N
-O 0.15 1 0.926 0.148 0.85 ; O
-OH 0.152 1 1.080 0.1535 0.85 ; O
-O2 0.17 1 0.922 0.148 0.85 ; O
-S 0.18 1 1.121 0.1775 0.96 ; S
-SH 0.18 1 1.121 0.1775 0.96 ; S
-
+C 0.172 1 1.554 0.17 0.72 ; C
+CA 0.18 1 1.037 0.17 0.72 ; C
+CB 0.172 0.012 1.554 0.17 0.72 ; C
+CC 0.172 1 1.554 0.17 0.72 ; C
+CN 0.172 0.012 1.554 0.17 0.72 ; C
+CR 0.18 1 1.073 0.17 0.72 ; C
+CT 0.18 1 1.276 0.17 0.72 ; C
+CV 0.18 1 1.073 0.17 0.72 ; C
+CW 0.18 1 1.073 0.17 0.72 ; C
+C* 0.172 0.012 1.554 0.17 0.72 ; C
+H 0.1 1 1 0.13 0.85 ; H
+HC 0.1 1 1 0.12 0.85 ; H
+H1 0.1 1 1 0.12 0.85 ; H
+HA 0.1 1 1 0.12 0.85 ; H
+H4 0.1 1 1 0.12 0.85 ; H
+H5 0.1 1 1 0.12 0.85 ; H
+HO 0.1 1 1 0.12 0.85 ; H
+HS 0.1 1 1 0.12 0.85 ; H
+HP 0.1 1 1 0.12 0.85 ; H
+N 0.155 1 1.028 0.155 0.79 ; N
+NA 0.155 1 1.028 0.155 0.79 ; N
+NB 0.155 1 1.215 0.155 0.79 ; N
+N2 0.16 1 1.215 0.155 0.79 ; N
+N3 0.16 1 1.215 0.155 0.79 ; N
+O 0.15 1 0.926 0.15 0.85 ; O
+OH 0.152 1 1.080 0.15 0.85 ; O
+O2 0.17 1 0.922 0.15 0.85 ; O
+S 0.18 1 1.121 0.18 0.96 ; S
+SH 0.18 1 1.121 0.18 0.96 ; S
; masscenters for vsites do not have gbsa parameters
-
MNH3 0 0 0 0 0
MCH3 0 0 0 0 0
+; original reference: [M. W. Mahoney and W. L. Jorgensen, J. Chem. Phys. 112 , 2000]
+;
+; Note that there are various issues with tip5p and the different forcefields.
+; Discussion is here: http://redmine.gromacs.org/issues/1348
+
[ moleculetype ]
; molname nrexcl
SOL 2
tip3p TIP3P TIP 3-point, recommended
tip4p TIP4P TIP 4-point
tip4pew TIP4P-Ew TIP 4-point optimized with Ewald
+tip5p TIP5P TIP 5-point (see http://redmine.gromacs.org/issues/1348 for issues)
spc SPC simple point charge
spce SPC/E extended simple point charge
[ implicit_genborn_params ]
-
; atype sar st pi gbr hct
;Br 0.1 1 1 0.125 0.85 ; H
-C 0.172 1 1.554 0.1875 0.72 ; C
-CA 0.18 1 1.037 0.1875 0.72 ; C
-CB 0.172 0.012 1.554 0.1875 0.72 ; C
-CC 0.172 1 1.554 0.1875 0.72 ; C
-CN 0.172 0.012 1.554 0.1875 0.72 ; C
-CR 0.18 1 1.073 0.1875 0.72 ; C
-CT 0.18 1 1.276 0.190 0.72 ; C
-CV 0.18 1 1.073 0.1875 0.72 ; C
-CW 0.18 1 1.073 0.1875 0.72 ; C
-C* 0.172 0.012 1.554 0.1875 0.72 ; C
-H 0.1 1 1 0.115 0.85 ; H
-HC 0.1 1 1 0.125 0.85 ; H
-H1 0.1 1 1 0.125 0.85 ; H
-HA 0.1 1 1 0.125 0.85 ; H
-H4 0.1 1 1 0.115 0.85 ; H
-H5 0.1 1 1 0.125 0.85 ; H
-HO 0.1 1 1 0.105 0.85 ; H
-HS 0.1 1 1 0.125 0.85 ; H
-HP 0.1 1 1 0.125 0.85 ; H
-N 0.155 1 1.028 0.17063 0.79 ; N
-NA 0.155 1 1.028 0.17063 0.79 ; N
-NB 0.155 1 1.215 0.17063 0.79 ; N
-N2 0.16 1 1.215 0.17063 0.79 ; N
-N3 0.16 1 1.215 0.1625 0.79 ; N
-O 0.15 1 0.926 0.148 0.85 ; O
-OH 0.152 1 1.080 0.1535 0.85 ; O
-O2 0.17 1 0.922 0.148 0.85 ; O
-S 0.18 1 1.121 0.1775 0.96 ; S
-SH 0.18 1 1.121 0.1775 0.96 ; S
-
+C 0.172 1 1.554 0.17 0.72 ; C
+CA 0.18 1 1.037 0.17 0.72 ; C
+CB 0.172 0.012 1.554 0.17 0.72 ; C
+CC 0.172 1 1.554 0.17 0.72 ; C
+CN 0.172 0.012 1.554 0.17 0.72 ; C
+CR 0.18 1 1.073 0.17 0.72 ; C
+CT 0.18 1 1.276 0.17 0.72 ; C
+CV 0.18 1 1.073 0.17 0.72 ; C
+CW 0.18 1 1.073 0.17 0.72 ; C
+C* 0.172 0.012 1.554 0.17 0.72 ; C
+H 0.1 1 1 0.13 0.85 ; H
+HC 0.1 1 1 0.12 0.85 ; H
+H1 0.1 1 1 0.12 0.85 ; H
+HA 0.1 1 1 0.12 0.85 ; H
+H4 0.1 1 1 0.12 0.85 ; H
+H5 0.1 1 1 0.12 0.85 ; H
+HO 0.1 1 1 0.12 0.85 ; H
+HS 0.1 1 1 0.12 0.85 ; H
+HP 0.1 1 1 0.12 0.85 ; H
+N 0.155 1 1.028 0.155 0.79 ; N
+NA 0.155 1 1.028 0.155 0.79 ; N
+NB 0.155 1 1.215 0.155 0.79 ; N
+N2 0.16 1 1.215 0.155 0.79 ; N
+N3 0.16 1 1.215 0.155 0.79 ; N
+O 0.15 1 0.926 0.15 0.85 ; O
+OH 0.152 1 1.080 0.15 0.85 ; O
+O2 0.17 1 0.922 0.15 0.85 ; O
+S 0.18 1 1.121 0.18 0.96 ; S
+SH 0.18 1 1.121 0.18 0.96 ; S
; masscenters for vsites do not have gbsa parameters
-
MNH3 0 0 0 0 0
MCH3 0 0 0 0 0
+; original reference: [M. W. Mahoney and W. L. Jorgensen, J. Chem. Phys. 112 , 2000]
+;
+; Note that there are various issues with tip5p and the different forcefields.
+; Discussion is here: http://redmine.gromacs.org/issues/1348
+
[ moleculetype ]
; molname nrexcl
SOL 2
tip3p TIP3P TIP 3-point, recommended
tip4p TIP4P TIP 4-point
tip4pew TIP4P-Ew TIP 4-point optimized with Ewald
+tip5p TIP5P TIP 5-point (see http://redmine.gromacs.org/issues/1348 for issues)
spc SPC simple point charge
spce SPC/E extended simple point charge
[ implicit_genborn_params ]
-
; atype sar st pi gbr hct
;Br 0.1 1 1 0.125 0.85 ; H
-C 0.172 1 1.554 0.1875 0.72 ; C
-CA 0.18 1 1.037 0.1875 0.72 ; C
-CB 0.172 0.012 1.554 0.1875 0.72 ; C
-CC 0.172 1 1.554 0.1875 0.72 ; C
-CN 0.172 0.012 1.554 0.1875 0.72 ; C
-CR 0.18 1 1.073 0.1875 0.72 ; C
-CT 0.18 1 1.276 0.190 0.72 ; C
-CV 0.18 1 1.073 0.1875 0.72 ; C
-CW 0.18 1 1.073 0.1875 0.72 ; C
-C* 0.172 0.012 1.554 0.1875 0.72 ; C
-H 0.1 1 1 0.115 0.85 ; H
-HC 0.1 1 1 0.125 0.85 ; H
-H1 0.1 1 1 0.125 0.85 ; H
-HA 0.1 1 1 0.125 0.85 ; H
-H4 0.1 1 1 0.115 0.85 ; H
-H5 0.1 1 1 0.125 0.85 ; H
-HO 0.1 1 1 0.105 0.85 ; H
-HS 0.1 1 1 0.125 0.85 ; H
-HP 0.1 1 1 0.125 0.85 ; H
-N 0.155 1 1.028 0.17063 0.79 ; N
-NA 0.155 1 1.028 0.17063 0.79 ; N
-NB 0.155 1 1.215 0.17063 0.79 ; N
-N2 0.16 1 1.215 0.17063 0.79 ; N
-N3 0.16 1 1.215 0.1625 0.79 ; N
-O 0.15 1 0.926 0.148 0.85 ; O
-OH 0.152 1 1.080 0.1535 0.85 ; O
-O2 0.17 1 0.922 0.148 0.85 ; O
-S 0.18 1 1.121 0.1775 0.96 ; S
-SH 0.18 1 1.121 0.1775 0.96 ; S
-
+C 0.172 1 1.554 0.17 0.72 ; C
+CA 0.18 1 1.037 0.17 0.72 ; C
+CB 0.172 0.012 1.554 0.17 0.72 ; C
+CC 0.172 1 1.554 0.17 0.72 ; C
+CN 0.172 0.012 1.554 0.17 0.72 ; C
+CR 0.18 1 1.073 0.17 0.72 ; C
+CT 0.18 1 1.276 0.17 0.72 ; C
+CV 0.18 1 1.073 0.17 0.72 ; C
+CW 0.18 1 1.073 0.17 0.72 ; C
+C* 0.172 0.012 1.554 0.17 0.72 ; C
+H 0.1 1 1 0.13 0.85 ; H
+HC 0.1 1 1 0.12 0.85 ; H
+H1 0.1 1 1 0.12 0.85 ; H
+HA 0.1 1 1 0.12 0.85 ; H
+H4 0.1 1 1 0.12 0.85 ; H
+H5 0.1 1 1 0.12 0.85 ; H
+HO 0.1 1 1 0.12 0.85 ; H
+HS 0.1 1 1 0.12 0.85 ; H
+HP 0.1 1 1 0.12 0.85 ; H
+N 0.155 1 1.028 0.155 0.79 ; N
+NA 0.155 1 1.028 0.155 0.79 ; N
+NB 0.155 1 1.215 0.155 0.79 ; N
+N2 0.16 1 1.215 0.155 0.79 ; N
+N3 0.16 1 1.215 0.155 0.79 ; N
+O 0.15 1 0.926 0.15 0.85 ; O
+OH 0.152 1 1.080 0.15 0.85 ; O
+O2 0.17 1 0.922 0.15 0.85 ; O
+S 0.18 1 1.121 0.18 0.96 ; S
+SH 0.18 1 1.121 0.18 0.96 ; S
; masscenters for vsites do not have gbsa parameters
-
MNH3 0 0 0 0 0
MCH3 0 0 0 0 0
+; original reference: [M. W. Mahoney and W. L. Jorgensen, J. Chem. Phys. 112 , 2000]
+;
+; Note that there are various issues with tip5p and the different forcefields.
+; Discussion is here: http://redmine.gromacs.org/issues/1348
+
[ moleculetype ]
; molname nrexcl
SOL 2
tip3p TIP3P TIP 3-point, recommended
tip4p TIP4P TIP 4-point
tip4pew TIP4P-Ew TIP 4-point optimized with Ewald, recommended
+tip5p TIP5P TIP 5-point (see http://redmine.gromacs.org/issues/1348 for issues)
spc SPC simple point charge
spce SPC/E extended simple point charge
[ implicit_genborn_params ]
-
; atype sar st pi gbr hct
-;H0 0.1 1 1 0.125 0.85 ; H
-C 0.172 1 1.554 0.1875 0.72 ; C
-CA 0.18 1 1.037 0.1875 0.72 ; C
-CB 0.172 0.012 1.554 0.1875 0.72 ; C
-CC 0.172 1 1.554 0.1875 0.72 ; C
-CN 0.172 0.012 1.554 0.1875 0.72 ; C
-CR 0.18 1 1.073 0.1875 0.72 ; C
-CT 0.18 1 1.276 0.190 0.72 ; C
-CV 0.18 1 1.073 0.1875 0.72 ; C
-CW 0.18 1 1.073 0.1875 0.72 ; C
-C* 0.172 0.012 1.554 0.1875 0.72 ; C
-H 0.1 1 1 0.115 0.85 ; H
-HC 0.1 1 1 0.125 0.85 ; H
-H1 0.1 1 1 0.125 0.85 ; H
-HA 0.1 1 1 0.125 0.85 ; H
-H4 0.1 1 1 0.115 0.85 ; H
-H5 0.1 1 1 0.125 0.85 ; H
-HO 0.1 1 1 0.105 0.85 ; H
-HS 0.1 1 1 0.125 0.85 ; H
-HP 0.1 1 1 0.125 0.85 ; H
-N 0.155 1 1.028 0.17063 0.79 ; N
-NA 0.155 1 1.028 0.17063 0.79 ; N
-NB 0.155 1 1.215 0.17063 0.79 ; N
-N2 0.16 1 1.215 0.17063 0.79 ; N
-N3 0.16 1 1.215 0.1625 0.79 ; N
-O 0.15 1 0.926 0.148 0.85 ; O
-OH 0.152 1 1.080 0.1535 0.85 ; O
-O2 0.17 1 0.922 0.148 0.85 ; O
-S 0.18 1 1.121 0.1775 0.96 ; S
-SH 0.18 1 1.121 0.1775 0.96 ; S
-
+;Br 0.1 1 1 0.125 0.85 ; H
+C 0.172 1 1.554 0.17 0.72 ; C
+CA 0.18 1 1.037 0.17 0.72 ; C
+CB 0.172 0.012 1.554 0.17 0.72 ; C
+CC 0.172 1 1.554 0.17 0.72 ; C
+CN 0.172 0.012 1.554 0.17 0.72 ; C
+CR 0.18 1 1.073 0.17 0.72 ; C
+CT 0.18 1 1.276 0.17 0.72 ; C
+CV 0.18 1 1.073 0.17 0.72 ; C
+CW 0.18 1 1.073 0.17 0.72 ; C
+C* 0.172 0.012 1.554 0.17 0.72 ; C
+H 0.1 1 1 0.13 0.85 ; H
+HC 0.1 1 1 0.12 0.85 ; H
+H1 0.1 1 1 0.12 0.85 ; H
+HA 0.1 1 1 0.12 0.85 ; H
+H4 0.1 1 1 0.12 0.85 ; H
+H5 0.1 1 1 0.12 0.85 ; H
+HO 0.1 1 1 0.12 0.85 ; H
+HS 0.1 1 1 0.12 0.85 ; H
+HP 0.1 1 1 0.12 0.85 ; H
+N 0.155 1 1.028 0.155 0.79 ; N
+NA 0.155 1 1.028 0.155 0.79 ; N
+NB 0.155 1 1.215 0.155 0.79 ; N
+N2 0.16 1 1.215 0.155 0.79 ; N
+N3 0.16 1 1.215 0.155 0.79 ; N
+O 0.15 1 0.926 0.15 0.85 ; O
+OH 0.152 1 1.080 0.15 0.85 ; O
+O2 0.17 1 0.922 0.15 0.85 ; O
+S 0.18 1 1.121 0.18 0.96 ; S
+SH 0.18 1 1.121 0.18 0.96 ; S
; masscenters for vsites do not have gbsa parameters
-
MNH3 0 0 0 0 0
MCH3 0 0 0 0 0
+; original reference: [M. W. Mahoney and W. L. Jorgensen, J. Chem. Phys. 112 , 2000]
+;
+; Note that there are various issues with tip5p and the different forcefields.
+; Discussion is here: http://redmine.gromacs.org/issues/1348
+
[ moleculetype ]
; molname nrexcl
SOL 2
tip3p TIP3P TIP 3-point, recommended
tip4p TIP4P TIP 4-point
tip4pew TIP4P-Ew TIP 4-point optimized with Ewald
+tip5p TIP5P TIP 5-point (see http://redmine.gromacs.org/issues/1348 for issues)
spc SPC simple point charge
spce SPC/E extended simple point charge
[ GLY-NH3+ ]
[ replace ]
- N N NH3 14.0027 -0.3
+ N N NH3 14.007 -0.3
CA CA CT2 12.011 0.13
[ Add ]
3 4 H N CA C
[ NH3+ ]
[ replace ]
- N N NH3 14.0027 -0.3
+ N N NH3 14.007 -0.3
CA CA CT1 12.011 0.21
HA HA HB 1.008 0.10
[ Add ]
[ PRO-NH2+ ]
[ replace ]
- N N NP 14.0027 -0.07
+ N N NP 14.007 -0.07
CA CA CP1 12.011 0.16
CD CD CP3 12.011 0.16
[ add ]
;
[ NH2 ]
[ replace ]
- N NH2 14.0067 -0.96
+ N NH2 14.007 -0.96
CA CT1 12.011 0.19
HA HB 1.008 0.09
[ add ]
;
[ GLY-NH2 ]
[ replace ]
- N NH2 14.0067 -0.96
+ N NH2 14.007 -0.96
CA CT2 12.011 0.10
[ add ]
2 4 HT N CA C
;
[ PRO-NH ]
[ replace ]
- N NP 14.0027 -0.40
+ N NP 14.007 -0.40
CA CP1 12.011 -0.08
CD CP3 12.011 -0.10
[ add ]
; rtp residue to rtp building block table
;GMX Force-field
HISD HSD
+HIS1 HSD
HISE HSE
HISH HSP
LYSN LSN
MNH2 0.0000 ; vsite
MCH3 0.0000 ; vsite (rigid CH3 group connected to carbons)
MCH3S 0.0000 ; vsite (rigid CH3 group connected to S)
+MW 0.0 ; Dummy mass in rigid tyrosine rings
; DNA and RNA section
P 30.974 ; Phosphorus ### For DNA
P2 30.974000 ; pyrophosphate phosphorus (see toppar_all27_na_nad_ppi.str) ### For DNA
MNH2 0 0.000000 0.00 A 0.0 0.0
MCH3 0 0.000000 0.00 A 0.0 0.0
MCH3S 0 0.000000 0.00 A 0.0 0.0
+MW 0 0.000000 0.00 A 0.0 0.0
; Ions and noble gases (useful for tutorials)
Cu2+ 29 63.54600 2.00 A 2.08470e-01 4.76976e+00
Ar 18 39.94800 0.00 A 3.41000e-01 2.74580e-02
MNH2 0 0 0 0 0 ; dummy mass
MCH3 0 0 0 0 0 ; dummy mass
MCH3S 0 0 0 0 0 ; dummy mass
+ MW 0 0 0 0 0
+; original reference: [M. W. Mahoney and W. L. Jorgensen, J. Chem. Phys. 112 , 2000]
+;
+; Note that there are various issues with tip5p and the different forcefields.
+; Discussion is here: http://redmine.gromacs.org/issues/1348
+
[ moleculetype ]
; molname nrexcl
SOL 2
tip3p TIP3P TIP 3-point, recommended
tip4p TIP4P TIP 4-point
tips3p TIPS3P CHARMM TIP 3-point with LJ on H's (note: twice as slow in GROMACS)
+tip5p TIP5P TIP 5-point (see http://redmine.gromacs.org/issues/1348 for issues)
spc SPC simple point charge
spce SPC/E extended simple point charge
CA N H2 ga_10
CA N H3 ga_10
[ dihedrals ]
-H1 N CA C gd_14
+H1 N CA C gd_19
[ NH2 ]
[ replace ]
CA N H1 ga_10
CA N H2 ga_10
[ dihedrals ]
-H1 N CA C gd_14
+H1 N CA C gd_19
[ PRO-NH2+ ]
[ replace ]
CD N H1 ga_10
CD N H2 ga_10
[ dihedrals ]
-H1 N CA C gd_14
+CD N CA C gd_19
[ PRO-NH ]
[ replace ]
[ angles ]
CA N H ga_10
CD N H ga_10
+[ dihedrals ]
+CD N CA C gd_19
[ GLY-NH3+ ]
[ replace ]
CA N H2 ga_10
CA N H3 ga_10
[ dihedrals ]
-H1 N CA C gd_14
+H1 N CA C gd_19
CA N H2 ga_10
CA N H3 ga_10
[ dihedrals ]
-H1 N CA C gd_14
+H1 N CA C gd_19
[ NH2 ]
[ replace ]
CA N H1 ga_10
CA N H2 ga_10
[ dihedrals ]
-H1 N CA C gd_14
+H1 N CA C gd_19
[ PRO-NH2+ ]
[ replace ]
CD N H1 ga_10
CD N H2 ga_10
[ dihedrals ]
-H1 N CA C gd_14
+CD N CA C gd_19
[ PRO-NH ]
[ replace ]
[ angles ]
CA N H ga_10
CD N H ga_10
+[ dihedrals ]
+CD N CA C gd_19
[ GLY-NH3+ ]
[ replace ]
CA N H2 ga_10
CA N H3 ga_10
[ dihedrals ]
-H1 N CA C gd_14
+H1 N CA C gd_19
CA N H2 ga_11
CA N H3 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+H1 N CA C gd_39
[ NH2 ]
[ replace ]
CA N H1 ga_11
CA N H2 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+H1 N CA C gd_39
[ PRO-NH2+ ]
[ replace ]
CD N H1 ga_11
CD N H2 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+CD N CA C gd_39
[ PRO-NH ]
[ replace ]
[ angles ]
CA N H ga_11
CD N H ga_11
+[ dihedrals ]
+CD N CA C gd_39
[ GLY-NH3+ ]
[ replace ]
CA N H2 ga_11
CA N H3 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+H1 N CA C gd_39
CA N H2 ga_11
CA N H3 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+H1 N CA C gd_39
[ NH2 ]
[ replace ]
CA N H1 ga_11
CA N H2 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+H1 N CA C gd_39
[ PRO-NH2+ ]
[ replace ]
CD N H1 ga_11
CD N H2 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+CD N CA C gd_39
[ PRO-NH ]
[ replace ]
[ angles ]
CA N H ga_11
CD N H ga_11
+[ dihedrals ]
+CD N CA C gd_39
[ GLY-NH3+ ]
[ replace ]
CA N H2 ga_11
CA N H3 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+H1 N CA C gd_39
CA N H2 ga_11
CA N H3 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+H1 N CA C gd_39
[ NH2 ]
[ replace ]
CA N H1 ga_11
CA N H2 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+H1 N CA C gd_39
[ PRO-NH2+ ]
[ replace ]
CD N H1 ga_11
CD N H2 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+CD N CA C gd_39
[ PRO-NH ]
[ replace ]
[ angles ]
CA N H ga_11
CD N H ga_11
+[ dihedrals ]
+CD N CA C gd_39
[ GLY-NH3+ ]
[ replace ]
CA N H2 ga_11
CA N H3 ga_11
[ dihedrals ]
-H1 N CA C gd_29
+H1 N CA C gd_39
HB1 opls_140 0.060 2
HB2 opls_140 0.060 2
CG opls_267 0.520 3
- OD1 opls_269 -0.530 3
- OD2 opls_268 -0.440 4
+ OD1 opls_269 -0.440 3
+ OD2 opls_268 -0.530 4
HD2 opls_270 0.450 4
C opls_235 0.500 5
O opls_236 -0.500 5
+; original reference: [M. W. Mahoney and W. L. Jorgensen, J. Chem. Phys. 112 , 2000]
+;
+; Note that there are various issues with tip5p and the different forcefields.
+; Discussion is here: http://redmine.gromacs.org/issues/1348
+
[ moleculetype ]
; molname nrexcl
SOL 2
4 opls_120 1 SOL LP1 1 -0.241
5 opls_120 1 SOL LP2 1 -0.241
+#ifndef FLEXIBLE
+
[ settles ]
; i funct doh dhh
1 1 0.09572 0.15139
+#else
+
+[ bonds ]
+; i j funct length force.c.
+1 2 1 0.09572 502416.0 0.09572 502416.0
+1 3 1 0.09572 502416.0 0.09572 502416.0
+
+[ angles ]
+; i j k funct angle force.c.
+2 1 3 1 104.52 628.02 104.52 628.02
+
+#endif
+
[ virtual_sites3 ]
; The position of the virtual site is computed as follows:
;
tip4p TIP4P TIP 4-point, recommended
tip3p TIP3P TIP 3-point
-tip5p TIP5P TIP 5-point
+tip5p TIP5P TIP 5-point (see http://redmine.gromacs.org/issues/1348 for issues)
tip5pe TIP5P TIP 5-point improved for Ewald sums
spc SPC simple point charge
spce SPC/E extended simple point charge
26
-ILE CD1 CD
-ILE HD11 HD1
-ILE HD12 HD2
-ILE HD13 HD3
-HOH O OW
-HOH OW1 OW
-HO4 O OW
-HO4 OW1 OW
-HO5 O OW
-HO5 OW1 OW
-HEME N_A NA
-HEME N_B NB
-HEME N_C NC
-HEME N_D ND
-protein O1 O
-protein O2 OXT
-protein OT1 O
-protein OT2 OXT
-protein OT OXT
-protein O' O
-protein O'' OXT
-protein OC1 O
-protein OC2 OXT
-protein HN H
-protein HT1 H1
-protein HT2 H2
-protein HT3 H3
+ILE CD1 CD
+ILE HD11 HD1
+ILE HD12 HD2
+ILE HD13 HD3
+HOH O OW
+HOH OW1 OW
+HO4 O OW
+HO4 OW1 OW
+HO5 O OW
+HO5 OW1 OW
+HEME N_A NA
+HEME N_B NB
+HEME N_C NC
+HEME N_D ND
+protein HN H
+protein-nterm HT1 H1
+protein-nterm HT2 H2
+protein-nterm HT3 H3
+protein-cterm O1 O
+protein-cterm O2 OXT
+protein-cterm OT1 O
+protein-cterm OT2 OXT
+protein-cterm OT OXT
+protein-cterm O' O
+protein-cterm O'' OXT
+protein-cterm OC1 O
+protein-cterm OC2 OXT
+++ /dev/null
-/*
- *
- * This source code is part of
- *
- * G R O M A C S
- *
- * GROningen MAchine for Chemical Simulations
- *
- * VERSION 3.3.99_development_20071104
- * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
- * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
- * Copyright (c) 2001-2006, The GROMACS development team,
- * check out http://www.gromacs.org for more information.
-
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- *
- * For more info, check our website at http://www.gromacs.org
- *
- * And Hey:
- * Groningen Machine for Chemical Simulation
- */
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "typedefs.h"
-#include "macros.h"
-#include "gromacs/utility/smalloc.h"
-#include "copyrite.h"
-#include "nrnb.h"
-#include "txtdump.h"
-#include "gromacs/fileio/tpxio.h"
-#include "gromacs/commandline/pargs.h"
-#include "gromacs/utility/futil.h"
-#include "gromacs/utility/fatalerror.h"
-#include "gromacs/math/vec.h"
-#include "mdatoms.h"
-#include "coulomb.h"
-#include "nsb.h"
-#include "pme.h"
-#include "force.h"
-#include "gromacs/fileio/xvgr.h"
-#include "gromacs/pbcutil/pbc.h"
-
-#include "gromacs/utility/gmxmpi.h"
-
-#include "block_tx.h"
-
-rvec *xptr=NULL;
-
-static int comp_xptr(const void *a,const void *b)
-{
- int va,vb;
- real dx;
-
- va = *(int *)a;
- vb = *(int *)b;
-
- if ((dx = (xptr[va][XX] - xptr[vb][XX])) < 0)
- return -1;
- else if (dx > 0)
- return 1;
- else
- return 0;
-}
-
-static void do_my_pme(FILE *fp,real tm,gmx_bool bVerbose,t_inputrec *ir,
- rvec x[],rvec xbuf[],rvec f[],
- real charge[],real qbuf[],real qqbuf[],
- matrix box,gmx_bool bSort,
- t_commrec *cr,t_nsborder *nsb,t_nrnb *nrnb,
- t_block *excl,real qtot,
- t_forcerec *fr,int index[],FILE *fp_xvg,
- int ngroups,unsigned short cENER[])
-{
- real ener,vcorr,q,xx,dvdl=0,vdip,vcharge;
- tensor vir,vir_corr,vir_tot;
- rvec mu_tot[2];
- int i,m,ii,ig,jg;
- real **epme,*qptr;
-
- /* Initiate local variables */
- fr->f_el_recip = f;
- clear_mat(vir);
- clear_mat(vir_corr);
-
- if (ngroups > 1) {
- fprintf(fp,"There are %d energy groups\n",ngroups);
- snew(epme,ngroups);
- for(i=0; (i<ngroups); i++)
- snew(epme[i],ngroups);
- }
-
- /* Put x is in the box, this part needs to be parallellized properly */
- /*put_atoms_in_box(box,nsb->natoms,x);*/
- /* Here sorting of X (and q) is done.
- * Alternatively, one could just put the atoms in one of the
- * cr->nnodes slabs. That is much cheaper than sorting.
- */
- for(i=0; (i<nsb->natoms); i++)
- index[i] = i;
- if (bSort) {
- xptr = x;
- qsort(index,nsb->natoms,sizeof(index[0]),comp_xptr);
- xptr = NULL; /* To trap unintentional use of the ptr */
- }
- /* After sorting we only need the part that is to be computed on
- * this processor. We also compute the mu_tot here (system dipole)
- */
- clear_rvec(mu_tot[0]);
- for(i=START(nsb); (i<START(nsb)+HOMENR(nsb)); i++) {
- ii = index[i];
- q = charge[ii];
- qbuf[i] = q;
- for(m=0; (m<DIM); m++) {
- xx = x[ii][m];
- xbuf[i][m] = xx;
- mu_tot[0][m] += q*xx;
- }
- clear_rvec(f[ii]);
- }
- copy_rvec(mu_tot[0],mu_tot[1]);
- if (debug) {
- pr_rvec(debug,0,"qbuf",qbuf,nsb->natoms,TRUE);
- pr_rvecs(debug,0,"xbuf",xbuf,nsb->natoms);
- pr_rvecs(debug,0,"box",box,DIM);
- }
- for(ig=0; (ig<ngroups); ig++) {
- for(jg=ig; (jg<ngroups); jg++) {
- if (ngroups > 1) {
- for(i=START(nsb); (i<START(nsb)+HOMENR(nsb)); i++) {
- if ((cENER[i] == ig) || (cENER[i] == jg))
- qqbuf[i] = qbuf[i];
- else
- qqbuf[i] = 0;
- }
- qptr = qqbuf;
- }
- else
- qptr = qbuf;
- ener = do_pme(fp,bVerbose,ir,xbuf,f,qptr,qptr,box,cr,
- nsb,nrnb,vir,fr->ewaldcoeff,FALSE,0,&dvdl,FALSE);
- vcorr = ewald_LRcorrection(fp,nsb,cr,fr,qptr,qptr,excl,xbuf,box,mu_tot,
- ir->ewald_geometry,ir->epsilon_surface,
- 0,&dvdl,&vdip,&vcharge);
- gmx_sum(1,&ener,cr);
- gmx_sum(1,&vcorr,cr);
- if (ngroups > 1)
- epme[ig][jg] = ener+vcorr;
- }
- }
- if (ngroups > 1) {
- if (fp_xvg)
- fprintf(fp_xvg,"%10.3f",tm);
- for(ig=0; (ig<ngroups); ig++) {
- for(jg=ig; (jg<ngroups); jg++) {
- if (ig != jg)
- epme[ig][jg] -= epme[ig][ig]+epme[jg][jg];
- if (fp_xvg)
- fprintf(fp_xvg," %12.5e",epme[ig][jg]);
- }
- }
- if (fp_xvg)
- fprintf(fp_xvg,"\n");
- }
- else {
- fprintf(fp,"Time: %10.3f Energy: %12.5e Correction: %12.5e Total: %12.5e\n",
- tm,ener,vcorr,ener+vcorr);
- if (fp_xvg)
- fprintf(fp_xvg,"%10.3f %12.5e %12.5e %12.5e\n",tm,ener+vcorr,vdip,vcharge);
- if (bVerbose) {
- m_add(vir,vir_corr,vir_tot);
- gmx_sum(9,vir_tot[0],cr);
- pr_rvecs(fp,0,"virial",vir_tot,DIM);
- }
- fflush(fp);
- }
-}
-
-int main(int argc,char *argv[])
-{
- static char *desc[] = {
- "The [TT]pmetest[tt] program tests the scaling of the PME code. When only given",
- "a [TT].tpr[tt] file it will compute PME for one frame. When given a trajectory",
- "it will do so for all the frames in the trajectory. Before the PME",
- "routine is called the coordinates are sorted along the X-axis.[PAR]",
- "As an extra service to the public the program can also compute",
- "long-range Coulomb energies for components of the system. When the",
- "[TT]-groups[tt] flag is given to the program the energy groups",
- "from the [TT].tpr[tt] file will be read, and half an energy matrix computed."
- };
- t_commrec *cr,*mcr;
- static t_filenm fnm[] = {
- { efTPX, NULL, NULL, ffREAD },
- { efTRN, "-o", NULL, ffWRITE },
- { efLOG, "-g", "pme", ffWRITE },
- { efTRX, "-f", NULL, ffOPTRD },
- { efXVG, "-x", "ener-pme", ffWRITE }
- };
-#define NFILE asize(fnm)
-
- /* Command line options ! */
- static gmx_bool bVerbose=FALSE;
- static gmx_bool bOptFFT=FALSE;
- static gmx_bool bSort=FALSE;
- static int ewald_geometry=eewg3D;
- static int nnodes=1;
- static int pme_order=0;
- static rvec grid = { -1, -1, -1 };
- static real rc = 0.0;
- static real dtol = 0.0;
- static gmx_bool bGroups = FALSE;
- static t_pargs pa[] = {
- { "-np", FALSE, etINT, {&nnodes},
- "Number of nodes, must be the same as used for [TT]grompp[tt]" },
- { "-v", FALSE, etBOOL,{&bVerbose},
- "Be loud and noisy" },
- { "-sort", FALSE, etBOOL,{&bSort},
- "Sort coordinates. Crucial for domain decomposition." },
- { "-grid", FALSE, etRVEC,{&grid},
- "Number of grid cells in X, Y, Z dimension (if -1 use from [TT].tpr[tt])" },
- { "-order", FALSE, etINT, {&pme_order},
- "Order of the PME spreading algorithm" },
- { "-groups", FALSE, etBOOL, {&bGroups},
- "Compute half an energy matrix based on the energy groups in your [TT].tpr[tt] file" },
- { "-rc", FALSE, etREAL, {&rc},
- "Rcoulomb for Ewald summation" },
- { "-tol", FALSE, etREAL, {&dtol},
- "Tolerance for Ewald summation" }
- };
- FILE *fp;
- t_inputrec *ir;
- t_topology top;
- t_tpxheader tpx;
- t_nrnb nrnb;
- t_nsborder *nsb;
- t_forcerec *fr;
- t_mdatoms *mdatoms;
- char title[STRLEN];
- int natoms,step,status,i,ncg,root;
- real t,lambda,ewaldcoeff,qtot;
- rvec *x,*f,*xbuf;
- int *index;
- gmx_bool bCont;
- real *charge,*qbuf,*qqbuf;
- matrix box;
-
- /* Start the actual parallel code if necessary */
- cr = init_par(&argc,&argv);
- root = 0;
-
- if (MASTER(cr))
- CopyRight(stderr,argv[0]);
-
- /* Parse command line on all processors, arguments are passed on in
- * init_par (see above)
- */
- parse_common_args(&argc,argv,
- PCA_NOEXIT_ON_ARGS | PCA_BE_NICE |
- PCA_CAN_SET_DEFFNM | (MASTER(cr) ? 0 : PCA_QUIET),
- NFILE,fnm,asize(pa),pa,asize(desc),desc,0,NULL);
-
-#ifndef GMX_MPI
- if (nnodes > 1)
- gmx_fatal(FARGS,"GROMACS compiled without MPI support - can't do parallel runs");
-#endif
-
- /* Open log files on all processors */
- open_log(ftp2fn(efLOG,NFILE,fnm),cr);
- snew(ir,1);
-
- if (MASTER(cr)) {
- /* Read tpr file etc. */
- read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&tpx,FALSE,NULL,NULL);
- snew(x,tpx.natoms);
- read_tpx(ftp2fn(efTPX,NFILE,fnm),&step,&t,&lambda,ir,
- box,&natoms,x,NULL,NULL,&top);
- /* Charges */
- qtot = 0;
- snew(charge,natoms);
- for(i=0; (i<natoms); i++) {
- charge[i] = top.atoms.atom[i].q;
- qtot += charge[i];
- }
-
- /* Grid stuff */
- if (opt2parg_bSet("-grid",asize(pa),pa)) {
- ir->nkx = grid[XX];
- ir->nky = grid[YY];
- ir->nkz = grid[ZZ];
- }
- /* Check command line parameters for consistency */
- if ((ir->nkx <= 0) || (ir->nky <= 0) || (ir->nkz <= 0))
- gmx_fatal(FARGS,"PME grid = %d %d %d",ir->nkx,ir->nky,ir->nkz);
- if (opt2parg_bSet("-rc",asize(pa),pa))
- ir->rcoulomb = rc;
- if (ir->rcoulomb <= 0)
- gmx_fatal(FARGS,"rcoulomb should be > 0 (not %f)",ir->rcoulomb);
- if (opt2parg_bSet("-order",asize(pa),pa))
- ir->pme_order = pme_order;
- if (ir->pme_order <= 0)
- gmx_fatal(FARGS,"pme_order should be > 0 (not %d)",ir->pme_order);
- if (opt2parg_bSet("-tol",asize(pa),pa))
- ir->ewald_rtol = dtol;
- if (ir->ewald_rtol <= 0)
- gmx_fatal(FARGS,"ewald_tol should be > 0 (not %f)",ir->ewald_rtol);
- }
- else {
- init_top(&top);
- }
-
- /* Add parallellization code here */
- snew(nsb,1);
- if (MASTER(cr)) {
- ncg = top.blocks[ebCGS].multinr[0];
- for(i=0; (i<cr->nnodes-1); i++)
- top.blocks[ebCGS].multinr[i] = min(ncg,(ncg*(i+1))/cr->nnodes);
- for( ; (i<MAXNODES); i++)
- top.blocks[ebCGS].multinr[i] = ncg;
- }
- if (PAR(cr)) {
- /* Set some variables to zero to avoid core dumps */
- ir->opts.ngtc = ir->opts.ngacc = ir->opts.ngfrz = ir->opts.ngener = 0;
-#ifdef GMX_MPI
- /* Distribute the data over processors */
- MPI_Bcast(&natoms,1,MPI_INT,root,MPI_COMM_WORLD);
- MPI_Bcast(ir,sizeof(*ir),MPI_BYTE,root,MPI_COMM_WORLD);
- MPI_Bcast(&qtot,1,GMX_MPI_REAL,root,MPI_COMM_WORLD);
-#endif
-
- /* Call some dedicated communication routines, master sends n-1 times */
- if (MASTER(cr)) {
- for(i=1; (i<cr->nnodes); i++) {
- mv_block(i,&(top.blocks[ebCGS]));
- mv_block(i,&(top.atoms.excl));
- }
- }
- else {
- ld_block(root,&(top.blocks[ebCGS]));
- ld_block(root,&(top.atoms.excl));
- }
- if (!MASTER(cr)) {
- snew(charge,natoms);
- snew(x,natoms);
- }
-#ifdef GMX_MPI
- MPI_Bcast(charge,natoms,GMX_MPI_REAL,root,MPI_COMM_WORLD);
-#endif
- }
- ewaldcoeff = calc_ewaldcoeff(ir->rcoulomb,ir->ewald_rtol);
-
-
- if (bVerbose)
- pr_inputrec(stdlog,0,"Inputrec",ir);
-
- /* Allocate memory for temp arrays etc. */
- snew(xbuf,natoms);
- snew(f,natoms);
- snew(qbuf,natoms);
- snew(qqbuf,natoms);
- snew(index,natoms);
-
- /* Initialize the PME code */
- init_pme(stdlog,cr,ir->nkx,ir->nky,ir->nkz,ir->pme_order,
- natoms,FALSE,bOptFFT,ewald_geometry);
-
- /* MFlops accounting */
- init_nrnb(&nrnb);
-
- /* Initialize the work division */
- calc_nsb(stdlog,&(top.blocks[ebCGS]),cr->nnodes,nsb,0);
- nsb->nodeid = cr->nodeid;
- print_nsb(stdlog,"pmetest",nsb);
-
- /* Initiate forcerec */
- mdatoms = atoms2md(stdlog,&top.atoms,ir->opts.nFreeze,ir->eI,
- ir->delta_t,0,ir->opts.tau_t,FALSE,FALSE);
- snew(fr,1);
- init_forcerec(stdlog,fr,ir,&top,cr,mdatoms,nsb,box,FALSE,NULL,NULL,FALSE);
-
- /* First do PME based on coordinates in tpr file, send them to
- * other processors if needed.
- */
- if (MASTER(cr))
- fprintf(stdlog,"-----\n"
- "Results based on tpr file %s\n",ftp2fn(efTPX,NFILE,fnm));
-#ifdef GMX_MPI
- if (PAR(cr)) {
- MPI_Bcast(x[0],natoms*DIM,GMX_MPI_REAL,root,MPI_COMM_WORLD);
- MPI_Bcast(box[0],DIM*DIM,GMX_MPI_REAL,root,MPI_COMM_WORLD);
- MPI_Bcast(&t,1,GMX_MPI_REAL,root,MPI_COMM_WORLD);
- }
-#endif
- do_my_pme(stdlog,0,bVerbose,ir,x,xbuf,f,charge,qbuf,qqbuf,box,bSort,
- cr,nsb,&nrnb,&(top.atoms.excl),qtot,fr,index,NULL,
- bGroups ? ir->opts.ngener : 1,mdatoms->cENER);
-
- /* If we have a trajectry file, we will read the frames in it and compute
- * the PME energy.
- */
- if (ftp2bSet(efTRX,NFILE,fnm)) {
- fprintf(stdlog,"-----\n"
- "Results based on trx file %s\n",ftp2fn(efTRX,NFILE,fnm));
- if (MASTER(cr)) {
- sfree(x);
- natoms = read_first_x(&status,ftp2fn(efTRX,NFILE,fnm),&t,&x,box);
- if (natoms != top.atoms.nr)
- gmx_fatal(FARGS,"natoms in trx = %d, in tpr = %d",natoms,top.atoms.nr);
- fp = xvgropen(ftp2fn(efXVG,NFILE,fnm),"PME Energy","Time (ps)","E (kJ/mol)");
- }
- else
- fp = NULL;
- do {
- /* Send coordinates, box and time to the other nodes */
-#ifdef GMX_MPI
- if (PAR(cr)) {
- MPI_Bcast(x[0],natoms*DIM,GMX_MPI_REAL,root,MPI_COMM_WORLD);
- MPI_Bcast(box[0],DIM*DIM,GMX_MPI_REAL,root,MPI_COMM_WORLD);
- MPI_Bcast(&t,1,GMX_MPI_REAL,root,MPI_COMM_WORLD);
- }
-#endif
- rm_pbc(&top.idef,nsb->natoms,box,x,x);
- /* Call the PME wrapper function */
- do_my_pme(stdlog,t,bVerbose,ir,x,xbuf,f,charge,qbuf,qqbuf,box,bSort,cr,
- nsb,&nrnb,&(top.atoms.excl),qtot,fr,index,fp,
- bGroups ? ir->opts.ngener : 1,mdatoms->cENER);
- /* Only the master processor reads more data */
- if (MASTER(cr))
- bCont = read_next_x(status,&t,natoms,x,box);
- /* Check whether we need to continue */
-#ifdef GMX_MPI
- if (PAR(cr))
- MPI_Bcast(&bCont,1,MPI_INT,root,MPI_COMM_WORLD);
-#endif
-
- } while (bCont);
-
- /* Finish I/O, close files */
- if (MASTER(cr)) {
- close_trx(status);
- gmx_ffclose(fp);
- }
- }
-
- if (bVerbose) {
- /* Do some final I/O about performance, might be useful in debugging */
- fprintf(stdlog,"-----\n");
- print_nrnb(stdlog,&nrnb);
- }
-
- /* Finish the parallel stuff */
- if (gmx_parallel_env_initialized())
- gmx_finalize(cr);
-
- /* Thank the audience, as usual */
- if (MASTER(cr))
- gmx_thanx(stderr);
-
- return 0;
-}
-
static inline void *tMPI_Atomic_ptr_swap(tMPI_Atomic_ptr_t *a, void *b)
{
void *volatile *ret = (void* volatile*)b;
-#ifndef __x86_64__
+#ifndef __LP64__
__asm__ __volatile__("\txchgl %0, %1;"
: "+r" (ret), "+m" (a->value)
:
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 2.8.8)
project(TNG_IO)
set(PROJECT_VERSION "1.5")
add_subdirectory(src)
-install(FILES include/tng_io.h DESTINATION include/)
+install(FILES include/tng_io.h include/tng_io_fwd.h DESTINATION include/)
#-- Add an Option to toggle the generation of the API documentation
option(TNG_BUILD_DOCUMENTATION "Use Doxygen to create the HTML based API documentation" OFF)
target_link_libraries(tng_compress m)
endif()
+# Use GNUInstallDirst to set paths on multiarch systems
+include(GNUInstallDirs)
+
install(TARGETS tng_compress
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib)
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
target_link_libraries(tng_io ${ZLIB_LIBRARIES})
endif()
+# Use GNUInstallDirst to set paths on multiarch systems
+include(GNUInstallDirs)
+
install(TARGETS tng_io
- LIBRARY DESTINATION lib
- ARCHIVE DESTINATION lib)
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
set_source_files_properties(selection/scanner.cpp PROPERTIES COMPILE_FLAGS "${_scanner_cpp_compiler_flags}")
-target_link_libraries(libgromacs ${GMX_GPU_LIBRARIES}
+target_link_libraries(libgromacs
+ ${EXTRAE_LIBRARIES}
+ ${GMX_GPU_LIBRARIES}
${GMX_EXTRA_LIBRARIES}
${GMX_TNG_LIBRARIES}
- ${EXTRAE_LIBRARIES}
${FFT_LIBRARIES} ${LINEAR_ALGEBRA_LIBRARIES}
${XML_LIBRARIES}
${THREAD_LIB} ${GMX_SHARED_LINKER_FLAGS})
if (bSeekForwardOnly)
{
- low = gmx_ftell(fp);
+ low = gmx_ftell(fp)-header_size;
}
if (gmx_fseek(fp, 0, SEEK_END))
{
};
-/* this is not very good,
- but these are only used in gmx_trjconv and gmx_editconv */
-static gmx_bool bWideFormat = FALSE;
#define REMARK_SIM_BOX "REMARK THIS IS A SIMULATION BOX"
-void set_pdb_wide_format(gmx_bool bSet)
-{
- bWideFormat = bSet;
-}
-
static void xlate_atomname_pdb2gmx(char *name)
{
int i, length;
gmx_conect conect, gmx_bool bTerSepChains)
{
gmx_conect_t *gc = (gmx_conect_t *)conect;
- char resnm[6], nm[6], pdbform[128], pukestring[100];
+ char resnm[6], nm[6], pukestring[100];
atom_id i, ii;
- int resind, resnr, type;
+ int resind, resnr;
+ enum PDB_record type;
unsigned char resic, ch;
+ char altloc;
real occup, bfac;
gmx_bool bOccup;
int nlongname = 0;
bromacs(pukestring, 99);
fprintf(out, "TITLE %s\n", (title && title[0]) ? title : pukestring);
- if (bWideFormat)
- {
- fprintf(out, "REMARK This file does not adhere to the PDB standard\n");
- fprintf(out, "REMARK As a result of, some programs may not like it\n");
- }
if (box && ( norm2(box[XX]) || norm2(box[YY]) || norm2(box[ZZ]) ) )
{
gmx_write_pdb_box(out, ePBC, box);
}
strncpy(resnm, *atoms->resinfo[resind].name, sizeof(resnm)-1);
+ resnm[sizeof(resnm)-1] = 0;
strncpy(nm, *atoms->atomname[i], sizeof(nm)-1);
+ nm[sizeof(nm)-1] = 0;
+
/* rename HG12 to 2HG1, etc. */
xlate_atomname_gmx2pdb(nm);
resnr = atoms->resinfo[resind].nr;
}
if (atoms->pdbinfo)
{
- type = atoms->pdbinfo[i].type;
+ type = (enum PDB_record)(atoms->pdbinfo[i].type);
+ altloc = atoms->pdbinfo[i].altloc;
+ if (!isalnum(altloc))
+ {
+ altloc = ' ';
+ }
occup = bOccup ? 1.0 : atoms->pdbinfo[i].occup;
bfac = atoms->pdbinfo[i].bfac;
}
else
{
- type = 0;
- occup = 1.0;
- bfac = 0.0;
- }
- if (bWideFormat)
- {
- strcpy(pdbform,
- "%-6s%5u %-4.4s %3.3s %c%4d%c %10.5f%10.5f%10.5f%8.4f%8.4f %2s\n");
- }
- else
- {
- /* Check whether atomname is an element name */
- if ((strlen(nm) < 4) && (gmx_strcasecmp(nm, atoms->atom[i].elem) != 0))
- {
- strcpy(pdbform, get_pdbformat());
- }
- else
- {
- strcpy(pdbform, get_pdbformat4());
- if (strlen(nm) > 4)
- {
- int maxwln = 20;
- if (nlongname < maxwln)
- {
- fprintf(stderr, "WARNING: Writing out atom name (%s) longer than 4 characters to .pdb file\n", nm);
- }
- else if (nlongname == maxwln)
- {
- fprintf(stderr, "WARNING: More than %d long atom names, will not write more warnings\n", maxwln);
- }
- nlongname++;
- }
- }
- strcat(pdbform, "%6.2f%6.2f %2s\n");
+ type = epdbATOM;
+ occup = 1.0;
+ bfac = 0.0;
+ altloc = ' ';
}
- fprintf(out, pdbform, pdbtp[type], (i+1)%100000, nm, resnm, ch, resnr,
- (resic == '\0') ? ' ' : resic,
- 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ], occup, bfac, atoms->atom[i].elem);
+
+ gmx_fprintf_pdb_atomline(out,
+ type,
+ i+1,
+ nm,
+ altloc,
+ resnm,
+ ch,
+ resnr,
+ resic,
+ 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ],
+ occup,
+ bfac,
+ atoms->atom[i].elem);
+
if (atoms->pdbinfo && atoms->pdbinfo[i].bAnisotropic)
{
- fprintf(out, "ANISOU%5u %-4.4s%3.3s %c%4d%c %7d%7d%7d%7d%7d%7d\n",
+ fprintf(out, "ANISOU%5u %-4.4s%4.4s%c%4d%c %7d%7d%7d%7d%7d%7d\n",
(i+1)%100000, nm, resnm, ch, resnr,
(resic == '\0') ? ' ' : resic,
atoms->pdbinfo[i].uij[0], atoms->pdbinfo[i].uij[1],
t_atom *atomn;
int j, k;
char nc = '\0';
- char anr[12], anm[12], anm_copy[12], altloc, resnm[12], rnr[12];
+ char anr[12], anm[12], anm_copy[12], altloc, resnm[12], rnr[12], elem[3];
char xc[12], yc[12], zc[12], occup[12], bfac[12];
unsigned char resic;
char chainid;
}
bfac[k] = nc;
+ /* 10 blanks */
+ j += 10;
+
+ /* Element name */
+ for (k = 0; (k < 2); k++, j++)
+ {
+ elem[k] = line[j];
+ }
+ elem[k] = nc;
+ trim(elem);
+
if (atoms->atom)
{
atomn = &(atoms->atom[natom]);
atomn->m = 0.0;
atomn->q = 0.0;
atomn->atomnumber = atomnumber;
- atomn->elem[0] = '\0';
+ strncpy(atomn->elem, elem, 4);
}
x[natom][XX] = strtod(xc, NULL)*0.1;
x[natom][YY] = strtod(yc, NULL)*0.1;
return gc;
}
-const char* get_pdbformat()
+int
+gmx_fprintf_pdb_atomline(FILE * fp,
+ enum PDB_record record,
+ int atom_seq_number,
+ const char * atom_name,
+ char alternate_location,
+ const char * res_name,
+ char chain_id,
+ int res_seq_number,
+ char res_insertion_code,
+ real x,
+ real y,
+ real z,
+ real occupancy,
+ real b_factor,
+ const char * element)
{
- static const char *pdbformat = "%-6s%5u %-4.4s%3.3s %c%4d%c %8.3f%8.3f%8.3f";
- return pdbformat;
-}
+ char tmp_atomname[6], tmp_resname[6];
+ gmx_bool start_name_in_col13;
+ int n;
-const char* get_pdbformat4()
-{
- static const char *pdbformat4 = "%-6s%5u %-4.4s %3.3s %c%4d%c %8.3f%8.3f%8.3f";
- return pdbformat4;
+ if (record != epdbATOM && record != epdbHETATM)
+ {
+ gmx_fatal(FARGS, "Can only print PDB atom lines as ATOM or HETATM records");
+ }
+
+ /* Format atom name */
+ if (atom_name != NULL)
+ {
+ /* If the atom name is an element name with two chars, it should start already in column 13.
+ * Otherwise it should start in column 14, unless the name length is 4 chars.
+ */
+ if ( (element != NULL) && (strlen(element) >= 2) && (gmx_strncasecmp(atom_name, element, 2) == 0) )
+ {
+ start_name_in_col13 = TRUE;
+ }
+ else
+ {
+ start_name_in_col13 = (strlen(atom_name) >= 4);
+ }
+ sprintf(tmp_atomname, start_name_in_col13 ? "" : " ");
+ strncat(tmp_atomname, atom_name, 4);
+ tmp_atomname[5] = '\0';
+ }
+ else
+ {
+ tmp_atomname[0] = '\0';
+ }
+
+ /* Format residue name */
+ strncpy(tmp_resname, (res_name != NULL) ? res_name : "", 4);
+ /* Make sure the string is terminated if strlen was > 4 */
+ tmp_resname[4] = '\0';
+ /* String is properly terminated, so now we can use strcat. By adding a
+ * space we can write it right-justified, and if the original name was
+ * three characters or less there will be a space added on the right side.
+ */
+ strcat(tmp_resname, " ");
+
+ /* Truncate integers so they fit */
+ atom_seq_number = atom_seq_number % 100000;
+ res_seq_number = res_seq_number % 10000;
+
+ n = fprintf(fp,
+ "%-6s%5d %-4.4s%c%4.4s%c%4d%c %8.3f%8.3f%8.3f%6.2f%6.2f %2s\n",
+ pdbtp[record],
+ atom_seq_number,
+ tmp_atomname,
+ alternate_location,
+ tmp_resname,
+ chain_id,
+ res_seq_number,
+ res_insertion_code,
+ x, y, z,
+ occupancy,
+ b_factor,
+ (element != NULL) ? element : "");
+
+ return n;
}
typedef struct gmx_conect_t *gmx_conect;
-/* THE pdb format (for ATOM/HETATOM lines) */
-const char* get_pdbformat(void);
-const char* get_pdbformat4(void);
-
/* Enumerated type for pdb records. The other entries are ignored
* when reading a pdb file
*/
-enum {
+enum PDB_record {
epdbATOM, epdbHETATM, epdbANISOU, epdbCRYST1, epdbCOMPND,
epdbMODEL, epdbENDMDL, epdbTER, epdbHEADER, epdbTITLE, epdbREMARK,
epdbCONECT, epdbNR
};
+/* Write a PDB line with an ATOM or HETATM record directly to a file pointer.
+ *
+ * Returns the number of characters printed.
+ */
+int
+gmx_fprintf_pdb_atomline(FILE * fp,
+ enum PDB_record record,
+ int atom_seq_number,
+ const char * atom_name,
+ char alternate_location,
+ const char * res_name,
+ char chain_id,
+ int res_seq_number,
+ char res_insertion_code,
+ real x,
+ real y,
+ real z,
+ real occupancy,
+ real b_factor,
+ const char * element);
+
/* Enumerated value for indexing an uij entry (anisotropic temperature factors) */
enum {
U11, U22, U33, U12, U13, U23
};
-void set_pdb_wide_format(gmx_bool bSet);
-/* If bSet, use wider format for occupancy and bfactor */
-
void pdb_use_ter(gmx_bool bSet);
/* set read_pdbatoms to read upto 'TER' or 'ENDMDL' (default, bSet=FALSE).
This function is fundamentally broken as far as thread-safety is concerned.*/
gmx_int64_t numMolecules,
tng_molecule_t *tngMol)
{
+ tng_chain_t tngChain = NULL;
+ tng_residue_t tngRes = NULL;
+
if (tng_molecule_add(tng, moleculeName, tngMol) != TNG_SUCCESS)
{
gmx_file("Cannot add molecule to TNG molecular system.");
{
const t_resinfo *resInfo = &atoms->resinfo[at->resind];
char chainName[2] = {resInfo->chainid, 0};
- tng_chain_t tngChain = NULL;
- tng_residue_t tngRes = NULL;
tng_atom_t tngAtom = NULL;
+ t_atom *prevAtom;
- if (tng_molecule_chain_find (tng, *tngMol, chainName,
- (gmx_int64_t)-1, &tngChain) !=
- TNG_SUCCESS)
+ if (atomIndex > 0)
+ {
+ prevAtom = &atoms->atom[atomIndex - 1];
+ }
+ else
{
- tng_molecule_chain_add (tng, *tngMol, chainName,
- &tngChain);
+ prevAtom = 0;
}
- /* FIXME: When TNG supports both residue index and residue
- * number the latter should be used. Wait for TNG 2.0*/
- if (tng_chain_residue_find(tng, tngChain, *resInfo->name,
- at->resind + 1, &tngRes)
- != TNG_SUCCESS)
+ /* If this is the first atom or if the residue changed add the
+ * residue to the TNG molecular system. */
+ if (!prevAtom || resInfo != &atoms->resinfo[prevAtom->resind])
{
+ /* If this is the first atom or if the chain changed add
+ * the chain to the TNG molecular system. */
+ if (!prevAtom || resInfo->chainid !=
+ atoms->resinfo[prevAtom->resind].chainid)
+ {
+ tng_molecule_chain_add(tng, *tngMol, chainName,
+ &tngChain);
+ }
+ /* FIXME: When TNG supports both residue index and residue
+ * number the latter should be used. Wait for TNG 2.0*/
tng_chain_residue_add(tng, tngChain, *resInfo->name, &tngRes);
}
tng_residue_atom_add(tng, tngRes, *(atoms->atomname[atomIndex]), *(atoms->atomtype[atomIndex]), &tngAtom);
tpxv_ComputationalElectrophysiology = 96, /**< support for ion/water position swaps (computational electrophysiology) */
tpxv_Use64BitRandomSeed, /**< change ld_seed from int to gmx_int64_t */
tpxv_RestrictedBendingAndCombinedAngleTorsionPotentials, /**< potentials for supporting coarse-grained force fields */
- tpxv_InteractiveMolecularDynamics /**< interactive molecular dynamics (IMD) */
+ tpxv_InteractiveMolecularDynamics, /**< interactive molecular dynamics (IMD) */
+ tpxv_RemoveObsoleteParameters1 /**< remove optimize_fft, dihre_fc, nstcheckpoint */
};
/*! \brief Version number of the file format written to run input
*
* When developing a feature branch that needs to change the run input
* file format, change tpx_tag instead. */
-static const int tpx_version = tpxv_InteractiveMolecularDynamics;
+static const int tpx_version = tpxv_RemoveObsoleteParameters1;
/* This number should only be increased when you edit the TOPOLOGY section
int i, j, k, *tmp, idum = 0;
real rdum, bd_temp;
rvec vdum;
- gmx_bool bSimAnn;
+ gmx_bool bSimAnn, bdum = 0;
real zerotemptime, finish_t, init_temp, finish_temp;
if (file_version != tpx_version)
gmx_fio_do_int(fio, idum);
ir->nsteps = idum;
}
+
if (file_version > 25)
{
if (file_version >= 62)
}
gmx_fio_do_int(fio, ir->ns_type);
gmx_fio_do_int(fio, ir->nstlist);
- gmx_fio_do_int(fio, ir->ndelta);
+ gmx_fio_do_int(fio, idum); /* used to be ndelta; not used anymore */
if (file_version < 41)
{
gmx_fio_do_int(fio, idum);
}
ir->nstcomm = abs(ir->nstcomm);
- if (file_version > 25)
- {
- gmx_fio_do_int(fio, ir->nstcheckpoint);
- }
- else
+ /* ignore nstcheckpoint */
+ if (file_version > 25 && file_version < tpxv_RemoveObsoleteParameters1)
{
- ir->nstcheckpoint = 0;
+ gmx_fio_do_int(fio, idum);
}
gmx_fio_do_int(fio, ir->nstcgsteep);
gmx_fio_do_real(fio, ir->epsilon_surface);
}
- gmx_fio_do_gmx_bool(fio, ir->bOptFFT);
+ /* ignore bOptFFT */
+ if (file_version < tpxv_RemoveObsoleteParameters1)
+ {
+ gmx_fio_do_gmx_bool(fio, bdum);
+ }
if (file_version >= 93)
{
ir->orires_tau = 0;
ir->nstorireout = 0;
}
+
+ /* ignore dihre_fc */
if (file_version >= 26 && file_version < 79)
{
- gmx_fio_do_real(fio, ir->dihre_fc);
+ gmx_fio_do_real(fio, rdum);
if (file_version < 56)
{
gmx_fio_do_real(fio, rdum);
gmx_fio_do_int(fio, idum);
}
}
- else
- {
- ir->dihre_fc = 0;
- }
gmx_fio_do_real(fio, ir->em_stepsize);
gmx_fio_do_real(fio, ir->em_tol);
gmx_fio_ndo_int(fio, block->a, block->nra);
}
+/* This is a primitive routine to make it possible to translate atomic numbers
+ * to element names when reading TPR files, without making the Gromacs library
+ * directory a dependency on mdrun (which is the case if we need elements.dat).
+ */
+static const char *
+atomicnumber_to_element(int atomicnumber)
+{
+ const char * p;
+
+ /* This does not have to be complete, so we only include elements likely
+ * to occur in PDB files.
+ */
+ switch (atomicnumber)
+ {
+ case 1: p = "H"; break;
+ case 5: p = "B"; break;
+ case 6: p = "C"; break;
+ case 7: p = "N"; break;
+ case 8: p = "O"; break;
+ case 9: p = "F"; break;
+ case 11: p = "Na"; break;
+ case 12: p = "Mg"; break;
+ case 15: p = "P"; break;
+ case 16: p = "S"; break;
+ case 17: p = "Cl"; break;
+ case 18: p = "Ar"; break;
+ case 19: p = "K"; break;
+ case 20: p = "Ca"; break;
+ case 25: p = "Mn"; break;
+ case 26: p = "Fe"; break;
+ case 28: p = "Ni"; break;
+ case 29: p = "Cu"; break;
+ case 30: p = "Zn"; break;
+ case 35: p = "Br"; break;
+ case 47: p = "Ag"; break;
+ default: p = ""; break;
+ }
+ return p;
+}
+
+
static void do_atom(t_fileio *fio, t_atom *atom, int ngrp, gmx_bool bRead,
int file_version, gmx_groups_t *groups, int atnr)
{
- int i, myngrp;
+ int i, myngrp;
+ char * p_elem;
gmx_fio_do_real(fio, atom->m);
gmx_fio_do_real(fio, atom->q);
if (file_version >= 52)
{
gmx_fio_do_int(fio, atom->atomnumber);
+ if (bRead)
+ {
+ /* Set element string from atomic number if present.
+ * This routine returns an empty string if the name is not found.
+ */
+ strncpy(atom->elem, atomicnumber_to_element(atom->atomnumber), 4);
+ /* avoid warnings about potentially unterminated string */
+ atom->elem[3] = '\0';
+ }
}
else if (bRead)
{
static void do_mtop(t_fileio *fio, gmx_mtop_t *mtop, gmx_bool bRead,
int file_version)
{
- int mt, mb, i;
- t_blocka dumb;
+ int mt, mb, i;
+ t_blocka dumb;
if (bRead)
{
int natoms; /* number of atoms (atoms, x, v, f) */
real t0; /* time of the first frame, needed *
* for skipping frames with -dt */
+ real tf; /* internal frame time - DO NOT CHANGE */
real tpf; /* time of the previous frame, not */
/* the read, but real file frames */
real tppf; /* time of two frames ago */
fr->bDouble = FALSE;
fr->natoms = -1;
fr->t0 = 0;
+ fr->tf = 0;
fr->tpf = 0;
fr->tppf = 0;
fr->title = NULL;
int ftp;
bRet = FALSE;
- pt = fr->time;
+ pt = fr->tf;
do
{
clear_trxframe(fr, FALSE);
fr->tppf = fr->tpf;
- fr->tpf = fr->time;
+ fr->tpf = fr->tf;
if (status->tng)
{
/* DvdS 2005-05-31: this has been fixed along with the increased
* accuracy of the control over -b and -e options.
*/
- if (bTimeSet(TBEGIN) && (fr->time < rTimeValue(TBEGIN)))
+ if (bTimeSet(TBEGIN) && (fr->tf < rTimeValue(TBEGIN)))
{
if (xtc_seek_time(status->fio, rTimeValue(TBEGIN), fr->natoms, TRUE))
{
gmx_fio_getname(status->fio));
#endif
}
+ fr->tf = fr->time;
if (bRet)
{
#endif
break;
}
+ fr->tf = fr->time;
/* Return FALSE if we read a frame that's past the set ending time. */
if (!bFirst && (!(fr->flags & TRX_DONT_SKIP) && check_times(fr->time) > 0))
int i, j, Dih, Chi;
j = 0;
- for (Dih = 0; (Dih < NONCHI+maxchi); Dih++)
+ /* NONCHI points to chi1, therefore we have to start counting there. */
+ for (Dih = NONCHI; (Dih < NONCHI+maxchi); Dih++)
{
for (i = 0; (i < nlist); i++)
{
sprintf(histitle, "cumulative rotamer distribution for %s", dlist[i].name);
fprintf(stderr, " and %s ", hisfile);
fp = xvgropen(hisfile, histitle, "number", "", oenv);
- fprintf(fp, "@ xaxis tick on\n");
- fprintf(fp, "@ xaxis tick major 1\n");
- fprintf(fp, "@ type xy\n");
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "@ xaxis tick on\n");
+ fprintf(fp, "@ xaxis tick major 1\n");
+ fprintf(fp, "@ type xy\n");
+ }
for (k = 0; (k < nbin); k++)
{
if (bNormalize)
fprintf(fp, "%5d %10d\n", k, chi_prhist[k]);
}
}
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
gmx_ffclose(fp);
}
{
if (bSplit && i > 0 && fabs(x[i]) < 1e-5)
{
- if (output_env_get_print_xvgr_codes(oenv))
- {
- fprintf(out, "&\n");
- }
+ fprintf(out, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
fprintf(out, "%10.4f %10.5f\n",
x[i]*scale_x, y ? y[g][i] : sy[g][s][i]);
}
- if (output_env_get_print_xvgr_codes(oenv))
- {
- fprintf(out, "&\n");
- }
+ fprintf(out, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
}
gmx_ffclose(out);
out = xvgropen(outfile, "Subspace overlap",
"Eigenvectors of trajectory 2", "Overlap", oenv);
- fprintf(out, "@ subtitle \"using %d eigenvectors of trajectory 1\"\n",
- noutvec);
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(out, "@ subtitle \"using %d eigenvectors of trajectory 1\"\n", noutvec);
+ }
overlap = 0;
for (x = 0; x < nvec2; x++)
{
{
if (bSplit && i > 0 && fabs(inprod[noutvec][i]) < 1e-5)
{
- fprintf(xvgrout, "&\n");
+ fprintf(xvgrout, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
fprintf(xvgrout, "%10.5f %10.5f\n", inprod[0][i], inprod[noutvec-1][i]);
}
rvec *x;
real *b = NULL;
matrix box;
- char *resnm, *atnm, pdbform[STRLEN];
+ char *resnm, *atnm;
gmx_bool bPDB, b4D;
FILE *out;
}
if ( ( b4D || bSplit ) && bPDB)
{
- strcpy(pdbform, get_pdbformat());
- strcat(pdbform, "%8.4f%8.4f\n");
-
out = gmx_ffopen(threedplotfile, "w");
fprintf(out, "HEADER %s\n", str);
if (b4D)
fprintf(out, "TER\n");
j = 0;
}
- fprintf(out, pdbform, "ATOM", i+1, "C", "PRJ", ' ', j+1,
- 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ], 1.0, 10*b[i]);
+ gmx_fprintf_pdb_atomline(out, epdbATOM, i+1, "C", ' ', "PRJ", ' ', j+1, ' ',
+ 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ], 1.0, 10*b[i], "");
if (j > 0)
{
fprintf(out, "CONECT%5d%5d\n", i, i+1);
}
if (s < nset-1)
{
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
}
gmx_ffclose(fp);
}
fprintf(stdout, "Set %3d: err.est. %g a %g tau1 %g tau2 %g\n",
s+1, ee, a, tau1, tau2);
- fprintf(fp, "@ legend string %d \"av %f\"\n", 2*s, av[s]);
- fprintf(fp, "@ legend string %d \"ee %6g\"\n",
- 2*s+1, sig[s]*anal_ee_inf(fitparm, n*dt));
+ if (output_env_get_xvg_format(oenv) == exvgXMGR)
+ {
+ fprintf(fp, "@ legend string %d \"av %f\"\n", 2*s, av[s]);
+ fprintf(fp, "@ legend string %d \"ee %6g\"\n", 2*s+1, sig[s]*anal_ee_inf(fitparm, n*dt));
+ }
+ else if (output_env_get_xvg_format(oenv) == exvgXMGRACE)
+ {
+ fprintf(fp, "@ s%d legend \"av %f\"\n", 2*s, av[s]);
+ fprintf(fp, "@ s%d legend \"ee %6g\"\n", 2*s+1, sig[s]*anal_ee_inf(fitparm, n*dt));
+ }
for (i = 0; i < nbs; i++)
{
fprintf(fp, "%g %g %g\n", tbs[i], sig[s]*sqrt(ybs[i]/(n*dt)),
s+1, sig[s]*anal_ee_inf(ac_fit, n*dt),
ac_fit[1], ac_fit[0], ac_fit[2]);
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
for (i = 0; i < nbs; i++)
{
fprintf(fp, "%g %g\n", tbs[i],
}
if (s < nset-1)
{
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
}
sfree(fitsig);
}
if (s < nset-1)
{
- fprintf(out, "&\n");
+ fprintf(out, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
}
gmx_ffclose(out);
{
maxstat = max(maxstat, angstat[i]*norm_fac);
}
- fprintf(out, "@with g0\n");
- fprintf(out, "@ world xmin -180\n");
- fprintf(out, "@ world xmax 180\n");
- fprintf(out, "@ world ymin 0\n");
- fprintf(out, "@ world ymax %g\n", maxstat*1.05);
- fprintf(out, "@ xaxis tick major 60\n");
- fprintf(out, "@ xaxis tick minor 30\n");
- fprintf(out, "@ yaxis tick major 0.005\n");
- fprintf(out, "@ yaxis tick minor 0.0025\n");
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(out, "@with g0\n");
+ fprintf(out, "@ world xmin -180\n");
+ fprintf(out, "@ world xmax 180\n");
+ fprintf(out, "@ world ymin 0\n");
+ fprintf(out, "@ world ymax %g\n", maxstat*1.05);
+ fprintf(out, "@ xaxis tick major 60\n");
+ fprintf(out, "@ xaxis tick minor 30\n");
+ fprintf(out, "@ yaxis tick major 0.005\n");
+ fprintf(out, "@ yaxis tick minor 0.0025\n");
+ }
}
for (i = first; (i <= last); i++)
{
strcpy(hhisfile, hisfile);
strcat(hhisfile, ".xvg");
fp = xvgropen(hhisfile, title, "Degrees", "", oenv);
- fprintf(fp, "@ with g0\n");
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "@ with g0\n");
+ }
xvgr_world(fp, -180, 0, 180, 0.1, oenv);
- fprintf(fp, "# this effort to set graph size fails unless you run with -autoscale none or -autoscale y flags\n");
- fprintf(fp, "@ xaxis tick on\n");
- fprintf(fp, "@ xaxis tick major 90\n");
- fprintf(fp, "@ xaxis tick minor 30\n");
- fprintf(fp, "@ xaxis ticklabel prec 0\n");
- fprintf(fp, "@ yaxis tick off\n");
- fprintf(fp, "@ yaxis ticklabel off\n");
- fprintf(fp, "@ type xy\n");
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "# this effort to set graph size fails unless you run with -autoscale none or -autoscale y flags\n");
+ fprintf(fp, "@ xaxis tick on\n");
+ fprintf(fp, "@ xaxis tick major 90\n");
+ fprintf(fp, "@ xaxis tick minor 30\n");
+ fprintf(fp, "@ xaxis ticklabel prec 0\n");
+ fprintf(fp, "@ yaxis tick off\n");
+ fprintf(fp, "@ yaxis ticklabel off\n");
+ fprintf(fp, "@ type xy\n");
+ }
if (bSSHisto)
{
for (k = 0; (k < 3); k++)
}
}
}
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
gmx_ffclose(fp);
if (bSSHisto)
{
for (k = 0; (k < 3); k++)
{
- fprintf(ssfp[k], "&\n");
+ fprintf(ssfp[k], "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
gmx_ffclose(ssfp[k]);
}
}
FILE *fp;
fp = xvgropen(fn, title, xaxis, yaxis, oenv);
- fprintf(fp, "@ with g0\n");
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "@ with g0\n");
+ }
xvgr_world(fp, -180, -180, 180, 180, oenv);
- fprintf(fp, "@ xaxis tick on\n");
- fprintf(fp, "@ xaxis tick major 90\n");
- fprintf(fp, "@ xaxis tick minor 30\n");
- fprintf(fp, "@ xaxis ticklabel prec 0\n");
- fprintf(fp, "@ yaxis tick on\n");
- fprintf(fp, "@ yaxis tick major 90\n");
- fprintf(fp, "@ yaxis tick minor 30\n");
- fprintf(fp, "@ yaxis ticklabel prec 0\n");
- fprintf(fp, "@ s0 type xy\n");
- fprintf(fp, "@ s0 symbol 2\n");
- fprintf(fp, "@ s0 symbol size 0.410000\n");
- fprintf(fp, "@ s0 symbol fill 1\n");
- fprintf(fp, "@ s0 symbol color 1\n");
- fprintf(fp, "@ s0 symbol linewidth 1\n");
- fprintf(fp, "@ s0 symbol linestyle 1\n");
- fprintf(fp, "@ s0 symbol center false\n");
- fprintf(fp, "@ s0 symbol char 0\n");
- fprintf(fp, "@ s0 skip 0\n");
- fprintf(fp, "@ s0 linestyle 0\n");
- fprintf(fp, "@ s0 linewidth 1\n");
- fprintf(fp, "@ type xy\n");
-
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "@ xaxis tick on\n");
+ fprintf(fp, "@ xaxis tick major 90\n");
+ fprintf(fp, "@ xaxis tick minor 30\n");
+ fprintf(fp, "@ xaxis ticklabel prec 0\n");
+ fprintf(fp, "@ yaxis tick on\n");
+ fprintf(fp, "@ yaxis tick major 90\n");
+ fprintf(fp, "@ yaxis tick minor 30\n");
+ fprintf(fp, "@ yaxis ticklabel prec 0\n");
+ fprintf(fp, "@ s0 type xy\n");
+ fprintf(fp, "@ s0 symbol 2\n");
+ fprintf(fp, "@ s0 symbol size 0.410000\n");
+ fprintf(fp, "@ s0 symbol fill 1\n");
+ fprintf(fp, "@ s0 symbol color 1\n");
+ fprintf(fp, "@ s0 symbol linewidth 1\n");
+ fprintf(fp, "@ s0 symbol linestyle 1\n");
+ fprintf(fp, "@ s0 symbol center false\n");
+ fprintf(fp, "@ s0 symbol char 0\n");
+ fprintf(fp, "@ s0 skip 0\n");
+ fprintf(fp, "@ s0 linestyle 0\n");
+ fprintf(fp, "@ s0 linewidth 1\n");
+ fprintf(fp, "@ type xy\n");
+ }
return fp;
}
{
FILE *fp;
int nh[edMax];
- char buf[STRLEN];
int i, Dih, Xi;
real S2Max, S2Min;
x0 *= 10.0; /* nm -> angstrom */
y0 *= 10.0; /* nm -> angstrom */
z0 *= 10.0; /* nm -> angstrom */
- sprintf(buf, "%s%%6.f%%6.2f\n", get_pdbformat());
for (i = 0; (i < 10); i++)
{
- fprintf(fp, buf, "ATOM ", atoms->nr+1+i, "CA", "LEG", ' ',
- atoms->nres+1, ' ', x0, y0, z0+(1.2*i), 0.0, -0.1*i);
+ gmx_fprintf_pdb_atomline(fp, epdbATOM, atoms->nr+1+i, "CA", ' ', "LEG", ' ', atoms->nres+1, ' ',
+ x0, y0, z0+(1.2*i), 0.0, -0.1*i, "");
}
gmx_ffclose(fp);
}
if (clustidfn)
{
fp = xvgropen(clustidfn, "Clusters", output_env_get_xvgr_tlabel(oenv), "Cluster #", oenv);
- fprintf(fp, "@ s0 symbol 2\n");
- fprintf(fp, "@ s0 symbol size 0.2\n");
- fprintf(fp, "@ s0 linestyle 0\n");
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "@ s0 symbol 2\n");
+ fprintf(fp, "@ s0 symbol size 0.2\n");
+ fprintf(fp, "@ s0 linestyle 0\n");
+ }
for (i = 0; i < nf; i++)
{
fprintf(fp, "%8g %8d\n", time[i], clust->cl[i]);
if (sizefn)
{
fp = xvgropen(sizefn, "Cluster Sizes", "Cluster #", "# Structures", oenv);
- fprintf(fp, "@g%d type %s\n", 0, "bar");
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "@g%d type %s\n", 0, "bar");
+ }
}
snew(structure, nf);
fprintf(log, "\n%3s | %3s %4s | %6s %4s | cluster members\n",
return nr;
}
-void center_coords(t_atoms *atoms, matrix box, rvec x0[], int axis)
+void center_coords(t_atoms *atoms, atom_id *index_center, int ncenter,
+ matrix box, rvec x0[])
{
- int i, m;
+ int i, k, m;
real tmass, mm;
rvec com, shift, box_center;
tmass = 0;
clear_rvec(com);
- for (i = 0; (i < atoms->nr); i++)
+ for (k = 0; (k < ncenter); k++)
{
+ i = index_center[k];
+ if (i >= atoms->nr)
+ {
+ gmx_fatal(FARGS, "Index %d refers to atom %d, which is larger than natoms (%d).",
+ k+1, i+1, atoms->nr);
+ }
mm = atoms->atom[i].m;
tmass += mm;
for (m = 0; (m < DIM); m++)
}
calc_box_center(ecenterDEF, box, box_center);
rvec_sub(box_center, com, shift);
- shift[axis] -= box_center[axis];
+ /* Important - while the center was calculated based on a group, we should move all atoms */
for (i = 0; (i < atoms->nr); i++)
{
rvec_dec(x0[i], shift);
int ePBC,
int axis, int nr_grps, real *slWidth,
t_electron eltab[], int nr, gmx_bool bCenter,
- const output_env_t oenv)
+ atom_id *index_center, int ncenter,
+ gmx_bool bRelative, const output_env_t oenv)
{
rvec *x0; /* coordinates without pbc */
matrix box; /* box (3x3) */
slice; /* current slice */
t_electron *found; /* found by bsearch */
t_electron sought; /* thingie thought by bsearch */
+ real boxSz, aveBox;
gmx_rmpbc_t gpbc = NULL;
real t,
gmx_fatal(FARGS, "Could not read coordinates from statusfile\n");
}
+ aveBox = 0;
+
if (!*nslices)
{
*nslices = (int)(box[axis][axis] * 10); /* default value */
+ fprintf(stderr, "\nDividing the box in %d slices\n", *nslices);
}
- fprintf(stderr, "\nDividing the box in %d slices\n", *nslices);
snew(*slDensity, nr_grps);
for (i = 0; i < nr_grps; i++)
{
gmx_rmpbc(gpbc, natoms, box, x0);
+ /* Translate atoms so the com of the center-group is in the
+ * box geometrical center.
+ */
if (bCenter)
{
- center_coords(&top->atoms, box, x0, axis);
+ center_coords(&top->atoms, index_center, ncenter, box, x0);
}
- *slWidth = box[axis][axis]/(*nslices);
invvol = *nslices/(box[XX][XX]*box[YY][YY]*box[ZZ][ZZ]);
+ if (bRelative)
+ {
+ *slWidth = 1.0/(*nslices);
+ boxSz = 1.0;
+ }
+ else
+ {
+ *slWidth = box[axis][axis]/(*nslices);
+ boxSz = box[axis][axis];
+ }
+
+ aveBox += box[axis][axis];
+
for (n = 0; n < nr_grps; n++)
{
for (i = 0; i < gnx[n]; i++) /* loop over all atoms in index file */
z -= box[axis][axis];
}
+ if (bRelative)
+ {
+ z = z/box[axis][axis];
+ }
+
/* determine which slice atom is in */
- slice = (z / (*slWidth));
+ if (bCenter)
+ {
+ slice = floor( (z-(boxSz/2.0)) / (*slWidth) ) + *nslices/2;
+ }
+ else
+ {
+ slice = (z / (*slWidth));
+ }
sought.nr_el = 0;
sought.atomname = strdup(*(top->atoms.atomname[index[n][i]]));
fprintf(stderr, "\nRead %d frames from trajectory. Counting electrons\n",
nr_frames);
+ if (bRelative)
+ {
+ aveBox /= nr_frames;
+ *slWidth = aveBox/(*nslices);
+ }
+
for (n = 0; n < nr_grps; n++)
{
for (i = 0; i < *nslices; i++)
void calc_density(const char *fn, atom_id **index, int gnx[],
double ***slDensity, int *nslices, t_topology *top, int ePBC,
int axis, int nr_grps, real *slWidth, gmx_bool bCenter,
- const output_env_t oenv)
+ atom_id *index_center, int ncenter,
+ gmx_bool bRelative, const output_env_t oenv)
{
- rvec *x0; /* coordinates without pbc */
- matrix box; /* box (3x3) */
+ rvec *x0; /* coordinates without pbc */
+ matrix box; /* box (3x3) */
double invvol;
- int natoms; /* nr. atoms in trj */
+ int natoms; /* nr. atoms in trj */
t_trxstatus *status;
- int **slCount, /* nr. of atoms in one slice for a group */
- i, j, n, /* loop indices */
- teller = 0,
+ int **slCount, /* nr. of atoms in one slice for a group */
+ i, j, n, /* loop indices */
ax1 = 0, ax2 = 0,
nr_frames = 0, /* number of frames */
slice; /* current slice */
real t,
z;
+ real boxSz, aveBox;
char *buf; /* for tmp. keeping atomname */
gmx_rmpbc_t gpbc = NULL;
gmx_fatal(FARGS, "Could not read coordinates from statusfile\n");
}
+ aveBox = 0;
+
if (!*nslices)
{
*nslices = (int)(box[axis][axis] * 10); /* default value */
{
gmx_rmpbc(gpbc, natoms, box, x0);
+ /* Translate atoms so the com of the center-group is in the
+ * box geometrical center.
+ */
if (bCenter)
{
- center_coords(&top->atoms, box, x0, axis);
+ center_coords(&top->atoms, index_center, ncenter, box, x0);
}
- *slWidth = box[axis][axis]/(*nslices);
invvol = *nslices/(box[XX][XX]*box[YY][YY]*box[ZZ][ZZ]);
- teller++;
+
+ if (bRelative)
+ {
+ *slWidth = 1.0/(*nslices);
+ boxSz = 1.0;
+ }
+ else
+ {
+ *slWidth = box[axis][axis]/(*nslices);
+ boxSz = box[axis][axis];
+ }
+
+ aveBox += box[axis][axis];
for (n = 0; n < nr_grps; n++)
{
z -= box[axis][axis];
}
+ if (bRelative)
+ {
+ z = z/box[axis][axis];
+ }
+
/* determine which slice atom is in */
- slice = (int)(z / (*slWidth));
+ if (bCenter)
+ {
+ slice = floor( (z-(boxSz/2.0)) / (*slWidth) ) + *nslices/2;
+ }
+ else
+ {
+ slice = floor(z / (*slWidth));
+ }
+
+ /* Slice should already be 0<=slice<nslices, but we just make
+ * sure we are not hit by IEEE rounding errors since we do
+ * math operations after applying PBC above.
+ */
+ if (slice < 0)
+ {
+ slice += *nslices;
+ }
+ else if (slice >= *nslices)
+ {
+ slice -= *nslices;
+ }
+
(*slDensity)[n][slice] += top->atoms.atom[index[n][i]].m*invvol;
}
}
fprintf(stderr, "\nRead %d frames from trajectory. Calculating density\n",
nr_frames);
+ if (bRelative)
+ {
+ aveBox /= nr_frames;
+ *slWidth = aveBox/(*nslices);
+ }
+
for (n = 0; n < nr_grps; n++)
{
for (i = 0; i < *nslices; i++)
void plot_density(double *slDensity[], const char *afile, int nslices,
int nr_grps, char *grpname[], real slWidth,
const char **dens_opt,
- gmx_bool bSymmetrize, const output_env_t oenv)
+ gmx_bool bCenter, gmx_bool bRelative, gmx_bool bSymmetrize,
+ const output_env_t oenv)
{
FILE *den;
+ const char *title = NULL;
+ const char *xlabel = NULL;
const char *ylabel = NULL;
int slice, n;
real ddd;
+ real axispos;
+
+ title = bSymmetrize ? "Symmetrized partial density" : "Partial density";
+
+ if (bCenter)
+ {
+ xlabel = bRelative ?
+ "Average relative position from center (nm)" :
+ "Relative position from center (nm)";
+ }
+ else
+ {
+ xlabel = bRelative ? "Average coordinate (nm)" : "Coordinate (nm)";
+ }
switch (dens_opt[0][0])
{
case 'e': ylabel = "Electron density (e nm\\S-3\\N)"; break;
}
- den = xvgropen(afile, "Partial densities", "Box (nm)", ylabel, oenv);
+ den = xvgropen(afile,
+ title, xlabel, ylabel, oenv);
xvgr_legend(den, nr_grps, (const char**)grpname, oenv);
for (slice = 0; (slice < nslices); slice++)
{
- fprintf(den, "%12g ", slice * slWidth);
+ if (bCenter)
+ {
+ axispos = (slice - nslices/2.0 + 0.5) * slWidth;
+ }
+ else
+ {
+ axispos = (slice + 0.5) * slWidth;
+ }
+ fprintf(den, "%12g ", axispos);
for (n = 0; (n < nr_grps); n++)
{
if (bSymmetrize)
"[THISMODULE] computes partial densities across the box, using an index file.[PAR]",
"For the total density of NPT simulations, use [gmx-energy] instead.",
"[PAR]",
+
+ "Option [TT]-center[tt] performs the histogram binning relative to the center",
+ "of an arbitrary group, in absolute box coordinates. If you are calculating",
+ "profiles along the Z axis box dimension bZ, output would be from -bZ/2 to",
+ "bZ/2 if you center based on the entire system.",
+ "Note that this behaviour has changed in Gromacs 5.0; earlier versions",
+ "merely performed a static binning in (0,bZ) and shifted the output. Now",
+ "we compute the center for each frame and bin in (-bZ/2,bZ/2).[PAR]",
+
+ "Option [TT]-symm[tt] symmetrizes the output around the center. This will",
+ "automatically turn on [TT]-center[tt] too.",
+
+ "Option [TT]-relative[tt] performs the binning in relative instead of absolute",
+ "box coordinates, and scales the final output with the average box dimension",
+ "along the output axis. This can be used in combination with [TT]-center[tt].[PAR]",
+
"Densities are in kg/m^3, and number densities or electron densities can also be",
"calculated. For electron densities, a file describing the number of",
"electrons for each type of atom should be provided using [TT]-ei[tt].",
"The first line contains the number of lines to read from the file.",
"There should be one line for each unique atom name in your system.",
"The number of electrons for each atom is modified by its atomic",
- "partial charge."
+ "partial charge.[PAR]",
+
+ "IMPORTANT CONSIDERATIONS FOR BILAYERS[PAR]",
+ "One of the most common usage scenarios is to calculate the density of various",
+ "groups across a lipid bilayer, typically with the z axis being the normal",
+ "direction. For short simulations, small systems, and fixed box sizes this",
+ "will work fine, but for the more general case lipid bilayers can be complicated.",
+ "The first problem that while both proteins and lipids have low volume",
+ "compressibility, lipids have quite high area compressiblity. This means the",
+ "shape of the box (thickness and area/lipid) will fluctuate substantially even",
+ "for a fully relaxed system. Since Gromacs places the box between the origin",
+ "and positive coordinates, this in turn means that a bilayer centered in the",
+ "box will move a bit up/down due to these fluctuations, and smear out your",
+ "profile. The easiest way to fix this (if you want pressure coupling) is",
+ "to use the [TT]-center[tt] option that calculates the density profile with",
+ "respect to the center of the box. Note that you can still center on the",
+ "bilayer part even if you have a complex non-symmetric system with a bilayer",
+ "and, say, membrane proteins - then our output will simply have more values",
+ "on one side of the (center) origin reference.[PAR]",
+
+ "Even the centered calculation will lead to some smearing out the output",
+ "profiles, as lipids themselves are compressed and expanded. In most cases",
+ "you probably want this (since it corresponds to macroscopic experiments),",
+ "but if you want to look at molecular details you can use the [TT]-relative[tt]",
+ "option to attempt to remove even more of the effects of volume fluctuations.[PAR]",
+
+ "Finally, large bilayers that are not subject to a surface tension will exhibit",
+ "undulatory fluctuations, where there are 'waves' forming in the system.",
+ "This is a fundamental property of the biological system, and if you are",
+ "comparing against experiments you likely want to include the undulation",
+ "smearing effect.",
+ "",
};
output_env_t oenv;
static int ngrps = 1; /* nr. of groups */
static gmx_bool bSymmetrize = FALSE;
static gmx_bool bCenter = FALSE;
+ static gmx_bool bRelative = FALSE;
+
t_pargs pa[] = {
{ "-d", FALSE, etSTR, {&axtitle},
"Take the normal on the membrane in direction X, Y or Z." },
"Density"},
{ "-ng", FALSE, etINT, {&ngrps},
"Number of groups of which to compute densities." },
- { "-symm", FALSE, etBOOL, {&bSymmetrize},
+ { "-center", FALSE, etBOOL, {&bCenter},
+ "Perform the binning relative to the center of the (changing) box. Useful for bilayers." },
+ { "-symm", FALSE, etBOOL, {&bSymmetrize},
"Symmetrize the density along the axis, with respect to the center. Useful for bilayers." },
- { "-center", FALSE, etBOOL, {&bCenter},
- "Shift the center of mass along the axis to zero. This means if your axis is Z and your box is bX, bY, bZ, the center of mass will be at bX/2, bY/2, 0."}
+ { "-relative", FALSE, etBOOL, {&bRelative},
+ "Use relative coordinates for changing boxes and scale output by average dimensions." }
};
const char *bugs[] = {
"When calculating electron densities, atomnames are used instead of types. This is bad.",
};
- double **density; /* density per slice */
- real slWidth; /* width of one slice */
- char **grpname; /* groupnames */
- int nr_electrons; /* nr. electrons */
- int *ngx; /* sizes of groups */
- t_electron *el_tab; /* tabel with nr. of electrons*/
- t_topology *top; /* topology */
+ double **density; /* density per slice */
+ real slWidth; /* width of one slice */
+ char *grpname_center; /* centering group name */
+ char **grpname; /* groupnames */
+ int nr_electrons; /* nr. electrons */
+ int ncenter; /* size of centering group */
+ int *ngx; /* sizes of groups */
+ t_electron *el_tab; /* tabel with nr. of electrons*/
+ t_topology *top; /* topology */
int ePBC;
- atom_id **index; /* indices for all groups */
+ atom_id *index_center; /* index for centering group */
+ atom_id **index; /* indices for all groups */
int i;
t_filenm fnm[] = { /* files for g_density */
snew(index, ngrps);
snew(ngx, ngrps);
+ if (bCenter)
+ {
+ fprintf(stderr,
+ "\nNote: that the center of mass is calculated inside the box without applying\n"
+ "any special periodicity. If necessary, it is your responsibility to first use\n"
+ "trjconv to make sure atoms in this group are placed in the right periodicity.\n\n"
+ "Select the group to center density profiles around:\n");
+ get_index(&top->atoms, ftp2fn_null(efNDX, NFILE, fnm), 1, &ncenter,
+ &index_center, &grpname_center);
+ }
+ else
+ {
+ ncenter = 0;
+ }
+
+ fprintf(stderr, "\nSelect %d group%s to calculate density for:\n", ngrps, (ngrps > 1) ? "s" : "");
get_index(&top->atoms, ftp2fn_null(efNDX, NFILE, fnm), ngrps, ngx, index, grpname);
if (dens_opt[0][0] == 'e')
calc_electron_density(ftp2fn(efTRX, NFILE, fnm), index, ngx, &density,
&nslices, top, ePBC, axis, ngrps, &slWidth, el_tab,
- nr_electrons, bCenter, oenv);
+ nr_electrons, bCenter, index_center, ncenter,
+ bRelative, oenv);
}
else
{
calc_density(ftp2fn(efTRX, NFILE, fnm), index, ngx, &density, &nslices, top,
- ePBC, axis, ngrps, &slWidth, bCenter, oenv);
+ ePBC, axis, ngrps, &slWidth, bCenter, index_center, ncenter,
+ bRelative, oenv);
}
plot_density(density, opt2fn("-o", NFILE, fnm),
nslices, ngrps, grpname, slWidth, dens_opt,
- bSymmetrize, oenv);
+ bCenter, bRelative, bSymmetrize, oenv);
do_view(oenv, opt2fn("-o", NFILE, fnm), "-nxy"); /* view xvgr file */
return 0;
DD = pow(10.0, 0.125);
fp = xvgropen("fy.xvg", "Fig. 2, Lin2003a", "Delta", "y or fy", oenv);
xvgr_legend(fp, asize(leg), leg, oenv);
- fprintf(fp, "@ world 1e-05, 0, 1000, 1\n");
- fprintf(fp, "@ xaxes scale Logarithmic\n");
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "@ world 1e-05, 0, 1000, 1\n");
+ fprintf(fp, "@ xaxes scale Logarithmic\n");
+ }
for (Delta = 1e-5; (Delta <= 1000); Delta *= DD)
{
f = calc_fluidicity(Delta, toler);
for (i = 0; i < nat; i++)
{
- fprintf(out, get_pdbformat(), "ATOM", a0 + i, "C", "BOX", 'K' + i
- / NCUCVERT, r0 + i, 10 * vert[i][XX], 10 * vert[i][YY], 10
- * vert[i][ZZ]);
- fprintf(out, "\n");
+ gmx_fprintf_pdb_atomline(out, epdbATOM, a0 + i, "C", ' ', "BOX", 'K' + i / NCUCVERT, r0 + i, ' ',
+ 10*vert[i][XX], 10*vert[i][YY], 10*vert[i][ZZ], 1.0, 0.0, "");
}
edge = compact_unitcell_edges();
{
for (x = 0; x <= 1; x++)
{
- fprintf(out, get_pdbformat(), "ATOM", a0 + i, "C", "BOX", 'K' + i
- / 8, r0 + i, x * 10 * box[XX][XX],
- y * 10 * box[YY][YY], z * 10 * box[ZZ][ZZ]);
- fprintf(out, "\n");
+ gmx_fprintf_pdb_atomline(out, epdbATOM, a0 + i, "C", ' ', "BOX", 'K' + i/8, r0+i, ' ',
+ x * 10 * box[XX][XX], y * 10 * box[YY][YY], z * 10 * box[ZZ][ZZ], 1.0, 0.0, "");
i++;
}
}
out = gmx_ffopen(outfile, "w");
if (bMead)
{
- set_pdb_wide_format(TRUE);
fprintf(out, "REMARK "
"The B-factors in this file hold atomic radii\n");
fprintf(out, "REMARK "
oenv);
xvgr_legend(out, 0, NULL, oenv);
j = 0;
- for (m = 0; (m < egNR+egSP); m++)
+ if (output_env_get_print_xvgr_codes(oenv))
{
- if (egrp_use[m])
+ char str1[STRLEN], str2[STRLEN];
+ if (output_env_get_xvg_format(oenv) == exvgXMGR)
{
- fprintf(out, "@ legend string %d \"%s\"\n", j++, egrp_nm[m]);
+ sprintf(str1, "@ legend string ");
+ sprintf(str2, " ");
}
- }
- if (bFree)
- {
- fprintf(out, "@ legend string %d \"%s\"\n", j++, "Free");
- }
- if (bFree)
- {
- fprintf(out, "@ legend string %d \"%s\"\n", j++, "Diff");
- }
- fprintf(out, "@TYPE xy\n");
- fprintf(out, "#%3s", "grp");
- for (m = 0; (m < egNR+egSP); m++)
- {
- if (egrp_use[m])
+ else
{
- fprintf(out, " %9s", egrp_nm[m]);
+ sprintf(str1, "@ s");
+ sprintf(str2, " legend ");
}
+
+ for (m = 0; (m < egNR+egSP); m++)
+ {
+ if (egrp_use[m])
+ {
+ fprintf(out, "%s%d%s \"%s\"\n", str1, j++, str2, egrp_nm[m]);
+ }
+ }
+ if (bFree)
+ {
+ fprintf(out, "%s%d%s \"%s\"\n", str1, j++, str2, "Free");
+ }
+ if (bFree)
+ {
+ fprintf(out, "%s%d%s \"%s\"\n", str1, j++, str2, "Diff");
+ }
+ fprintf(out, "@TYPE xy\n");
+ fprintf(out, "#%3s", "grp");
+
+ for (m = 0; (m < egNR+egSP); m++)
+ {
+ if (egrp_use[m])
+ {
+ fprintf(out, " %9s", egrp_nm[m]);
+ }
+ }
+ if (bFree)
+ {
+ fprintf(out, " %9s", "Free");
+ }
+ if (bFree)
+ {
+ fprintf(out, " %9s", "Diff");
+ }
+ fprintf(out, "\n");
}
- if (bFree)
- {
- fprintf(out, " %9s", "Free");
- }
- if (bFree)
- {
- fprintf(out, " %9s", "Diff");
- }
- fprintf(out, "\n");
for (i = 0; (i < ngroups); i++)
{
fprintf(out, "%3.0f", groupnr[i]);
{
fort = xvgropen(opt2fn("-ort", NFILE, fnm), "Calculated orientations",
"Time (ps)", "", oenv);
- if (bOrinst)
+ if (bOrinst && output_env_get_print_xvgr_codes(oenv))
{
fprintf(fort, "%s", orinst_sub);
}
fodt = xvgropen(opt2fn("-odt", NFILE, fnm),
"Orientation restraint deviation",
"Time (ps)", "", oenv);
- if (bOrinst)
+ if (bOrinst && output_env_get_print_xvgr_codes(oenv))
{
fprintf(fodt, "%s", orinst_sub);
}
out = xvgropen(opt2fn("-ora", NFILE, fnm),
"Average calculated orientations",
"Restraint label", "", oenv);
- if (bOrinst)
+ if (bOrinst && output_env_get_print_xvgr_codes(oenv))
{
fprintf(out, "%s", orinst_sub);
}
out = xvgropen(opt2fn("-oda", NFILE, fnm),
"Average restraint deviation",
"Restraint label", "", oenv);
- if (bOrinst)
+ if (bOrinst && output_env_get_print_xvgr_codes(oenv))
{
fprintf(out, "%s", orinst_sub);
}
out = xvgropen(opt2fn("-odr", NFILE, fnm),
"RMS orientation restraint deviations",
"Restraint label", "", oenv);
- if (bOrinst)
+ if (bOrinst && output_env_get_print_xvgr_codes(oenv))
{
fprintf(out, "%s", orinst_sub);
}
hi = d+dd;
fprintf(out, "%5d %5d %1d %5d %10d %10g %10g %10g %10g\n",
ind_grp[i]+1, ind_grp[j]+1, 1, k, 1,
- lo, hi, hi+1, 1.0);
+ lo, hi, hi+disre_up2, 1.0);
}
}
}
if (bCalcN)
{
+ char **legend;
+
+ snew(legend, 5);
+ for (i = 0; i < 5; i++)
+ {
+ snew(legend[i], STRLEN);
+ }
tot_nmat(nres, natoms, nframes, totnmat, tot_n, mean_n);
fp = xvgropen(ftp2fn(efXVG, NFILE, fnm),
"Increase in number of contacts", "Residue", "Ratio", oenv);
- fprintf(fp, "@ legend on\n");
- fprintf(fp, "@ legend box on\n");
- fprintf(fp, "@ legend loctype view\n");
- fprintf(fp, "@ legend 0.75, 0.8\n");
- fprintf(fp, "@ legend string 0 \"Total/mean\"\n");
- fprintf(fp, "@ legend string 1 \"Total\"\n");
- fprintf(fp, "@ legend string 2 \"Mean\"\n");
- fprintf(fp, "@ legend string 3 \"# atoms\"\n");
- fprintf(fp, "@ legend string 4 \"Mean/# atoms\"\n");
- fprintf(fp, "#%3s %8s %3s %8s %3s %8s\n",
- "res", "ratio", "tot", "mean", "natm", "mean/atm");
+ sprintf(legend[0], "Total/mean");
+ sprintf(legend[1], "Total");
+ sprintf(legend[2], "Mean");
+ sprintf(legend[3], "# atoms");
+ sprintf(legend[4], "Mean/# atoms");
+ xvgr_legend(fp, 5, (const char**)legend, oenv);
for (i = 0; (i < nres); i++)
{
if (mean_n[i] == 0)
#include "gromacs/fileio/trxio.h"
#include "gromacs/pbcutil/rmpbc.h"
#include "gmx_ana.h"
+#include "names.h"
-static void periodic_dist(matrix box, rvec x[], int n, atom_id index[],
+static void periodic_dist(int ePBC,
+ matrix box, rvec x[], int n, atom_id index[],
real *rmin, real *rmax, int *min_ind)
{
-#define NSHIFT 26
- int sx, sy, sz, i, j, s;
+#define NSHIFT_MAX 26
+ int nsz, nshift, sx, sy, sz, i, j, s;
real sqr_box, r2min, r2max, r2;
- rvec shift[NSHIFT], d0, d;
+ rvec shift[NSHIFT_MAX], d0, d;
- sqr_box = sqr(min(norm(box[XX]), min(norm(box[YY]), norm(box[ZZ]))));
+ sqr_box = min(norm2(box[XX]), norm2(box[YY]));
+ if (ePBC == epbcXYZ)
+ {
+ sqr_box = min(sqr_box, norm2(box[ZZ]));
+ nsz = 1;
+ }
+ else if (ePBC == epbcXY)
+ {
+ nsz = 0;
+ }
+ else
+ {
+ gmx_fatal(FARGS, "pbc = %s is not supported by g_mindist",
+ epbc_names[ePBC]);
+ nsz = 0; /* Keep compilers quiet */
+ }
- s = 0;
- for (sz = -1; sz <= 1; sz++)
+ nshift = 0;
+ for (sz = -nsz; sz <= nsz; sz++)
{
for (sy = -1; sy <= 1; sy++)
{
{
for (i = 0; i < DIM; i++)
{
- shift[s][i] = sx*box[XX][i]+sy*box[YY][i]+sz*box[ZZ][i];
+ shift[nshift][i] =
+ sx*box[XX][i] + sy*box[YY][i] + sz*box[ZZ][i];
}
- s++;
+ nshift++;
}
}
}
{
r2max = r2;
}
- for (s = 0; s < NSHIFT; s++)
+ for (s = 0; s < nshift; s++)
{
rvec_add(d0, shift[s], d);
r2 = norm2(d);
gmx_rmpbc(gpbc, natoms, box, x);
}
- periodic_dist(box, x, n, index, &rmin, &rmax, ind_min);
+ periodic_dist(ePBC, box, x, n, index, &rmin, &rmax, ind_min);
if (rmin < rmint)
{
rmint = rmin;
}
if (bSplit && !bFirst && fabs(t/output_env_get_time_factor(oenv)) < 1e-5)
{
- fprintf(out, "&\n");
+ fprintf(out, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
fprintf(out, "\t%g\t%6.3f %6.3f %6.3f %6.3f %6.3f\n",
output_env_conv_time(oenv, t), rmin, rmax, norm(box[0]), norm(box[1]), norm(box[2]));
{
if (bSplit && !bFirst && fabs(t/output_env_get_time_factor(oenv)) < 1e-5)
{
- fprintf(dist, "&\n");
+ fprintf(dist, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
if (num)
{
- fprintf(num, "&\n");
+ fprintf(num, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
if (atm)
{
- fprintf(atm, "&\n");
+ fprintf(atm, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
}
fprintf(dist, "%12e", output_env_conv_time(oenv, t));
/* Handle printing of internal distances. */
if (outi)
{
- fprintf(outi, "@ xaxes scale Logarithmic\n");
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(outi, "@ xaxes scale Logarithmic\n");
+ }
ymax = -1;
ymin = 1e300;
j = index[molind[1]-1] - index[molind[0]]; /* Polymer length -1. */
#include "txtdump.h"
#include "gromacs/fileio/tpxio.h"
#include "gromacs/fileio/trxio.h"
+#include "gromacs/fileio/xvgr.h"
#include "gstat.h"
#include "gmx_ana.h"
matrix axes, box;
output_env_t oenv;
gmx_rmpbc_t gpbc = NULL;
+ char ** legend;
-
- t_filenm fnm[] = {
+ t_filenm fnm[] = {
{ efTRX, "-f", NULL, ffREAD },
{ efTPS, NULL, NULL, ffREAD },
{ efNDX, NULL, NULL, ffOPTRD },
- { efDAT, "-a1", "paxis1", ffWRITE },
- { efDAT, "-a2", "paxis2", ffWRITE },
- { efDAT, "-a3", "paxis3", ffWRITE },
- { efDAT, "-om", "moi", ffWRITE }
+ { efXVG, "-a1", "paxis1", ffWRITE },
+ { efXVG, "-a2", "paxis2", ffWRITE },
+ { efXVG, "-a3", "paxis3", ffWRITE },
+ { efXVG, "-om", "moi", ffWRITE }
};
#define NFILE asize(fnm)
return 0;
}
- axis1 = gmx_ffopen(opt2fn("-a1", NFILE, fnm), "w");
- axis2 = gmx_ffopen(opt2fn("-a2", NFILE, fnm), "w");
- axis3 = gmx_ffopen(opt2fn("-a3", NFILE, fnm), "w");
- fmoi = gmx_ffopen(opt2fn("-om", NFILE, fnm), "w");
+ snew(legend, DIM);
+ for (i = 0; i < DIM; i++)
+ {
+ snew(legend[i], STRLEN);
+ sprintf(legend[i], "%c component", 'X'+i);
+ }
+
+ axis1 = xvgropen(opt2fn("-a1", NFILE, fnm), "Principal axis 1 (major axis)",
+ output_env_get_xvgr_tlabel(oenv), "Component (nm)", oenv);
+ xvgr_legend(axis1, DIM, (const char **)legend, oenv);
+
+ axis2 = xvgropen(opt2fn("-a2", NFILE, fnm), "Principal axis 2 (middle axis)",
+ output_env_get_xvgr_tlabel(oenv), "Component (nm)", oenv);
+ xvgr_legend(axis2, DIM, (const char **)legend, oenv);
+
+ axis3 = xvgropen(opt2fn("-a3", NFILE, fnm), "Principal axis 3 (minor axis)",
+ output_env_get_xvgr_tlabel(oenv), "Component (nm)", oenv);
+ xvgr_legend(axis3, DIM, (const char **)legend, oenv);
+
+ sprintf(legend[XX], "Axis 1 (major)");
+ sprintf(legend[YY], "Axis 2 (middle)");
+ sprintf(legend[ZZ], "Axis 3 (minor)");
+
+ fmoi = xvgropen(opt2fn("-om", NFILE, fnm), "Moments of inertia around inertial axes",
+ output_env_get_xvgr_tlabel(oenv), "I (au nm\\S2\\N)", oenv);
+ xvgr_legend(fmoi, DIM, (const char **)legend, oenv);
+
+ for (i = 0; i < DIM; i++)
+ {
+ sfree(legend[i]);
+ }
+ sfree(legend);
read_tps_conf(ftp2fn(efTPS, NFILE, fnm), title, &top, &ePBC, NULL, NULL, box, TRUE);
gmx_rmpbc_done(gpbc);
-
close_trj(status);
- gmx_ffclose(axis1);
- gmx_ffclose(axis2);
- gmx_ffclose(axis3);
- gmx_ffclose(fmoi);
+
+ xvgrclose(axis1);
+ xvgrclose(axis2);
+ xvgrclose(axis3);
+ xvgrclose(fmoi);
return 0;
}
xvgr_line_props(out, 0, elNone, ecFrank, oenv);
xvgr_view(out, 0.2, 0.2, 0.8, 0.8, oenv);
xvgr_world(out, -180, -180, 180, 180, oenv);
- fprintf(out, "@ xaxis tick on\n@ xaxis tick major 60\n@ xaxis tick minor 30\n");
- fprintf(out, "@ yaxis tick on\n@ yaxis tick major 60\n@ yaxis tick minor 30\n");
- fprintf(out, "@ s0 symbol 2\n@ s0 symbol size 0.4\n@ s0 symbol fill 1\n");
-
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(out, "@ xaxis tick on\n@ xaxis tick major 60\n@ xaxis tick minor 30\n");
+ fprintf(out, "@ yaxis tick on\n@ yaxis tick major 60\n@ yaxis tick minor 30\n");
+ fprintf(out, "@ s0 symbol 2\n@ s0 symbol size 0.4\n@ s0 symbol fill 1\n");
+ }
j = 0;
do
{
bPrev = (prev > 0);
if (bPrev)
{
+ fprintf(stderr, "WARNING: using option -prev with large trajectories will\n"
+ " require a lot of memory and could lead to crashes\n");
prev = abs(prev);
if (freq != 1)
{
if (bSplit && i > 0 &&
fabs(time[bPrev ? freq*i : i]/output_env_get_time_factor(oenv)) < 1e-5)
{
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
fprintf(fp, "%12.7f", time[bPrev ? freq*i : i]);
for (j = 0; (j < nrms); j++)
{
if (bSplit && i > 0 && fabs(time[i]) < 1e-5)
{
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
fprintf(fp, "%12.7f", time[i]);
for (j = 0; (j < nrms); j++)
tcafc[kc][i] /= tcafc[kc][0];
fprintf(fp_cub, "%g %g\n", i*dt, tcafc[kc][i]);
}
- fprintf(fp_cub, "&\n");
+ fprintf(fp_cub, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
tcafc[kc][0] = 1.0;
}
}
fp_vk = xvgropen(fn_vk, "Fits", "k (nm\\S-1\\N)",
"\\8h\\4 (10\\S-3\\N kg m\\S-1\\N s\\S-1\\N)", oenv);
- fprintf(fp_vk, "@ s0 symbol 2\n");
- fprintf(fp_vk, "@ s0 symbol color 1\n");
- fprintf(fp_vk, "@ s0 linestyle 0\n");
- if (fn_cub)
+ if (output_env_get_print_xvgr_codes(oenv))
{
- fprintf(fp_vk, "@ s1 symbol 3\n");
- fprintf(fp_vk, "@ s1 symbol color 2\n");
+ fprintf(fp_vk, "@ s0 symbol 2\n");
+ fprintf(fp_vk, "@ s0 symbol color 1\n");
+ fprintf(fp_vk, "@ s0 linestyle 0\n");
+ if (fn_cub)
+ {
+ fprintf(fp_vk, "@ s1 symbol 3\n");
+ fprintf(fp_vk, "@ s1 symbol color 2\n");
+ }
}
fp = xvgropen(fn_tcf, "TCAF Fits", "Time (ps)", "", oenv);
for (k = 0; k < nk; k++)
{
fprintf(fp, "%g %g\n", i*dt, fit_function(effnVAC, fitparms, i*dt));
}
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
gmx_ffclose(fp);
do_view(oenv, fn_tcf, "-nxy");
if (fn_cub)
{
fprintf(stdout, "Averaged over k-vectors:\n");
- fprintf(fp_vk, "&\n");
+ fprintf(fp_vk, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
for (k = 0; k < nkc; k++)
{
tcafc[k][0] = 1.0;
{
fprintf(fp_cub, "%g %g\n", i*dt, fit_function(effnVAC, fitparms, i*dt));
}
- fprintf(fp_cub, "&\n");
+ fprintf(fp_cub, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
}
- fprintf(fp_vk, "&\n");
+ fprintf(fp_vk, "%s\n", output_env_get_print_xvgr_codes(oenv) ? "&" : "");
gmx_ffclose(fp_cub);
do_view(oenv, fn_cub, "-nxy");
}
read_first_frame(oenv, &status, ftp2fn(efTRX, NFILE, fnm), &fr, flags);
+
+ if ((bOV || bOF) && fn2ftp(ftp2fn(efTRX, NFILE, fnm)) == efXTC)
+ {
+ gmx_fatal(FARGS, "Cannot extract velocities or forces since your input XTC file does not contain them.");
+ }
+
if (bCV || bCF)
{
snew(sumx, fr.natoms);
/* Make atoms struct for output in GRO or PDB files */
if ((ftp == efGRO) || ((ftp == efG96) && bTPS) || (ftp == efPDB))
{
- /* get memory for stuff to go in .pdb file */
- init_t_atoms(&useatoms, atoms->nr, FALSE);
+ /* get memory for stuff to go in .pdb file, and initialize
+ * the pdbinfo structure part if the input has it.
+ */
+ init_t_atoms(&useatoms, atoms->nr, (atoms->pdbinfo != NULL));
sfree(useatoms.resinfo);
useatoms.resinfo = atoms->resinfo;
for (i = 0; (i < nout); i++)
{
useatoms.atomname[i] = atoms->atomname[index[i]];
useatoms.atom[i] = atoms->atom[index[i]];
+ if (atoms->pdbinfo != NULL)
+ {
+ useatoms.pdbinfo[i] = atoms->pdbinfo[index[i]];
+ }
useatoms.nres = max(useatoms.nres, useatoms.atom[i].resind+1);
}
useatoms.nr = nout;
if (orfile)
{
fp = xvgropen(orfile, "Van Hove function", "r (nm)", "G (nm\\S-1\\N)", oenv);
- fprintf(fp, "@ subtitle \"for particles in group %s\"\n", grpname);
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "@ subtitle \"for particles in group %s\"\n", grpname);
+ }
snew(legend, nr);
for (fbin = 0; fbin < nr; fbin++)
{
{
sprintf(buf, "Probability of moving less than %g nm", rint);
fp = xvgropen(otfile, buf, "t (ps)", "", oenv);
- fprintf(fp, "@ subtitle \"for particles in group %s\"\n", grpname);
+ if (output_env_get_print_xvgr_codes(oenv))
+ {
+ fprintf(fp, "@ subtitle \"for particles in group %s\"\n", grpname);
+ }
for (f = 0; f <= ftmax; f++)
{
fprintf(fp, "%g %g\n", f*dt, (real)pt[f]/(tcount[f]*isize));
bsProfiles_av2[i] += tmp*tmp;
fprintf(fp, "%e\t%e\n", (i+0.5)*opt->dz+opt->min, tmp);
}
- fprintf(fp, "&\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(opt->oenv) ? "&" : "");
}
gmx_ffclose(fp);
/* write average and stddev */
fp = xvgropen(fnres, "Average and stddev from bootstrapping", "z", ylabel, opt->oenv);
- fprintf(fp, "@TYPE xydy\n");
+ if (output_env_get_print_xvgr_codes(opt->oenv))
+ {
+ fprintf(fp, "@TYPE xydy\n");
+ }
for (i = 0; i < opt->bins; i++)
{
bsProfiles_av [i] /= opt->nBootStrap;
{
fprintf(fpcorr, "%g %g\n", k*dt, corr[k]);
}
- fprintf(fpcorr, "&\n");
+ fprintf(fpcorr, "%s\n", output_env_get_print_xvgr_codes(opt->oenv) ? "&" : "");
}
/* esimate integrated correlation time, fitting is too unstable */
/* plot IACT along reaction coordinate */
fp = xvgropen(fn, "Integrated autocorrelation times", "z", "IACT [ps]", opt->oenv);
- fprintf(fp, "@ s0 symbol 1\n@ s0 symbol size 0.5\n@ s0 line linestyle 0\n");
- fprintf(fp, "# WIN tau(gr1) tau(gr2) ...\n");
- for (i = 0; i < nwins; i++)
+ if (output_env_get_print_xvgr_codes(opt->oenv))
{
- fprintf(fp, "# %3d ", i);
- for (ig = 0; ig < window[i].nPull; ig++)
+ fprintf(fp, "@ s0 symbol 1\n@ s0 symbol size 0.5\n@ s0 line linestyle 0\n");
+ fprintf(fp, "# WIN tau(gr1) tau(gr2) ...\n");
+ for (i = 0; i < nwins; i++)
{
- fprintf(fp, " %11g", window[i].tau[ig]);
+ fprintf(fp, "# %3d ", i);
+ for (ig = 0; ig < window[i].nPull; ig++)
+ {
+ fprintf(fp, " %11g", window[i].tau[ig]);
+ }
+ fprintf(fp, "\n");
}
- fprintf(fp, "\n");
}
for (i = 0; i < nwins; i++)
{
opt->sigSmoothIact);
/* smooth IACT along reaction coordinate and overwrite g=1+2tau */
smoothIact(window, nwins, opt);
- fprintf(fp, "&\n@ s1 symbol 1\n@ s1 symbol size 0.5\n@ s1 line linestyle 0\n");
- fprintf(fp, "@ s1 symbol color 2\n");
+ fprintf(fp, "%s\n", output_env_get_print_xvgr_codes(opt->oenv) ? "&" : "");
+ if (output_env_get_print_xvgr_codes(opt->oenv))
+ {
+ fprintf(fp, "@ s1 symbol 1\n@ s1 symbol size 0.5\n@ s1 line linestyle 0\n");
+ fprintf(fp, "@ s1 symbol color 2\n");
+ }
for (i = 0; i < nwins; i++)
{
for (ig = 0; ig < window[i].nPull; ig++)
* a shell connected to a dummy with spring constant that differ in the
* three spatial dimensions in the molecular frame.
*/
- int i, m, aO, aH1, aH2, aD, aS, type, type0;
+ int i, m, aO, aH1, aH2, aD, aS, type, type0, ki;
+ ivec dt;
rvec dOH1, dOH2, dHH, dOD, dDS, nW, kk, dx, kdx, proj;
#ifdef DEBUG
rvec df;
aS = forceatoms[i+5];
/* Compute vectors describing the water frame */
- rvec_sub(x[aH1], x[aO], dOH1);
- rvec_sub(x[aH2], x[aO], dOH2);
- rvec_sub(x[aH2], x[aH1], dHH);
- rvec_sub(x[aD], x[aO], dOD);
- rvec_sub(x[aS], x[aD], dDS);
+ pbc_rvec_sub(pbc, x[aH1], x[aO], dOH1);
+ pbc_rvec_sub(pbc, x[aH2], x[aO], dOH2);
+ pbc_rvec_sub(pbc, x[aH2], x[aH1], dHH);
+ pbc_rvec_sub(pbc, x[aD], x[aO], dOD);
+ ki = pbc_rvec_sub(pbc, x[aS], x[aD], dDS);
cprod(dOH1, dOH2, nW);
/* Compute inverse length of normal vector
kdx[YY] = kk[YY]*dx[YY];
kdx[ZZ] = kk[ZZ]*dx[ZZ];
vtot += iprod(dx, kdx);
+
+ if (g)
+ {
+ ivec_sub(SHIFT_IVEC(g, aS), SHIFT_IVEC(g, aD), dt);
+ ki = IVEC2IS(dt);
+ }
+
for (m = 0; (m < DIM); m++)
{
/* This is a tensor operation but written out for speed */
#ifdef DEBUG
df[m] = fij;
#endif
- f[aS][m] += fij;
- f[aD][m] -= fij;
+ f[aS][m] += fij;
+ f[aD][m] -= fij;
+ fshift[ki][m] += fij;
+ fshift[CENTRAL][m] -= fij;
}
#ifdef DEBUG
if (debug)
vtot += 0.5*kk*dx[m]*dx[m];
*dvdlambda +=
0.5*(pr->posres.fcB[m] - pr->posres.fcA[m])*dx[m]*dx[m]
- -fm*dpdl[m];
+ + fm*dpdl[m];
/* Here we correct for the pbc_dx which included rdist */
if (bForceValid)
ivec dd_nc, ivec dd_nc_f)
{
int npp;
- gmx_bool mm;
-
- mm = FALSE;
+ gmx_bool mm = FALSE;
+ gmx_bool patchlevel_differs = FALSE;
+ gmx_bool version_differs = FALSE;
check_string(fplog, "Version", gmx_version(), version, &mm);
+ patchlevel_differs = mm;
+
+ if (patchlevel_differs)
+ {
+ /* Gromacs should be able to continue from checkpoints between
+ * different patch level versions, but we do not guarantee
+ * compatibility between different major/minor versions - check this.
+ */
+ int gmx_major, gmx_minor;
+ int cpt_major, cpt_minor;
+ sscanf(gmx_version(), "VERSION %5d.%5d", &gmx_major, &gmx_minor);
+ sscanf(version, "VERSION %5d.%5d", &cpt_major, &cpt_minor);
+ version_differs = (gmx_major != cpt_major || gmx_minor != cpt_minor);
+ }
+
check_string(fplog, "Build time", BUILD_TIME, btime, &mm);
check_string(fplog, "Build user", BUILD_USER, buser, &mm);
check_string(fplog, "Build host", BUILD_HOST, bhost, &mm);
if (mm)
{
- fprintf(stderr,
- "Gromacs binary or parallel settings not identical to previous run.\n"
- "Continuation is exact, but is not guaranteed to be binary identical%s.\n\n",
- fplog ? ",\n see the log file for details" : "");
+ const char msg_version_difference[] =
+ "The current Gromacs major & minor version are not identical to those that\n"
+ "generated the checkpoint file. In principle Gromacs does not support\n"
+ "continuation from checkpoints between different versions, so we advise\n"
+ "against this. If you still want to try your luck we recommend that you use\n"
+ "the -noappend flag to keep your output files from the two versions separate.\n"
+ "This might also work around errors where the output fields in the energy\n"
+ "file have changed between the different major & minor versions.\n";
- if (fplog)
+ const char msg_mismatch_notice[] =
+ "Gromacs patchlevel, binary or parallel settings differ from previous run.\n"
+ "Continuation is exact, but not guaranteed to be binary identical.\n";
+
+ const char msg_logdetails[] =
+ "See the log file for details.\n";
+
+ if (version_differs)
{
- fprintf(fplog,
- "Gromacs binary or parallel settings not identical to previous run.\n"
- "Continuation is exact, but is not guaranteed to be binary identical.\n\n");
+ fprintf(stderr, "%s%s\n", msg_version_difference, fplog ? msg_logdetails : "");
+
+ if (fplog)
+ {
+ fprintf(fplog, "%s\n", msg_version_difference);
+ }
+ }
+ else
+ {
+ /* Major & minor versions match at least, but something is different. */
+ fprintf(stderr, "%s%s\n", msg_mismatch_notice, fplog ? msg_logdetails : "");
+ if (fplog)
+ {
+ fprintf(fplog, "%s\n", msg_mismatch_notice);
+ }
}
}
}
}
fprintf(stderr, "\n");
- gmx_fatal(FARGS, "File appending requested, but only %d of the %d output files are present", nexist, nfiles);
+ gmx_fatal(FARGS, "File appending requested, but %d of the %d output files are not present or are named differently", nfiles-nexist, nfiles);
}
}
real Vvdw6, Vvdw12, vvtot;
real ix, iy, iz, fix, fiy, fiz;
real dx, dy, dz, rsq, rinv;
- real c6[NSTATES], c12[NSTATES], c6grid[NSTATES];
+ real c6[NSTATES], c12[NSTATES], c6grid;
real LFC[NSTATES], LFV[NSTATES], DLF[NSTATES];
double dvdl_coul, dvdl_vdw;
real lfac_coul[NSTATES], dlfac_coul[NSTATES], lfac_vdw[NSTATES], dlfac_vdw[NSTATES];
real * Vv;
real * Vc;
gmx_bool bDoForces, bDoShiftForces, bDoPotential;
- real rcoulomb, sh_ewald;
- real rvdw, sh_invrc6;
- gmx_bool bExactElecCutoff, bExactVdwCutoff, bExactCutoffAll, bEwald;
+ real rcoulomb, rvdw, sh_invrc6;
+ gmx_bool bExactElecCutoff, bExactVdwCutoff, bExactCutoffAll;
+ gmx_bool bEwald, bEwaldLJ;
real rcutoff_max2;
- real rcutoff, rcutoff2, rswitch, d, d2, swV3, swV4, swV5, swF2, swF3, swF4, sw, dsw, rinvcorr;
- const real * tab_ewald_F;
- const real * tab_ewald_V;
const real * tab_ewald_F_lj;
const real * tab_ewald_V_lj;
- real tab_ewald_scale, tab_ewald_halfsp;
+ real d, d2, sw, dsw, rinvcorr;
+ real elec_swV3, elec_swV4, elec_swV5, elec_swF2, elec_swF3, elec_swF4;
+ real vdw_swV3, vdw_swV4, vdw_swV5, vdw_swF2, vdw_swF3, vdw_swF4;
+ gmx_bool bConvertEwaldToCoulomb, bConvertLJEwaldToLJ6;
+ gmx_bool bComputeVdwInteraction, bComputeElecInteraction;
+ const real * ewtab;
+ int ewitab;
+ real ewrt, eweps, ewtabscale, ewtabhalfspace, sh_ewald;
+
+ sh_ewald = fr->ic->sh_ewald;
+ ewtab = fr->ic->tabq_coul_FDV0;
+ ewtabscale = fr->ic->tabq_scale;
+ ewtabhalfspace = 0.5/ewtabscale;
+ tab_ewald_F_lj = fr->ic->tabq_vdw_F;
+ tab_ewald_V_lj = fr->ic->tabq_vdw_V;
x = xx[0];
f = ff[0];
bDoPotential = kernel_data->flags & GMX_NONBONDED_DO_POTENTIAL;
rcoulomb = fr->rcoulomb;
- sh_ewald = fr->ic->sh_ewald;
rvdw = fr->rvdw;
sh_invrc6 = fr->ic->sh_invrc6;
- /* Ewald (PME) reciprocal force and energy quadratic spline tables */
- tab_ewald_F = fr->ic->tabq_coul_F;
- tab_ewald_V = fr->ic->tabq_coul_V;
- tab_ewald_scale = fr->ic->tabq_scale;
- tab_ewald_F_lj = fr->ic->tabq_vdw_F;
- tab_ewald_V_lj = fr->ic->tabq_vdw_V;
- tab_ewald_halfsp = 0.5/tab_ewald_scale;
+ if (fr->coulomb_modifier == eintmodPOTSWITCH)
+ {
+ d = fr->rcoulomb-fr->rcoulomb_switch;
+ elec_swV3 = -10.0/(d*d*d);
+ elec_swV4 = 15.0/(d*d*d*d);
+ elec_swV5 = -6.0/(d*d*d*d*d);
+ elec_swF2 = -30.0/(d*d*d);
+ elec_swF3 = 60.0/(d*d*d*d);
+ elec_swF4 = -30.0/(d*d*d*d*d);
+ }
+ else
+ {
+ /* Avoid warnings from stupid compilers (looking at you, Clang!) */
+ elec_swV3 = elec_swV4 = elec_swV5 = elec_swF2 = elec_swF3 = elec_swF4 = 0.0;
+ }
- if (fr->coulomb_modifier == eintmodPOTSWITCH || fr->vdw_modifier == eintmodPOTSWITCH)
+ if (fr->vdw_modifier == eintmodPOTSWITCH)
{
- rcutoff = (fr->coulomb_modifier == eintmodPOTSWITCH) ? fr->rcoulomb : fr->rvdw;
- rcutoff2 = rcutoff*rcutoff;
- rswitch = (fr->coulomb_modifier == eintmodPOTSWITCH) ? fr->rcoulomb_switch : fr->rvdw_switch;
- d = rcutoff-rswitch;
- swV3 = -10.0/(d*d*d);
- swV4 = 15.0/(d*d*d*d);
- swV5 = -6.0/(d*d*d*d*d);
- swF2 = -30.0/(d*d*d);
- swF3 = 60.0/(d*d*d*d);
- swF4 = -30.0/(d*d*d*d*d);
+ d = fr->rvdw-fr->rvdw_switch;
+ vdw_swV3 = -10.0/(d*d*d);
+ vdw_swV4 = 15.0/(d*d*d*d);
+ vdw_swV5 = -6.0/(d*d*d*d*d);
+ vdw_swF2 = -30.0/(d*d*d);
+ vdw_swF3 = 60.0/(d*d*d*d);
+ vdw_swF4 = -30.0/(d*d*d*d*d);
}
else
{
- /* Stupid compilers dont realize these variables will not be used */
- rswitch = 0.0;
- swV3 = 0.0;
- swV4 = 0.0;
- swV5 = 0.0;
- swF2 = 0.0;
- swF3 = 0.0;
- swF4 = 0.0;
+ /* Avoid warnings from stupid compilers (looking at you, Clang!) */
+ vdw_swV3 = vdw_swV4 = vdw_swV5 = vdw_swF2 = vdw_swF3 = vdw_swF4 = 0.0;
}
if (fr->cutoff_scheme == ecutsVERLET)
rcutoff_max2 = rcutoff_max2*rcutoff_max2;
bEwald = (icoul == GMX_NBKERNEL_ELEC_EWALD);
+ bEwaldLJ = (ivdw == GMX_NBKERNEL_VDW_LJEWALD);
+
+ /* For Ewald/PME interactions we cannot easily apply the soft-core component to
+ * reciprocal space. When we use vanilla (not switch/shift) Ewald interactions, we
+ * can apply the small trick of subtracting the _reciprocal_ space contribution
+ * in this kernel, and instead apply the free energy interaction to the 1/r
+ * (standard coulomb) interaction.
+ *
+ * However, we cannot use this approach for switch-modified since we would then
+ * effectively end up evaluating a significantly different interaction here compared to the
+ * normal (non-free-energy) kernels, either by applying a cutoff at a different
+ * position than what the user requested, or by switching different
+ * things (1/r rather than short-range Ewald). For these settings, we just
+ * use the traditional short-range Ewald interaction in that case.
+ */
+ bConvertEwaldToCoulomb = (bEwald && (fr->coulomb_modifier != eintmodPOTSWITCH));
+ /* For now the below will always be true (since LJ-PME only works with Shift in Gromacs-5.0),
+ * but writing it this way means we stay in sync with coulomb, and it avoids future bugs.
+ */
+ bConvertLJEwaldToLJ6 = (bEwaldLJ && (fr->vdw_modifier != eintmodPOTSWITCH));
/* fix compiler warnings */
nj1 = 0;
tj[STATE_A] = ntiA+2*typeA[jnr];
tj[STATE_B] = ntiB+2*typeB[jnr];
- if (ivdw == GMX_NBKERNEL_VDW_LJEWALD)
- {
- c6grid[STATE_A] = nbfp_grid[tj[STATE_A]];
- c6grid[STATE_B] = nbfp_grid[tj[STATE_B]];
- }
-
if (nlist->excl_fep == NULL || nlist->excl_fep[k])
{
c6[STATE_A] = nbfp[tj[STATE_A]];
n1V = tab_elemsize*n0;
}
- /* With Ewald and soft-core we should put the cut-off on r,
- * not on the soft-cored rC, as the real-space and
- * reciprocal space contributions should (almost) cancel.
+ /* Only process the coulomb interactions if we have charges,
+ * and if we either include all entries in the list (no cutoff
+ * used in the kernel), or if we are within the cutoff.
*/
- if (qq[i] != 0 &&
- !(bExactElecCutoff &&
- ((!bEwald && rC >= rcoulomb) ||
- (bEwald && r >= rcoulomb))))
+ bComputeElecInteraction = !bExactElecCutoff ||
+ ( bConvertEwaldToCoulomb && r < rcoulomb) ||
+ (!bConvertEwaldToCoulomb && rC < rcoulomb);
+
+ if ( (qq[i] != 0) && bComputeElecInteraction)
{
switch (icoul)
{
/* simple cutoff */
Vcoul[i] = qq[i]*rinvC;
FscalC[i] = Vcoul[i];
- break;
-
- case GMX_NBKERNEL_ELEC_EWALD:
- /* Ewald FEP is done only on the 1/r part */
- Vcoul[i] = qq[i]*(rinvC - sh_ewald);
- FscalC[i] = Vcoul[i];
+ /* The shift for the Coulomb potential is stored in
+ * the RF parameter c_rf, which is 0 without shift
+ */
+ Vcoul[i] -= qq[i]*fr->ic->c_rf;
break;
case GMX_NBKERNEL_ELEC_REACTIONFIELD:
gmx_fatal(FARGS, "Free energy and GB not implemented.\n");
break;
+ case GMX_NBKERNEL_ELEC_EWALD:
+ if (bConvertEwaldToCoulomb)
+ {
+ /* Ewald FEP is done only on the 1/r part */
+ Vcoul[i] = qq[i]*(rinvC-sh_ewald);
+ FscalC[i] = qq[i]*rinvC;
+ }
+ else
+ {
+ ewrt = rC*ewtabscale;
+ ewitab = (int) ewrt;
+ eweps = ewrt-ewitab;
+ ewitab = 4*ewitab;
+ FscalC[i] = ewtab[ewitab]+eweps*ewtab[ewitab+1];
+ rinvcorr = rinvC-sh_ewald;
+ Vcoul[i] = qq[i]*(rinvcorr-(ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+FscalC[i])));
+ FscalC[i] = qq[i]*(rinvC-rC*FscalC[i]);
+ }
+ break;
+
case GMX_NBKERNEL_ELEC_NONE:
FscalC[i] = 0.0;
Vcoul[i] = 0.0;
if (fr->coulomb_modifier == eintmodPOTSWITCH)
{
- d = rC-rswitch;
+ d = rC-fr->rcoulomb_switch;
d = (d > 0.0) ? d : 0.0;
d2 = d*d;
- sw = 1.0+d2*d*(swV3+d*(swV4+d*swV5));
- dsw = d2*(swF2+d*(swF3+d*swF4));
+ sw = 1.0+d2*d*(elec_swV3+d*(elec_swV4+d*elec_swV5));
+ dsw = d2*(elec_swF2+d*(elec_swF3+d*elec_swF4));
+
+ FscalC[i] = FscalC[i]*sw - rC*Vcoul[i]*dsw;
+ Vcoul[i] *= sw;
- Vcoul[i] *= sw;
- FscalC[i] = FscalC[i]*sw + Vcoul[i]*dsw;
+ FscalC[i] = (rC < rcoulomb) ? FscalC[i] : 0.0;
+ Vcoul[i] = (rC < rcoulomb) ? Vcoul[i] : 0.0;
}
}
- if ((c6[i] != 0 || c12[i] != 0) &&
- !(bExactVdwCutoff &&
- ((ivdw != GMX_NBKERNEL_VDW_LJEWALD && rV >= rvdw) ||
- (ivdw == GMX_NBKERNEL_VDW_LJEWALD && r >= rvdw))))
+ /* Only process the VDW interactions if we have
+ * some non-zero parameters, and if we either
+ * include all entries in the list (no cutoff used
+ * in the kernel), or if we are within the cutoff.
+ */
+ bComputeVdwInteraction = !bExactVdwCutoff ||
+ ( bConvertLJEwaldToLJ6 && r < rvdw) ||
+ (!bConvertLJEwaldToLJ6 && rV < rvdw);
+ if ((c6[i] != 0 || c12[i] != 0) && bComputeVdwInteraction)
{
switch (ivdw)
{
if (fr->vdw_modifier == eintmodPOTSWITCH)
{
- d = rV-rswitch;
- d = (d > 0.0) ? d : 0.0;
- d2 = d*d;
- sw = 1.0+d2*d*(swV3+d*(swV4+d*swV5));
- dsw = d2*(swF2+d*(swF3+d*swF4));
+ d = rV-fr->rvdw_switch;
+ d = (d > 0.0) ? d : 0.0;
+ d2 = d*d;
+ sw = 1.0+d2*d*(vdw_swV3+d*(vdw_swV4+d*vdw_swV5));
+ dsw = d2*(vdw_swF2+d*(vdw_swF3+d*vdw_swF4));
- Vvdw[i] *= sw;
- FscalV[i] = FscalV[i]*sw + Vvdw[i]*dsw;
+ FscalV[i] = FscalV[i]*sw - rV*Vvdw[i]*dsw;
+ Vvdw[i] *= sw;
FscalV[i] = (rV < rvdw) ? FscalV[i] : 0.0;
Vvdw[i] = (rV < rvdw) ? Vvdw[i] : 0.0;
}
}
- if (icoul == GMX_NBKERNEL_ELEC_EWALD &&
- !(bExactElecCutoff && r >= rcoulomb))
+ if (bConvertEwaldToCoulomb && ( !bExactElecCutoff || r < rcoulomb ) )
{
- /* Because we compute the soft-core normally,
- * we have to remove the Ewald short range portion.
- * Done outside of the states loop because this part
- * doesn't depend on the scaled R.
+ /* See comment in the preamble. When using Ewald interactions
+ * (unless we use a switch modifier) we subtract the reciprocal-space
+ * Ewald component here which made it possible to apply the free
+ * energy interaction to 1/r (vanilla coulomb short-range part)
+ * above. This gets us closer to the ideal case of applying
+ * the softcore to the entire electrostatic interaction,
+ * including the reciprocal-space component.
*/
- real rs, frac, f_lr;
- int ri;
+ real v_lr, f_lr;
- rs = rsq*rinv*tab_ewald_scale;
- ri = (int)rs;
- frac = rs - ri;
- f_lr = (1 - frac)*tab_ewald_F[ri] + frac*tab_ewald_F[ri+1];
- FF = f_lr*rinv;
- VV = tab_ewald_V[ri] - tab_ewald_halfsp*frac*(tab_ewald_F[ri] + f_lr);
+ ewrt = r*ewtabscale;
+ ewitab = (int) ewrt;
+ eweps = ewrt-ewitab;
+ ewitab = 4*ewitab;
+ f_lr = ewtab[ewitab]+eweps*ewtab[ewitab+1];
+ v_lr = (ewtab[ewitab+2]-ewtabhalfspace*eweps*(ewtab[ewitab]+f_lr));
+ f_lr *= rinv;
if (ii == jnr)
{
- VV *= 0.5;
+ /* If we get here, the i particle (ii) has itself (jnr)
+ * in its neighborlist. This can only happen with the Verlet
+ * scheme, and corresponds to a self-interaction that will
+ * occur twice. Scale it down by 50% to only include it once.
+ */
+ v_lr *= 0.5;
}
for (i = 0; i < NSTATES; i++)
{
- vctot -= LFC[i]*qq[i]*VV;
- Fscal -= LFC[i]*qq[i]*FF;
- dvdl_coul -= (DLF[i]*qq[i])*VV;
+ vctot -= LFC[i]*qq[i]*v_lr;
+ Fscal -= LFC[i]*qq[i]*f_lr;
+ dvdl_coul -= (DLF[i]*qq[i])*v_lr;
}
}
- if (ivdw == GMX_NBKERNEL_VDW_LJEWALD &&
- !(bExactVdwCutoff && r >= rvdw))
+ if (bConvertLJEwaldToLJ6 && (!bExactVdwCutoff || r < rvdw))
{
+ /* See comment in the preamble. When using LJ-Ewald interactions
+ * (unless we use a switch modifier) we subtract the reciprocal-space
+ * Ewald component here which made it possible to apply the free
+ * energy interaction to r^-6 (vanilla LJ6 short-range part)
+ * above. This gets us closer to the ideal case of applying
+ * the softcore to the entire VdW interaction,
+ * including the reciprocal-space component.
+ */
real rs, frac, f_lr;
int ri;
- rs = rsq*rinv*tab_ewald_scale;
+ rs = rsq*rinv*ewtabscale;
ri = (int)rs;
frac = rs - ri;
f_lr = (1 - frac)*tab_ewald_F_lj[ri] + frac*tab_ewald_F_lj[ri+1];
FF = f_lr*rinv;
- VV = tab_ewald_V_lj[ri] - tab_ewald_halfsp*frac*(tab_ewald_F_lj[ri] + f_lr);
+ VV = tab_ewald_V_lj[ri] - ewtabhalfspace*frac*(tab_ewald_F_lj[ri] + f_lr);
+
+ if (ii == jnr)
+ {
+ /* If we get here, the i particle (ii) has itself (jnr)
+ * in its neighborlist. This can only happen with the Verlet
+ * scheme, and corresponds to a self-interaction that will
+ * occur twice. Scale it down by 50% to only include it once.
+ */
+ VV *= 0.5;
+ }
+
for (i = 0; i < NSTATES; i++)
{
- vvtot += LFV[i]*c6grid[i]*VV*(1.0/6.0);
- Fscal += LFV[i]*c6grid[i]*FF*(1.0/6.0);
- dvdl_vdw += (DLF[i]*c6grid[i])*VV*(1.0/6.0);
+ c6grid = nbfp_grid[tj[i]];
+ vvtot += LFV[i]*c6grid*VV*(1.0/6.0);
+ Fscal += LFV[i]*c6grid*FF*(1.0/6.0);
+ dvdl_vdw += (DLF[i]*c6grid)*VV*(1.0/6.0);
}
}
fvdw = (vvdw_rep - vvdw_disp - c6grid*(1.0/6.0)*exponent*ewclj6)*rinvsq;
if (fr->vdw_modifier == eintmodPOTSHIFT)
{
- vvdw = (vvdw_rep + c12*sh_repulsion)/12.0 - (vvdw_disp + c6*sh_dispersion + c6grid*sh_lj_ewald)/6.0;
+ vvdw = (vvdw_rep + c12*sh_repulsion)/12.0 - (vvdw_disp + c6*sh_dispersion - c6grid*sh_lj_ewald)/6.0;
}
else
{
void
-gmx_nonbonded_set_kernel_pointers(FILE *log, t_nblist *nl)
+gmx_nonbonded_set_kernel_pointers(FILE *log, t_nblist *nl, gmx_bool bElecAndVdwSwitchDiffers)
{
const char * elec;
const char * elec_mod;
}
}
- /* Give up. If this was a water kernel, leave the pointer as NULL, which
- * will disable water optimization in NS. If it is a particle kernel, set
- * the pointer to the generic NB kernel.
+ /* For now, the accelerated kernels cannot handle the combination of switch functions for both
+ * electrostatics and VdW that use different switch radius or switch cutoff distances
+ * (both of them enter in the switch function calculation). This would require
+ * us to evaluate two completely separate switch functions for every interaction.
+ * Instead, we disable such kernels by setting the pointer to NULL.
+ * This will cause the generic kernel (which can handle it) to be called instead.
+ *
+ * Note that we typically already enable tabulated coulomb interactions for this case,
+ * so this is mostly a safe-guard to make sure we call the generic kernel if the
+ * tables are disabled.
+ */
+ if ((nl->ielec != GMX_NBKERNEL_ELEC_NONE) && (nl->ielecmod == eintmodPOTSWITCH) &&
+ (nl->ivdw != GMX_NBKERNEL_VDW_NONE) && (nl->ivdwmod == eintmodPOTSWITCH) &&
+ bElecAndVdwSwitchDiffers)
+ {
+ nl->kernelptr_vf = NULL;
+ nl->kernelptr_f = NULL;
+ }
+
+ /* Give up, pick a generic one instead.
+ * We only do this for particle-particle kernels; by leaving the water-optimized kernel
+ * pointers to NULL, the water optimization will automatically be disabled for this interaction.
*/
if (nl->kernelptr_vf == NULL && !gmx_strcasecmp_min(geom, "Particle-Particle"))
{
fprintf(debug,
"WARNING - Slow generic NB kernel used for neighborlist with\n"
" Elec: '%s', Modifier: '%s'\n"
- " Vdw: '%s', Modifier: '%s'\n"
- " Geom: '%s', Other: '%s'\n\n",
- elec, elec_mod, vdw, vdw_mod, geom, other);
+ " Vdw: '%s', Modifier: '%s'\n",
+ elec, elec_mod, vdw, vdw_mod);
}
}
}
-
return;
}
{
(*kernelptr)(&(nlist[i]), x, f, fr, mdatoms, &kernel_data, nrnb);
}
+ else
+ {
+ gmx_fatal(FARGS, "Non-empty neighborlist does not have any kernel pointer assigned.");
+ }
}
}
}
pr_ivec(fp, indent, "QMbasis", opts->QMbasis, opts->ngQM, FALSE);
pr_ivec(fp, indent, "QMcharge", opts->QMcharge, opts->ngQM, FALSE);
pr_ivec(fp, indent, "QMmult", opts->QMmult, opts->ngQM, FALSE);
- pr_bvec(fp, indent, "bSH", opts->bSH, opts->ngQM, FALSE);
+ pr_bvec(fp, indent, "SH", opts->bSH, opts->ngQM, FALSE);
pr_ivec(fp, indent, "CASorbitals", opts->CASorbitals, opts->ngQM, FALSE);
pr_ivec(fp, indent, "CASelectrons", opts->CASelectrons, opts->ngQM, FALSE);
pr_rvec(fp, indent, "SAon", opts->SAon, opts->ngQM, FALSE);
- pr_rvec(fp, indent, "SAon", opts->SAon, opts->ngQM, FALSE);
+ pr_rvec(fp, indent, "SAoff", opts->SAoff, opts->ngQM, FALSE);
pr_ivec(fp, indent, "SAsteps", opts->SAsteps, opts->ngQM, FALSE);
pr_bvec(fp, indent, "bOPT", opts->bOPT, opts->ngQM, FALSE);
pr_bvec(fp, indent, "bTS", opts->bTS, opts->ngQM, FALSE);
fprintf(out, "\n");
/* Pretty-print the simulated annealing info */
- fprintf(out, "anneal%s", bMDPformat ? " = " : ":");
+ fprintf(out, "annealing%s", bMDPformat ? " = " : ":");
for (i = 0; (i < opts->ngtc); i++)
{
fprintf(out, " %10s", EANNEAL(opts->annealing[i]));
}
fprintf(out, "\n");
- fprintf(out, "ann-npoints%s", bMDPformat ? " = " : ":");
+ fprintf(out, "annealing-npoints%s", bMDPformat ? " = " : ":");
for (i = 0; (i < opts->ngtc); i++)
{
fprintf(out, " %10d", opts->anneal_npoints[i]);
{
if (opts->anneal_npoints[i] > 0)
{
- fprintf(out, "ann. times [%d]:\t", i);
+ fprintf(out, "annealing-time [%d]:\t", i);
for (j = 0; (j < opts->anneal_npoints[i]); j++)
{
fprintf(out, " %10.1f", opts->anneal_time[i][j]);
}
fprintf(out, "\n");
- fprintf(out, "ann. temps [%d]:\t", i);
+ fprintf(out, "annealing-temp [%d]:\t", i);
for (j = 0; (j < opts->anneal_npoints[i]); j++)
{
fprintf(out, " %10.1f", opts->anneal_temp[i][j]);
static void pr_simtempvals(FILE *fp, int indent, t_simtemp *simtemp, int n_lambda)
{
- PR("simtemp_low", simtemp->simtemp_low);
- PR("simtemp_high", simtemp->simtemp_high);
PS("simulated-tempering-scaling", ESIMTEMP(simtemp->eSimTempScale));
+ PR("sim-temp-low", simtemp->simtemp_low);
+ PR("sim-temp-high", simtemp->simtemp_high);
pr_rvec(fp, indent, "simulated tempering temperatures", simtemp->temperatures, n_lambda, TRUE);
}
{
PI("nstexpanded", expand->nstexpanded);
- PS("lambda-stats", elamstats_names[expand->elamstats]);
- PS("lambda-mc-move", elmcmove_names[expand->elmcmove]);
- PI("lmc-repeats", expand->lmc_repeats);
- PI("lmc-gibbsdelta", expand->gibbsdeltalam);
- PI("lmc-nstart", expand->lmc_forced_nstart);
- PS("symmetrized-transition-matrix", EBOOL(expand->bSymmetrizedTMatrix));
- PI("nst-transition-matrix", expand->nstTij);
- PI("mininum-var-min", expand->minvarmin); /*default is reasonable */
- PI("weight-c-range", expand->c_range); /* default is just C=0 */
- PR("wl-scale", expand->wl_scale);
- PR("init-wl-delta", expand->init_wl_delta);
- PR("wl-ratio", expand->wl_ratio);
- PS("bWLoneovert", EBOOL(expand->bWLoneovert));
- PI("lmc-seed", expand->lmc_seed);
- PR("mc-temperature", expand->mc_temp);
+ PS("lmc-stats", elamstats_names[expand->elamstats]);
+ PS("lmc-move", elmcmove_names[expand->elmcmove]);
PS("lmc-weights-equil", elmceq_names[expand->elmceq]);
if (expand->elmceq == elmceqNUMATLAM)
{
{
PR("weight-equil-count-ratio", expand->equil_ratio);
}
+ PI("lmc-seed", expand->lmc_seed);
+ PR("mc-temperature", expand->mc_temp);
+ PI("lmc-repeats", expand->lmc_repeats);
+ PI("lmc-gibbsdelta", expand->gibbsdeltalam);
+ PI("lmc-forced-nstart", expand->lmc_forced_nstart);
+ PS("symmetrized-transition-matrix", EBOOL(expand->bSymmetrizedTMatrix));
+ PI("nst-transition-matrix", expand->nstTij);
+ PI("mininum-var-min", expand->minvarmin); /*default is reasonable */
+ PI("weight-c-range", expand->c_range); /* default is just C=0 */
+ PR("wl-scale", expand->wl_scale);
+ PR("wl-ratio", expand->wl_ratio);
+ PR("init-wl-delta", expand->init_wl_delta);
+ PS("wl-oneovert", EBOOL(expand->bWLoneovert));
pr_indent(fp, indent);
pr_rvec(fp, indent, "init-lambda-weights", expand->init_lambda_weights, n_lambda, TRUE);
{
int i, j;
- PI("nstdhdl", fep->nstdhdl);
- PI("init-lambda-state", fep->init_fep_state);
PR("init-lambda", fep->init_lambda);
+ PI("init-lambda-state", fep->init_fep_state);
PR("delta-lambda", fep->delta_lambda);
+ PI("nstdhdl", fep->nstdhdl);
+
if (!bMDPformat)
{
PI("n-lambdas", fep->n_lambda);
}
}
PI("calc-lambda-neighbors", fep->lambda_neighbors);
-
+ PS("dhdl-print-energy", EBOOL(fep->bPrintEnergy));
PR("sc-alpha", fep->sc_alpha);
- PS("bScCoul", EBOOL(fep->bScCoul));
- PS("bScPrintEnergy", EBOOL(fep->bPrintEnergy));
PI("sc-power", fep->sc_power);
PR("sc-r-power", fep->sc_r_power);
PR("sc-sigma", fep->sc_sigma);
PR("sc-sigma-min", fep->sc_sigma_min);
- PS("separate-dhdl-file", SEPDHDLFILETYPE(fep->separate_dhdl_file));
- PS("dhdl-derivatives", DHDLDERIVATIVESTYPE(fep->dhdl_derivatives));
+ PS("sc-coul", EBOOL(fep->bScCoul));
PI("dh-hist-size", fep->dh_hist_size);
PD("dh-hist-spacing", fep->dh_hist_spacing);
+ PS("separate-dhdl-file", SEPDHDLFILETYPE(fep->separate_dhdl_file));
+ PS("dhdl-derivatives", DHDLDERIVATIVESTYPE(fep->dhdl_derivatives));
};
static void pr_pull(FILE *fp, int indent, t_pull *pull)
PR("pull-r1", pull->cyl_r1);
PR("pull-r0", pull->cyl_r0);
PR("pull-constr-tol", pull->constr_tol);
- PS("pull-bPrintRef", EBOOL(pull->bPrintRef));
+ PS("pull-print-reference", EBOOL(pull->bPrintRef));
PI("pull-nstxout", pull->nstxout);
PI("pull-nstfout", pull->nstfout);
- PI("pull-ngroup", pull->ngroup);
+ PI("pull-ngroups", pull->ngroup);
for (g = 0; g < pull->ngroup; g++)
{
pr_pull_group(fp, indent, g, &pull->group[g]);
}
- PI("pull-ncoord", pull->ncoord);
+ PI("pull-ncoords", pull->ncoord);
for (g = 0; g < pull->ncoord; g++)
{
pr_pull_coord(fp, indent, g, &pull->coord[g]);
static void pr_rotgrp(FILE *fp, int indent, int g, t_rotgrp *rotg)
{
pr_indent(fp, indent);
- fprintf(fp, "rotation_group %d:\n", g);
+ fprintf(fp, "rot-group %d:\n", g);
indent += 2;
- PS("type", EROTGEOM(rotg->eType));
- PS("massw", EBOOL(rotg->bMassW));
+ PS("rot-type", EROTGEOM(rotg->eType));
+ PS("rot-massw", EBOOL(rotg->bMassW));
pr_ivec_block(fp, indent, "atom", rotg->ind, rotg->nat, TRUE);
- pr_rvecs(fp, indent, "x_ref", rotg->x_ref, rotg->nat);
- pr_rvec(fp, indent, "vec", rotg->vec, DIM, TRUE);
- pr_rvec(fp, indent, "pivot", rotg->pivot, DIM, TRUE);
- PR("rate", rotg->rate);
- PR("k", rotg->k);
- PR("slab_dist", rotg->slab_dist);
- PR("min_gaussian", rotg->min_gaussian);
- PR("epsilon", rotg->eps);
- PS("fit_method", EROTFIT(rotg->eFittype));
- PI("potfitangle_nstep", rotg->PotAngle_nstep);
- PR("potfitangle_step", rotg->PotAngle_step);
+ pr_rvecs(fp, indent, "x-ref", rotg->x_ref, rotg->nat);
+ pr_rvec(fp, indent, "rot-vec", rotg->vec, DIM, TRUE);
+ pr_rvec(fp, indent, "rot-pivot", rotg->pivot, DIM, TRUE);
+ PR("rot-rate", rotg->rate);
+ PR("rot-k", rotg->k);
+ PR("rot-slab-dist", rotg->slab_dist);
+ PR("rot-min-gauss", rotg->min_gaussian);
+ PR("rot-eps", rotg->eps);
+ PS("rot-fit-method", EROTFIT(rotg->eFittype));
+ PI("rot_potfit_nstep", rotg->PotAngle_nstep);
+ PR("rot_potfit_step", rotg->PotAngle_step);
}
static void pr_rot(FILE *fp, int indent, t_rot *rot)
{
int g;
- PI("rot_nstrout", rot->nstrout);
- PI("rot_nstsout", rot->nstsout);
- PI("rot_ngrp", rot->ngrp);
+ PI("rot-nstrout", rot->nstrout);
+ PI("rot-nstsout", rot->nstsout);
+ PI("rot-ngroups", rot->ngrp);
for (g = 0; g < rot->ngrp; g++)
{
pr_rotgrp(fp, indent, g, &rot->grp[g]);
char str[STRLEN];
- PI("frequency", swap->nstswap);
- for (j = 0; j < 2; j++)
- {
- sprintf(str, "nanions%c", j+'A');
- PI(str, swap->nanions[j]);
- sprintf(str, "ncations%c", j+'A');
- PI(str, swap->ncations[j]);
- }
- PI("coupling_steps", swap->nAverage);
- PR("threshold", swap->threshold);
+ PI("swap-frequency", swap->nstswap);
for (j = 0; j < 2; j++)
{
- sprintf(str, "splitgroup%d_massw", j);
+ sprintf(str, "massw_split%d", j);
PS(str, EBOOL(swap->massw_split[j]));
sprintf(str, "split atoms group %d", j);
pr_ivec_block(fp, indent, str, swap->ind_split[j], swap->nat_split[j], TRUE);
}
pr_ivec_block(fp, indent, "swap atoms", swap->ind, swap->nat, TRUE);
pr_ivec_block(fp, indent, "solvent atoms", swap->ind_sol, swap->nat_sol, TRUE);
- PR("cyl0_radius", swap->cyl0r);
- PR("cyl0_upper", swap->cyl0u);
- PR("cyl0_lower", swap->cyl0l);
- PR("cyl1_radius", swap->cyl1r);
- PR("cyl1_upper", swap->cyl1u);
- PR("cyl1_lower", swap->cyl1l);
+ PR("cyl0-r", swap->cyl0r);
+ PR("cyl0-up", swap->cyl0u);
+ PR("cyl0-down", swap->cyl0l);
+ PR("cyl1-r", swap->cyl1r);
+ PR("cyl1-up", swap->cyl1u);
+ PR("cyl1-down", swap->cyl1l);
+ PI("coupl-steps", swap->nAverage);
+ for (j = 0; j < 2; j++)
+ {
+ sprintf(str, "anions%c", j+'A');
+ PI(str, swap->nanions[j]);
+ sprintf(str, "cations%c", j+'A');
+ PI(str, swap->ncations[j]);
+ }
+ PR("threshold", swap->threshold);
}
static void pr_imd(FILE *fp, int indent, t_IMD *imd)
{
- PI("IMD_atoms", imd->nat);
+ PI("IMD-atoms", imd->nat);
pr_ivec_block(fp, indent, "atom", imd->ind, imd->nat, TRUE);
}
{
indent = pr_title(fp, indent, title);
}
- /* This strings do not all have a direct correspondence to
- .mdp entries, but we should follow the same convention of
- using hyphens in the names users read and write. */
+ /* Try to make this list appear in the same order as the
+ * options are written in the default mdout.mdp, and with
+ * the same user-exposed names to facilitate debugging.
+ */
PS("integrator", EI(ir->eI));
+ PR("tinit", ir->init_t);
+ PR("dt", ir->delta_t);
PSTEP("nsteps", ir->nsteps);
PSTEP("init-step", ir->init_step);
- PS("cutoff-scheme", ECUTSCHEME(ir->cutoff_scheme));
- PS("ns-type", ENS(ir->ns_type));
- PI("nstlist", ir->nstlist);
- PI("ndelta", ir->ndelta);
- PI("nstcomm", ir->nstcomm);
+ PI("simulation-part", ir->simulation_part);
PS("comm-mode", ECOM(ir->comm_mode));
- PI("nstlog", ir->nstlog);
+ PI("nstcomm", ir->nstcomm);
+
+ /* Langevin dynamics */
+ PR("bd-fric", ir->bd_fric);
+ PSTEP("ld-seed", ir->ld_seed);
+
+ /* Energy minimization */
+ PR("emtol", ir->em_tol);
+ PR("emstep", ir->em_stepsize);
+ PI("niter", ir->niter);
+ PR("fcstep", ir->fc_stepsize);
+ PI("nstcgsteep", ir->nstcgsteep);
+ PI("nbfgscorr", ir->nbfgscorr);
+
+ /* Test particle insertion */
+ PR("rtpi", ir->rtpi);
+
+ /* Output control */
PI("nstxout", ir->nstxout);
PI("nstvout", ir->nstvout);
PI("nstfout", ir->nstfout);
+ PI("nstlog", ir->nstlog);
PI("nstcalcenergy", ir->nstcalcenergy);
PI("nstenergy", ir->nstenergy);
PI("nstxout-compressed", ir->nstxout_compressed);
- PR("init-t", ir->init_t);
- PR("delta-t", ir->delta_t);
+ PR("compressed-x-precision", ir->x_compression_precision);
- PR("x-compression-precision", ir->x_compression_precision);
- PR("fourierspacing", ir->fourier_spacing);
- PI("nkx", ir->nkx);
- PI("nky", ir->nky);
- PI("nkz", ir->nkz);
- PI("pme-order", ir->pme_order);
- PR("ewald-rtol", ir->ewald_rtol);
- PR("ewald-rtol-lj", ir->ewald_rtol_lj);
- PR("ewald-geometry", ir->ewald_geometry);
- PR("epsilon-surface", ir->epsilon_surface);
- PS("optimize-fft", EBOOL(ir->bOptFFT));
- PS("lj-pme-comb-rule", ELJPMECOMBNAMES(ir->ljpme_combination_rule));
- PS("ePBC", EPBC(ir->ePBC));
- PS("bPeriodicMols", EBOOL(ir->bPeriodicMols));
- PS("bContinuation", EBOOL(ir->bContinuation));
- PS("bShakeSOR", EBOOL(ir->bShakeSOR));
- PS("etc", ETCOUPLTYPE(ir->etc));
- PS("bPrintNHChains", EBOOL(ir->bPrintNHChains));
- PI("nsttcouple", ir->nsttcouple);
- PS("epc", EPCOUPLTYPE(ir->epc));
- PS("epctype", EPCOUPLTYPETYPE(ir->epct));
- PI("nstpcouple", ir->nstpcouple);
- PR("tau-p", ir->tau_p);
- pr_matrix(fp, indent, "ref-p", ir->ref_p, bMDPformat);
- pr_matrix(fp, indent, "compress", ir->compress, bMDPformat);
- PS("refcoord-scaling", EREFSCALINGTYPE(ir->refcoord_scaling));
- if (bMDPformat)
- {
- fprintf(fp, "posres-com = %g %g %g\n", ir->posres_com[XX],
- ir->posres_com[YY], ir->posres_com[ZZ]);
- }
- else
- {
- pr_rvec(fp, indent, "posres-com", ir->posres_com, DIM, TRUE);
- }
- if (bMDPformat)
- {
- fprintf(fp, "posres-comB = %g %g %g\n", ir->posres_comB[XX],
- ir->posres_comB[YY], ir->posres_comB[ZZ]);
- }
- else
- {
- pr_rvec(fp, indent, "posres-comB", ir->posres_comB, DIM, TRUE);
- }
+ /* Neighborsearching parameters */
+ PS("cutoff-scheme", ECUTSCHEME(ir->cutoff_scheme));
+ PI("nstlist", ir->nstlist);
+ PS("ns-type", ENS(ir->ns_type));
+ PS("pbc", EPBC(ir->ePBC));
+ PS("periodic-molecules", EBOOL(ir->bPeriodicMols));
PR("verlet-buffer-tolerance", ir->verletbuf_tol);
PR("rlist", ir->rlist);
PR("rlistlong", ir->rlistlong);
PR("nstcalclr", ir->nstcalclr);
- PR("rtpi", ir->rtpi);
+
+ /* Options for electrostatics and VdW */
PS("coulombtype", EELTYPE(ir->coulombtype));
PS("coulomb-modifier", INTMODIFIER(ir->coulomb_modifier));
PR("rcoulomb-switch", ir->rcoulomb_switch);
PR("rcoulomb", ir->rcoulomb);
- PS("vdwtype", EVDWTYPE(ir->vdwtype));
- PS("vdw-modifier", INTMODIFIER(ir->vdw_modifier));
- PR("rvdw-switch", ir->rvdw_switch);
- PR("rvdw", ir->rvdw);
if (ir->epsilon_r != 0)
{
PR("epsilon-r", ir->epsilon_r);
{
PS("epsilon-rf", infbuf);
}
- PR("tabext", ir->tabext);
+ PS("vdw-type", EVDWTYPE(ir->vdwtype));
+ PS("vdw-modifier", INTMODIFIER(ir->vdw_modifier));
+ PR("rvdw-switch", ir->rvdw_switch);
+ PR("rvdw", ir->rvdw);
+ PS("DispCorr", EDISPCORR(ir->eDispCorr));
+ PR("table-extension", ir->tabext);
+
+ PR("fourierspacing", ir->fourier_spacing);
+ PI("fourier-nx", ir->nkx);
+ PI("fourier-ny", ir->nky);
+ PI("fourier-nz", ir->nkz);
+ PI("pme-order", ir->pme_order);
+ PR("ewald-rtol", ir->ewald_rtol);
+ PR("ewald-rtol-lj", ir->ewald_rtol_lj);
+ PS("lj-pme-comb-rule", ELJPMECOMBNAMES(ir->ljpme_combination_rule));
+ PR("ewald-geometry", ir->ewald_geometry);
+ PR("epsilon-surface", ir->epsilon_surface);
+
+ /* Implicit solvent */
PS("implicit-solvent", EIMPLICITSOL(ir->implicit_solvent));
+
+ /* Generalized born electrostatics */
PS("gb-algorithm", EGBALGORITHM(ir->gb_algorithm));
- PR("gb-epsilon-solvent", ir->gb_epsilon_solvent);
PI("nstgbradii", ir->nstgbradii);
PR("rgbradii", ir->rgbradii);
+ PR("gb-epsilon-solvent", ir->gb_epsilon_solvent);
PR("gb-saltconc", ir->gb_saltconc);
PR("gb-obc-alpha", ir->gb_obc_alpha);
PR("gb-obc-beta", ir->gb_obc_beta);
PR("gb-dielectric-offset", ir->gb_dielectric_offset);
PS("sa-algorithm", ESAALGORITHM(ir->gb_algorithm));
PR("sa-surface-tension", ir->sa_surface_tension);
- PS("DispCorr", EDISPCORR(ir->eDispCorr));
- PS("bSimTemp", EBOOL(ir->bSimTemp));
- if (ir->bSimTemp)
- {
- pr_simtempvals(fp, indent, ir->simtempvals, ir->fepvals->n_lambda);
- }
- PS("free-energy", EFEPTYPE(ir->efep));
- if (ir->efep != efepNO || ir->bSimTemp)
+
+ /* Options for weak coupling algorithms */
+ PS("tcoupl", ETCOUPLTYPE(ir->etc));
+ PI("nsttcouple", ir->nsttcouple);
+ PI("nh-chain-length", ir->opts.nhchainlength);
+ PS("print-nose-hoover-chain-variables", EBOOL(ir->bPrintNHChains));
+
+ PS("pcoupl", EPCOUPLTYPE(ir->epc));
+ PS("pcoupltype", EPCOUPLTYPETYPE(ir->epct));
+ PI("nstpcouple", ir->nstpcouple);
+ PR("tau-p", ir->tau_p);
+ pr_matrix(fp, indent, "compressibility", ir->compress, bMDPformat);
+ pr_matrix(fp, indent, "ref-p", ir->ref_p, bMDPformat);
+ PS("refcoord-scaling", EREFSCALINGTYPE(ir->refcoord_scaling));
+
+ if (bMDPformat)
{
- pr_fepvals(fp, indent, ir->fepvals, bMDPformat);
+ fprintf(fp, "posres-com = %g %g %g\n", ir->posres_com[XX],
+ ir->posres_com[YY], ir->posres_com[ZZ]);
+ fprintf(fp, "posres-comB = %g %g %g\n", ir->posres_comB[XX],
+ ir->posres_comB[YY], ir->posres_comB[ZZ]);
}
- if (ir->bExpanded)
+ else
{
- pr_expandedvals(fp, indent, ir->expandedvals, ir->fepvals->n_lambda);
+ pr_rvec(fp, indent, "posres-com", ir->posres_com, DIM, TRUE);
+ pr_rvec(fp, indent, "posres-comB", ir->posres_comB, DIM, TRUE);
}
+ /* QMMM */
+ PS("QMMM", EBOOL(ir->bQMMM));
+ PI("QMconstraints", ir->QMconstraints);
+ PI("QMMMscheme", ir->QMMMscheme);
+ PR("MMChargeScaleFactor", ir->scalefactor);
+ pr_qm_opts(fp, indent, "qm-opts", &(ir->opts));
+
+ /* CONSTRAINT OPTIONS */
+ PS("constraint-algorithm", ECONSTRTYPE(ir->eConstrAlg));
+ PS("continuation", EBOOL(ir->bContinuation));
+
+ PS("Shake-SOR", EBOOL(ir->bShakeSOR));
+ PR("shake-tol", ir->shake_tol);
+ PI("lincs-order", ir->nProjOrder);
+ PI("lincs-iter", ir->nLincsIter);
+ PR("lincs-warnangle", ir->LincsWarnAngle);
+
+ /* Walls */
PI("nwall", ir->nwall);
PS("wall-type", EWALLTYPE(ir->wall_type));
+ PR("wall-r-linpot", ir->wall_r_linpot);
+ /* wall-atomtype */
PI("wall-atomtype[0]", ir->wall_atomtype[0]);
PI("wall-atomtype[1]", ir->wall_atomtype[1]);
+ /* wall-density */
PR("wall-density[0]", ir->wall_density[0]);
PR("wall-density[1]", ir->wall_density[1]);
PR("wall-ewald-zfac", ir->wall_ewald_zfac);
+ /* COM PULLING */
PS("pull", EPULLTYPE(ir->ePull));
if (ir->ePull != epullNO)
{
pr_pull(fp, indent, ir->pull);
}
+ /* ENFORCED ROTATION */
PS("rotation", EBOOL(ir->bRot));
if (ir->bRot)
{
pr_rot(fp, indent, ir->rot);
}
+ /* INTERACTIVE MD */
PS("interactiveMD", EBOOL(ir->bIMD));
if (ir->bIMD)
{
pr_imd(fp, indent, ir->imd);
}
+ /* NMR refinement stuff */
PS("disre", EDISRETYPE(ir->eDisre));
PS("disre-weighting", EDISREWEIGHTING(ir->eDisreWeighting));
PS("disre-mixed", EBOOL(ir->bDisreMixed));
PR("dr-fc", ir->dr_fc);
PR("dr-tau", ir->dr_tau);
PR("nstdisreout", ir->nstdisreout);
- PR("orires-fc", ir->orires_fc);
- PR("orires-tau", ir->orires_tau);
- PR("nstorireout", ir->nstorireout);
- PR("dihre-fc", ir->dihre_fc);
+ PR("orire-fc", ir->orires_fc);
+ PR("orire-tau", ir->orires_tau);
+ PR("nstorireout", ir->nstorireout);
- PR("em-stepsize", ir->em_stepsize);
- PR("em-tol", ir->em_tol);
- PI("niter", ir->niter);
- PR("fc-stepsize", ir->fc_stepsize);
- PI("nstcgsteep", ir->nstcgsteep);
- PI("nbfgscorr", ir->nbfgscorr);
+ /* FREE ENERGY VARIABLES */
+ PS("free-energy", EFEPTYPE(ir->efep));
+ if (ir->efep != efepNO || ir->bSimTemp)
+ {
+ pr_fepvals(fp, indent, ir->fepvals, bMDPformat);
+ }
+ if (ir->bExpanded)
+ {
+ pr_expandedvals(fp, indent, ir->expandedvals, ir->fepvals->n_lambda);
+ }
- PS("ConstAlg", ECONSTRTYPE(ir->eConstrAlg));
- PR("shake-tol", ir->shake_tol);
- PI("lincs-order", ir->nProjOrder);
- PR("lincs-warnangle", ir->LincsWarnAngle);
- PI("lincs-iter", ir->nLincsIter);
- PR("bd-fric", ir->bd_fric);
- PSTEP("ld-seed", ir->ld_seed);
- PR("cos-accel", ir->cos_accel);
+ /* NON-equilibrium MD stuff */
+ PR("cos-acceleration", ir->cos_accel);
pr_matrix(fp, indent, "deform", ir->deform, bMDPformat);
+ /* SIMULATED TEMPERING */
+ PS("simulated-tempering", EBOOL(ir->bSimTemp));
+ if (ir->bSimTemp)
+ {
+ pr_simtempvals(fp, indent, ir->simtempvals, ir->fepvals->n_lambda);
+ }
+
+ /* ELECTRIC FIELDS */
+ pr_cosine(fp, indent, "E-x", &(ir->ex[XX]), bMDPformat);
+ pr_cosine(fp, indent, "E-xt", &(ir->et[XX]), bMDPformat);
+ pr_cosine(fp, indent, "E-y", &(ir->ex[YY]), bMDPformat);
+ pr_cosine(fp, indent, "E-yt", &(ir->et[YY]), bMDPformat);
+ pr_cosine(fp, indent, "E-z", &(ir->ex[ZZ]), bMDPformat);
+ pr_cosine(fp, indent, "E-zt", &(ir->et[ZZ]), bMDPformat);
+
+ /* ION/WATER SWAPPING FOR COMPUTATIONAL ELECTROPHYSIOLOGY */
+ PS("swapcoords", ESWAPTYPE(ir->eSwapCoords));
+ if (ir->eSwapCoords != eswapNO)
+ {
+ pr_swap(fp, indent, ir->swap);
+ }
+
+ /* AdResS PARAMETERS */
PS("adress", EBOOL(ir->bAdress));
if (ir->bAdress)
{
PR("adress-const-wf", ir->adress->const_wf);
PR("adress-ex-width", ir->adress->ex_width);
PR("adress-hy-width", ir->adress->hy_width);
+ PR("adress-ex-forcecap", ir->adress->ex_forcecap);
PS("adress-interface-correction", EADRESSICTYPE(ir->adress->icor));
PS("adress-site", EADRESSSITETYPE(ir->adress->site));
- PR("adress-ex-force-cap", ir->adress->ex_forcecap);
- PS("adress-do-hybridpairs", EBOOL(ir->adress->do_hybridpairs));
-
pr_rvec(fp, indent, "adress-reference-coords", ir->adress->refs, DIM, TRUE);
+ PS("adress-do-hybridpairs", EBOOL(ir->adress->do_hybridpairs));
}
+
+ /* USER-DEFINED THINGIES */
PI("userint1", ir->userint1);
PI("userint2", ir->userint2);
PI("userint3", ir->userint3);
PR("userreal2", ir->userreal2);
PR("userreal3", ir->userreal3);
PR("userreal4", ir->userreal4);
+
pr_grp_opts(fp, indent, "grpopts", &(ir->opts), bMDPformat);
- pr_cosine(fp, indent, "efield-x", &(ir->ex[XX]), bMDPformat);
- pr_cosine(fp, indent, "efield-xt", &(ir->et[XX]), bMDPformat);
- pr_cosine(fp, indent, "efield-y", &(ir->ex[YY]), bMDPformat);
- pr_cosine(fp, indent, "efield-yt", &(ir->et[YY]), bMDPformat);
- pr_cosine(fp, indent, "efield-z", &(ir->ex[ZZ]), bMDPformat);
- pr_cosine(fp, indent, "efield-zt", &(ir->et[ZZ]), bMDPformat);
- PS("eSwapCoords", ESWAPTYPE(ir->eSwapCoords));
- if (ir->eSwapCoords != eswapNO)
- {
- pr_swap(fp, indent, ir->swap);
- }
- PS("bQMMM", EBOOL(ir->bQMMM));
- PI("QMconstraints", ir->QMconstraints);
- PI("QMMMscheme", ir->QMMMscheme);
- PR("scalefactor", ir->scalefactor);
- pr_qm_opts(fp, indent, "qm-opts", &(ir->opts));
}
}
#undef PS
ir->vdw_modifier = eintmodNONE;
ir->coulombtype = eelCUT;
ir->vdwtype = evdwCUT;
- ir->ndelta = 2;
ir->ns_type = ensGRID;
snew(ir->opts.egp_flags, 1);
#include "calc_verletbuf.h"
#include "tomorse.h"
#include "gromacs/imd/imd.h"
+#include "gromacs/utility/cstringutil.h"
#include "gromacs/commandline/pargs.h"
#include "gromacs/pbcutil/pbc.h"
}
}
+static void check_shells_inputrec(gmx_mtop_t *mtop,
+ t_inputrec *ir,
+ warninp_t wi)
+{
+ gmx_mtop_atomloop_all_t aloop;
+ t_atom *atom;
+ int a, nshells = 0;
+ char warn_buf[STRLEN];
+
+ aloop = gmx_mtop_atomloop_all_init(mtop);
+ while (gmx_mtop_atomloop_all_next(aloop, &a, &atom))
+ {
+ if (atom->ptype == eptShell ||
+ atom->ptype == eptBond)
+ {
+ nshells++;
+ }
+ }
+ if (IR_TWINRANGE(*ir) && (nshells > 0))
+ {
+ snprintf(warn_buf, STRLEN,
+ "The combination of using shells and a twin-range cut-off is not supported");
+ warning_error(wi, warn_buf);
+ }
+ if ((nshells > 0) && (ir->nstcalcenergy != 1))
+ {
+ set_warning_line(wi, "unknown", -1);
+ snprintf(warn_buf, STRLEN,
+ "There are %d shells, changing nstcalcenergy from %d to 1",
+ nshells, ir->nstcalcenergy);
+ ir->nstcalcenergy = 1;
+ warning(wi, warn_buf);
+ }
+}
+
static gmx_bool nint_ftype(gmx_mtop_t *mtop, t_molinfo *mi, int ftype)
{
int nint, mb;
int i, j;
read_posres (mtop, mi, FALSE, fnA, rc_scaling, ePBC, com, wi);
- if (strcmp(fnA, fnB) != 0)
- {
- read_posres(mtop, mi, TRUE, fnB, rc_scaling, ePBC, comB, wi);
- }
+ /* It is safer to simply read the b-state posres rather than trying
+ * to be smart and copy the positions.
+ */
+ read_posres(mtop, mi, TRUE, fnB, rc_scaling, ePBC, comB, wi);
}
static void set_wall_atomtype(gpp_atomtype_t at, t_gromppopts *opts,
}
/* If we are using CMAP, setup the pre-interpolation grid */
- if (plist->ncmap > 0)
+ if (plist[F_CMAP].ncmap > 0)
{
- init_cmap_grid(&sys->ffparams.cmap_grid, plist->nc, plist->grid_spacing);
- setup_cmap(plist->grid_spacing, plist->nc, plist->cmap, &sys->ffparams.cmap_grid);
+ init_cmap_grid(&sys->ffparams.cmap_grid, plist[F_CMAP].nc, plist[F_CMAP].grid_spacing);
+ setup_cmap(plist[F_CMAP].grid_spacing, plist[F_CMAP].nc, plist[F_CMAP].cmap, &sys->ffparams.cmap_grid);
}
set_wall_atomtype(atype, opts, ir, wi);
check_vel(sys, state.v);
}
+ /* check for shells and inpurecs */
+ check_shells_inputrec(sys, ir, wi);
+
/* check masses */
check_mol(sys, wi);
return bRet;
}
+gmx_bool rbonded_atoms_exist_in_list(t_rbonded *b, t_rbonded blist[], int nlist, int natoms)
+{
+ int i, k;
+ gmx_bool matchFound = FALSE;
+ gmx_bool atomsMatch;
+
+ for (i = 0; i < nlist && !matchFound; i++)
+ {
+ atomsMatch = TRUE;
+ for (k = 0; k < natoms && atomsMatch; k++)
+ {
+ atomsMatch = atomsMatch && !strcmp(b->a[k], blist[i].a[k]);
+ }
+ /* Try reverse if forward match did not work */
+ if (!atomsMatch)
+ {
+ atomsMatch = TRUE;
+ for (k = 0; k < natoms && atomsMatch; k++)
+ {
+ atomsMatch = atomsMatch && !strcmp(b->a[k], blist[i].a[natoms-1-k]);
+ }
+ }
+ matchFound = atomsMatch;
+ }
+ return matchFound;
+}
+
gmx_bool merge_t_bondeds(t_rbondeds s[], t_rbondeds d[], gmx_bool bMin, gmx_bool bPlus)
{
int i, j;
srenew(d[i].b, d[i].nb + s[i].nb);
for (j = 0; j < s[i].nb; j++)
{
- if (!(bMin && contains_char(&s[i].b[j], '-'))
- && !(bPlus && contains_char(&s[i].b[j], '+')))
+ /* Check if this bonded string already exists before adding.
+ * We are merging from the main rtp to the hackblocks, so this
+ * will mean the hackblocks overwrite the man rtp, as intended.
+ */
+ if (!rbonded_atoms_exist_in_list(&s[i].b[j], d[i].b, d[i].nb, btsNiatoms[i]))
{
- copy_t_rbonded(&s[i].b[j], &d[i].b[ d[i].nb ]);
- d[i].nb++;
- }
- else if (i == ebtsBONDS)
- {
- bBondsRemoved = TRUE;
+ if (!(bMin && contains_char(&s[i].b[j], '-'))
+ && !(bPlus && contains_char(&s[i].b[j], '+')))
+ {
+ copy_t_rbonded(&s[i].b[j], &d[i].b[ d[i].nb ]);
+ d[i].nb++;
+ }
+ else if (i == ebtsBONDS)
+ {
+ bBondsRemoved = TRUE;
+ }
}
}
}
}
-
return bBondsRemoved;
}
printf("There are %d chains and %d blocks of water and "
"%d residues with %d atoms\n",
nch-nwaterchain, nwaterchain,
- pdba_all.resinfo[pdba_all.atom[natom-1].resind].nr, natom);
+ pdba_all.nres, natom);
printf("\n %5s %4s %6s\n", "chain", "#res", "#atoms");
for (i = 0; (i < nch); i++)
sfree(model);
}
-static int name2type(t_atoms *at, int **cgnr, gpp_atomtype_t atype,
+static int name2type(t_atoms *at, int **cgnr,
t_restp restp[], gmx_residuetype_t *rt)
{
int i, j, prevresind, resind, i0, prevcg, cg, curcg;
j = search_jtype(&restp[resind], name, bNterm);
at->atom[i].type = restp[resind].atom[j].type;
at->atom[i].q = restp[resind].atom[j].q;
- at->atom[i].m = get_atomtype_massA(restp[resind].atom[j].type,
- atype);
- cg = restp[resind].cgnr[j];
+ at->atom[i].m = restp[resind].atom[j].m;
+ cg = restp[resind].cgnr[j];
/* A charge group number -1 signals a separate charge group
* for this atom.
*/
atoms, nssbonds, ssbonds,
bAllowMissing);
- nmissat = name2type(atoms, &cgnr, atype, restp, rt);
+ nmissat = name2type(atoms, &cgnr, restp, rt);
if (nmissat)
{
if (bAllowMissing)
}
}
+ if (ir->nsteps == 0 && !ir->bContinuation)
+ {
+ warning_note(wi, "For a correct single-point energy evaluation with nsteps = 0, use continuation = yes to avoid constraining the input coordinates.");
+ }
+
/* LD STUFF */
if ((EI_SD(ir->eI) || ir->eI == eiBD) &&
ir->bContinuation && ir->ld_seed != -1)
}
}
+ if (ir->coulombtype == eelSWITCH || ir->coulombtype == eelSHIFT)
+ {
+ sprintf(err_buf,
+ "Explicit switch/shift coulomb interactions cannot be used in combination with a secondary coulomb-modifier.");
+ CHECK( ir->coulomb_modifier != eintmodNONE);
+ }
+ if (ir->vdwtype == evdwSWITCH || ir->vdwtype == evdwSHIFT)
+ {
+ sprintf(err_buf,
+ "Explicit switch/shift vdw interactions cannot be used in combination with a secondary vdw-modifier.");
+ CHECK( ir->vdw_modifier != eintmodNONE);
+ }
+
if (ir->coulombtype == eelSWITCH || ir->coulombtype == eelSHIFT ||
ir->vdwtype == evdwSWITCH || ir->vdwtype == evdwSHIFT)
{
if (ir->rcoulomb_switch/ir->rcoulomb < 0.9499)
{
real percentage = 100*(ir->rcoulomb-ir->rcoulomb_switch)/ir->rcoulomb;
- sprintf(warn_buf, "The switching range for should be 5%% or less (currently %.2f%% using a switching range of %4f-%4f) for accurate electrostatic energies, energy conservation will be good regardless, since ewald_rtol = %g.",
+ sprintf(warn_buf, "The switching range should be 5%% or less (currently %.2f%% using a switching range of %4f-%4f) for accurate electrostatic energies, energy conservation will be good regardless, since ewald_rtol = %g.",
percentage, ir->rcoulomb_switch, ir->rcoulomb, ir->ewald_rtol);
warning(wi, warn_buf);
}
warning_note(wi, warn_buf);
}
- /* remove the following deprecated commands */
+ /* ignore the following deprecated commands */
REM_TYPE("title");
REM_TYPE("cpp");
REM_TYPE("domain-decomposition");
REM_TYPE("dihre-tau");
REM_TYPE("nstdihreout");
REM_TYPE("nstcheckpoint");
+ REM_TYPE("optimize-fft");
/* replace the following commands with the clearer new versions*/
REPL_TYPE("unconstrained-start", "continuation");
ITYPE ("nstxout", ir->nstxout, 0);
ITYPE ("nstvout", ir->nstvout, 0);
ITYPE ("nstfout", ir->nstfout, 0);
- ir->nstcheckpoint = 1000;
CTYPE ("Output frequency for energies to log file and energy file");
ITYPE ("nstlog", ir->nstlog, 1000);
ITYPE ("nstcalcenergy", ir->nstcalcenergy, 100);
ITYPE ("nstlist", ir->nstlist, 10);
CTYPE ("ns algorithm (simple or grid)");
EETYPE("ns-type", ir->ns_type, ens_names);
- /* set ndelta to the optimal value of 2 */
- ir->ndelta = 2;
CTYPE ("Periodic boundary conditions: xyz, no, xy");
EETYPE("pbc", ir->ePBC, epbc_names);
EETYPE("periodic-molecules", ir->bPeriodicMols, yesno_names);
EETYPE("lj-pme-comb-rule", ir->ljpme_combination_rule, eljpme_names);
EETYPE("ewald-geometry", ir->ewald_geometry, eewg_names);
RTYPE ("epsilon-surface", ir->epsilon_surface, 0.0);
- EETYPE("optimize-fft", ir->bOptFFT, yesno_names);
CCTYPE("IMPLICIT SOLVENT ALGORITHM");
EETYPE("implicit-solvent", ir->implicit_solvent, eis_names);
}
else
{
- warning(wi, "Can not couple a molecule with free_energy = no");
+ warning_note(wi, "Free energy is turned off, so we will not decouple the molecule listed in your input.");
}
}
/* FREE ENERGY AND EXPANDED ENSEMBLE OPTIONS */
RTYPE("pull-r1", pull->cyl_r1, 1.0);
CTYPE("Switch from r1 to r0 in case of dynamic reaction force");
RTYPE("pull-r0", pull->cyl_r0, 1.5);
- RTYPE("pull_constr_tol", pull->constr_tol, 1E-6);
+ RTYPE("pull-constr-tol", pull->constr_tol, 1E-6);
EETYPE("pull-start", *bStart, yesno_names);
EETYPE("pull-print-reference", pull->bPrintRef, yesno_names);
ITYPE("pull-nstxout", pull->nstxout, 10);
{
pgrp = &pull->group[g];
+ if (strcmp(pgnames[g], "") == 0)
+ {
+ gmx_fatal(FARGS, "Group pull_group%d required by grompp was undefined.", g);
+ }
+
ig = search_string(pgnames[g], grps->nr, gnames);
pgrp->nat = grps->index[ig+1] - grps->index[ig];
comb = 0;
/* Init the number of CMAP torsion angles and grid spacing */
- plist->grid_spacing = 0;
- plist->nc = 0;
+ plist[F_CMAP].grid_spacing = 0;
+ plist[F_CMAP].nc = 0;
bWarn_copy_A_B = bFEP;
break;
case eCOMB_ARITHMETIC:
- /* c0 and c1 are epsilon and sigma */
+ /* c0 and c1 are sigma and epsilon */
for (i = k = 0; (i < nr); i++)
{
for (j = 0; (j < nr); j++, k++)
cj0 = get_atomtype_nbparam(j, 0, atype);
ci1 = get_atomtype_nbparam(i, 1, atype);
cj1 = get_atomtype_nbparam(j, 1, atype);
- plist->param[k].c[0] = (ci0+cj0)*0.5;
+ plist->param[k].c[0] = (fabs(ci0) + fabs(cj0))*0.5;
+ /* Negative sigma signals that c6 should be set to zero later,
+ * so we need to propagate that through the combination rules.
+ */
+ if (ci0 < 0 || cj0 < 0)
+ {
+ plist->param[k].c[0] *= -1;
+ }
plist->param[k].c[1] = sqrt(ci1*cj1);
}
}
break;
case eCOMB_GEOM_SIG_EPS:
- /* c0 and c1 are epsilon and sigma */
+ /* c0 and c1 are sigma and epsilon */
for (i = k = 0; (i < nr); i++)
{
for (j = 0; (j < nr); j++, k++)
cj0 = get_atomtype_nbparam(j, 0, atype);
ci1 = get_atomtype_nbparam(i, 1, atype);
cj1 = get_atomtype_nbparam(j, 1, atype);
- plist->param[k].c[0] = sqrt(ci0*cj0);
+ plist->param[k].c[0] = sqrt(fabs(ci0*cj0));
+ /* Negative sigma signals that c6 should be set to zero later,
+ * so we need to propagate that through the combination rules.
+ */
+ if (ci0 < 0 || cj0 < 0)
+ {
+ plist->param[k].c[0] *= -1;
+ }
plist->param[k].c[1] = sqrt(ci1*cj1);
}
}
nrfp = nrfpA+nrfpB;
/* Allocate memory for the CMAP grid */
- bt->ncmap += nrfp;
- srenew(bt->cmap, bt->ncmap);
+ bt[F_CMAP].ncmap += nrfp;
+ srenew(bt[F_CMAP].cmap, bt[F_CMAP].ncmap);
/* Read in CMAP parameters */
sl = 0;
}
nn = sscanf(line+start+sl, " %s ", s);
sl += strlen(s);
- bt->cmap[i+(bt->ncmap)-nrfp] = strtod(s, NULL);
+ bt[F_CMAP].cmap[i+(bt[F_CMAP].ncmap)-nrfp] = strtod(s, NULL);
if (nn == 1)
{
{
for (i = 0; i < ncmap; i++)
{
- bt->cmap[i+ncmap] = bt->cmap[i];
+ bt[F_CMAP].cmap[i+ncmap] = bt[F_CMAP].cmap[i];
}
}
else
/* Set grid spacing and the number of grids (we assume these numbers to be the same for all grids
* so we can safely assign them each time
*/
- bt->grid_spacing = nxcmap; /* Or nycmap, they need to be equal */
- bt->nc = bt->nc + 1; /* Since we are incrementing here, we need to subtract later, see (*****) */
- nct = (nral+1) * bt->nc;
+ bt[F_CMAP].grid_spacing = nxcmap; /* Or nycmap, they need to be equal */
+ bt[F_CMAP].nc = bt[F_CMAP].nc + 1; /* Since we are incrementing here, we need to subtract later, see (*****) */
+ nct = (nral+1) * bt[F_CMAP].nc;
/* Allocate memory for the cmap_types information */
- srenew(bt->cmap_types, nct);
+ srenew(bt[F_CMAP].cmap_types, nct);
for (i = 0; (i < nral); i++)
{
}
/* Assign a grid number to each cmap_type */
- bt->cmap_types[bt->nct++] = get_bond_atomtype_type(alc[i], bat);
+ bt[F_CMAP].cmap_types[bt[F_CMAP].nct++] = get_bond_atomtype_type(alc[i], bat);
}
/* Assign a type number to this cmap */
- bt->cmap_types[bt->nct++] = bt->nc-1; /* Since we inremented earlier, we need to subtrac here, to get the types right (****) */
+ bt[F_CMAP].cmap_types[bt[F_CMAP].nct++] = bt[F_CMAP].nc-1; /* Since we inremented earlier, we need to subtrac here, to get the types right (****) */
/* Check for the correct number of atoms (again) */
- if (bt->nct != nct)
+ if (bt[F_CMAP].nct != nct)
{
- gmx_fatal(FARGS, "Incorrect number of atom types (%d) in cmap type %d\n", nct, bt->nc);
+ gmx_fatal(FARGS, "Incorrect number of atom types (%d) in cmap type %d\n", nct, bt[F_CMAP].nc);
}
/* Is this correct?? */
ct = 0;
/* Match the current cmap angle against the list of cmap_types */
- for (i = 0; i < bondtype->nct && !bFound; i += 6)
+ for (i = 0; i < bondtype[F_CMAP].nct && !bFound; i += 6)
{
if (bB)
{
else
{
if (
- (get_atomtype_batype(at->atom[p->a[0]].type, atype) == bondtype->cmap_types[i]) &&
- (get_atomtype_batype(at->atom[p->a[1]].type, atype) == bondtype->cmap_types[i+1]) &&
- (get_atomtype_batype(at->atom[p->a[2]].type, atype) == bondtype->cmap_types[i+2]) &&
- (get_atomtype_batype(at->atom[p->a[3]].type, atype) == bondtype->cmap_types[i+3]) &&
- (get_atomtype_batype(at->atom[p->a[4]].type, atype) == bondtype->cmap_types[i+4]))
+ (get_atomtype_batype(at->atom[p->a[0]].type, atype) == bondtype[F_CMAP].cmap_types[i]) &&
+ (get_atomtype_batype(at->atom[p->a[1]].type, atype) == bondtype[F_CMAP].cmap_types[i+1]) &&
+ (get_atomtype_batype(at->atom[p->a[2]].type, atype) == bondtype[F_CMAP].cmap_types[i+2]) &&
+ (get_atomtype_batype(at->atom[p->a[3]].type, atype) == bondtype[F_CMAP].cmap_types[i+3]) &&
+ (get_atomtype_batype(at->atom[p->a[4]].type, atype) == bondtype[F_CMAP].cmap_types[i+4]))
{
/* Found cmap torsion */
bFound = TRUE;
- ct = bondtype->cmap_types[i+5];
+ ct = bondtype[F_CMAP].cmap_types[i+5];
nparam_found = 1;
}
}
char **f;
char c, *rnm, atombuf[32], *ptr0, *ptr1;
gmx_bool bReorderedNum, bRenamed, bMatch;
+ gmx_bool bStartTerm, bEndTerm;
nxlate = 0;
xlatom = NULL;
for (a = 0; (a < atoms->nr); a++)
{
resind = atoms->atom[a].resind;
+
+ bStartTerm = (resind == 0) || atoms->resinfo[resind].chainnum != atoms->resinfo[resind-1].chainnum;
+ bEndTerm = (resind >= atoms->nres-1) || atoms->resinfo[resind].chainnum != atoms->resinfo[resind+1].chainnum;
+
if (bResname)
{
rnm = *(atoms->resinfo[resind].name);
{
/* Match the residue name */
bMatch = (xlatom[i].res == NULL ||
+ (gmx_strcasecmp("protein-nterm", xlatom[i].res) == 0 &&
+ gmx_residuetype_is_protein(rt, rnm) && bStartTerm) ||
+ (gmx_strcasecmp("protein-cterm", xlatom[i].res) == 0 &&
+ gmx_residuetype_is_protein(rt, rnm) && bEndTerm) ||
(gmx_strcasecmp("protein", xlatom[i].res) == 0 &&
gmx_residuetype_is_protein(rt, rnm)) ||
(gmx_strcasecmp("DNA", xlatom[i].res) == 0 &&
void
gmx_nonbonded_set_kernel_pointers(FILE * fplog,
- t_nblist * nl);
+ t_nblist * nl,
+ gmx_bool bElecAndVdwSwitchDiffers);
/* return time conversion factor from ps (i.e. 1e-3 for ps->ns) */
real output_env_get_time_invfactor(const output_env_t oenv);
-/* return inverse time conversion factor from ps (i.e. 1e3 for ps->ns) */
+/* return inverse time conversion factor to ps (i.e. 1e3 for ns->ps) */
real output_env_conv_time(const output_env_t oenv, real time);
/* return converted time */
* If x!=NULL, the shells are predict for the global coordinates x.
*/
gmx_shellfc_t init_shell_flexcon(FILE *fplog,
- gmx_bool bCutoffSchemeIsVerlet,
gmx_mtop_t *mtop, int nflexcon,
rvec *x);
real *table_V,
real *table_FDV0,
int ntab,
- real dx,
+ double dx,
real beta,
real_space_grid_contribution_computer v_lr);
/* Fill tables of ntab points with spacing dr with the ewald long-range
int nstlist; /* number of steps before pairlist is generated */
int ndelta; /* number of cells per rlong */
int nstcomm; /* number of steps after which center of mass */
- /* motion is removed */
+ /* motion is removed */
int comm_mode; /* Center of mass motion removal algorithm */
- int nstcheckpoint; /* checkpointing frequency */
int nstlog; /* number of steps after which print to logfile */
int nstxout; /* number of steps after which X is output */
int nstvout; /* id. for V */
real ewald_rtol_lj; /* Real space tolerance for LJ-Ewald */
int ewald_geometry; /* normal/3d ewald, or pseudo-2d LR corrections */
real epsilon_surface; /* Epsilon for PME dipole correction */
- gmx_bool bOptFFT; /* optimize the fft plan at start */
int ljpme_combination_rule; /* Type of combination rule in LJ-PME */
int ePBC; /* Type of periodic boundary conditions */
int bPeriodicMols; /* Periodic molecules */
real orires_fc; /* force constant for orientational restraints */
real orires_tau; /* time constant for memory function in orires */
int nstorireout; /* frequency of writing tr(SD) to enx */
- real dihre_fc; /* force constant for dihedral restraints (obsolete) */
real em_stepsize; /* The stepsize for updating */
real em_tol; /* The tolerance */
int niter; /* Number of iterations for convergence of */
int start, int homenr, t_commrec *cr,
rvec x[], matrix box)
{
- char fname[STRLEN], format[STRLEN];
+ char fname[STRLEN];
FILE *out;
int dd_ac0 = 0, dd_ac1 = 0, i, ii, resnr;
gmx_domdec_t *dd;
{
sprintf(fname, "%s.pdb", fn);
}
- sprintf(format, "%s\n", get_pdbformat());
out = gmx_fio_fopen(fname, "w");
ii = i;
}
gmx_mtop_atominfo_global(mtop, ii, &anm, &resnr, &resnm);
- fprintf(out, format, "ATOM", (ii+1)%100000,
- anm, resnm, ' ', resnr%10000, ' ',
- 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ]);
+ gmx_fprintf_pdb_atomline(out, epdbATOM, ii+1, anm, ' ', resnm, ' ', resnr, ' ',
+ 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ], 1.0, 0.0, "");
}
fprintf(out, "TER\n");
gmx_domdec_t *dd, matrix box, gmx_ddbox_t *ddbox)
{
rvec grid_s[2], *grid_r = NULL, cx, r;
- char fname[STRLEN], format[STRLEN], buf[22];
+ char fname[STRLEN], buf[22];
FILE *out;
int a, i, d, z, y, x;
matrix tric;
}
}
sprintf(fname, "%s_%s.pdb", fn, gmx_step_str(step, buf));
- sprintf(format, "%s%s\n", get_pdbformat(), "%6.2f%6.2f");
out = gmx_fio_fopen(fname, "w");
gmx_write_pdb_box(out, dd->bScrewPBC ? epbcSCREW : epbcXYZ, box);
a = 1;
cx[YY] = grid_r[i*2+y][YY];
cx[ZZ] = grid_r[i*2+z][ZZ];
mvmul(tric, cx, r);
- fprintf(out, format, "ATOM", a++, "CA", "GLY", ' ', 1+i,
- ' ', 10*r[XX], 10*r[YY], 10*r[ZZ], 1.0, vol);
+ gmx_fprintf_pdb_atomline(out, epdbATOM, a++, "CA", ' ', "GLY", ' ', i+1, ' ',
+ 10*r[XX], 10*r[YY], 10*r[ZZ], 1.0, vol, "");
}
}
}
gmx_mtop_t *mtop, t_commrec *cr,
int natoms, rvec x[], matrix box)
{
- char fname[STRLEN], format[STRLEN], format4[STRLEN], buf[22];
+ char fname[STRLEN], buf[22];
FILE *out;
int i, ii, resnr, c;
char *atomname, *resname;
sprintf(fname, "%s_%s_n%d.pdb", fn, gmx_step_str(step, buf), cr->sim_nodeid);
- sprintf(format, "%s%s\n", get_pdbformat(), "%6.2f%6.2f");
- sprintf(format4, "%s%s\n", get_pdbformat4(), "%6.2f%6.2f");
-
out = gmx_fio_fopen(fname, "w");
fprintf(out, "TITLE %s\n", title);
{
b = dd->comm->zones.n + 1;
}
- fprintf(out, strlen(atomname) < 4 ? format : format4,
- "ATOM", (ii+1)%100000,
- atomname, resname, ' ', resnr%10000, ' ',
- 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ], 1.0, b);
+ gmx_fprintf_pdb_atomline(out, epdbATOM, ii+1, atomname, ' ', resname, ' ', resnr, ' ',
+ 10*x[i][XX], 10*x[i][YY], 10*x[i][ZZ], 1.0, b, "");
}
fprintf(out, "TER\n");
sigmaj = pow(c12j / c6j, 1.0/6.0);
epsi = c6i * c6i / c12i;
epsj = c6j * c6j / c12j;
- c6 = epsi * epsj * pow(0.5*(sigmai+sigmaj), 6);
- c12 = epsi * epsj * pow(0.5*(sigmai+sigmaj), 12);
+ c6 = sqrt(epsi * epsj) * pow(0.5*(sigmai+sigmaj), 6);
+ c12 = sqrt(epsi * epsj) * pow(0.5*(sigmai+sigmaj), 12);
}
C6(nbfp, atnr, i, j) = c6*6.0;
C12(nbfp, atnr, i, j) = c12*12.0;
fr->nbkernel_elec_modifier = fr->coulomb_modifier;
fr->nbkernel_vdw_modifier = fr->vdw_modifier;
+ fr->rvdw = cutoff_inf(ir->rvdw);
+ fr->rvdw_switch = ir->rvdw_switch;
+ fr->rcoulomb = cutoff_inf(ir->rcoulomb);
+ fr->rcoulomb_switch = ir->rcoulomb_switch;
+
fr->bTwinRange = fr->rlistlong > fr->rlist;
fr->bEwald = (EEL_PME(fr->eeltype) || fr->eeltype == eelEWALD);
/* If the user absolutely wants different switch/shift settings for coul/vdw, it is likely
* going to be faster to tabulate the interaction than calling the generic kernel.
+ * However, if generic kernels have been requested we keep things analytically.
*/
- if (fr->nbkernel_elec_modifier == eintmodPOTSWITCH && fr->nbkernel_vdw_modifier == eintmodPOTSWITCH)
+ if (fr->nbkernel_elec_modifier == eintmodPOTSWITCH &&
+ fr->nbkernel_vdw_modifier == eintmodPOTSWITCH &&
+ bGenericKernelOnly == FALSE)
{
if ((fr->rcoulomb_switch != fr->rvdw_switch) || (fr->rcoulomb != fr->rvdw))
{
fr->bcoultab = TRUE;
+ /* Once we tabulate electrostatics, we can use the switch function for LJ,
+ * which would otherwise need two tables.
+ */
}
}
else if ((fr->nbkernel_elec_modifier == eintmodPOTSHIFT && fr->nbkernel_vdw_modifier == eintmodPOTSHIFT) ||
fr->nbkernel_elec_modifier == eintmodEXACTCUTOFF &&
(fr->nbkernel_vdw_modifier == eintmodPOTSWITCH || fr->nbkernel_vdw_modifier == eintmodPOTSHIFT))))
{
- if (fr->rcoulomb != fr->rvdw)
+ if ((fr->rcoulomb != fr->rvdw) && (bGenericKernelOnly == FALSE))
{
fr->bcoultab = TRUE;
}
}
+ if (fr->nbkernel_elec_modifier == eintmodFORCESWITCH)
+ {
+ fr->bcoultab = TRUE;
+ }
+ if (fr->nbkernel_vdw_modifier == eintmodFORCESWITCH)
+ {
+ fr->bvdwtab = TRUE;
+ }
+
if (getenv("GMX_REQUIRE_TABLES"))
{
fr->bvdwtab = TRUE;
fr->epsilon_r = ir->epsilon_r;
fr->epsilon_rf = ir->epsilon_rf;
fr->fudgeQQ = mtop->ffparams.fudgeQQ;
- fr->rcoulomb_switch = ir->rcoulomb_switch;
- fr->rcoulomb = cutoff_inf(ir->rcoulomb);
/* Parameters for generalized RF */
fr->zsquare = 0.0;
fr->egp_flags = ir->opts.egp_flags;
/* Van der Waals stuff */
- fr->rvdw = cutoff_inf(ir->rvdw);
- fr->rvdw_switch = ir->rvdw_switch;
if ((fr->vdwtype != evdwCUT) && (fr->vdwtype != evdwUSER) && !fr->bBHAM)
{
if (fr->rvdw_switch >= fr->rvdw)
(ir->eDispCorr != edispcNO && ir_vdw_switched(ir));
bMakeSeparate14Table = ((!bMakeTables || fr->eeltype != eelCUT || fr->vdwtype != evdwCUT ||
+ fr->coulomb_modifier != eintmodNONE ||
+ fr->vdw_modifier != eintmodNONE ||
fr->bBHAM || fr->bEwald) &&
(gmx_mtop_ftype_count(mtop, F_LJ14) > 0 ||
gmx_mtop_ftype_count(mtop, F_LJC14_Q) > 0 ||
}
}
}
+ else if ((fr->eDispCorr != edispcNO) &&
+ ((fr->vdw_modifier == eintmodPOTSWITCH) ||
+ (fr->vdw_modifier == eintmodFORCESWITCH) ||
+ (fr->vdw_modifier == eintmodPOTSHIFT)))
+ {
+ /* Tables might not be used for the potential modifier interactions per se, but
+ * we still need them to evaluate switch/shift dispersion corrections in this case.
+ */
+ make_nbf_tables(fp, oenv, fr, rtab, cr, tabfn, NULL, NULL, &fr->nblists[0]);
+ }
+
if (bMakeSeparate14Table)
{
/* generate extra tables with plain Coulomb for 1-4 interactions only */
int maxsr, int maxlr,
int ivdw, int ivdwmod,
int ielec, int ielecmod,
- int igeometry, int type)
+ int igeometry, int type,
+ gmx_bool bElecAndVdwSwitchDiffers)
{
t_nblist *nl;
int homenr;
}
/* This will also set the simd_padding_width field */
- gmx_nonbonded_set_kernel_pointers( (i == 0) ? log : NULL, nl);
+ gmx_nonbonded_set_kernel_pointers( (i == 0) ? log : NULL, nl, bElecAndVdwSwitchDiffers);
/* maxnri is influenced by the number of shifts (maximum is 8)
* and the number of energy groups.
* cache trashing.
*/
int maxsr, maxsr_wat, maxlr, maxlr_wat;
- int ielec, ielecf, ivdw, ielecmod, ielecmodf, ivdwmod, type;
+ int ielec, ivdw, ielecmod, ivdwmod, type;
int solvent;
int igeometry_def, igeometry_w, igeometry_ww;
int i;
+ gmx_bool bElecAndVdwSwitchDiffers;
t_nblists *nbl;
/* maxsr = homenr-fr->nWatMol*3; */
}
/* Determine the values for ielec/ivdw. */
- ielec = fr->nbkernel_elec_interaction;
- ivdw = fr->nbkernel_vdw_interaction;
- ielecmod = fr->nbkernel_elec_modifier;
- ivdwmod = fr->nbkernel_vdw_modifier;
- type = GMX_NBLIST_INTERACTION_STANDARD;
+ ielec = fr->nbkernel_elec_interaction;
+ ivdw = fr->nbkernel_vdw_interaction;
+ ielecmod = fr->nbkernel_elec_modifier;
+ ivdwmod = fr->nbkernel_vdw_modifier;
+ type = GMX_NBLIST_INTERACTION_STANDARD;
+ bElecAndVdwSwitchDiffers = ( (fr->rcoulomb_switch != fr->rvdw_switch) || (fr->rcoulomb != fr->rvdw));
fr->ns.bCGlist = (getenv("GMX_NBLISTCG") != 0);
if (!fr->ns.bCGlist)
type = GMX_NBLIST_INTERACTION_ADRESS;
}
init_nblist(log, &nbl->nlist_sr[eNL_VDWQQ], &nbl->nlist_lr[eNL_VDWQQ],
- maxsr, maxlr, ivdw, ivdwmod, ielec, ielecmod, igeometry_def, type);
+ maxsr, maxlr, ivdw, ivdwmod, ielec, ielecmod, igeometry_def, type, bElecAndVdwSwitchDiffers);
init_nblist(log, &nbl->nlist_sr[eNL_VDW], &nbl->nlist_lr[eNL_VDW],
- maxsr, maxlr, ivdw, ivdwmod, GMX_NBKERNEL_ELEC_NONE, eintmodNONE, igeometry_def, type);
+ maxsr, maxlr, ivdw, ivdwmod, GMX_NBKERNEL_ELEC_NONE, eintmodNONE, igeometry_def, type, bElecAndVdwSwitchDiffers);
init_nblist(log, &nbl->nlist_sr[eNL_QQ], &nbl->nlist_lr[eNL_QQ],
- maxsr, maxlr, GMX_NBKERNEL_VDW_NONE, eintmodNONE, ielec, ielecmod, igeometry_def, type);
+ maxsr, maxlr, GMX_NBKERNEL_VDW_NONE, eintmodNONE, ielec, ielecmod, igeometry_def, type, bElecAndVdwSwitchDiffers);
init_nblist(log, &nbl->nlist_sr[eNL_VDWQQ_WATER], &nbl->nlist_lr[eNL_VDWQQ_WATER],
- maxsr_wat, maxlr_wat, ivdw, ivdwmod, ielec, ielecmod, igeometry_w, type);
+ maxsr_wat, maxlr_wat, ivdw, ivdwmod, ielec, ielecmod, igeometry_w, type, bElecAndVdwSwitchDiffers);
init_nblist(log, &nbl->nlist_sr[eNL_QQ_WATER], &nbl->nlist_lr[eNL_QQ_WATER],
- maxsr_wat, maxlr_wat, GMX_NBKERNEL_VDW_NONE, eintmodNONE, ielec, ielecmod, igeometry_w, type);
+ maxsr_wat, maxlr_wat, GMX_NBKERNEL_VDW_NONE, eintmodNONE, ielec, ielecmod, igeometry_w, type, bElecAndVdwSwitchDiffers);
init_nblist(log, &nbl->nlist_sr[eNL_VDWQQ_WATERWATER], &nbl->nlist_lr[eNL_VDWQQ_WATERWATER],
- maxsr_wat, maxlr_wat, ivdw, ivdwmod, ielec, ielecmod, igeometry_ww, type);
+ maxsr_wat, maxlr_wat, ivdw, ivdwmod, ielec, ielecmod, igeometry_ww, type, bElecAndVdwSwitchDiffers);
init_nblist(log, &nbl->nlist_sr[eNL_QQ_WATERWATER], &nbl->nlist_lr[eNL_QQ_WATERWATER],
- maxsr_wat, maxlr_wat, GMX_NBKERNEL_VDW_NONE, eintmodNONE, ielec, ielecmod, igeometry_ww, type);
+ maxsr_wat, maxlr_wat, GMX_NBKERNEL_VDW_NONE, eintmodNONE, ielec, ielecmod, igeometry_ww, type, bElecAndVdwSwitchDiffers);
/* Did we get the solvent loops so we can use optimized water kernels? */
if (nbl->nlist_sr[eNL_VDWQQ_WATER].kernelptr_vf == NULL
if (fr->efep != efepNO)
{
- if ((fr->bEwald) && (fr->sc_alphacoul > 0)) /* need to handle long range differently if using softcore */
- {
- ielecf = GMX_NBKERNEL_ELEC_EWALD;
- ielecmodf = eintmodNONE;
- }
- else
- {
- ielecf = ielec;
- ielecmodf = ielecmod;
- }
-
init_nblist(log, &nbl->nlist_sr[eNL_VDWQQ_FREE], &nbl->nlist_lr[eNL_VDWQQ_FREE],
- maxsr, maxlr, ivdw, ivdwmod, ielecf, ielecmod, GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE, GMX_NBLIST_INTERACTION_FREE_ENERGY);
+ maxsr, maxlr, ivdw, ivdwmod, ielec, ielecmod, GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE, GMX_NBLIST_INTERACTION_FREE_ENERGY, bElecAndVdwSwitchDiffers);
init_nblist(log, &nbl->nlist_sr[eNL_VDW_FREE], &nbl->nlist_lr[eNL_VDW_FREE],
- maxsr, maxlr, ivdw, ivdwmod, GMX_NBKERNEL_ELEC_NONE, eintmodNONE, GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE, GMX_NBLIST_INTERACTION_FREE_ENERGY);
+ maxsr, maxlr, ivdw, ivdwmod, GMX_NBKERNEL_ELEC_NONE, eintmodNONE, GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE, GMX_NBLIST_INTERACTION_FREE_ENERGY, bElecAndVdwSwitchDiffers);
init_nblist(log, &nbl->nlist_sr[eNL_QQ_FREE], &nbl->nlist_lr[eNL_QQ_FREE],
- maxsr, maxlr, GMX_NBKERNEL_VDW_NONE, eintmodNONE, ielecf, ielecmod, GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE, GMX_NBLIST_INTERACTION_FREE_ENERGY);
+ maxsr, maxlr, GMX_NBKERNEL_VDW_NONE, eintmodNONE, ielec, ielecmod, GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE, GMX_NBLIST_INTERACTION_FREE_ENERGY, bElecAndVdwSwitchDiffers);
}
}
/* QMMM MM list */
if (fr->bQMMM && fr->qr->QMMMscheme != eQMMMschemeoniom)
{
init_nblist(log, &fr->QMMMlist, NULL,
- maxsr, maxlr, 0, 0, ielec, ielecmod, GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE, GMX_NBLIST_INTERACTION_STANDARD);
+ maxsr, maxlr, 0, 0, ielec, ielecmod, GMX_NBLIST_GEOMETRY_PARTICLE_PARTICLE, GMX_NBLIST_INTERACTION_STANDARD, bElecAndVdwSwitchDiffers);
}
if (log != NULL)
{
#ifdef DEBUG_PME
FILE *fp, *fp2;
- char fn[STRLEN], format[STRLEN];
+ char fn[STRLEN];
real val;
sprintf(fn, "pmegrid%d.pdb", pme->nodeid);
fp = gmx_ffopen(fn, "w");
sprintf(fn, "pmegrid%d.txt", pme->nodeid);
fp2 = gmx_ffopen(fn, "w");
- sprintf(format, "%s%s\n", pdbformat, "%6.2f%6.2f");
#endif
for (ix = 0; ix < local_fft_ndata[XX]; ix++)
val = 100*pmegrid[pmeidx];
if (pmegrid[pmeidx] != 0)
{
- fprintf(fp, format, "ATOM", pmeidx, "CA", "GLY", ' ', pmeidx, ' ',
- 5.0*ix, 5.0*iy, 5.0*iz, 1.0, val);
+ gmx_fprintf_pdb_atomline(fp, epdbATOM, pmeidx, "CA", ' ', "GLY", ' ', pmeidx, ' ',
+ 5.0*ix, 5.0*iy, 5.0*iz, 1.0, val, "");
}
if (pmegrid[pmeidx] != 0)
{
/* Now loop over all the thread data blocks that contribute
* to the grid region we (our thread) are operating on.
*/
- /* Note that ffy_nx/y is equal to the number of grid points
+ /* Note that fft_nx/y is equal to the number of grid points
* between the first point of our node grid and the one of the next node.
*/
for (sx = 0; sx >= -pmegrids->nthread_comm[XX]; sx--)
}
pmegrid_g = &pmegrids->grid_th[fx*pmegrids->nc[YY]*pmegrids->nc[ZZ]];
ox += pmegrid_g->offset[XX];
- if (!bCommX)
- {
- tx1 = min(ox + pmegrid_g->n[XX], ne[XX]);
- }
- else
- {
- tx1 = min(ox + pmegrid_g->n[XX], pme->pme_order);
- }
+ /* Determine the end of our part of the source grid */
+ tx1 = min(ox + pmegrid_g->n[XX], ne[XX]);
for (sy = 0; sy >= -pmegrids->nthread_comm[YY]; sy--)
{
}
pmegrid_g = &pmegrids->grid_th[fy*pmegrids->nc[ZZ]];
oy += pmegrid_g->offset[YY];
- if (!bCommY)
- {
- ty1 = min(oy + pmegrid_g->n[YY], ne[YY]);
- }
- else
- {
- ty1 = min(oy + pmegrid_g->n[YY], pme->pme_order);
- }
+ /* Determine the end of our part of the source grid */
+ ty1 = min(oy + pmegrid_g->n[YY], ne[YY]);
for (sz = 0; sz >= -pmegrids->nthread_comm[ZZ]; sz--)
{
#include "gromacs/math/vec.h"
#include "gromacs/pbcutil/mshift.h"
+#include "gromacs/pbcutil/pbc.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/smalloc.h"
}
gmx_shellfc_t init_shell_flexcon(FILE *fplog,
- gmx_bool bCutoffSchemeIsVerlet,
gmx_mtop_t *mtop, int nflexcon,
rvec *x)
{
return NULL;
}
- if (bCutoffSchemeIsVerlet)
- {
- gmx_fatal(FARGS, "The shell code does not work with the Verlet cut-off scheme.\n");
- }
-
snew(shfc, 1);
shfc->nflexcon = nflexcon;
{
fprintf(fplog, "\nNOTE: there all shells that are connected to particles outside thier own charge group, will not predict shells positions during the run\n\n");
}
+ /* Prediction improves performance, so we should implement either:
+ * 1. communication for the atoms needed for prediction
+ * 2. prediction using the velocities of shells; currently the
+ * shell velocities are zeroed, it's a bit tricky to keep
+ * track of the shell displacements and thus the velocity.
+ */
shfc->bPredict = FALSE;
}
}
force[i] = shfc->f[i];
}
- /* When we had particle decomposition, this code only worked with
- * PD when all particles involved with each shell were in the same
- * charge group. Not sure if this is still relevant. */
if (bDoNS && inputrec->ePBC != epbcNONE && !DOMAINDECOMP(cr))
{
/* This is the only time where the coordinates are used
* before do_force is called, which normally puts all
* charge groups in the box.
*/
- cg0 = 0;
- cg1 = top->cgs.nr;
- put_charge_groups_in_box(fplog, cg0, cg1, fr->ePBC, state->box,
- &(top->cgs), state->x, fr->cg_cm);
+ if (inputrec->cutoff_scheme == ecutsVERLET)
+ {
+ put_atoms_in_box_omp(fr->ePBC, state->box, md->homenr, state->x);
+ }
+ else
+ {
+ cg0 = 0;
+ cg1 = top->cgs.nr;
+ put_charge_groups_in_box(fplog, cg0, cg1, fr->ePBC, state->box,
+ &(top->cgs), state->x, fr->cg_cm);
+ }
+
if (graph)
{
mk_mshift(fplog, graph, fr->ePBC, state->box, state->x);
}
}
- /* After this all coordinate arrays will contain whole molecules */
+ /* After this all coordinate arrays will contain whole charge groups */
if (graph)
{
shift_self(graph, state->box, state->x);
void calc_enervirdiff(FILE *fplog, int eDispCorr, t_forcerec *fr)
{
- double eners[2], virs[2], enersum, virsum, y0, f, g, h;
- double r0, r1, r, rc3, rc9, ea, eb, ec, pa, pb, pc, pd;
- double invscale, invscale2, invscale3;
- int ri0, ri1, ri, i, offstart, offset;
- real scale, *vdwtab, tabfactor, tmp;
+ double eners[2], virs[2], enersum, virsum, y0, f, g, h;
+ double r0, r1, r, rc3, rc9, ea, eb, ec, pa, pb, pc, pd;
+ double invscale, invscale2, invscale3;
+ int ri0, ri1, ri, i, offstart, offset;
+ real scale, *vdwtab, tabfactor, tmp;
fr->enershiftsix = 0;
fr->enershifttwelve = 0;
eners[i] = 0;
virs[i] = 0;
}
- if (fr->vdwtype == evdwSWITCH || fr->vdwtype == evdwSHIFT ||
- fr->vdw_modifier == eintmodPOTSWITCH ||
- fr->vdw_modifier == eintmodFORCESWITCH)
+ if ((fr->vdw_modifier == eintmodPOTSHIFT) ||
+ (fr->vdw_modifier == eintmodPOTSWITCH) ||
+ (fr->vdw_modifier == eintmodFORCESWITCH) ||
+ (fr->vdwtype == evdwSHIFT) ||
+ (fr->vdwtype == evdwSWITCH))
{
- if (fr->rvdw_switch == 0)
+ if (((fr->vdw_modifier == eintmodPOTSWITCH) ||
+ (fr->vdw_modifier == eintmodFORCESWITCH) ||
+ (fr->vdwtype == evdwSWITCH)) && fr->rvdw_switch == 0)
{
gmx_fatal(FARGS,
"With dispersion correction rvdw-switch can not be zero "
"for vdw-type = %s", evdw_names[fr->vdwtype]);
}
- scale = fr->nblists[0].table_elec_vdw.scale;
+ scale = fr->nblists[0].table_vdw.scale;
vdwtab = fr->nblists[0].table_vdw.data;
/* Round the cut-offs to exact table values for precision */
ri0 = floor(fr->rvdw_switch*scale);
ri1 = ceil(fr->rvdw*scale);
+
+ /* The code below has some support for handling force-switching, i.e.
+ * when the force (instead of potential) is switched over a limited
+ * region. This leads to a constant shift in the potential inside the
+ * switching region, which we can handle by adding a constant energy
+ * term in the force-switch case just like when we do potential-shift.
+ *
+ * For now this is not enabled, but to keep the functionality in the
+ * code we check separately for switch and shift. When we do force-switch
+ * the shifting point is rvdw_switch, while it is the cutoff when we
+ * have a classical potential-shift.
+ *
+ * For a pure potential-shift the potential has a constant shift
+ * all the way out to the cutoff, and that is it. For other forms
+ * we need to calculate the constant shift up to the point where we
+ * start modifying the potential.
+ */
+ ri0 = (fr->vdw_modifier == eintmodPOTSHIFT) ? ri1 : ri0;
+
r0 = ri0/scale;
r1 = ri1/scale;
rc3 = r0*r0*r0;
rc9 = rc3*rc3*rc3;
- if (fr->vdwtype == evdwSHIFT ||
- fr->vdw_modifier == eintmodFORCESWITCH)
+ if ((fr->vdw_modifier == eintmodFORCESWITCH) ||
+ (fr->vdwtype == evdwSHIFT))
{
/* Determine the constant energy shift below rvdw_switch.
* Table has a scale factor since we have scaled it down to compensate
fr->enershiftsix = (real)(-1.0/(rc3*rc3)) - 6.0*vdwtab[8*ri0];
fr->enershifttwelve = (real)( 1.0/(rc9*rc3)) - 12.0*vdwtab[8*ri0 + 4];
}
+ else if (fr->vdw_modifier == eintmodPOTSHIFT)
+ {
+ fr->enershiftsix = (real)(-1.0/(rc3*rc3));
+ fr->enershifttwelve = (real)( 1.0/(rc9*rc3));
+ }
+
/* Add the constant part from 0 to rvdw_switch.
* This integration from 0 to rvdw_switch overcounts the number
* of interactions by 1, as it also counts the self interaction.
*/
eners[0] += 4.0*M_PI*fr->enershiftsix*rc3/3.0;
eners[1] += 4.0*M_PI*fr->enershifttwelve*rc3/3.0;
+
+ /* Calculate the contribution in the range [r0,r1] where we
+ * modify the potential. For a pure potential-shift modifier we will
+ * have ri0==ri1, and there will not be any contribution here.
+ */
for (i = 0; i < 2; i++)
{
enersum = 0;
virs[i] -= virsum;
}
- /* now add the correction for rvdw_switch to infinity */
+ /* Alright: Above we compensated by REMOVING the parts outside r0
+ * corresponding to the ideal VdW 1/r6 and /r12 potentials.
+ *
+ * Regardless of whether r0 is the point where we start switching,
+ * or the cutoff where we calculated the constant shift, we include
+ * all the parts we are missing out to infinity from r0 by
+ * calculating the analytical dispersion correction.
+ */
eners[0] += -4.0*M_PI/(3.0*rc3);
eners[1] += 4.0*M_PI/(9.0*rc9);
virs[0] += 8.0*M_PI/rc3;
evdw_names[fr->vdwtype]);
}
- /* TODO: remove this code once we have group LJ-PME kernels
- * that calculate the exact, full LJ param C6/r^6 within the cut-off,
- * as the current nbnxn kernels do.
- */
+ /* When we deprecate the group kernels the code below can go too */
if (fr->vdwtype == evdwPME && fr->cutoff_scheme == ecutsGROUP)
{
/* Calculate self-interaction coefficient (assuming that
real *table_v,
real *table_fdv0,
int ntab,
- real dx,
+ double dx,
real beta,
real_space_grid_contribution_computer v_lr)
{
sfree(td->f);
}
-static void fill_table(t_tabledata *td, int tp, const t_forcerec *fr)
+static void fill_table(t_tabledata *td, int tp, const t_forcerec *fr,
+ gmx_bool b14only)
{
/* Fill the table according to the formulas in the manual.
* In principle, we only need the potential and the second
int i;
double reppow, p;
double r1, rc, r12, r13;
- double r, r2, r6, rc6;
+ double r, r2, r6, rc2, rc6, rc12;
double expr, Vtab, Ftab;
/* Parameters for David's function */
double A = 0, B = 0, C = 0, A_3 = 0, B_4 = 0;
/* Parameters for the switching function */
double ksw, swi, swi1;
/* Temporary parameters */
- gmx_bool bSwitch, bShift;
+ gmx_bool bPotentialSwitch, bForceSwitch, bPotentialShift;
double ewc = fr->ewaldcoeff_q;
double ewclj = fr->ewaldcoeff_lj;
+ double Vcut = 0;
- bSwitch = ((tp == etabLJ6Switch) || (tp == etabLJ12Switch) ||
- (tp == etabCOULSwitch) ||
- (tp == etabEwaldSwitch) || (tp == etabEwaldUserSwitch));
-
- bShift = ((tp == etabLJ6Shift) || (tp == etabLJ12Shift) ||
- (tp == etabShift));
+ if (b14only)
+ {
+ bPotentialSwitch = FALSE;
+ bForceSwitch = FALSE;
+ bPotentialShift = FALSE;
+ }
+ else
+ {
+ bPotentialSwitch = ((tp == etabLJ6Switch) || (tp == etabLJ12Switch) ||
+ (tp == etabCOULSwitch) ||
+ (tp == etabEwaldSwitch) || (tp == etabEwaldUserSwitch) ||
+ (tprops[tp].bCoulomb && (fr->coulomb_modifier == eintmodPOTSWITCH)) ||
+ (!tprops[tp].bCoulomb && (fr->vdw_modifier == eintmodPOTSWITCH)));
+ bForceSwitch = ((tp == etabLJ6Shift) || (tp == etabLJ12Shift) ||
+ (tp == etabShift) ||
+ (tprops[tp].bCoulomb && (fr->coulomb_modifier == eintmodFORCESWITCH)) ||
+ (!tprops[tp].bCoulomb && (fr->vdw_modifier == eintmodFORCESWITCH)));
+ bPotentialShift = ((tprops[tp].bCoulomb && (fr->coulomb_modifier == eintmodPOTSHIFT)) ||
+ (!tprops[tp].bCoulomb && (fr->vdw_modifier == eintmodPOTSHIFT)));
+ }
reppow = fr->reppow;
r1 = fr->rvdw_switch;
rc = fr->rvdw;
}
- if (bSwitch)
+ if (bPotentialSwitch)
{
ksw = 1.0/(pow5(rc-r1));
}
{
ksw = 0.0;
}
- if (bShift)
+ if (bForceSwitch)
{
if (tp == etabShift)
{
fp = xvgropen("switch.xvg", "switch", "r", "s");
#endif
+ if (bPotentialShift)
+ {
+ rc2 = rc*rc;
+ rc6 = 1.0/(rc2*rc2*rc2);
+ if (gmx_within_tol(reppow, 12.0, 10*GMX_DOUBLE_EPS))
+ {
+ rc12 = rc6*rc6;
+ }
+ else
+ {
+ rc12 = pow(rc, -reppow);
+ }
+
+ switch (tp)
+ {
+ case etabLJ6:
+ /* Dispersion */
+ Vcut = -rc6;
+ break;
+ case etabLJ6Ewald:
+ Vcut = -rc6*exp(-ewclj*ewclj*rc2)*(1 + ewclj*ewclj*rc2 + pow4(ewclj)*rc2*rc2/2);
+ break;
+ case etabLJ12:
+ /* Repulsion */
+ Vcut = rc12;
+ break;
+ case etabCOUL:
+ Vcut = 1.0/rc;
+ break;
+ case etabEwald:
+ case etabEwaldSwitch:
+ Vtab = gmx_erfc(ewc*rc)/rc;
+ break;
+ case etabEwaldUser:
+ /* Only calculate minus the reciprocal space contribution */
+ Vtab = -gmx_erf(ewc*rc)/rc;
+ break;
+ case etabRF:
+ case etabRF_ZERO:
+ /* No need for preventing the usage of modifiers with RF */
+ Vcut = 0.0;
+ break;
+ case etabEXPMIN:
+ Vcut = exp(-rc);
+ break;
+ default:
+ gmx_fatal(FARGS, "Cannot apply new potential-shift modifier to interaction type '%s' yet. (%s,%d)",
+ tprops[tp].name, __FILE__, __LINE__);
+ }
+ }
+
for (i = td->nx0; (i < td->nx); i++)
{
r = td->x[i];
}
Vtab = 0.0;
Ftab = 0.0;
- if (bSwitch)
+ if (bPotentialSwitch)
{
/* swi is function, swi1 1st derivative and swi2 2nd derivative */
/* The switch function is 1 for r<r1, 0 for r>rc, and smooth for
gmx_fatal(FARGS, "Table type %d not implemented yet. (%s,%d)",
tp, __FILE__, __LINE__);
}
- if (bShift)
+ if (bForceSwitch)
{
/* Normal coulomb with cut-off correction for potential */
if (r < rc)
Ftab += A*r12 + B*r13;
}
}
+ else
+ {
+ /* Make sure interactions are zero outside cutoff with modifiers */
+ Vtab = 0;
+ Ftab = 0;
+ }
+ }
+ if (bPotentialShift)
+ {
+ if (r < rc)
+ {
+ Vtab -= Vcut;
+ }
+ else
+ {
+ /* Make sure interactions are zero outside cutoff with modifiers */
+ Vtab = 0;
+ Ftab = 0;
+ }
}
if (ETAB_USER(tp))
Ftab += td->f[i];
}
- if ((r > r1) && bSwitch)
+ if (bPotentialSwitch)
{
- Ftab = Ftab*swi - Vtab*swi1;
- Vtab = Vtab*swi;
+ if (r >= rc)
+ {
+ /* Make sure interactions are zero outside cutoff with modifiers */
+ Vtab = 0;
+ Ftab = 0;
+ }
+ else if (r > r1)
+ {
+ Ftab = Ftab*swi - Vtab*swi1;
+ Vtab = Vtab*swi;
+ }
}
-
/* Convert to single precision when we store to mem */
td->v[i] = Vtab;
td->f[i] = Ftab;
gmx_incons("Potential modifiers other than potential-shift are only implemented for LJ cut-off");
}
- switch (fr->vdw_modifier)
+ /* LJ-PME and other (shift-only) modifiers are handled by applying the modifiers
+ * to the original interaction forms when we fill the table, so we only check cutoffs here.
+ */
+ if (fr->vdwtype == evdwCUT)
{
- case eintmodNONE:
- case eintmodPOTSHIFT:
- case eintmodEXACTCUTOFF:
- /* No modification */
- break;
- case eintmodPOTSWITCH:
- tabsel[etiLJ6] = etabLJ6Switch;
- tabsel[etiLJ12] = etabLJ12Switch;
- break;
- case eintmodFORCESWITCH:
- tabsel[etiLJ6] = etabLJ6Shift;
- tabsel[etiLJ12] = etabLJ12Shift;
- break;
- default:
- gmx_incons("Unsupported vdw_modifier");
+ switch (fr->vdw_modifier)
+ {
+ case eintmodNONE:
+ case eintmodPOTSHIFT:
+ case eintmodEXACTCUTOFF:
+ /* No modification */
+ break;
+ case eintmodPOTSWITCH:
+ tabsel[etiLJ6] = etabLJ6Switch;
+ tabsel[etiLJ12] = etabLJ12Switch;
+ break;
+ case eintmodFORCESWITCH:
+ tabsel[etiLJ6] = etabLJ6Shift;
+ tabsel[etiLJ12] = etabLJ12Shift;
+ break;
+ default:
+ gmx_incons("Unsupported vdw_modifier");
+ }
}
}
}
init_table(nx, nx0,
(tabsel[k] == etabEXPMIN) ? table.scale_exp : table.scale,
&(td[k]), !bReadTab);
- fill_table(&(td[k]), tabsel[k], fr);
+ fill_table(&(td[k]), tabsel[k], fr, b14only);
if (out)
{
fprintf(out, "%s table with %d data points for %s%s.\n"
}
if (md->nPerturbed && md->bPerturbed[n])
{
- dekindl += 0.5*(md->massB[n] - md->massA[n])*iprod(v_corrt, v_corrt);
+ /* The minus sign here might be confusing.
+ * The kinetic contribution from dH/dl doesn't come from
+ * d m(l)/2 v^2 / dl, but rather from d p^2/2m(l) / dl,
+ * where p are the momenta. The difference is only a minus sign.
+ */
+ dekindl -= 0.5*(md->massB[n] - md->massA[n])*iprod(v_corrt, v_corrt);
}
}
ekind->dekindl = dekindl;
}
else
{
- lamfac = 0;
+ lamfac = lambda;
type = md->typeB;
}
}
for (c = 0; c < pull->ncoord; c++)
{
pcrd = &pull->coord[c];
+ ref = pcrd->init + pcrd->rate*t;
low_get_pull_coord_dr(pull, pcrd, pbc, t,
rnew[pcrd->group[1]],
cmp_int(fp, "inputrec->cutoff_scheme", -1, ir1->cutoff_scheme, ir2->cutoff_scheme);
cmp_int(fp, "inputrec->ns_type", -1, ir1->ns_type, ir2->ns_type);
cmp_int(fp, "inputrec->nstlist", -1, ir1->nstlist, ir2->nstlist);
- cmp_int(fp, "inputrec->ndelta", -1, ir1->ndelta, ir2->ndelta);
cmp_int(fp, "inputrec->nstcomm", -1, ir1->nstcomm, ir2->nstcomm);
cmp_int(fp, "inputrec->comm_mode", -1, ir1->comm_mode, ir2->comm_mode);
- cmp_int(fp, "inputrec->nstcheckpoint", -1, ir1->nstcheckpoint, ir2->nstcheckpoint);
cmp_int(fp, "inputrec->nstlog", -1, ir1->nstlog, ir2->nstlog);
cmp_int(fp, "inputrec->nstxout", -1, ir1->nstxout, ir2->nstxout);
cmp_int(fp, "inputrec->nstvout", -1, ir1->nstvout, ir2->nstvout);
cmp_real(fp, "inputrec->ewald_rtol", -1, ir1->ewald_rtol, ir2->ewald_rtol, ftol, abstol);
cmp_int(fp, "inputrec->ewald_geometry", -1, ir1->ewald_geometry, ir2->ewald_geometry);
cmp_real(fp, "inputrec->epsilon_surface", -1, ir1->epsilon_surface, ir2->epsilon_surface, ftol, abstol);
- cmp_int(fp, "inputrec->bOptFFT", -1, ir1->bOptFFT, ir2->bOptFFT);
cmp_int(fp, "inputrec->bContinuation", -1, ir1->bContinuation, ir2->bContinuation);
cmp_int(fp, "inputrec->bShakeSOR", -1, ir1->bShakeSOR, ir2->bShakeSOR);
cmp_int(fp, "inputrec->etc", -1, ir1->etc, ir2->etc);
cmp_real(fp, "inputrec->orires_fc", -1, ir1->orires_fc, ir2->orires_fc, ftol, abstol);
cmp_real(fp, "inputrec->orires_tau", -1, ir1->orires_tau, ir2->orires_tau, ftol, abstol);
cmp_int(fp, "inputrec->nstorireout", -1, ir1->nstorireout, ir2->nstorireout);
- cmp_real(fp, "inputrec->dihre_fc", -1, ir1->dihre_fc, ir2->dihre_fc, ftol, abstol);
cmp_real(fp, "inputrec->em_stepsize", -1, ir1->em_stepsize, ir2->em_stepsize, ftol, abstol);
cmp_real(fp, "inputrec->em_tol", -1, ir1->em_tol, ir2->em_tol, ftol, abstol);
cmp_int(fp, "inputrec->niter", -1, ir1->niter, ir2->niter);
}
if (cmp_bool(fp, "bF", -1, fr1->bF, fr2->bF))
{
- cmp_rvecs_rmstol(fp, "f", min(fr1->natoms, fr2->natoms), fr1->f, fr2->f, ftol, abstol);
+ if (bRMSD)
+ {
+ cmp_rvecs(fp, "f", min(fr1->natoms, fr2->natoms), fr1->f, fr2->f, bRMSD, ftol, abstol);
+ }
+ else
+ {
+ cmp_rvecs_rmstol(fp, "f", min(fr1->natoms, fr2->natoms), fr1->f, fr2->f, ftol, abstol);
+ }
}
if (cmp_bool(fp, "bBox", -1, fr1->bBox, fr2->bBox))
{
ATOM 7 CB RA B 1 20.000 30.000 0.000 1.50 0.00
ATOM 8 S1 RA B 1 20.000 40.000 0.000 1.50 0.30
ATOM 9 S2 RA B 1 30.000 10.000 0.000 2.00 0.30
-ATOM 13 CB RD B 2 40.000 10.000 0.000 1.00 0.00
-ATOM 14 S1 RD B 2 40.000 20.000 0.000 0.50 0.00
-ATOM 15 S2 RD B 2 40.000 30.000 0.000 0.00 0.00
+ATOM 13 CB A RD B 2 40.000 10.000 0.000 1.00 0.00
+ATOM 14 S1 A RD B 2 40.000 20.000 0.000 0.50 0.00
+ATOM 15 S2 A RD B 2 40.000 30.000 0.000 0.00 0.00
TER
ENDMDL
]]></String>
ATOM 10 CB RC B 1A 30.000 20.000 0.000 0.00 0.00
ATOM 11 S1 RC B 1A 30.000 30.000 0.000 0.00 0.00
ATOM 12 S2 RC B 1A 30.000 40.000 0.000 0.00 0.30
-ATOM 13 CB RD B 2 40.000 10.000 0.000 1.00 0.00
-ATOM 14 S1 RD B 2 40.000 20.000 0.000 0.50 0.00
-ATOM 15 S2 RD B 2 40.000 30.000 0.000 0.00 0.00
+ATOM 13 CB A RD B 2 40.000 10.000 0.000 1.00 0.00
+ATOM 14 S1 A RD B 2 40.000 20.000 0.000 0.50 0.00
+ATOM 15 S2 A RD B 2 40.000 30.000 0.000 0.00 0.00
TER
ENDMDL
]]></String>
ATOM 7 CB RA B 1 20.000 30.000 0.000 1.50 0.00
ATOM 8 S1 RA B 1 20.000 40.000 0.000 1.50 0.30
ATOM 9 S2 RA B 1 30.000 10.000 0.000 2.00 0.30
-ATOM 13 CB RD B 2 40.000 10.000 0.000 1.00 0.00
-ATOM 14 S1 RD B 2 40.000 20.000 0.000 0.50 0.00
+ATOM 13 CB A RD B 2 40.000 10.000 0.000 1.00 0.00
+ATOM 14 S1 A RD B 2 40.000 20.000 0.000 0.50 0.00
TER
ENDMDL
]]></String>
add_library(fahcore $<TARGET_OBJECTS:mdrun_objlib>)
elseif(GMX_BUILD_MDRUN_ONLY)
add_executable(mdrun $<TARGET_OBJECTS:mdrun_objlib> mdrun_main.cpp)
- target_link_libraries(mdrun
- ${GMX_EXTRA_LIBRARIES} libgromacs ${GMX_EXE_LINKER_FLAGS})
+ target_link_libraries(mdrun libgromacs ${GMX_EXE_LINKER_FLAGS})
set(BINARY_NAME "mdrun${GMX_BINARY_SUFFIX}")
set_target_properties(mdrun PROPERTIES
OUTPUT_NAME "${BINARY_NAME}"
${GMX_MAIN_SOURCES}
$<TARGET_OBJECTS:mdrun_objlib>
$<TARGET_OBJECTS:view_objlib>)
- target_link_libraries(gmx
- ${GMX_EXTRA_LIBRARIES} libgromacs ${GMX_EXE_LINKER_FLAGS})
+ target_link_libraries(gmx libgromacs ${GMX_EXE_LINKER_FLAGS})
if(GMX_X11)
target_link_libraries(gmx ${X11_LIBRARIES})
endif()
debug_gmx();
/* Check for polarizable models and flexible constraints */
- shellfc = init_shell_flexcon(fplog, fr->cutoff_scheme == ecutsVERLET,
+ shellfc = init_shell_flexcon(fplog,
top_global, n_flexible_constraints(constr),
(ir->bContinuation ||
(DOMAINDECOMP(cr) && !MASTER(cr))) ?
NULL : state_global->x);
-
+ if (shellfc && ir->nstcalcenergy != 1)
+ {
+ gmx_fatal(FARGS, "You have nstcalcenergy set to a value (%d) that is different from 1.\nThis is not supported in combinations with shell particles.\nPlease make a new tpr file.", ir->nstcalcenergy);
+ }
+ if (shellfc && DOMAINDECOMP(cr))
+ {
+ gmx_fatal(FARGS, "Shell particles are not implemented with domain decomposition, use a single rank");
+ }
if (shellfc && ir->eI == eiNM)
{
/* Currently shells don't work with Normal Modes */
"[PAR]",
"When PME is used with domain decomposition, separate nodes can",
"be assigned to do only the PME mesh calculation;",
- "this is computationally more efficient starting at about 12 nodes.",
+ "this is computationally more efficient starting at about 12 nodes",
+ "or even fewer when OpenMP parallelization is used.",
"The number of PME nodes is set with option [TT]-npme[tt],",
"this can not be more than half of the nodes.",
"By default [TT]mdrun[tt] makes a guess for the number of PME",
- "nodes when the number of nodes is larger than 11 or performance wise",
- "not compatible with the PME grid x dimension.",
- "But the user should optimize npme. Performance statistics on this issue",
+ "nodes when the number of nodes is larger than 16. With GPUs,",
+ "PME nodes are not selected automatically, since the optimal setup",
+ "depends very much on the details of the hardware.",
+ "In all cases you might gain performance by optimizing [TT]-npme[tt].",
+ "Performance statistics on this issue",
"are written at the end of the log file.",
"For good load balancing at high parallelization, the PME grid x and y",
"dimensions should be divisible by the number of PME nodes",
{
if (re->q[re->type][re->ind[j]] < re->q[re->type][re->ind[i]])
{
+ /* Unordered replicas are supposed to work, but there
+ * is still an issues somewhere.
+ * Note that at this point still re->ind[i]=i.
+ */
+ gmx_fatal(FARGS, "Replicas with indices %d < %d have %ss %g > %g, please order your replicas on increasing %s",
+ i, j,
+ erename[re->type],
+ re->q[re->type][i], re->q[re->type][j],
+ erename[re->type]);
+
k = re->ind[i];
re->ind[i] = re->ind[j];
re->ind[j] = k;
dpV = (beta[ap]*re->pres[ap]-beta[bp]*re->pres[bp])*(Vol[b]-Vol[a])/PRESFAC;
if (bPrint)
{
- fprintf(fplog, " dpV = %10.3e d = %10.3e\nb", dpV, delta + dpV);
+ fprintf(fplog, " dpV = %10.3e d = %10.3e\n", dpV, delta + dpV);
}
delta += dpV;
}
gmx_bool bVol = FALSE;
bMultiEx = (re->nex > 1); /* multiple exchanges at each state */
- fprintf(fplog, "Replica exchange at step " "%" GMX_PRId64 " time %g\n", step, time);
+ fprintf(fplog, "Replica exchange at step %" GMX_PRId64 " time %.5f\n", step, time);
if (re->bNPT)
{
}
static void
-prepare_to_do_exchange(FILE *fplog,
- const int *destinations,
- const int replica_id,
- const int nrepl,
- int *maxswap,
- int **order,
- int **cyclic,
- int *incycle,
- gmx_bool *bThisReplicaExchanged)
+prepare_to_do_exchange(FILE *fplog,
+ struct gmx_repl_ex *re,
+ const int replica_id,
+ int *maxswap,
+ gmx_bool *bThisReplicaExchanged)
{
int i, j;
/* Hold the cyclic decomposition of the (multiple) replica
gmx_bool bAnyReplicaExchanged = FALSE;
*bThisReplicaExchanged = FALSE;
- for (i = 0; i < nrepl; i++)
+ for (i = 0; i < re->nrepl; i++)
{
- if (destinations[i] != i)
+ if (re->destinations[i] != re->ind[i])
{
/* only mark as exchanged if the index has been shuffled */
bAnyReplicaExchanged = TRUE;
if (bAnyReplicaExchanged)
{
/* reinitialize the placeholder arrays */
- for (i = 0; i < nrepl; i++)
+ for (i = 0; i < re->nrepl; i++)
{
- for (j = 0; j < nrepl; j++)
+ for (j = 0; j < re->nrepl; j++)
{
- cyclic[i][j] = -1;
- order[i][j] = -1;
+ re->cyclic[i][j] = -1;
+ re->order[i][j] = -1;
}
}
/* Identify the cyclic decomposition of the permutation (very
* fast if neighbor replica exchange). */
- cyclic_decomposition(destinations, cyclic, incycle, nrepl, maxswap);
+ cyclic_decomposition(re->destinations, re->cyclic, re->incycle, re->nrepl, maxswap);
/* Now translate the decomposition into a replica exchange
* order at each step. */
- compute_exchange_order(fplog, cyclic, order, nrepl, *maxswap);
+ compute_exchange_order(fplog, re->cyclic, re->order, re->nrepl, *maxswap);
/* Did this replica do any exchange at any point? */
for (j = 0; j < *maxswap; j++)
{
- if (replica_id != order[replica_id][j])
+ if (replica_id != re->order[replica_id][j])
{
*bThisReplicaExchanged = TRUE;
break;
{
replica_id = re->repl;
test_for_replica_exchange(fplog, cr->ms, re, enerd, det(state_local->box), step, time);
- prepare_to_do_exchange(fplog, re->destinations, replica_id, re->nrepl, &maxswap,
- re->order, re->cyclic, re->incycle, &bThisReplicaExchanged);
+ prepare_to_do_exchange(fplog, re, replica_id, &maxswap, &bThisReplicaExchanged);
}
/* Do intra-simulation broadcast so all processors belonging to
* each simulation know whether they need to participate in
/* Initialize per-physical-node MPI process/thread ID and counters. */
gmx_init_intranode_counters(cr);
-
#ifdef GMX_MPI
+ if (MULTISIM(cr))
+ {
+ md_print_info(cr, fplog,
+ "This is simulation %d out of %d running as a composite Gromacs\n"
+ "multi-simulation job. Setup for this simulation:\n\n",
+ cr->ms->sim, cr->ms->nsim);
+ }
md_print_info(cr, fplog, "Using %d MPI %s\n",
cr->nnodes,
#ifdef GMX_THREAD_MPI