endif(${GMX_ACCELERATION} STREQUAL "NONE")
+if(GMX_FORTRAN)
+ if (GMX_THREADS)
+ message(WARNING "FORTRAN is incompatible with threads. Disable threads or FORTRAN kernels")
+ endif()
+endif()
src/CMakeLists.txt \
src/tools/CMakeLists.txt \
COPYING-GPU \
- INSTALL-GPU
+ INSTALL-GPU \
+ INSTALL.cmake \
+ INSTALL.automake
install-exec-hook:
+if NO_LA_FILES
+ cd $(DESTDIR)$(libdir) && rm -f libmd@LIBSUFFIX@.la libgmx@LIBSUFFIX@.la libgmxpreprocess@LIBSUFFIX@.la libgmxana@LIBSUFFIX@.la
+endif
@echo ""
@echo "GROMACS is installed under $(prefix)."
@echo "Make sure to update your PATH and MANPATH to find the"
(cd $(top_builddir)/src/mdlib && $(MAKE) install ; exit 0)
(cd $(top_builddir)/src/kernel && $(MAKE) install-libLTLIBRARIES ; exit 0)
(cd $(top_builddir)/src/kernel && $(MAKE) install-mdrun ; exit 0)
+if NO_LA_FILES
+ cd $(DESTDIR)$(libdir) && rm -f libmd@LIBSUFFIX@.la libgmx@LIBSUFFIX@.la libgmxpreprocess@LIBSUFFIX@.la libgmxana@LIBSUFFIX@.la
+endif
fahcore:
(cd $(top_builddir)/src/gmxlib && $(MAKE) ; exit 0)
Welcome to the official version of GROMACS!
If you are familiar with unix, it should be fairly trivial to compile and
-install GROMACS. Installation instructions are available in the INSTALL file,
-and a more extended step-by-step guide can be found on http://www.gromacs.org .
+install GROMACS. Installation instructions are available in the INSTALL.*
+files (there is one for automake users, INSTALL.automake and one for cmake
+users, INSTALL.cmake). A more extended step-by-step guide can be found
+on our website http://www.gromacs.org .
Of course we will do our utmost to help you with any problems, but PLEASE
READ THE INSTALLATION INSTRUCTIONS BEFORE CONTACTING US!
# FFTW2_INCLUDE_DIR - where to find [d]fftw.h
# FFTW2_LIBRARIES - List of libraries when using FFTW.
# FFTW2_FOUND - True if FFTW found.
+#
+# The FFTW2 root installation directory can be provided in the FFTW2_ROOT_DIR
if (FFTW2_INCLUDE_DIR)
# Already in cache, be silent
set(FFTW2_FOUND 0)
+file(TO_CMAKE_PATH "$ENV{FFTW2_ROOT_DIR}" _env_FFTW2_ROOT_DIR)
foreach(fftw2_name dfftw fftw)
string(TOUPPER ${fftw2_name} fftw2_uname)
string(REPLACE "fftw" "rfftw" rfftw2_name ${fftw2_name})
if(NOT FFTW2_FOUND)
- find_path (FFTW2_INCLUDE_DIR ${fftw2_name}.h)
- find_library (CFFTW2_LIBRARIES ${fftw2_name})
- find_library (RFFTW2_LIBRARIES ${rfftw2_name})
+ find_path (FFTW2_INCLUDE_DIR
+ PATHS "${_env_FFTW2_ROOT_DIR}/include"
+ ${fftw2_name}.h)
+ CACHE STRING "Path to double precision FFTW2 headers")
+ find_library (CFFTW2_LIBRARIES ${fftw2_name}
+ PATHS "${_env_FFTW2_ROOT_DIR}/lib"
+ CACHE STRING "Double precision CFFTW2 libraries")
+ find_library (RFFTW2_LIBRARIES ${rfftw2_name}
+ PATHS "${_env_FFTW2_ROOT_DIR}/lib"
+ CACHE STRING "Double precision RFFTW2 libraries")
TRY_COMPILE(FFTW2_FOUND "${CMAKE_BINARY_DIR}"
"${CMAKE_SOURCE_DIR}/cmake/TestFFTW2.c"
COMPILE_DEFINITIONS "-I${FFTW2_INCLUDE_DIR} -DDOUBLE -D${fftw2_uname}" )
# handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (FFTW2 DEFAULT_MSG FFTW2_LIBRARIES FFTW2_INCLUDE_DIR)
+set(__MSG "Could not find FFTW2. Provide the fftw2 install directory in the FFTW2_ROOT_DIR environment variable.")
+find_package_handle_standard_args (FFTW2 ${__MSG} FFTW2_LIBRARIES FFTW2_INCLUDE_DIR)
mark_as_advanced (RFFTW2_LIBRARIES CFFTW2_LIBRARIES FFTW2_LIBRARIES FFTW2_INCLUDE_DIR)
# FFTW2_INCLUDE_DIR - where to find [d]fftw.h
# FFTW2_LIBRARIES - List of libraries when using FFTW.
# FFTW2_FOUND - True if FFTW found.
+#
+# The FFTW2F root installation directory can be provided in the FFTW2F_ROOT_DIR
+
if (FFTW2_INCLUDE_DIR)
# Already in cache, be silent
set(FFTW2_FOUND 0)
+file(TO_CMAKE_PATH "$ENV{FFTW2F_ROOT_DIR}" _env_FFTW2F_ROOT_DIR)
foreach(fftw2_name sfftw fftw)
string(TOUPPER ${fftw2_name} fftw2_uname)
string(REPLACE "fftw" "rfftw" rfftw2_name ${fftw2_name})
if(NOT FFTW2_FOUND)
- find_path (FFTW2_INCLUDE_DIR ${fftw2_name}.h)
- find_library (CFFTW2_LIBRARIES ${fftw2_name})
- find_library (RFFTW2_LIBRARIES ${rfftw2_name})
+ find_path (FFTW2_INCLUDE_DIR
+ PATHS "${_env_FFTW2F_ROOT_DIR}/include"
+ ${fftw2_name}.h
+ CACHE STRING "Path single precision FFTW2 headers")
+ find_library (CFFTW2_LIBRARIES ${fftw2_name}
+ PATHS "${_env_FFTW2F_ROOT_DIR}/lib"
+ CACHE STRING "Single precision CFFTW2 libraries")
+ find_library (RFFTW2_LIBRARIES ${rfftw2_name}
+ PATHS "${_env_FFTW2F_ROOT_DIR}/lib"
+ CACHE STRING "Single precision RFFTW2 libraries")
TRY_COMPILE(FFTW2_FOUND "${CMAKE_BINARY_DIR}"
"${CMAKE_SOURCE_DIR}/cmake/TestFFTW2.c"
COMPILE_DEFINITIONS "-I${FFTW2_INCLUDE_DIR} -D${fftw2_uname}" )
# handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (FFTW2 DEFAULT_MSG FFTW2_LIBRARIES FFTW2_INCLUDE_DIR)
+set(__MSG "Could not find FFTW2F. Provide the fftw2 install directory in the FFTW2F_ROOT_DIR environment variable.")
+find_package_handle_standard_args (FFTW2 ${__MSG} FFTW2_LIBRARIES FFTW2_INCLUDE_DIR)
mark_as_advanced (RFFTW2_LIBRARIES CFFTW2_LIBRARIES FFTW2_LIBRARIES FFTW2_INCLUDE_DIR)
# FFTW3_INCLUDE_DIR - where to find fftw3.h
# FFTW3_LIBRARIES - List of libraries when using FFTW.
# FFTW3_FOUND - True if FFTW found.
+#
+# The FFTW3 root installation directory can be provided in the FFTW3_ROOT_DIR
if (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES)
# Already in cache, be silent
set (FFTW3_FIND_QUIETLY TRUE)
endif (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES)
-find_path (FFTW3_INCLUDE_DIR fftw3.h
- CACHE STRING "Path to headers for double precision FFTW3")
+file(TO_CMAKE_PATH "$ENV{FFTW3_ROOT_DIR}" _env_FFTW3_ROOT_DIR)
+find_path (FFTW3_INCLUDE_DIR fftw3.h
+ PATHS "${_env_FFTW3_ROOT_DIR}/include"
+ CACHE STRING "Path to double precision FFTW3 headers")
find_library (FFTW3_LIBRARIES
NAMES fftw3
- PATHS "${FFTW3_INCLUDE_DIR}/../lib"
+ PATHS "${_env_FFTW3_ROOT_DIR}/lib"
+ "${FFTW3_INCLUDE_DIR}/../lib"
CACHE STRING "Double precision FFTW3 libraries")
-
# handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (FFTW3 DEFAULT_MSG FFTW3_LIBRARIES FFTW3_INCLUDE_DIR)
+set(__MSG "Could not find FFTW3. Provide the fftw3 install directory in the FFTW3_ROOT_DIR environment variable.")
+find_package_handle_standard_args (FFTW3 ${__MSG} FFTW3_LIBRARIES FFTW3_INCLUDE_DIR)
mark_as_advanced (FFTW3_LIBRARIES FFTW3_INCLUDE_DIR)
# FFTW3F_INCLUDE_DIR - where to find fftw3.h
# FFTW3F_LIBRARIES - List of libraries when using FFTW.
# FFTW3F_FOUND - True if FFTW found.
+#
+# The FFTW3F root installation directory can be provided in the FFTW3F_ROOT_DIR
if (FFTW3F_INCLUDE_DIR AND FFTW3F_LIBRARIES)
# Already in cache, be silent
set (FFTW3F_FIND_QUIETLY TRUE)
endif (FFTW3F_INCLUDE_DIR AND FFTW3F_LIBRARIES)
+file(TO_CMAKE_PATH "$ENV{FFTW3F_ROOT_DIR}" _env_FFTW3F_ROOT_DIR)
+
find_path (FFTW3F_INCLUDE_DIR fftw3.h
- CACHE STRING "Path to headers for single precision FFTW3")
+ PATHS "${_env_FFTW3F_ROOT_DIR}/include"
+ CACHE STRING "Path to single precision FFTW3 headers")
find_library (FFTW3F_LIBRARIES
NAMES fftw3f
- PATHS "${FFTW3F_INCLUDE_DIR}/../lib"
+ PATHS "${_env_FFTW3F_ROOT_DIR}/lib"
+ "${FFTW3F_INCLUDE_DIR}/../lib"
CACHE STRING "Single precision FFTW3 libraries")
# handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if
# all listed variables are TRUE
include (FindPackageHandleStandardArgs)
-find_package_handle_standard_args (FFTW3F DEFAULT_MSG FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIR)
+set(__MSG "Could not find FFTW3F. Provide the fftw3 install directory in the FFTW3F_ROOT_DIR environment variable.")
+find_package_handle_standard_args (FFTW3F ${__MSG} FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIR)
mark_as_advanced (FFTW3F_LIBRARIES FFTW3F_INCLUDE_DIR)
endif()
if(NOT IS_DIRECTORY ${OpenMM_ROOT_DIR})
- message(FATAL_ERROR "Can't find OpenMM! Either set the OPENMM_ROOT_DIR environment "
- "variable to the path where your OpenMM installation is located or install it to the default location (/usr/local/openmm)!")
+ message(FATAL_ERROR "Could not find OpenMM! Set the OPENMM_ROOT_DIR environment "
+ "variable to contain the path of the OpenMM installation.")
endif()
if(NOT IS_DIRECTORY ${OpenMM_LIBRARY_DIR})
set(OpenMM_PLUGIN_DIR ${OpenMM_PLUGIN_DIR} CACHE PATH "OpenMM plugins directory")
else()
message(WARNING "Could not detect the OpenMM plugin directory at the default location (${OpenMM_LIBRARY_DIR}/plugins)."
- "Check you OpenMM installation or manually set the OPENMM_PLUGIN_DIR environment variable!")
+ "Check your OpenMM installation or set the OPENMM_PLUGIN_DIR environment variable!")
endif()
if(NOT OpenMM_INCLUDE_DIR)
sparc*-solaris* | alpha*-* | rs6000*-aix* | powerpc*-aix* | mips*-irix*) enable_fortran=yes ;;
*) enable_fortran=no ;;
esac])
-# Generic fortran kernels will be turned off below if you enable power6-specific optimization!
# always use CC for linking:
AC_SUBST(F77LINK,"\$(LINK)")
+#On some systems GNU libtool's la files are more confusing for libtool than helpful due to the
+#hard coded paths/libs in the files. And for better linking we have pkg-config files (.pc).
+AC_ARG_ENABLE(la-files,
+ [AS_HELP_STRING([--disable-la-files],[Do NOT install GNU libtool's la files])],,
+ [enable_la_files=yes])
+AM_CONDITIONAL(NO_LA_FILES,[test "$enable_la_files" = no])
AC_ARG_ENABLE(power6,
[AC_HELP_STRING([--enable-power6],
[Use IBM Pwr6/PPC440/PPC450-specific F77 kernels])],,enable_power6=no)
-# Turn off generic fortran loops if we are using power6-specific optimization
if test "$enable_power6" = "yes"; then
- enable_fortran=no;
AC_DEFINE(GMX_POWER6,,[Enable IBM Pwr6/PPC440/PPC450-specific F77 kernels])
fi
case "${host_cpu}-${host_os}" in
alpha*-linux*)
cc_names="ccc cc gcc"
- f77_names="fort f77 g77"
+ f77_names="fort f77 gfortran g77"
;;
*)
cc_names="cc icc xlc gcc"
- f77_names="f77 ifort xlf xlf77 cf77 fl32 g77 fort77 f90 xlf90 pgf77 cf77 fort fort77 pgf90"
+ f77_names="f77 ifort xlf xlf77 cf77 fl32 gfortran g77 fort77 f90 xlf90 pgf77 cf77 fort fort77 pgf90"
;;
esac
# the (non-mpi) c compiler, which is also used for programs executed during build stage
if test "$with_fft" = "fftw2"; then
AC_MSG_ERROR([fftw2 can't be used with threads. Use fftw3 or mkl.])
fi
+ if test "$enable_fortran" = "yes"; then
+ AC_MSG_ERROR([FORTRAN is incompatible with threads. Use --disable-threads.])
+ fi
AC_CHECK_HEADERS(unistd.h)
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(sched.h)
variable you can overwrite it
]
)
-if test -z ${LIBSUFFIX} ; then
+if test -z "${LIBSUFFIX}" ; then
if test "$enable_mpi" = "yes"; then
LIBSUFFIX="_mpi"
fi
CopyrightText[] = {
"Written by Emile Apol, Rossen Apostolov, Herman J.C. Berendsen,",
"Aldert van Buuren, Pär Bjelkmar, Rudi van Drunen, Anton Feenstra, ",
- "Gerrit Groenhof, Peter Kasson, Per Larsson, Peiter Meulenhoff, ",
+ "Gerrit Groenhof, Peter Kasson, Per Larsson, Pieter Meulenhoff, ",
"Teemu Murtola, Szilard Pall, Sander Pronk, Roland Schultz, ",
"Michael Shirts, Alfons Sijbers, Peter Tieleman,\n",
"Berk Hess, David van der Spoel, and Erik Lindahl.\n",
/* Functions for calculating adjustments due to ie chain rule terms */
void
calc_gb_forces(t_commrec *cr, t_mdatoms *md, gmx_genborn_t *born, gmx_localtop_t *top, const t_atomtypes *atype,
- rvec x[], rvec f[], t_forcerec *fr,t_idef *idef,int gb_algorithm, t_nrnb *nrnb, gmx_bool bRad,
+ rvec x[], rvec f[], t_forcerec *fr,t_idef *idef,int gb_algorithm, int sa_algorithm, t_nrnb *nrnb, gmx_bool bRad,
const t_pbc *pbc, const t_graph *graph, gmx_enerdata_t *enerd);
t_dlist *mk_dlist(FILE *log,
t_atoms *atoms, int *nlist,
gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bHChi,
- int maxchi,int r0,int naa,char **aa);
+ int maxchi, int r0, gmx_residuetype_t rt);
void pr_dlist(FILE *fp,int nl,t_dlist dl[],real dt, int printtype,
gmx_bool bPhi, gmx_bool bPsi,gmx_bool bChi,gmx_bool bOmega, int maxchi);
gmx_bool
gmx_residuetype_is_rna(gmx_residuetype_t rt, const char *resnm);
+int
+gmx_residuetype_get_size(gmx_residuetype_t rt);
+
+int
+gmx_residuetype_get_index(gmx_residuetype_t rt, const char *resnm);
+
+const char *
+gmx_residuetype_get_name(gmx_residuetype_t rt, int index);
+
#include "vsite.h"
#include "pull.h"
#include "update.h"
-#include "gmx_membed.h"
+#include "membed.h"
#ifdef __cplusplus
extern "C" {
#include "thread_mpi/threads.h"
#include "thread_mpi/barrier.h"
#include "thread_mpi/event.h"
+#include "thread_mpi/lock.h"
#include "thread_mpi/tmpi.h"
#include "thread_mpi/collective.h"
#include "thread_mpi/hwinfo.h"
#endif
-/* first check for gcc/icc platforms. icc on linux+mac will take this path,
+/* first check for gcc/icc platforms.
+ Some compatible compilers, like icc on linux+mac will take this path,
too */
#if ( (defined(__GNUC__) || defined(__PATHSCALE__) || defined(__PGI)) && (!defined(__xlc__)) )
/* then ia64: */
#include "atomic/gcc_ia64.h"
-#elif (defined(__powerpc__) || (defined(__ppc__)) )
-/* and powerpc: */
-/*#include "atomic/gcc_ppc.h"*/
-
/* for now we use gcc intrinsics on gcc: */
-#include "atomic/gcc.h"
-
+/*#elif (defined(__powerpc__) || (defined(__ppc__)) )*/
+/*#include "atomic/gcc_ppc.h"*/
#else
/* otherwise, there's a generic gcc intrinsics version: */
#elif ( (defined(__IBM_GCC_ASM) || defined(__IBM_STDCPP_ASM)) && \
(defined(__powerpc__) || defined(__ppc__)))
-/* PowerPC using xlC inline assembly.
- * Recent versions of xlC (>=7.0) _partially_ support GCC inline assembly
- * if you use the option -qasm=gcc but we have had to hack things a bit, in
- * particular when it comes to clobbered variables. Since this implementation
- * _could_ be buggy, we have separated it from the known-to-be-working gcc
- * one above.
- */
+
+/* PowerPC using xlC intrinsics. */
+
#include "atomic/xlc_ppc.h"
-#elif defined(__xlC__) && defined (_AIX)
-/* IBM xlC compiler on AIX */
+#elif defined(__xlC__) || defined(__xlc__)
+/* IBM xlC compiler */
#include "atomic/xlc_ppc.h"
-#elif (defined(__hpux) || defined(__HP_cc)) && defined(__ia64)
-/* HP compiler on ia64 */
-#include "atomic/hpux.h"
+
: "r" (mask), "r" (p), "m" (*p)
: "cc", "memory");
- return ((old & mask) != 0);
+ return (old & mask);
}
static inline int tMPI_Spinlock_trylock(tMPI_Spinlock_t *x)
{
- return (__sync_lock_test_and_set(&(x->lock), 1) == 1);
+ return __sync_lock_test_and_set(&(x->lock), 1) ;
}
int ret;
/* Return 0 if we got the lock */
__fence();
- ret=__check_lock_mp((int*)&(x->lock), 0, 1) != 0;
+ ret=__check_lock_mp((int*)&(x->lock), 0, 1);
tMPI_Atomic_memory_barrier_acq();
return ret;
}
int ret;
__fence();
ret=((x->lock) != 0);
- tMPI_Atomic_memory_acq();
+ tMPI_Atomic_memory_barrier_acq();
return ret;
}
#define _TMPI_FASTLOCK_H_
#include "wait.h"
+#include "atomic.h"
/** Fast (possibly busy-wait-based) lock type
*
#include "thread_mpi/threads.h"
#include "thread_mpi/barrier.h"
#include "thread_mpi/event.h"
+#include "thread_mpi/lock.h"
#include "thread_mpi/tmpi.h"
#include "thread_mpi/collective.h"
#include "thread_mpi/hwinfo.h"
};
enum {
- esaNO, esaAPPROX, esaSTILL, esaNR
+ esaAPPROX, esaNO, esaSTILL, esaNR
};
/* Wall types */
real gb_doffset; /* Dielectric offset for Still/HCT/OBC */
real gb_epsilon_solvent; /* */
real epsilon_r; /* Used for inner dielectric */
+
+ real sa_surface_tension; /* Surface tension for non-polar solvation */
real *work; /* Used for parallel summation and in the chain rule, length natoms */
real *buf; /* Used for parallel summation and in the chain rule, length natoms */
double start_time; /* the start time of these energy diff blocks */
double start_lambda; /* lambda at start time */
+
+ gmx_bool start_lambda_set; /* whether the lambda value is set. Here
+ For backward-compatibility. */
} delta_h_history_t;
typedef struct
<dt><b>nsttcouple: (-1)</b></dt>
<dd>The frequency for coupling the temperature.
The default value of -1 sets <b>nsttcouple</b> equal to <b>nstlist</b>,
-unless <b>nstlist</b> ≤0, then a value of 10 is used.
+unless <b>nstlist</b>≤0, then a value of 10 is used.
For velocity Verlet integrators <b>nsttcouple</b> is set to 1.</dd>
</dd>
<dt><b>nh-chain-length (10)</b></dt>
-<dd>the number of chained Nose-Hoover thermostats for velocity Verlet integrators, the leap-frog <b>md</b> integrator only supports 1. Data for the NH chain variables is not printed to the .edr, but can be using the GMX_NOSEHOOVER_CHAINS environment variable</dd>
+<dd>the number of chained Nose-Hoover thermostats for velocity Verlet integrators, the leap-frog <b>md</b> integrator only supports 1. Data for the NH chain variables is not printed to the .edr, but can be using the <tt>GMX_NOSEHOOVER_CHAINS</tt> environment variable</dd>
<dt><b>tc_grps:</b></dt>
<dd>groups to couple separately to temperature bath</dd>
<dt><b>tau_t: [ps]</b></dt>
-<dd>time constant for coupling (one for each group in tc_grps),
+<dd>time constant for coupling (one for each group in <b>tc_grps</b>),
-1 means no temperature coupling</dd>
<dt><b>ref_t: [K]</b></dt>
-<dd>reference temperature for coupling (one for each group in tc_grps)</dd>
+<dd>reference temperature for coupling (one for each group in <b>tc_grps</b>)</dd>
</dl>
<A NAME="pc"><br>
each temperature group. Use 0 for groups that are not annealed. The number of entries should equal the number of temperature groups.</dd>
<dt><b>annealing_time:</b></dt>
-<dd>List of times at the annealing reference/control points for each group. If you are using periodic annealing, the times will be used modulo the last value, i.e. if the values are 0, 5, 10, and 15, the coupling will restart at the 0ps value after 15ps, 30ps, 45ps, etc. The number of entries should equal the sum of the numbers given in annealing_npoints.</dd>
+<dd>List of times at the annealing reference/control points for each group. If you are using periodic annealing, the times will be used modulo the last value, i.e. if the values are 0, 5, 10, and 15, the coupling will restart at the 0ps value after 15ps, 30ps, 45ps, etc. The number of entries should equal the sum of the numbers given in <tt>annealing_npoints</tt>.</dd>
<dt><b>annealing_temp:</b></dt>
-<dd>List of temperatures at the annealing reference/control points for each group. The number of entries should equal the sum of the numbers given in annealing_npoints.</dd>
+<dd>List of temperatures at the annealing reference/control points for each group. The number of entries should equal the sum of the numbers given in <tt>annealing_npoints</tt>.</dd>
<br>
Confused? OK, let's use an example. Assume you have two temperature groups, set the group selections to <tt>annealing = single periodic</tt>, the number of points of each group to <tt>annealing_npoints = 3 4</tt>, the times to <tt>annealing_time = 0 3 6 0 2 4 6</tt> and finally temperatures to <tt>annealing_temp = 298 280 270 298 320 320 298</tt>.
The first group will be coupled to 298K at 0ps, but the reference temperature will drop linearly to reach 280K at 3ps, and then linearly between 280K and 270K from 3ps to 6ps. After this is stays constant, at 270K. The second group is coupled to 298K at 0ps, it increases linearly to 320K at 2ps, where it stays constant until 4ps. Between 4ps and 6ps it decreases to 298K, and then it starts over with the same pattern again, i.e. rising linearly from 298K to 320K between 6ps and 8ps. Check the summary printed by grompp if you are unsure!
<dt><b>simple</b></dt>
<dd>simple (per-molecule) distance restraints,
ensemble averaging can be performed with <tt>mdrun -multi</tt>
-where the environment variable GMX_DISRE_ENSEMBLE_SIZE sets the number
+where the environment variable <tt>GMX_DISRE_ENSEMBLE_SIZE</tt> sets the number
of systems within each ensemble (usually equal to the mdrun -multi value)</dd>
<dt><b>ensemble</b></dt>
<dd>distance restraints over an ensemble of molecules in one simulation box,
<dl>
<dt><b>E_x ; E_y ; E_z:</b></dt>
<dd>If you want to use an electric field in a direction, enter 3 numbers
-after the appropriate E_*, the first number: the number of cosines,
+after the appropriate <b>E_*</b>, the first number: the number of cosines,
only 1 is implemented (with frequency 0) so enter 1,
the second number: the strength of the electric field in
<b>V nm<sup>-1</sup></b>,
<dt><b>GBSA</b></dt>
<dd>Do a simulation with implicit solvent using the Generalized Born formalism.
Three different methods for calculating the Born radii are available, Still, HCT and
-OBC. These are specified with the <b>gb_algorithm</b> field.</dd>
+OBC. These are specified with the <b>gb_algorithm</b> field. The non-polar solvation
+is specified with the <b>sa_algorithm</b> field.</dd>
</dl>
<dt></dt><b>gb_algorithm:</b>
<dt></dt><b>sa_algorithm</b>
<dd><dl compact="compact">
-<dt><b>no</b></dt>
-<dd>Which algorithm is used the the SA part. Note that currently no specific
-SA algorithm is implemented. With implicit_solvent=GBSA, a very crude ACE-style
-algorithm is used by default</dd>
+<dt><b>Ace-approx</b></dt>
+<dd>Use an Ace-type approximation (default)</dd>
+<dt><b>None</b></dt>
+<dd>No non-polar solvation calculation done. For GBSA only the polar part gets
+calculated</dd>
</dl>
-<dt></dt><b>sa_surface_tension: (2.092) [kj/mol/nm2]</b>
-<dd>Default values for surface tension with SA algorithms. The value, 2.092,
-correponds to 0.005 kcal/mol/Angstrom2</dd>
+<dt></dt><b>sa_surface_tension: [kj/mol/nm2]</b>
+<dd>Default value for surface tension with SA algorithms. The default value is -1,
+<br>Note that if this default value is not changed
+it will be over-ridden by grompp using values that are specific for the choice
+of radii algorithm (0.0049 kcal/mol/Angstrom2 for Still, 0.0054 kcal/mol/Angstrom2
+for HCT/OBC)
+<br>Setting it to 0 will while using an sa_algorithm other than None means
+no non-polar calculations are done.
+</dd>
</dl>
<A NAME="user"><br>
[ ALA ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT3 -0.27 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- HB3 HA 0.09 1
- C C 0.51 2
- O O -0.51 2
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT3 -0.27 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ HB3 HA 0.09 7
+ C C 0.51 8
+ O O -0.51 9
[ bonds ]
CB CA
N HN
[ ARG ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CT2 -0.18 2
- HG1 HA 0.09 2
- HG2 HA 0.09 2
- CD CT2 0.20 3
- HD1 HA 0.09 3
- HD2 HA 0.09 3
- NE NC2 -0.70 3
- HE HC 0.44 3
- CZ C 0.64 3
- NH1 NC2 -0.80 3
- HH11 HC 0.46 3
- HH12 HC 0.46 3
- NH2 NC2 -0.80 3
- HH21 HC 0.46 3
- HH22 HC 0.46 3
- C C 0.51 4
- O O -0.51 4
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.18 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CT2 -0.18 7
+ HG1 HA 0.09 8
+ HG2 HA 0.09 9
+ CD CT2 0.20 10
+ HD1 HA 0.09 11
+ HD2 HA 0.09 12
+ NE NC2 -0.70 13
+ HE HC 0.44 14
+ CZ C 0.64 15
+ NH1 NC2 -0.80 16
+ HH11 HC 0.46 17
+ HH12 HC 0.46 18
+ NH2 NC2 -0.80 19
+ HH21 HC 0.46 20
+ HH22 HC 0.46 21
+ C C 0.51 22
+ O O -0.51 23
[ bonds ]
CB CA
CG CB
[ ASN ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CC 0.55 2
- OD1 O -0.55 2
- ND2 NH2 -0.62 3
- HD21 H 0.32 3
- HD22 H 0.30 3
- C C 0.51 4
- O O -0.51 4
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.18 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CC 0.55 7
+ OD1 O -0.55 8
+ ND2 NH2 -0.62 9
+ HD21 H 0.32 10
+ HD22 H 0.30 11
+ C C 0.51 12
+ O O -0.51 13
[ bonds ]
CB CA
CG CB
[ ASP ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.28 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CC 0.62 1
- OD1 OC -0.76 1
- OD2 OC -0.76 1
- C C 0.51 2
- O O -0.51 2
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.28 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CC 0.62 7
+ OD1 OC -0.76 8
+ OD2 OC -0.76 9
+ C C 0.51 10
+ O O -0.51 11
[ bonds ]
CB CA
CG CB
[ CYS ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.11 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- SG S -0.23 1
- HG1 HS 0.16 1
- C C 0.51 2
- O O -0.51 2
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.11 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ SG S -0.23 7
+ HG1 HS 0.16 8
+ C C 0.51 9
+ O O -0.51 10
[ bonds ]
CB CA
SG CB
[ GLN ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CT2 -0.18 2
- HG1 HA 0.09 2
- HG2 HA 0.09 2
- CD CC 0.55 3
- OE1 O -0.55 3
- NE2 NH2 -0.62 4
- HE21 H 0.32 4
- HE22 H 0.30 4
- C C 0.51 5
- O O -0.51 5
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.18 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CT2 -0.18 7
+ HG1 HA 0.09 8
+ HG2 HA 0.09 9
+ CD CC 0.55 10
+ OE1 O -0.55 11
+ NE2 NH2 -0.62 12
+ HE21 H 0.32 13
+ HE22 H 0.30 14
+ C C 0.51 15
+ O O -0.51 16
[ bonds ]
CB CA
CG CB
[ GLU ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CT2 -0.28 2
- HG1 HA 0.09 2
- HG2 HA 0.09 2
- CD CC 0.62 2
- OE1 OC -0.76 2
- OE2 OC -0.76 2
- C C 0.51 3
- O O -0.51 3
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.18 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CT2 -0.28 7
+ HG1 HA 0.09 8
+ HG2 HA 0.09 9
+ CD CC 0.62 10
+ OE1 OC -0.76 11
+ OE2 OC -0.76 12
+ C C 0.51 13
+ O O -0.51 14
[ bonds ]
CB CA
CG CB
[ GLY ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT2 -0.02 0
- HA1 HB 0.09 0
- HA2 HB 0.09 0
- C C 0.51 1
- O O -0.51 1
+ HN H 0.31 1
+ CA CT2 -0.02 2
+ HA1 HB 0.09 3
+ HA2 HB 0.09 4
+ C C 0.51 5
+ O O -0.51 6
[ bonds ]
N HN
N CA
[ HSD ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.09 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- ND1 NR1 -0.36 1
- HD1 H 0.32 1
- CG CPH1 -0.05 1
- CE1 CPH2 0.25 2
- HE1 HR1 0.13 2
- NE2 NR2 -0.70 2
- CD2 CPH1 0.22 2
- HD2 HR3 0.10 2
- C C 0.51 3
- O O -0.51 3
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.09 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ ND1 NR1 -0.36 7
+ HD1 H 0.32 8
+ CG CPH1 -0.05 9
+ CE1 CPH2 0.25 10
+ HE1 HR1 0.13 11
+ NE2 NR2 -0.70 12
+ CD2 CPH1 0.22 13
+ HD2 HR3 0.10 14
+ C C 0.51 15
+ O O -0.51 16
[ bonds ]
CB CA
CG CB
[ HSE ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.08 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- ND1 NR2 -0.70 1
- CG CPH1 0.22 1
- CE1 CPH2 0.25 1
- HE1 HR1 0.13 1
- NE2 NR1 -0.36 2
- HE2 H 0.32 2
- CD2 CPH1 -0.05 2
- HD2 HR3 0.09 2
- C C 0.51 3
- O O -0.51 3
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.08 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ ND1 NR2 -0.70 7
+ CG CPH1 0.22 8
+ CE1 CPH2 0.25 9
+ HE1 HR1 0.13 10
+ NE2 NR1 -0.36 11
+ HE2 H 0.32 12
+ CD2 CPH1 -0.05 13
+ HD2 HR3 0.09 14
+ C C 0.51 15
+ O O -0.51 16
[ bonds ]
CB CA
CG CB
[ HSP ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.05 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CD2 CPH1 0.19 1
- HD2 HR1 0.13 1
- CG CPH1 0.19 1
- NE2 NR3 -0.51 2
- HE2 H 0.44 2
- ND1 NR3 -0.51 2
- HD1 H 0.44 2
- CE1 CPH2 0.32 2
- HE1 HR2 0.18 2
- C C 0.51 3
- O O -0.51 3
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.05 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CD2 CPH1 0.19 7
+ HD2 HR1 0.13 8
+ CG CPH1 0.19 9
+ NE2 NR3 -0.51 10
+ HE2 H 0.44 11
+ ND1 NR3 -0.51 12
+ HD1 H 0.44 13
+ CE1 CPH2 0.32 14
+ HE1 HR2 0.18 15
+ C C 0.51 16
+ O O -0.51 17
[ bonds ]
CB CA
CG CB
[ ILE ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT1 -0.09 1
- HB HA 0.09 1
- CG2 CT3 -0.27 2
- HG21 HA 0.09 2
- HG22 HA 0.09 2
- HG23 HA 0.09 2
- CG1 CT2 -0.18 3
- HG11 HA 0.09 3
- HG12 HA 0.09 3
- CD CT3 -0.27 4
- HD1 HA 0.09 4
- HD2 HA 0.09 4
- HD3 HA 0.09 4
- C C 0.51 5
- O O -0.51 5
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT1 -0.09 4
+ HB HA 0.09 5
+ CG2 CT3 -0.27 6
+ HG21 HA 0.09 7
+ HG22 HA 0.09 8
+ HG23 HA 0.09 9
+ CG1 CT2 -0.18 10
+ HG11 HA 0.09 11
+ HG12 HA 0.09 12
+ CD CT3 -0.27 13
+ HD1 HA 0.09 14
+ HD2 HA 0.09 15
+ HD3 HA 0.09 16
+ C C 0.51 17
+ O O -0.51 18
[ bonds ]
CB CA
CG1 CB
[ LEU ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CT1 -0.09 2
- HG HA 0.09 2
- CD1 CT3 -0.27 3
- HD11 HA 0.09 3
- HD12 HA 0.09 3
- HD13 HA 0.09 3
- CD2 CT3 -0.27 4
- HD21 HA 0.09 4
- HD22 HA 0.09 4
- HD23 HA 0.09 4
- C C 0.51 5
- O O -0.51 5
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.18 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CT1 -0.09 7
+ HG HA 0.09 8
+ CD1 CT3 -0.27 9
+ HD11 HA 0.09 10
+ HD12 HA 0.09 11
+ HD13 HA 0.09 12
+ CD2 CT3 -0.27 13
+ HD21 HA 0.09 14
+ HD22 HA 0.09 15
+ HD23 HA 0.09 16
+ C C 0.51 17
+ O O -0.51 18
[ bonds ]
CB CA
CG CB
[ LYS ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CT2 -0.18 2
- HG1 HA 0.09 2
- HG2 HA 0.09 2
- CD CT2 -0.18 3
- HD1 HA 0.09 3
- HD2 HA 0.09 3
- CE CT2 0.21 4
- HE1 HA 0.05 4
- HE2 HA 0.05 4
- NZ NH3 -0.30 4
- HZ1 HC 0.33 4
- HZ2 HC 0.33 4
- HZ3 HC 0.33 4
- C C 0.51 5
- O O -0.51 5
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.18 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CT2 -0.18 7
+ HG1 HA 0.09 8
+ HG2 HA 0.09 9
+ CD CT2 -0.18 10
+ HD1 HA 0.09 11
+ HD2 HA 0.09 12
+ CE CT2 0.21 13
+ HE1 HA 0.05 14
+ HE2 HA 0.05 15
+ NZ NH3 -0.30 16
+ HZ1 HC 0.33 17
+ HZ2 HC 0.33 18
+ HZ3 HC 0.33 19
+ C C 0.51 20
+ O O -0.51 21
[ bonds ]
CB CA
CG CB
[ MET ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CT2 -0.14 2
- HG1 HA 0.09 2
- HG2 HA 0.09 2
- SD S -0.09 2
- CE CT3 -0.22 2
- HE1 HA 0.09 2
- HE2 HA 0.09 2
- HE3 HA 0.09 2
- C C 0.51 3
- O O -0.51 3
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.18 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CT2 -0.14 7
+ HG1 HA 0.09 8
+ HG2 HA 0.09 9
+ SD S -0.09 10
+ CE CT3 -0.22 11
+ HE1 HA 0.09 12
+ HE2 HA 0.09 13
+ HE3 HA 0.09 14
+ C C 0.51 15
+ O O -0.51 16
[ bonds ]
CB CA
CG CB
[ PHE ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CA 0.00 2
- CD1 CA -0.115 3
- HD1 HP 0.115 3
- CE1 CA -0.115 4
- HE1 HP 0.115 4
- CZ CA -0.115 5
- HZ HP 0.115 5
- CD2 CA -0.115 6
- HD2 HP 0.115 6
- CE2 CA -0.115 7
- HE2 HP 0.115 7
- C C 0.51 8
- O O -0.51 8
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.18 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CA 0.00 7
+ CD1 CA -0.115 8
+ HD1 HP 0.115 9
+ CE1 CA -0.115 10
+ HE1 HP 0.115 11
+ CZ CA -0.115 12
+ HZ HP 0.115 13
+ CD2 CA -0.115 14
+ HD2 HP 0.115 15
+ CE2 CA -0.115 16
+ HE2 HP 0.115 17
+ C C 0.51 18
+ O O -0.51 19
[ bonds ]
CB CA
CG CB
[ PRO ]
[ atoms ]
N N -0.29 0
- CD CP3 0.00 0
- HD1 HA 0.09 0
- HD2 HA 0.09 0
- CA CP1 0.02 0
- HA HB 0.09 0
- CB CP2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CP2 -0.18 2
- HG1 HA 0.09 2
- HG2 HA 0.09 2
- C C 0.51 3
- O O -0.51 3
+ CD CP3 0.00 1
+ HD1 HA 0.09 2
+ HD2 HA 0.09 3
+ CA CP1 0.02 4
+ HA HB 0.09 5
+ CB CP2 -0.18 6
+ HB1 HA 0.09 7
+ HB2 HA 0.09 8
+ CG CP2 -0.18 9
+ HG1 HA 0.09 10
+ HG2 HA 0.09 11
+ C C 0.51 12
+ O O -0.51 13
[ bonds ]
C CA
C +N
[ SER ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 0.05 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- OG OH1 -0.66 1
- HG1 H 0.43 1
- C C 0.51 2
- O O -0.51 2
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 0.05 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ OG OH1 -0.66 7
+ HG1 H 0.43 8
+ C C 0.51 9
+ O O -0.51 10
[ bonds ]
CB CA
OG CB
[ THR ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT1 0.14 1
- HB HA 0.09 1
- OG1 OH1 -0.66 1
- HG1 H 0.43 1
- CG2 CT3 -0.27 2
- HG21 HA 0.09 2
- HG22 HA 0.09 2
- HG23 HA 0.09 2
- C C 0.51 3
- O O -0.51 3
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT1 0.14 4
+ HB HA 0.09 5
+ OG1 OH1 -0.66 6
+ HG1 H 0.43 7
+ CG2 CT3 -0.27 8
+ HG21 HA 0.09 9
+ HG22 HA 0.09 10
+ HG23 HA 0.09 11
+ C C 0.51 12
+ O O -0.51 13
[ bonds ]
CB CA
OG1 CB
[ TRP ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CY -0.03 2
- CD1 CA 0.035 2
- HD1 HP 0.115 2
- NE1 NY -0.61 2
- HE1 H 0.38 2
- CE2 CPT 0.13 2
- CD2 CPT -0.02 2
- CE3 CA -0.115 3
- HE3 HP 0.115 3
- CZ3 CA -0.115 4
- HZ3 HP 0.115 4
- CZ2 CA -0.115 5
- HZ2 HP 0.115 5
- CH2 CA -0.115 6
- HH2 HP 0.115 6
- C C 0.51 7
- O O -0.51 7
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.18 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CY -0.03 7
+ CD1 CA 0.035 8
+ HD1 HP 0.115 9
+ NE1 NY -0.61 10
+ HE1 H 0.38 11
+ CE2 CPT 0.13 12
+ CD2 CPT -0.02 13
+ CE3 CA -0.115 14
+ HE3 HP 0.115 15
+ CZ3 CA -0.115 16
+ HZ3 HP 0.115 17
+ CZ2 CA -0.115 18
+ HZ2 HP 0.115 19
+ CH2 CA -0.115 20
+ HH2 HP 0.115 21
+ C C 0.51 22
+ O O -0.51 23
[ bonds ]
CB CA
CG CB
[ TYR ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT2 -0.18 1
- HB1 HA 0.09 1
- HB2 HA 0.09 1
- CG CA 0.00 2
- CD1 CA -0.115 3
- HD1 HP 0.115 3
- CE1 CA -0.115 4
- HE1 HP 0.115 4
- CZ CA 0.11 5
- OH OH1 -0.54 5
- HH H 0.43 5
- CD2 CA -0.115 6
- HD2 HP 0.115 6
- CE2 CA -0.115 7
- HE2 HP 0.115 7
- C C 0.51 8
- O O -0.51 8
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT2 -0.18 4
+ HB1 HA 0.09 5
+ HB2 HA 0.09 6
+ CG CA 0.00 7
+ CD1 CA -0.115 8
+ HD1 HP 0.115 9
+ CE1 CA -0.115 10
+ HE1 HP 0.115 11
+ CZ CA 0.11 12
+ OH OH1 -0.54 13
+ HH H 0.43 14
+ CD2 CA -0.115 15
+ HD2 HP 0.115 16
+ CE2 CA -0.115 17
+ HE2 HP 0.115 18
+ C C 0.51 19
+ O O -0.51 20
[ bonds ]
CB CA
CG CB
[ VAL ]
[ atoms ]
N NH1 -0.47 0
- HN H 0.31 0
- CA CT1 0.07 0
- HA HB 0.09 0
- CB CT1 -0.09 1
- HB HA 0.09 1
- CG1 CT3 -0.27 2
- HG11 HA 0.09 2
- HG12 HA 0.09 2
- HG13 HA 0.09 2
- CG2 CT3 -0.27 3
- HG21 HA 0.09 3
- HG22 HA 0.09 3
- HG23 HA 0.09 3
- C C 0.51 4
- O O -0.51 4
+ HN H 0.31 1
+ CA CT1 0.07 2
+ HA HB 0.09 3
+ CB CT1 -0.09 4
+ HB HA 0.09 5
+ CG1 CT3 -0.27 6
+ HG11 HA 0.09 7
+ HG12 HA 0.09 8
+ HG13 HA 0.09 9
+ CG2 CT3 -0.27 10
+ HG21 HA 0.09 11
+ HG22 HA 0.09 12
+ HG23 HA 0.09 13
+ C C 0.51 14
+ O O -0.51 15
[ bonds ]
CB CA
CG1 CB
[ ALAD ] ; Alanine dipeptide
[ atoms ]
CL CT3 -0.27 0
- HL1 HA 0.09 0
- HL2 HA 0.09 0
- HL3 HA 0.09 0
- CLP C 0.51 1
- OL O -0.51 1
- NL NH1 -0.47 2
- HL H 0.31 2
- CA CT1 0.07 2
- HA HB 0.09 2
- CB CT3 -0.27 3
- HB1 HA 0.09 3
- HB2 HA 0.09 3
- HB3 HA 0.09 3
- CRP C 0.51 4
- OR O -0.51 4
- NR NH1 -0.47 5
- HR H 0.31 5
- CR CT3 -0.11 5
- HR1 HA 0.09 5
- HR2 HA 0.09 5
- HR3 HA 0.09 5
+ HL1 HA 0.09 1
+ HL2 HA 0.09 2
+ HL3 HA 0.09 3
+ CLP C 0.51 4
+ OL O -0.51 5
+ NL NH1 -0.47 6
+ HL H 0.31 7
+ CA CT1 0.07 8
+ HA HB 0.09 9
+ CB CT3 -0.27 10
+ HB1 HA 0.09 11
+ HB2 HA 0.09 12
+ HB3 HA 0.09 13
+ CRP C 0.51 14
+ OR O -0.51 15
+ NR NH1 -0.47 16
+ HR H 0.31 17
+ CR CT3 -0.11 18
+ HR1 HA 0.09 19
+ HR2 HA 0.09 20
+ HR3 HA 0.09 21
[ bonds ]
CL CLP
CLP NL
[ TIP3 ]
[ atoms ]
OH2 OT -0.834 0
- H1 HT 0.417 0
- H2 HT 0.417 0
+ H1 HT 0.417 1
+ H2 HT 0.417 2
[ bonds ]
OH2 H1
OH2 H2
[ TP3M ]
[ atoms ]
OH2 OT -0.834 0
- H1 HT 0.417 0
- H2 HT 0.417 0
+ H1 HT 0.417 1
+ H2 HT 0.417 2
[ bonds ]
OH2 H1
OH2 H2
;
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2 -0.05 2
-C5 CN5 0.28 2
-N7 NN4 -0.71 2
-C8 CN4 0.34 2
-H8 HN3 0.12 2
-N1 NN3A -0.74 2
-C2 CN4 0.50 2
-H2 HN3 0.13 2
-N3 NN3A -0.75 2
-C4 CN5 0.43 2
-C6 CN2 0.46 2
-N6 NN1 -0.77 2
-H61 HN1 0.38 2
-H62 HN1 0.38 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6 -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N9 NN2 -0.05 12
+C5 CN5 0.28 13
+N7 NN4 -0.71 14
+C8 CN4 0.34 15
+H8 HN3 0.12 16
+N1 NN3A -0.74 17
+C2 CN4 0.50 18
+H2 HN3 0.13 19
+N3 NN3A -0.75 20
+C4 CN5 0.43 21
+C6 CN2 0.46 22
+N6 NN1 -0.77 23
+H61 HN1 0.38 24
+H62 HN1 0.38 25
+C2' CN8 -0.18 26
+H2'1 HN8 0.09 27
+H2'2 HN8 0.09 28
+C3' CN7 0.01 29
+H3' HN7 0.09 30
+O3' ON2 -0.57 31
[ bonds ]
-O3' P
P O1P
;
[ atoms ]
H5T HN5 0.43 0
-O5' ON5 -0.66 0
-C5' CN8B 0.05 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2 -0.05 2
-C5 CN5 0.28 2
-N7 NN4 -0.71 2
-C8 CN4 0.34 2
-H8 HN3 0.12 2
-N1 NN3A -0.74 2
-C2 CN4 0.50 2
-H2 HN3 0.13 2
-N3 NN3A -0.75 2
-C4 CN5 0.43 2
-C6 CN2 0.46 2
-N6 NN1 -0.77 2
-H61 HN1 0.38 2
-H62 HN1 0.38 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O5' ON5 -0.66 1
+C5' CN8B 0.05 2
+H5'1 HN8 0.09 3
+H5'2 HN8 0.09 4
+C4' CN7 0.16 5
+H4' HN7 0.09 6
+O4' ON6 -0.50 7
+C1' CN7B 0.16 8
+H1' HN7 0.09 9
+N9 NN2 -0.05 10
+C5 CN5 0.28 11
+N7 NN4 -0.71 12
+C8 CN4 0.34 13
+H8 HN3 0.12 14
+N1 NN3A -0.74 15
+C2 CN4 0.50 16
+H2 HN3 0.13 17
+N3 NN3A -0.75 18
+C4 CN5 0.43 19
+C6 CN2 0.46 20
+N6 NN1 -0.77 21
+H61 HN1 0.38 22
+H62 HN1 0.38 23
+C2' CN8 -0.18 24
+H2'1 HN8 0.09 25
+H2'2 HN8 0.09 26
+C3' CN7 0.01 27
+H3' HN7 0.09 28
+O3' ON2 -0.57 29
[ bonds ]
H5T O5'
O5' C5'
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2 -0.05 2
-C5 CN5 0.28 2
-N7 NN4 -0.71 2
-C8 CN4 0.34 2
-H8 HN3 0.12 2
-N1 NN3A -0.74 2
-C2 CN4 0.50 2
-H2 HN3 0.13 2
-N3 NN3A -0.75 2
-C4 CN5 0.43 2
-C6 CN2 0.46 2
-N6 NN1 -0.77 2
-H61 HN1 0.38 2
-H62 HN1 0.38 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.14 4
-H3' HN7 0.09 4
-O3' ON5 -0.66 4
-H3T HN5 0.43 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6 -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N9 NN2 -0.05 12
+C5 CN5 0.28 13
+N7 NN4 -0.71 14
+C8 CN4 0.34 15
+H8 HN3 0.12 16
+N1 NN3A -0.74 17
+C2 CN4 0.50 18
+H2 HN3 0.13 19
+N3 NN3A -0.75 20
+C4 CN5 0.43 21
+C6 CN2 0.46 22
+N6 NN1 -0.77 23
+H61 HN1 0.38 24
+H62 HN1 0.38 25
+C2' CN8 -0.18 26
+H2'1 HN8 0.09 27
+H2'2 HN8 0.09 28
+C3' CN7 0.14 29
+H3' HN7 0.09 30
+O3' ON5 -0.66 31
+H3T HN5 0.43 32
[ bonds ]
-O3' P
P O1P
;
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2 -0.13 2
-C6 CN3 0.05 2
-H6 HN3 0.17 2
-C5 CN3 -0.13 2
-H5 HN3 0.07 2
-C2 CN1 0.52 2
-O2 ON1C -0.49 2
-N3 NN3 -0.66 2
-C4 CN2 0.65 2
-N4 NN1 -0.75 2
-H41 HN1 0.37 2
-H42 HN1 0.33 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6 -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N1 NN2 -0.13 12
+C6 CN3 0.05 13
+H6 HN3 0.17 14
+C5 CN3 -0.13 15
+H5 HN3 0.07 16
+C2 CN1 0.52 17
+O2 ON1C -0.49 18
+N3 NN3 -0.66 19
+C4 CN2 0.65 20
+N4 NN1 -0.75 21
+H41 HN1 0.37 22
+H42 HN1 0.33 23
+C2' CN8 -0.18 24
+H2'1 HN8 0.09 25
+H2'2 HN8 0.09 26
+C3' CN7 0.01 27
+H3' HN7 0.09 28
+O3' ON2 -0.57 29
[ bonds ]
-O3' P
P O1P
;
[ atoms ]
H5T HN5 0.43 0
-O5' ON5 -0.66 0
-C5' CN8B 0.05 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2 -0.13 2
-C6 CN3 0.05 2
-H6 HN3 0.17 2
-C5 CN3 -0.13 2
-H5 HN3 0.07 2
-C2 CN1 0.52 2
-O2 ON1C -0.49 2
-N3 NN3 -0.66 2
-C4 CN2 0.65 2
-N4 NN1 -0.75 2
-H41 HN1 0.37 2
-H42 HN1 0.33 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O5' ON5 -0.66 1
+C5' CN8B 0.05 2
+H5'1 HN8 0.09 3
+H5'2 HN8 0.09 4
+C4' CN7 0.16 5
+H4' HN7 0.09 6
+O4' ON6 -0.50 7
+C1' CN7B 0.16 8
+H1' HN7 0.09 9
+N1 NN2 -0.13 10
+C6 CN3 0.05 11
+H6 HN3 0.17 12
+C5 CN3 -0.13 13
+H5 HN3 0.07 14
+C2 CN1 0.52 15
+O2 ON1C -0.49 16
+N3 NN3 -0.66 17
+C4 CN2 0.65 18
+N4 NN1 -0.75 19
+H41 HN1 0.37 20
+H42 HN1 0.33 21
+C2' CN8 -0.18 22
+H2'1 HN8 0.09 23
+H2'2 HN8 0.09 24
+C3' CN7 0.01 25
+H3' HN7 0.09 26
+O3' ON2 -0.57 27
[ bonds ]
H5T O5'
O5' C5'
; H3T
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2 -0.13 2
-C6 CN3 0.05 2
-H6 HN3 0.17 2
-C5 CN3 -0.13 2
-H5 HN3 0.07 2
-C2 CN1 0.52 2
-O2 ON1C -0.49 2
-N3 NN3 -0.66 2
-C4 CN2 0.65 2
-N4 NN1 -0.75 2
-H41 HN1 0.37 2
-H42 HN1 0.33 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.14 4
-H3' HN7 0.09 4
-O3' ON5 -0.66 4
-H3T HN5 0.43 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6 -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N1 NN2 -0.13 12
+C6 CN3 0.05 13
+H6 HN3 0.17 14
+C5 CN3 -0.13 15
+H5 HN3 0.07 16
+C2 CN1 0.52 17
+O2 ON1C -0.49 18
+N3 NN3 -0.66 19
+C4 CN2 0.65 20
+N4 NN1 -0.75 21
+H41 HN1 0.37 22
+H42 HN1 0.33 23
+C2' CN8 -0.18 24
+H2'1 HN8 0.09 25
+H2'2 HN8 0.09 26
+C3' CN7 0.14 27
+H3' HN7 0.09 28
+O3' ON5 -0.66 29
+H3T HN5 0.43 30
[ bonds ]
-O3' P
P O1P
;
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2B -0.02 2
-C4 CN5 0.26 2
-N2 NN1 -0.68 2
-H21 HN1 0.32 2
-H22 HN1 0.35 2
-N3 NN3G -0.74 2
-C2 CN2 0.75 2
-N1 NN2G -0.34 2
-H1 HN2 0.26 2
-C6 CN1 0.54 2
-O6 ON1 -0.51 2
-C5 CN5G 0.00 2
-N7 NN4 -0.60 2
-C8 CN4 0.25 2
-H8 HN3 0.16 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6 -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N9 NN2B -0.02 12
+C4 CN5 0.26 13
+N2 NN1 -0.68 14
+H21 HN1 0.32 15
+H22 HN1 0.35 16
+N3 NN3G -0.74 17
+C2 CN2 0.75 18
+N1 NN2G -0.34 19
+H1 HN2 0.26 20
+C6 CN1 0.54 21
+O6 ON1 -0.51 22
+C5 CN5G 0.00 23
+N7 NN4 -0.60 24
+C8 CN4 0.25 25
+H8 HN3 0.16 26
+C2' CN8 -0.18 27
+H2'1 HN8 0.09 28
+H2'2 HN8 0.09 29
+C3' CN7 0.01 30
+H3' HN7 0.09 31
+O3' ON2 -0.57 32
[ bonds ]
-O3' P
P O1P
;
[ atoms ]
H5T HN5 0.43 0
-O5' ON5 -0.66 0
-C5' CN8B 0.05 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2B -0.02 2
-C4 CN5 0.26 2
-N2 NN1 -0.68 2
-H21 HN1 0.32 2
-H22 HN1 0.35 2
-N3 NN3G -0.74 2
-C2 CN2 0.75 2
-N1 NN2G -0.34 2
-H1 HN2 0.26 2
-C6 CN1 0.54 2
-O6 ON1 -0.51 2
-C5 CN5G 0.00 2
-N7 NN4 -0.60 2
-C8 CN4 0.25 2
-H8 HN3 0.16 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O5' ON5 -0.66 1
+C5' CN8B 0.05 2
+H5'1 HN8 0.09 3
+H5'2 HN8 0.09 4
+C4' CN7 0.16 5
+H4' HN7 0.09 6
+O4' ON6 -0.50 7
+C1' CN7B 0.16 8
+H1' HN7 0.09 9
+N9 NN2B -0.02 10
+C4 CN5 0.26 11
+N2 NN1 -0.68 12
+H21 HN1 0.32 13
+H22 HN1 0.35 14
+N3 NN3G -0.74 15
+C2 CN2 0.75 16
+N1 NN2G -0.34 17
+H1 HN2 0.26 18
+C6 CN1 0.54 19
+O6 ON1 -0.51 20
+C5 CN5G 0.00 21
+N7 NN4 -0.60 22
+C8 CN4 0.25 23
+H8 HN3 0.16 24
+C2' CN8 -0.18 25
+H2'1 HN8 0.09 26
+H2'2 HN8 0.09 27
+C3' CN7 0.01 28
+H3' HN7 0.09 29
+O3' ON2 -0.57 30
[ bonds ]
H5T O5'
O5' C5'
; H3T
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2B -0.02 2
-C4 CN5 0.26 2
-N2 NN1 -0.68 2
-H21 HN1 0.32 2
-H22 HN1 0.35 2
-N3 NN3G -0.74 2
-C2 CN2 0.75 2
-N1 NN2G -0.34 2
-H1 HN2 0.26 2
-C6 CN1 0.54 2
-O6 ON1 -0.51 2
-C5 CN5G 0.00 2
-N7 NN4 -0.60 2
-C8 CN4 0.25 2
-H8 HN3 0.16 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.14 4
-H3' HN7 0.09 4
-O3' ON5 -0.66 4
-H3T HN5 0.43 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6 -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N9 NN2B -0.02 12
+C4 CN5 0.26 13
+N2 NN1 -0.68 14
+H21 HN1 0.32 15
+H22 HN1 0.35 16
+N3 NN3G -0.74 17
+C2 CN2 0.75 18
+N1 NN2G -0.34 19
+H1 HN2 0.26 20
+C6 CN1 0.54 21
+O6 ON1 -0.51 22
+C5 CN5G 0.00 23
+N7 NN4 -0.60 24
+C8 CN4 0.25 25
+H8 HN3 0.16 26
+C2' CN8 -0.18 27
+H2'1 HN8 0.09 28
+H2'2 HN8 0.09 29
+C3' CN7 0.14 30
+H3' HN7 0.09 31
+O3' ON5 -0.66 32
+H3T HN5 0.43 33
[ bonds ]
-O3' P
P O1P
;
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2B -0.34 2
-C6 CN3 0.17 2
-H6 HN3 0.17 2
-C2 CN1T 0.51 2
-O2 ON1 -0.41 2
-N3 NN2U -0.46 2
-H3 HN2 0.36 2
-C4 CN1 0.50 2
-O4 ON1 -0.45 2
-C5 CN3T -0.15 2
-C5M CN9 -0.11 2
-H51 HN9 0.07 2
-H52 HN9 0.07 2
-H53 HN9 0.07 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6 -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N1 NN2B -0.34 12
+C6 CN3 0.17 13
+H6 HN3 0.17 14
+C2 CN1T 0.51 15
+O2 ON1 -0.41 16
+N3 NN2U -0.46 17
+H3 HN2 0.36 18
+C4 CN1 0.50 19
+O4 ON1 -0.45 20
+C5 CN3T -0.15 21
+C5M CN9 -0.11 22
+H51 HN9 0.07 23
+H52 HN9 0.07 24
+H53 HN9 0.07 25
+C2' CN8 -0.18 26
+H2'1 HN8 0.09 27
+H2'2 HN8 0.09 28
+C3' CN7 0.01 29
+H3' HN7 0.09 30
+O3' ON2 -0.57 31
[ bonds ]
-O3' P
P O1P
;
[ atoms ]
H5T HN5 0.43 0
-O5' ON5 -0.66 0
-C5' CN8B 0.05 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2B -0.34 2
-C6 CN3 0.17 2
-H6 HN3 0.17 2
-C2 CN1T 0.51 2
-O2 ON1 -0.41 2
-N3 NN2U -0.46 2
-H3 HN2 0.36 2
-C4 CN1 0.50 2
-O4 ON1 -0.45 2
-C5 CN3T -0.15 2
-C5M CN9 -0.11 2
-H51 HN9 0.07 2
-H52 HN9 0.07 2
-H53 HN9 0.07 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O5' ON5 -0.66 1
+C5' CN8B 0.05 2
+H5'1 HN8 0.09 3
+H5'2 HN8 0.09 4
+C4' CN7 0.16 5
+H4' HN7 0.09 6
+O4' ON6 -0.50 7
+C1' CN7B 0.16 8
+H1' HN7 0.09 9
+N1 NN2B -0.34 10
+C6 CN3 0.17 11
+H6 HN3 0.17 12
+C2 CN1T 0.51 13
+O2 ON1 -0.41 14
+N3 NN2U -0.46 15
+H3 HN2 0.36 16
+C4 CN1 0.50 17
+O4 ON1 -0.45 18
+C5 CN3T -0.15 19
+C5M CN9 -0.11 20
+H51 HN9 0.07 21
+H52 HN9 0.07 22
+H53 HN9 0.07 23
+C2' CN8 -0.18 24
+H2'1 HN8 0.09 25
+H2'2 HN8 0.09 26
+C3' CN7 0.01 27
+H3' HN7 0.09 28
+O3' ON2 -0.57 29
[ bonds ]
H5T O5'
O5' C5'
;
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6 -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2B -0.34 2
-C6 CN3 0.17 2
-H6 HN3 0.17 2
-C2 CN1T 0.51 2
-O2 ON1 -0.41 2
-N3 NN2U -0.46 2
-H3 HN2 0.36 2
-C4 CN1 0.50 2
-O4 ON1 -0.45 2
-C5 CN3T -0.15 2
-C5M CN9 -0.11 2
-H51 HN9 0.07 2
-H52 HN9 0.07 2
-H53 HN9 0.07 2
-C2' CN8 -0.18 3
-H2'1 HN8 0.09 3
-H2'2 HN8 0.09 3
-C3' CN7 0.14 4
-H3' HN7 0.09 4
-O3' ON5 -0.66 4
-H3T HN5 0.43 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6 -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N1 NN2B -0.34 12
+C6 CN3 0.17 13
+H6 HN3 0.17 14
+C2 CN1T 0.51 15
+O2 ON1 -0.41 16
+N3 NN2U -0.46 17
+H3 HN2 0.36 18
+C4 CN1 0.50 19
+O4 ON1 -0.45 20
+C5 CN3T -0.15 21
+C5M CN9 -0.11 22
+H51 HN9 0.07 23
+H52 HN9 0.07 24
+H53 HN9 0.07 25
+C2' CN8 -0.18 26
+H2'1 HN8 0.09 27
+H2'2 HN8 0.09 28
+C3' CN7 0.14 29
+H3' HN7 0.09 30
+O3' ON5 -0.66 31
+H3T HN5 0.43 32
[ bonds ]
-O3' P
P O1P
HWT3 1 4.032000 0.417 A 0.0 0.0 ; TIP3p H
OWT4 8 9.951400 0.0 A 3.15365e-01 6.48520e-01 ; TIP4p O
HWT4 1 4.032000 0.52 A 0.0 0.0 ; TIP4p H
-MWT4 0 0.000000 -1.04 A 0.0 0.0 ; TIP 4p vsite
-OWT5 8 9.951400 0.0 A 3.12000e-01 6.69440e-01 ; TIP5p O
+MWT4 0 0.000000 -1.04 A 0.0 0.0 ; TIP4p vsite
+OWT5 8 9.951400 0.0 A 3.12000e-01 6.69440e-01 ; TIP5p O
HWT5 1 4.032000 0.241 A 0.0 0.0 ; TIP5p H
MWT5 0 0.000000 -0.241 A 0.0 0.0 ; TIP5p vsite
OW 8 9.951400 -0.82 A 3.16557e-01 6.50194e-01 ; SPC 0
; special dummy-type particles
MNH3 0 0.000000 0.00 A 0.0 0.0
MNH2 0 0.000000 0.00 A 0.0 0.0
-; CH3 bound to carbons
MCH3 0 0.000000 0.00 A 0.0 0.0
-; CH3 bound to sulfur, type S only
MCH3S 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
Parameters derived from c32b1 version of CHARMM
+NOTE: Atom-based charge groups
References:
-Port
-
-Bjelkmar, P., Larsson, P., Cuendet, M. A, Bess, B., Lindahl, E.
-Implementation of the CHARMM force field in GROMACS: Analysis of protein
-stability effects from correction maps, virtual interaction sites, and
-water models., Journal of Chemical Theory and Computation, 6: 459-466, 2010.
-
-Protein parameterization
+Proteins
MacKerell, Jr., A. D., Feig, M., Brooks, C.L., III, Extending the
treatment of backbone energetics in protein force fields: limitations
empirical potential for molecular modeling and dynamics Studies of
proteins. Journal of Physical Chemistry B, 1998, 102, 3586-3616.
-Lipid parameterization
+Lipids
Feller, S. and MacKerell, Jr., A.D. An Improved Empirical Potential
Energy Function for Molecular Simulations of Phospholipids, Journal
of Physical Chemistry B, 2000, 104: 7510-7515.
-Nucleic Acids parameterization
+Nucleic Acids
Foloppe, N. and MacKerell, Jr., A.D. "All-Atom Empirical Force Field for
Nucleic Acids: 2) Parameter Optimization Based on Small Molecule and
MacKerell, Jr., A.D. and Banavali, N. "All-Atom Empirical Force Field for
Nucleic Acids: 2) Application to Molecular Dynamics Simulations of DNA
and RNA in Solution. 2000, 21: 105-120.
+
+
+
+If using there parameters for research please cite:
+Bjelkmar, P., Larsson, P., Cuendet, M. A, Bess, B., Lindahl, E.
+Implementation of the CHARMM force field in GROMACS: Analysis of protein
+stability effects from correction maps, virtual interaction sites, and
+water models., Journal of Chemical Theory and Computation, 6: 459-466, 2010.
[ LPPC ]
[ atoms ]
N NTL -0.60 0
- C13 CTL5 -0.35 0
- H13A HL 0.25 0
- H13B HL 0.25 0
- H13C HL 0.25 0
- C14 CTL5 -0.35 0
- H14A HL 0.25 0
- H14B HL 0.25 0
- H14C HL 0.25 0
- C15 CTL5 -0.35 0
- H15A HL 0.25 0
- H15B HL 0.25 0
- H15C HL 0.25 0
- C12 CTL2 -0.10 0
- H12A HL 0.25 0
- H12B HL 0.25 0
- C11 CTL2 -0.08 1
- H11A HAL2 0.09 1
- H11B HAL2 0.09 1
- P PL 1.50 1
- O13 O2L -0.78 1
- O14 O2L -0.78 1
- O11 OSL -0.57 1
- O12 OSL -0.57 1
- C1 CTL2 -0.08 1
- HA HAL2 0.09 1
- HB HAL2 0.09 1
- C2 CTL2 -0.18 2
- HS HAL2 0.09 2
- HR HAL2 0.09 2
- C3 CTL2 -0.05 3
- HX HAL2 0.09 3
- HY HAL2 0.09 3
- O31 OSL -0.34 3
- C31 CL 0.63 3
- O32 OBL -0.52 3
- C32 CTL2 -0.08 3
- H2X HAL2 0.09 3
- H2Y HAL2 0.09 3
- C33 CTL2 -0.18 4
- H3X HAL2 0.09 4
- H3Y HAL2 0.09 4
- C34 CTL2 -0.18 5
- H4X HAL2 0.09 5
- H4Y HAL2 0.09 5
- C35 CTL2 -0.18 6
- H5X HAL2 0.09 6
- H5Y HAL2 0.09 6
- C36 CTL2 -0.18 7
- H6X HAL2 0.09 7
- H6Y HAL2 0.09 7
- C37 CTL2 -0.18 8
- H7X HAL2 0.09 8
- H7Y HAL2 0.09 8
- C38 CTL2 -0.18 9
- H8X HAL2 0.09 9
- H8Y HAL2 0.09 9
- C39 CTL2 -0.18 10
- H9X HAL2 0.09 10
- H9Y HAL2 0.09 10
- C310 CTL2 -0.18 11
- H10X HAL2 0.09 11
- H10Y HAL2 0.09 11
- C311 CTL2 -0.18 12
- H11X HAL2 0.09 12
- H11Y HAL2 0.09 12
- C312 CTL3 -0.27 13
- H12X HAL3 0.09 13
- H12Y HAL3 0.09 13
- H12Z HAL3 0.09 13
+ C13 CTL5 -0.35 1
+ H13A HL 0.25 2
+ H13B HL 0.25 3
+ H13C HL 0.25 4
+ C14 CTL5 -0.35 5
+ H14A HL 0.25 6
+ H14B HL 0.25 7
+ H14C HL 0.25 8
+ C15 CTL5 -0.35 9
+ H15A HL 0.25 10
+ H15B HL 0.25 11
+ H15C HL 0.25 12
+ C12 CTL2 -0.10 13
+ H12A HL 0.25 14
+ H12B HL 0.25 15
+ C11 CTL2 -0.08 16
+ H11A HAL2 0.09 17
+ H11B HAL2 0.09 18
+ P PL 1.50 19
+ O13 O2L -0.78 20
+ O14 O2L -0.78 21
+ O11 OSL -0.57 22
+ O12 OSL -0.57 23
+ C1 CTL2 -0.08 24
+ HA HAL2 0.09 25
+ HB HAL2 0.09 26
+ C2 CTL2 -0.18 27
+ HS HAL2 0.09 28
+ HR HAL2 0.09 29
+ C3 CTL2 -0.05 30
+ HX HAL2 0.09 31
+ HY HAL2 0.09 32
+ O31 OSL -0.34 33
+ C31 CL 0.63 34
+ O32 OBL -0.52 35
+ C32 CTL2 -0.08 36
+ H2X HAL2 0.09 37
+ H2Y HAL2 0.09 38
+ C33 CTL2 -0.18 39
+ H3X HAL2 0.09 40
+ H3Y HAL2 0.09 41
+ C34 CTL2 -0.18 42
+ H4X HAL2 0.09 43
+ H4Y HAL2 0.09 44
+ C35 CTL2 -0.18 45
+ H5X HAL2 0.09 46
+ H5Y HAL2 0.09 47
+ C36 CTL2 -0.18 48
+ H6X HAL2 0.09 49
+ H6Y HAL2 0.09 50
+ C37 CTL2 -0.18 51
+ H7X HAL2 0.09 52
+ H7Y HAL2 0.09 53
+ C38 CTL2 -0.18 54
+ H8X HAL2 0.09 55
+ H8Y HAL2 0.09 56
+ C39 CTL2 -0.18 57
+ H9X HAL2 0.09 58
+ H9Y HAL2 0.09 59
+ C310 CTL2 -0.18 60
+ H10X HAL2 0.09 61
+ H10Y HAL2 0.09 62
+ C311 CTL2 -0.18 63
+ H11X HAL2 0.09 64
+ H11Y HAL2 0.09 65
+ C312 CTL3 -0.27 66
+ H12X HAL3 0.09 67
+ H12Y HAL3 0.09 68
+ H12Z HAL3 0.09 69
[ bonds ]
N C13
N C14
[ GPE ]
[ atoms ]
N NH3L -0.30 0
- HN1 HCL 0.33 0
- HN2 HCL 0.33 0
- HN3 HCL 0.33 0
- C12 CTL2 0.13 0
- H12A HAL2 0.09 0
- H12B HAL2 0.09 0
- C11 CTL2 -0.08 1
- H11A HAL2 0.09 1
- H11B HAL2 0.09 1
- P PL 1.50 1
- O13 O2L -0.78 1
- O14 O2L -0.78 1
- O11 OSL -0.57 1
- O12 OSL -0.57 1
- C1 CTL2 -0.08 1
- HA HAL2 0.09 1
- HB HAL2 0.09 1
- C2 CTL1 0.14 2
- HS HAL1 0.09 2
- OH2 OHL -0.66 2
- HO2 HOL 0.43 2
- C3 CTL2 0.05 3
- HX HAL2 0.09 3
- HY HAL2 0.09 3
- OH3 OHL -0.66 3
- HO3 HOL 0.43 3
+ HN1 HCL 0.33 1
+ HN2 HCL 0.33 2
+ HN3 HCL 0.33 3
+ C12 CTL2 0.13 4
+ H12A HAL2 0.09 5
+ H12B HAL2 0.09 6
+ C11 CTL2 -0.08 7
+ H11A HAL2 0.09 8
+ H11B HAL2 0.09 9
+ P PL 1.50 10
+ O13 O2L -0.78 11
+ O14 O2L -0.78 12
+ O11 OSL -0.57 13
+ O12 OSL -0.57 14
+ C1 CTL2 -0.08 15
+ HA HAL2 0.09 16
+ HB HAL2 0.09 17
+ C2 CTL1 0.14 18
+ HS HAL1 0.09 19
+ OH2 OHL -0.66 20
+ HO2 HOL 0.43 21
+ C3 CTL2 0.05 22
+ HX HAL2 0.09 23
+ HY HAL2 0.09 24
+ OH3 OHL -0.66 25
+ HO3 HOL 0.43 26
[ bonds ]
N HN1
N HN2
[ DLPE ]
[ atoms ]
N NH3L -0.30 0
- HN1 HCL 0.33 0
- HN2 HCL 0.33 0
- HN3 HCL 0.33 0
- C12 CTL2 0.13 0
- H12A HAL2 0.09 0
- H12B HAL2 0.09 0
- C11 CTL2 -0.08 1
- H11A HAL2 0.09 1
- H11B HAL2 0.09 1
- P PL 1.50 1
- O13 O2L -0.78 1
- O14 O2L -0.78 1
- O11 OSL -0.57 1
- O12 OSL -0.57 1
- C1 CTL2 -0.08 1
- HA HAL2 0.09 1
- HB HAL2 0.09 1
- C2 CTL1 0.04 2
- HS HAL1 0.09 2
- O21 OSL -0.34 2
- C21 CL 0.63 2
- O22 OBL -0.52 2
- C22 CTL2 -0.08 2
- H2R HAL2 0.09 2
- H2S HAL2 0.09 2
- C3 CTL2 -0.05 3
- HX HAL2 0.09 3
- HY HAL2 0.09 3
- O31 OSL -0.34 3
- C31 CL 0.63 3
- O32 OBL -0.52 3
- C32 CTL2 -0.08 3
- H2X HAL2 0.09 3
- H2Y HAL2 0.09 3
- C23 CTL2 -0.18 4
- H3R HAL2 0.09 4
- H3S HAL2 0.09 4
- C24 CTL2 -0.18 5
- H4R HAL2 0.09 5
- H4S HAL2 0.09 5
- C25 CTL2 -0.18 6
- H5R HAL2 0.09 6
- H5S HAL2 0.09 6
- C26 CTL2 -0.18 7
- H6R HAL2 0.09 7
- H6S HAL2 0.09 7
- C27 CTL2 -0.18 8
- H7R HAL2 0.09 8
- H7S HAL2 0.09 8
- C28 CTL2 -0.18 9
- H8R HAL2 0.09 9
- H8S HAL2 0.09 9
- C29 CTL2 -0.18 10
- H9R HAL2 0.09 10
- H9S HAL2 0.09 10
- C210 CTL2 -0.18 11
- H10R HAL2 0.09 11
- H10S HAL2 0.09 11
- C211 CTL2 -0.18 12
- H11R HAL2 0.09 12
- H11S HAL2 0.09 12
- C212 CTL3 -0.27 13
- H12R HAL3 0.09 13
- H12S HAL3 0.09 13
- H12T HAL3 0.09 13
- C33 CTL2 -0.18 14
- H3X HAL2 0.09 14
- H3Y HAL2 0.09 14
- C34 CTL2 -0.18 15
- H4X HAL2 0.09 15
- H4Y HAL2 0.09 15
- C35 CTL2 -0.18 16
- H5X HAL2 0.09 16
- H5Y HAL2 0.09 16
- C36 CTL2 -0.18 17
- H6X HAL2 0.09 17
- H6Y HAL2 0.09 17
- C37 CTL2 -0.18 18
- H7X HAL2 0.09 18
- H7Y HAL2 0.09 18
- C38 CTL2 -0.18 19
- H8X HAL2 0.09 19
- H8Y HAL2 0.09 19
- C39 CTL2 -0.18 20
- H9X HAL2 0.09 20
- H9Y HAL2 0.09 20
- C310 CTL2 -0.18 21
- H10X HAL2 0.09 21
- H10Y HAL2 0.09 21
- C311 CTL2 -0.18 22
- H11X HAL2 0.09 22
- H11Y HAL2 0.09 22
- C312 CTL3 -0.27 23
- H12X HAL3 0.09 23
- H12Y HAL3 0.09 23
- H12Z HAL3 0.09 23
+ HN1 HCL 0.33 1
+ HN2 HCL 0.33 2
+ HN3 HCL 0.33 3
+ C12 CTL2 0.13 4
+ H12A HAL2 0.09 5
+ H12B HAL2 0.09 6
+ C11 CTL2 -0.08 7
+ H11A HAL2 0.09 8
+ H11B HAL2 0.09 9
+ P PL 1.50 10
+ O13 O2L -0.78 11
+ O14 O2L -0.78 12
+ O11 OSL -0.57 13
+ O12 OSL -0.57 14
+ C1 CTL2 -0.08 15
+ HA HAL2 0.09 16
+ HB HAL2 0.09 17
+ C2 CTL1 0.04 18
+ HS HAL1 0.09 19
+ O21 OSL -0.34 20
+ C21 CL 0.63 21
+ O22 OBL -0.52 22
+ C22 CTL2 -0.08 23
+ H2R HAL2 0.09 24
+ H2S HAL2 0.09 25
+ C3 CTL2 -0.05 26
+ HX HAL2 0.09 27
+ HY HAL2 0.09 28
+ O31 OSL -0.34 29
+ C31 CL 0.63 30
+ O32 OBL -0.52 31
+ C32 CTL2 -0.08 32
+ H2X HAL2 0.09 33
+ H2Y HAL2 0.09 34
+ C23 CTL2 -0.18 35
+ H3R HAL2 0.09 36
+ H3S HAL2 0.09 37
+ C24 CTL2 -0.18 38
+ H4R HAL2 0.09 39
+ H4S HAL2 0.09 40
+ C25 CTL2 -0.18 41
+ H5R HAL2 0.09 42
+ H5S HAL2 0.09 43
+ C26 CTL2 -0.18 44
+ H6R HAL2 0.09 45
+ H6S HAL2 0.09 46
+ C27 CTL2 -0.18 47
+ H7R HAL2 0.09 48
+ H7S HAL2 0.09 49
+ C28 CTL2 -0.18 50
+ H8R HAL2 0.09 51
+ H8S HAL2 0.09 52
+ C29 CTL2 -0.18 53
+ H9R HAL2 0.09 54
+ H9S HAL2 0.09 55
+ C210 CTL2 -0.18 56
+ H10R HAL2 0.09 57
+ H10S HAL2 0.09 58
+ C211 CTL2 -0.18 59
+ H11R HAL2 0.09 60
+ H11S HAL2 0.09 61
+ C212 CTL3 -0.27 62
+ H12R HAL3 0.09 63
+ H12S HAL3 0.09 64
+ H12T HAL3 0.09 65
+ C33 CTL2 -0.18 66
+ H3X HAL2 0.09 67
+ H3Y HAL2 0.09 68
+ C34 CTL2 -0.18 69
+ H4X HAL2 0.09 70
+ H4Y HAL2 0.09 71
+ C35 CTL2 -0.18 72
+ H5X HAL2 0.09 73
+ H5Y HAL2 0.09 74
+ C36 CTL2 -0.18 75
+ H6X HAL2 0.09 76
+ H6Y HAL2 0.09 77
+ C37 CTL2 -0.18 78
+ H7X HAL2 0.09 79
+ H7Y HAL2 0.09 80
+ C38 CTL2 -0.18 81
+ H8X HAL2 0.09 82
+ H8Y HAL2 0.09 83
+ C39 CTL2 -0.18 84
+ H9X HAL2 0.09 85
+ H9Y HAL2 0.09 86
+ C310 CTL2 -0.18 87
+ H10X HAL2 0.09 88
+ H10Y HAL2 0.09 89
+ C311 CTL2 -0.18 90
+ H11X HAL2 0.09 91
+ H11Y HAL2 0.09 92
+ C312 CTL3 -0.27 93
+ H12X HAL3 0.09 94
+ H12Y HAL3 0.09 95
+ H12Z HAL3 0.09 96
[ bonds ]
N HN1
N HN2
[ DMPC ]
[ atoms ]
N NTL -0.60 0
- C13 CTL5 -0.35 0
- H13A HL 0.25 0
- H13B HL 0.25 0
- H13C HL 0.25 0
- C14 CTL5 -0.35 0
- H14A HL 0.25 0
- H14B HL 0.25 0
- H14C HL 0.25 0
- C15 CTL5 -0.35 0
- H15A HL 0.25 0
- H15B HL 0.25 0
- H15C HL 0.25 0
- C12 CTL2 -0.10 0
- H12A HL 0.25 0
- H12B HL 0.25 0
- C11 CTL2 -0.08 1
- H11A HAL2 0.09 1
- H11B HAL2 0.09 1
- P PL 1.50 1
- O13 O2L -0.78 1
- O14 O2L -0.78 1
- O11 OSL -0.57 1
- O12 OSL -0.57 1
- C1 CTL2 -0.08 1
- HA HAL2 0.09 1
- HB HAL2 0.09 1
- C2 CTL1 0.04 2
- HS HAL1 0.09 2
- O21 OSL -0.34 2
- C21 CL 0.63 2
- O22 OBL -0.52 2
- C22 CTL2 -0.08 2
- H2R HAL2 0.09 2
- H2S HAL2 0.09 2
- C3 CTL2 -0.05 3
- HX HAL2 0.09 3
- HY HAL2 0.09 3
- O31 OSL -0.34 3
- C31 CL 0.63 3
- O32 OBL -0.52 3
- C32 CTL2 -0.08 3
- H2X HAL2 0.09 3
- H2Y HAL2 0.09 3
- C23 CTL2 -0.18 4
- H3R HAL2 0.09 4
- H3S HAL2 0.09 4
- C24 CTL2 -0.18 5
- H4R HAL2 0.09 5
- H4S HAL2 0.09 5
- C25 CTL2 -0.18 6
- H5R HAL2 0.09 6
- H5S HAL2 0.09 6
- C26 CTL2 -0.18 7
- H6R HAL2 0.09 7
- H6S HAL2 0.09 7
- C27 CTL2 -0.18 8
- H7R HAL2 0.09 8
- H7S HAL2 0.09 8
- C28 CTL2 -0.18 9
- H8R HAL2 0.09 9
- H8S HAL2 0.09 9
- C29 CTL2 -0.18 10
- H9R HAL2 0.09 10
- H9S HAL2 0.09 10
- C210 CTL2 -0.18 11
- H10R HAL2 0.09 11
- H10S HAL2 0.09 11
- C211 CTL2 -0.18 12
- H11R HAL2 0.09 12
- H11S HAL2 0.09 12
- C212 CTL2 -0.18 13
- H12R HAL2 0.09 13
- H12S HAL2 0.09 13
- C213 CTL2 -0.18 14
- H13R HAL2 0.09 14
- H13S HAL2 0.09 14
- C214 CTL3 -0.27 15
- H14R HAL3 0.09 15
- H14S HAL3 0.09 15
- H14T HAL3 0.09 15
- C33 CTL2 -0.18 16
- H3X HAL2 0.09 16
- H3Y HAL2 0.09 16
- C34 CTL2 -0.18 17
- H4X HAL2 0.09 17
- H4Y HAL2 0.09 17
- C35 CTL2 -0.18 18
- H5X HAL2 0.09 18
- H5Y HAL2 0.09 18
- C36 CTL2 -0.18 19
- H6X HAL2 0.09 19
- H6Y HAL2 0.09 19
- C37 CTL2 -0.18 20
- H7X HAL2 0.09 20
- H7Y HAL2 0.09 20
- C38 CTL2 -0.18 21
- H8X HAL2 0.09 21
- H8Y HAL2 0.09 21
- C39 CTL2 -0.18 22
- H9X HAL2 0.09 22
- H9Y HAL2 0.09 22
- C310 CTL2 -0.18 23
- H10X HAL2 0.09 23
- H10Y HAL2 0.09 23
- C311 CTL2 -0.18 24
- H11X HAL2 0.09 24
- H11Y HAL2 0.09 24
- C312 CTL2 -0.18 25
- H12X HAL2 0.09 25
- H12Y HAL2 0.09 25
- C313 CTL2 -0.18 26
- H13X HAL2 0.09 26
- H13Y HAL2 0.09 26
- C314 CTL3 -0.27 27
- H14X HAL3 0.09 27
- H14Y HAL3 0.09 27
- H14Z HAL3 0.09 27
+ C13 CTL5 -0.35 1
+ H13A HL 0.25 2
+ H13B HL 0.25 3
+ H13C HL 0.25 4
+ C14 CTL5 -0.35 5
+ H14A HL 0.25 6
+ H14B HL 0.25 7
+ H14C HL 0.25 8
+ C15 CTL5 -0.35 9
+ H15A HL 0.25 10
+ H15B HL 0.25 11
+ H15C HL 0.25 12
+ C12 CTL2 -0.10 13
+ H12A HL 0.25 14
+ H12B HL 0.25 15
+ C11 CTL2 -0.08 16
+ H11A HAL2 0.09 17
+ H11B HAL2 0.09 18
+ P PL 1.50 19
+ O13 O2L -0.78 20
+ O14 O2L -0.78 21
+ O11 OSL -0.57 22
+ O12 OSL -0.57 23
+ C1 CTL2 -0.08 24
+ HA HAL2 0.09 25
+ HB HAL2 0.09 26
+ C2 CTL1 0.04 27
+ HS HAL1 0.09 28
+ O21 OSL -0.34 29
+ C21 CL 0.63 30
+ O22 OBL -0.52 31
+ C22 CTL2 -0.08 32
+ H2R HAL2 0.09 33
+ H2S HAL2 0.09 34
+ C3 CTL2 -0.05 35
+ HX HAL2 0.09 36
+ HY HAL2 0.09 37
+ O31 OSL -0.34 38
+ C31 CL 0.63 39
+ O32 OBL -0.52 40
+ C32 CTL2 -0.08 41
+ H2X HAL2 0.09 42
+ H2Y HAL2 0.09 43
+ C23 CTL2 -0.18 44
+ H3R HAL2 0.09 45
+ H3S HAL2 0.09 46
+ C24 CTL2 -0.18 47
+ H4R HAL2 0.09 48
+ H4S HAL2 0.09 49
+ C25 CTL2 -0.18 50
+ H5R HAL2 0.09 51
+ H5S HAL2 0.09 52
+ C26 CTL2 -0.18 53
+ H6R HAL2 0.09 54
+ H6S HAL2 0.09 55
+ C27 CTL2 -0.18 56
+ H7R HAL2 0.09 57
+ H7S HAL2 0.09 58
+ C28 CTL2 -0.18 59
+ H8R HAL2 0.09 60
+ H8S HAL2 0.09 61
+ C29 CTL2 -0.18 62
+ H9R HAL2 0.09 63
+ H9S HAL2 0.09 64
+ C210 CTL2 -0.18 65
+ H10R HAL2 0.09 66
+ H10S HAL2 0.09 67
+ C211 CTL2 -0.18 68
+ H11R HAL2 0.09 69
+ H11S HAL2 0.09 70
+ C212 CTL2 -0.18 71
+ H12R HAL2 0.09 72
+ H12S HAL2 0.09 73
+ C213 CTL2 -0.18 74
+ H13R HAL2 0.09 75
+ H13S HAL2 0.09 76
+ C214 CTL3 -0.27 77
+ H14R HAL3 0.09 78
+ H14S HAL3 0.09 79
+ H14T HAL3 0.09 80
+ C33 CTL2 -0.18 81
+ H3X HAL2 0.09 82
+ H3Y HAL2 0.09 83
+ C34 CTL2 -0.18 84
+ H4X HAL2 0.09 85
+ H4Y HAL2 0.09 86
+ C35 CTL2 -0.18 87
+ H5X HAL2 0.09 88
+ H5Y HAL2 0.09 89
+ C36 CTL2 -0.18 90
+ H6X HAL2 0.09 91
+ H6Y HAL2 0.09 92
+ C37 CTL2 -0.18 93
+ H7X HAL2 0.09 94
+ H7Y HAL2 0.09 95
+ C38 CTL2 -0.18 96
+ H8X HAL2 0.09 97
+ H8Y HAL2 0.09 98
+ C39 CTL2 -0.18 99
+ H9X HAL2 0.09 100
+ H9Y HAL2 0.09 101
+ C310 CTL2 -0.18 102
+ H10X HAL2 0.09 103
+ H10Y HAL2 0.09 104
+ C311 CTL2 -0.18 105
+ H11X HAL2 0.09 106
+ H11Y HAL2 0.09 107
+ C312 CTL2 -0.18 108
+ H12X HAL2 0.09 109
+ H12Y HAL2 0.09 110
+ C313 CTL2 -0.18 111
+ H13X HAL2 0.09 112
+ H13Y HAL2 0.09 113
+ C314 CTL3 -0.27 114
+ H14X HAL3 0.09 115
+ H14Y HAL3 0.09 116
+ H14Z HAL3 0.09 117
[ bonds ]
N C13
N C14
[ SDS ]
[ atoms ]
S SL 1.33 0
- OS1 OSL -0.28 0
- OS2 O2L -0.65 0
- OS3 O2L -0.65 0
- OS4 O2L -0.65 0
- C1 CTL2 -0.28 0
- H11 HAL2 0.09 0
- H12 HAL2 0.09 0
- C2 CTL2 -0.18 1
- H21 HAL2 0.09 1
- H22 HAL2 0.09 1
- C3 CTL2 -0.18 2
- H31 HAL2 0.09 2
- H32 HAL2 0.09 2
- C4 CTL2 -0.18 3
- H41 HAL2 0.09 3
- H42 HAL2 0.09 3
- C5 CTL2 -0.18 4
- H51 HAL2 0.09 4
- H52 HAL2 0.09 4
- C6 CTL2 -0.18 5
- H61 HAL2 0.09 5
- H62 HAL2 0.09 5
- C7 CTL2 -0.18 6
- H71 HAL2 0.09 6
- H72 HAL2 0.09 6
- C8 CTL2 -0.18 7
- H81 HAL2 0.09 7
- H82 HAL2 0.09 7
- C9 CTL2 -0.18 8
- H91 HAL2 0.09 8
- H92 HAL2 0.09 8
- C10 CTL2 -0.18 9
- H101 HAL2 0.09 9
- H102 HAL2 0.09 9
- C11 CTL2 -0.18 10
- H111 HAL2 0.09 10
- H112 HAL2 0.09 10
- C12 CTL3 -0.27 11
- H121 HAL3 0.09 11
- H122 HAL3 0.09 11
- H123 HAL3 0.09 11
+ OS1 OSL -0.28 1
+ OS2 O2L -0.65 2
+ OS3 O2L -0.65 3
+ OS4 O2L -0.65 4
+ C1 CTL2 -0.28 5
+ H11 HAL2 0.09 6
+ H12 HAL2 0.09 7
+ C2 CTL2 -0.18 8
+ H21 HAL2 0.09 9
+ H22 HAL2 0.09 10
+ C3 CTL2 -0.18 11
+ H31 HAL2 0.09 12
+ H32 HAL2 0.09 13
+ C4 CTL2 -0.18 14
+ H41 HAL2 0.09 15
+ H42 HAL2 0.09 16
+ C5 CTL2 -0.18 17
+ H51 HAL2 0.09 18
+ H52 HAL2 0.09 19
+ C6 CTL2 -0.18 20
+ H61 HAL2 0.09 21
+ H62 HAL2 0.09 22
+ C7 CTL2 -0.18 23
+ H71 HAL2 0.09 24
+ H72 HAL2 0.09 25
+ C8 CTL2 -0.18 26
+ H81 HAL2 0.09 27
+ H82 HAL2 0.09 28
+ C9 CTL2 -0.18 29
+ H91 HAL2 0.09 30
+ H92 HAL2 0.09 31
+ C10 CTL2 -0.18 32
+ H101 HAL2 0.09 33
+ H102 HAL2 0.09 34
+ C11 CTL2 -0.18 35
+ H111 HAL2 0.09 36
+ H112 HAL2 0.09 37
+ C12 CTL3 -0.27 38
+ H121 HAL3 0.09 39
+ H122 HAL3 0.09 40
+ H123 HAL3 0.09 41
[ bonds ]
S OS1
S OS2
[ POPC ]
[ atoms ]
N NTL -0.60 0
- C11 CTL2 -0.10 0
- C12 CTL5 -0.35 0
- C13 CTL5 -0.35 0
- C14 CTL5 -0.35 0
- H11 HL 0.25 0
- H12 HL 0.25 0
- H21 HL 0.25 0
- H22 HL 0.25 0
- H23 HL 0.25 0
- H31 HL 0.25 0
- H32 HL 0.25 0
- H33 HL 0.25 0
- H41 HL 0.25 0
- H42 HL 0.25 0
- H43 HL 0.25 0
- C15 CTL2 -0.08 1
- H51 HAL2 0.09 1
- H52 HAL2 0.09 1
- P1 PL 1.50 2
- O3 O2L -0.78 2
- O4 O2L -0.78 2
- O1 OSL -0.57 2
- O2 OSL -0.57 2
- C1 CTL2 -0.08 3
- HA HAL2 0.09 3
- HB HAL2 0.09 3
- C2 CTL1 0.04 4
- HS HAL1 0.09 4
- O21 OSL -0.34 4
- C21 CL 0.63 4
- O22 OBL -0.52 4
- C22 CTL2 -0.08 4
- H2R HAL2 0.09 4
- H2S HAL2 0.09 4
- C3 CTL2 -0.05 5
- HX HAL2 0.09 5
- HY HAL2 0.09 5
- O31 OSL -0.34 5
- C31 CL 0.63 5
- O32 OBL -0.52 5
- C32 CTL2 -0.08 5
- H2X HAL2 0.09 5
- H2Y HAL2 0.09 5
- C23 CTL2 -0.18 6
- H3R HAL2 0.09 6
- H3S HAL2 0.09 6
- C24 CTL2 -0.18 7
- H4R HAL2 0.09 7
- H4S HAL2 0.09 7
- C25 CTL2 -0.18 8
- H5R HAL2 0.09 8
- H5S HAL2 0.09 8
- C26 CTL2 -0.18 9
- H6R HAL2 0.09 9
- H6S HAL2 0.09 9
- C27 CTL2 -0.18 10
- H7R HAL2 0.09 10
- H7S HAL2 0.09 10
- C28 CTL2 -0.18 11
- H8R HAL2 0.09 11
- H8S HAL2 0.09 11
- C29 CEL1 -0.15 12
- H91 HEL1 0.15 12
- C210 CEL1 -0.15 13
- H101 HEL1 0.15 13
- C211 CTL2 -0.18 14
- H11R HAL2 0.09 14
- H11S HAL2 0.09 14
- C212 CTL2 -0.18 15
- H12R HAL2 0.09 15
- H12S HAL2 0.09 15
- C213 CTL2 -0.18 16
- H13R HAL2 0.09 16
- H13S HAL2 0.09 16
- C214 CTL2 -0.18 17
- H14R HAL2 0.09 17
- H14S HAL2 0.09 17
- C215 CTL2 -0.18 18
- H15R HAL2 0.09 18
- H15S HAL2 0.09 18
- C216 CTL2 -0.18 19
- H16R HAL2 0.09 19
- H16S HAL2 0.09 19
- C217 CTL2 -0.18 20
- H17R HAL2 0.09 20
- H17S HAL2 0.09 20
- C218 CTL3 -0.27 21
- H18R HAL3 0.09 21
- H18S HAL3 0.09 21
- H18T HAL3 0.09 21
- C33 CTL2 -0.18 22
- H3X HAL2 0.09 22
- H3Y HAL2 0.09 22
- C34 CTL2 -0.18 23
- H4X HAL2 0.09 23
- H4Y HAL2 0.09 23
- C35 CTL2 -0.18 24
- H5X HAL2 0.09 24
- H5Y HAL2 0.09 24
- C36 CTL2 -0.18 25
- H6X HAL2 0.09 25
- H6Y HAL2 0.09 25
- C37 CTL2 -0.18 26
- H7X HAL2 0.09 26
- H7Y HAL2 0.09 26
- C38 CTL2 -0.18 27
- H8X HAL2 0.09 27
- H8Y HAL2 0.09 27
- C39 CTL2 -0.18 28
- H9X HAL2 0.09 28
- H9Y HAL2 0.09 28
- C310 CTL2 -0.18 29
- H10X HAL2 0.09 29
- H10Y HAL2 0.09 29
- C311 CTL2 -0.18 30
- H11X HAL2 0.09 30
- H11Y HAL2 0.09 30
- C312 CTL2 -0.18 31
- H12X HAL2 0.09 31
- H12Y HAL2 0.09 31
- C313 CTL2 -0.18 32
- H13X HAL2 0.09 32
- H13Y HAL2 0.09 32
- C314 CTL2 -0.18 33
- H14X HAL2 0.09 33
- H14Y HAL2 0.09 33
- C315 CTL2 -0.18 34
- H15X HAL2 0.09 34
- H15Y HAL2 0.09 34
- C316 CTL3 -0.27 35
- H16X HAL3 0.09 35
- H16Y HAL3 0.09 35
- H16Z HAL3 0.09 35
+ C11 CTL2 -0.10 1
+ C12 CTL5 -0.35 2
+ C13 CTL5 -0.35 3
+ C14 CTL5 -0.35 4
+ H11 HL 0.25 5
+ H12 HL 0.25 6
+ H21 HL 0.25 7
+ H22 HL 0.25 8
+ H23 HL 0.25 9
+ H31 HL 0.25 10
+ H32 HL 0.25 11
+ H33 HL 0.25 12
+ H41 HL 0.25 13
+ H42 HL 0.25 14
+ H43 HL 0.25 15
+ C15 CTL2 -0.08 16
+ H51 HAL2 0.09 17
+ H52 HAL2 0.09 18
+ P1 PL 1.50 19
+ O3 O2L -0.78 20
+ O4 O2L -0.78 21
+ O1 OSL -0.57 22
+ O2 OSL -0.57 23
+ C1 CTL2 -0.08 24
+ HA HAL2 0.09 25
+ HB HAL2 0.09 26
+ C2 CTL1 0.04 27
+ HS HAL1 0.09 28
+ O21 OSL -0.34 29
+ C21 CL 0.63 30
+ O22 OBL -0.52 31
+ C22 CTL2 -0.08 32
+ H2R HAL2 0.09 33
+ H2S HAL2 0.09 34
+ C3 CTL2 -0.05 35
+ HX HAL2 0.09 36
+ HY HAL2 0.09 37
+ O31 OSL -0.34 38
+ C31 CL 0.63 39
+ O32 OBL -0.52 40
+ C32 CTL2 -0.08 41
+ H2X HAL2 0.09 42
+ H2Y HAL2 0.09 43
+ C23 CTL2 -0.18 44
+ H3R HAL2 0.09 45
+ H3S HAL2 0.09 46
+ C24 CTL2 -0.18 47
+ H4R HAL2 0.09 48
+ H4S HAL2 0.09 49
+ C25 CTL2 -0.18 50
+ H5R HAL2 0.09 51
+ H5S HAL2 0.09 52
+ C26 CTL2 -0.18 53
+ H6R HAL2 0.09 54
+ H6S HAL2 0.09 55
+ C27 CTL2 -0.18 56
+ H7R HAL2 0.09 57
+ H7S HAL2 0.09 58
+ C28 CTL2 -0.18 59
+ H8R HAL2 0.09 60
+ H8S HAL2 0.09 61
+ C29 CEL1 -0.15 62
+ H91 HEL1 0.15 63
+ C210 CEL1 -0.15 64
+ H101 HEL1 0.15 65
+ C211 CTL2 -0.18 66
+ H11R HAL2 0.09 67
+ H11S HAL2 0.09 68
+ C212 CTL2 -0.18 69
+ H12R HAL2 0.09 70
+ H12S HAL2 0.09 71
+ C213 CTL2 -0.18 72
+ H13R HAL2 0.09 73
+ H13S HAL2 0.09 74
+ C214 CTL2 -0.18 75
+ H14R HAL2 0.09 76
+ H14S HAL2 0.09 77
+ C215 CTL2 -0.18 78
+ H15R HAL2 0.09 79
+ H15S HAL2 0.09 80
+ C216 CTL2 -0.18 81
+ H16R HAL2 0.09 82
+ H16S HAL2 0.09 83
+ C217 CTL2 -0.18 84
+ H17R HAL2 0.09 85
+ H17S HAL2 0.09 86
+ C218 CTL3 -0.27 87
+ H18R HAL3 0.09 88
+ H18S HAL3 0.09 89
+ H18T HAL3 0.09 90
+ C33 CTL2 -0.18 91
+ H3X HAL2 0.09 92
+ H3Y HAL2 0.09 93
+ C34 CTL2 -0.18 94
+ H4X HAL2 0.09 95
+ H4Y HAL2 0.09 96
+ C35 CTL2 -0.18 97
+ H5X HAL2 0.09 98
+ H5Y HAL2 0.09 99
+ C36 CTL2 -0.18 100
+ H6X HAL2 0.09 101
+ H6Y HAL2 0.09 102
+ C37 CTL2 -0.18 103
+ H7X HAL2 0.09 104
+ H7Y HAL2 0.09 105
+ C38 CTL2 -0.18 106
+ H8X HAL2 0.09 107
+ H8Y HAL2 0.09 108
+ C39 CTL2 -0.18 109
+ H9X HAL2 0.09 110
+ H9Y HAL2 0.09 111
+ C310 CTL2 -0.18 112
+ H10X HAL2 0.09 113
+ H10Y HAL2 0.09 114
+ C311 CTL2 -0.18 115
+ H11X HAL2 0.09 116
+ H11Y HAL2 0.09 117
+ C312 CTL2 -0.18 118
+ H12X HAL2 0.09 119
+ H12Y HAL2 0.09 120
+ C313 CTL2 -0.18 121
+ H13X HAL2 0.09 122
+ H13Y HAL2 0.09 123
+ C314 CTL2 -0.18 124
+ H14X HAL2 0.09 125
+ H14Y HAL2 0.09 126
+ C315 CTL2 -0.18 127
+ H15X HAL2 0.09 128
+ H15Y HAL2 0.09 129
+ C316 CTL3 -0.27 130
+ H16X HAL3 0.09 131
+ H16Y HAL3 0.09 132
+ H16Z HAL3 0.09 133
[ bonds ]
N C11
N C12
[ POPE ]
[ atoms ]
N NH3L -0.30 0
- HN1 HCL 0.33 0
- HN2 HCL 0.33 0
- HN3 HCL 0.33 0
- C12 CTL2 0.13 0
- H12A HAL2 0.09 0
- H12B HAL2 0.09 0
- C11 CTL2 -0.08 1
- H11A HAL2 0.09 1
- H11B HAL2 0.09 1
- P PL 1.50 1
- O13 O2L -0.78 1
- O14 O2L -0.78 1
- O11 OSL -0.57 1
- O12 OSL -0.57 1
- C1 CTL2 -0.08 1
- HA HAL2 0.09 1
- HB HAL2 0.09 1
- C2 CTL1 0.04 2
- HS HAL1 0.09 2
- O21 OSL -0.34 2
- C21 CL 0.63 2
- O22 OBL -0.52 2
- C22 CTL2 -0.08 2
- H2R HAL2 0.09 2
- H2S HAL2 0.09 2
- C3 CTL2 -0.05 3
- HX HAL2 0.09 3
- HY HAL2 0.09 3
- O31 OSL -0.34 3
- C31 CL 0.63 3
- O32 OBL -0.52 3
- C32 CTL2 -0.08 3
- H2X HAL2 0.09 3
- H2Y HAL2 0.09 3
- C23 CTL2 -0.18 4
- H3R HAL2 0.09 4
- H3S HAL2 0.09 4
- C24 CTL2 -0.18 5
- H4R HAL2 0.09 5
- H4S HAL2 0.09 5
- C25 CTL2 -0.18 6
- H5R HAL2 0.09 6
- H5S HAL2 0.09 6
- C26 CTL2 -0.18 7
- H6R HAL2 0.09 7
- H6S HAL2 0.09 7
- C27 CTL2 -0.18 8
- H7R HAL2 0.09 8
- H7S HAL2 0.09 8
- C28 CTL2 -0.18 9
- H8R HAL2 0.09 9
- H8S HAL2 0.09 9
- C29 CEL1 -0.15 10
- H91 HEL1 0.15 10
- C210 CEL1 -0.15 11
- H101 HEL1 0.15 11
- C211 CTL2 -0.18 12
- H11R HAL2 0.09 12
- H11S HAL2 0.09 12
- C212 CTL2 -0.18 13
- H12R HAL2 0.09 13
- H12S HAL2 0.09 13
- C213 CTL2 -0.18 14
- H13R HAL2 0.09 14
- H13S HAL2 0.09 14
- C214 CTL2 -0.18 15
- H14R HAL2 0.09 15
- H14S HAL2 0.09 15
- C215 CTL2 -0.18 16
- H15R HAL2 0.09 16
- H15S HAL2 0.09 16
- C216 CTL2 -0.18 17
- H16R HAL2 0.09 17
- H16S HAL2 0.09 17
- C217 CTL2 -0.18 18
- H17R HAL2 0.09 18
- H17S HAL2 0.09 18
- C218 CTL3 -0.27 19
- H18R HAL3 0.09 19
- H18S HAL3 0.09 19
- H18T HAL3 0.09 19
- C33 CTL2 -0.18 20
- H3X HAL2 0.09 20
- H3Y HAL2 0.09 20
- C34 CTL2 -0.18 21
- H4X HAL2 0.09 21
- H4Y HAL2 0.09 21
- C35 CTL2 -0.18 22
- H5X HAL2 0.09 22
- H5Y HAL2 0.09 22
- C36 CTL2 -0.18 23
- H6X HAL2 0.09 23
- H6Y HAL2 0.09 23
- C37 CTL2 -0.18 24
- H7X HAL2 0.09 24
- H7Y HAL2 0.09 24
- C38 CTL2 -0.18 25
- H8X HAL2 0.09 25
- H8Y HAL2 0.09 25
- C39 CTL2 -0.18 26
- H9X HAL2 0.09 26
- H9Y HAL2 0.09 26
- C310 CTL2 -0.18 27
- H10X HAL2 0.09 27
- H10Y HAL2 0.09 27
- C311 CTL2 -0.18 28
- H11X HAL2 0.09 28
- H11Y HAL2 0.09 28
- C312 CTL2 -0.18 29
- H12X HAL2 0.09 29
- H12Y HAL2 0.09 29
- C313 CTL2 -0.18 30
- H13X HAL2 0.09 30
- H13Y HAL2 0.09 30
- C314 CTL2 -0.18 31
- H14X HAL2 0.09 31
- H14Y HAL2 0.09 31
- C315 CTL2 -0.18 32
- H15X HAL2 0.09 32
- H15Y HAL2 0.09 32
- C316 CTL3 -0.27 33
- H16X HAL3 0.09 33
- H16Y HAL3 0.09 33
- H16Z HAL3 0.09 33
+ HN1 HCL 0.33 1
+ HN2 HCL 0.33 2
+ HN3 HCL 0.33 3
+ C12 CTL2 0.13 4
+ H12A HAL2 0.09 5
+ H12B HAL2 0.09 6
+ C11 CTL2 -0.08 7
+ H11A HAL2 0.09 8
+ H11B HAL2 0.09 9
+ P PL 1.50 10
+ O13 O2L -0.78 11
+ O14 O2L -0.78 12
+ O11 OSL -0.57 13
+ O12 OSL -0.57 14
+ C1 CTL2 -0.08 15
+ HA HAL2 0.09 16
+ HB HAL2 0.09 17
+ C2 CTL1 0.04 18
+ HS HAL1 0.09 19
+ O21 OSL -0.34 20
+ C21 CL 0.63 21
+ O22 OBL -0.52 22
+ C22 CTL2 -0.08 23
+ H2R HAL2 0.09 24
+ H2S HAL2 0.09 25
+ C3 CTL2 -0.05 26
+ HX HAL2 0.09 27
+ HY HAL2 0.09 28
+ O31 OSL -0.34 29
+ C31 CL 0.63 30
+ O32 OBL -0.52 31
+ C32 CTL2 -0.08 32
+ H2X HAL2 0.09 33
+ H2Y HAL2 0.09 34
+ C23 CTL2 -0.18 35
+ H3R HAL2 0.09 36
+ H3S HAL2 0.09 37
+ C24 CTL2 -0.18 38
+ H4R HAL2 0.09 39
+ H4S HAL2 0.09 40
+ C25 CTL2 -0.18 41
+ H5R HAL2 0.09 42
+ H5S HAL2 0.09 43
+ C26 CTL2 -0.18 44
+ H6R HAL2 0.09 45
+ H6S HAL2 0.09 46
+ C27 CTL2 -0.18 47
+ H7R HAL2 0.09 48
+ H7S HAL2 0.09 49
+ C28 CTL2 -0.18 50
+ H8R HAL2 0.09 51
+ H8S HAL2 0.09 52
+ C29 CEL1 -0.15 53
+ H91 HEL1 0.15 54
+ C210 CEL1 -0.15 55
+ H101 HEL1 0.15 56
+ C211 CTL2 -0.18 57
+ H11R HAL2 0.09 58
+ H11S HAL2 0.09 59
+ C212 CTL2 -0.18 60
+ H12R HAL2 0.09 61
+ H12S HAL2 0.09 62
+ C213 CTL2 -0.18 63
+ H13R HAL2 0.09 64
+ H13S HAL2 0.09 65
+ C214 CTL2 -0.18 66
+ H14R HAL2 0.09 67
+ H14S HAL2 0.09 68
+ C215 CTL2 -0.18 69
+ H15R HAL2 0.09 70
+ H15S HAL2 0.09 71
+ C216 CTL2 -0.18 72
+ H16R HAL2 0.09 73
+ H16S HAL2 0.09 74
+ C217 CTL2 -0.18 75
+ H17R HAL2 0.09 76
+ H17S HAL2 0.09 77
+ C218 CTL3 -0.27 78
+ H18R HAL3 0.09 79
+ H18S HAL3 0.09 80
+ H18T HAL3 0.09 81
+ C33 CTL2 -0.18 82
+ H3X HAL2 0.09 83
+ H3Y HAL2 0.09 84
+ C34 CTL2 -0.18 85
+ H4X HAL2 0.09 86
+ H4Y HAL2 0.09 87
+ C35 CTL2 -0.18 88
+ H5X HAL2 0.09 89
+ H5Y HAL2 0.09 90
+ C36 CTL2 -0.18 91
+ H6X HAL2 0.09 92
+ H6Y HAL2 0.09 93
+ C37 CTL2 -0.18 94
+ H7X HAL2 0.09 95
+ H7Y HAL2 0.09 96
+ C38 CTL2 -0.18 97
+ H8X HAL2 0.09 98
+ H8Y HAL2 0.09 99
+ C39 CTL2 -0.18 100
+ H9X HAL2 0.09 101
+ H9Y HAL2 0.09 102
+ C310 CTL2 -0.18 103
+ H10X HAL2 0.09 104
+ H10Y HAL2 0.09 105
+ C311 CTL2 -0.18 106
+ H11X HAL2 0.09 107
+ H11Y HAL2 0.09 108
+ C312 CTL2 -0.18 109
+ H12X HAL2 0.09 110
+ H12Y HAL2 0.09 111
+ C313 CTL2 -0.18 112
+ H13X HAL2 0.09 113
+ H13Y HAL2 0.09 114
+ C314 CTL2 -0.18 115
+ H14X HAL2 0.09 116
+ H14Y HAL2 0.09 117
+ C315 CTL2 -0.18 118
+ H15X HAL2 0.09 119
+ H15Y HAL2 0.09 120
+ C316 CTL3 -0.27 121
+ H16X HAL3 0.09 122
+ H16Y HAL3 0.09 123
+ H16Z HAL3 0.09 124
[ bonds ]
N HN1
N HN2
[ PALM ]
[ atoms ]
C1 CL 0.62 0
- O1 OCL -0.76 0
- O2 OCL -0.76 0
- C2 CTL2 -0.28 0
- H2A HAL2 0.09 0
- H2B HAL2 0.09 0
- C3 CTL2 -0.18 1
- H3A HAL2 0.09 1
- H3B HAL2 0.09 1
- C4 CTL2 -0.18 2
- H4A HAL2 0.09 2
- H4B HAL2 0.09 2
- C5 CTL2 -0.18 3
- H5A HAL2 0.09 3
- H5B HAL2 0.09 3
- C6 CTL2 -0.18 4
- H6A HAL2 0.09 4
- H6B HAL2 0.09 4
- C7 CTL2 -0.18 5
- H7A HAL2 0.09 5
- H7B HAL2 0.09 5
- C8 CTL2 -0.18 6
- H8A HAL2 0.09 6
- H8B HAL2 0.09 6
- C9 CTL2 -0.18 7
- H9A HAL2 0.09 7
- H9B HAL2 0.09 7
- C10 CTL2 -0.18 8
- H10A HAL2 0.09 8
- H10B HAL2 0.09 8
- C11 CTL2 -0.18 9
- H11A HAL2 0.09 9
- H11B HAL2 0.09 9
- C12 CTL2 -0.18 10
- H12A HAL2 0.09 10
- H12B HAL2 0.09 10
- C13 CTL2 -0.18 11
- H13A HAL2 0.09 11
- H13B HAL2 0.09 11
- C14 CTL2 -0.18 12
- H14A HAL2 0.09 12
- H14B HAL2 0.09 12
- C15 CTL2 -0.18 13
- H15A HAL2 0.09 13
- H15B HAL2 0.09 13
- C16 CTL3 -0.27 14
- H16A HAL3 0.09 14
- H16B HAL3 0.09 14
- H16C HAL3 0.09 14
+ O1 OCL -0.76 1
+ O2 OCL -0.76 2
+ C2 CTL2 -0.28 3
+ H2A HAL2 0.09 4
+ H2B HAL2 0.09 5
+ C3 CTL2 -0.18 6
+ H3A HAL2 0.09 7
+ H3B HAL2 0.09 8
+ C4 CTL2 -0.18 9
+ H4A HAL2 0.09 10
+ H4B HAL2 0.09 11
+ C5 CTL2 -0.18 12
+ H5A HAL2 0.09 13
+ H5B HAL2 0.09 14
+ C6 CTL2 -0.18 15
+ H6A HAL2 0.09 16
+ H6B HAL2 0.09 17
+ C7 CTL2 -0.18 18
+ H7A HAL2 0.09 19
+ H7B HAL2 0.09 20
+ C8 CTL2 -0.18 21
+ H8A HAL2 0.09 22
+ H8B HAL2 0.09 23
+ C9 CTL2 -0.18 24
+ H9A HAL2 0.09 25
+ H9B HAL2 0.09 26
+ C10 CTL2 -0.18 27
+ H10A HAL2 0.09 28
+ H10B HAL2 0.09 29
+ C11 CTL2 -0.18 30
+ H11A HAL2 0.09 31
+ H11B HAL2 0.09 32
+ C12 CTL2 -0.18 33
+ H12A HAL2 0.09 34
+ H12B HAL2 0.09 35
+ C13 CTL2 -0.18 36
+ H13A HAL2 0.09 37
+ H13B HAL2 0.09 38
+ C14 CTL2 -0.18 39
+ H14A HAL2 0.09 40
+ H14B HAL2 0.09 41
+ C15 CTL2 -0.18 42
+ H15A HAL2 0.09 43
+ H15B HAL2 0.09 44
+ C16 CTL3 -0.27 45
+ H16A HAL3 0.09 46
+ H16B HAL3 0.09 47
+ H16C HAL3 0.09 48
[ bonds ]
C1 O1
C1 O2
[ OLEO ]
[ atoms ]
C1 CL 0.62 0
- O1 OCL -0.76 0
- O2 OCL -0.76 0
- C2 CTL2 -0.28 0
- H2A HAL2 0.09 0
- H2B HAL2 0.09 0
- C3 CTL2 -0.18 1
- H3A HAL2 0.09 1
- H3B HAL2 0.09 1
- C4 CTL2 -0.18 2
- H4A HAL2 0.09 2
- H4B HAL2 0.09 2
- C5 CTL2 -0.18 3
- H5A HAL2 0.09 3
- H5B HAL2 0.09 3
- C6 CTL2 -0.18 4
- H6A HAL2 0.09 4
- H6B HAL2 0.09 4
- C7 CTL2 -0.18 5
- H7A HAL2 0.09 5
- H7B HAL2 0.09 5
- C8 CTL2 -0.18 6
- H8A HAL2 0.09 6
- H8B HAL2 0.09 6
- C9 CEL1 -0.15 7
- H9A HEL1 0.15 7
- C10 CEL1 -0.15 8
- H10A HEL1 0.15 8
- C11 CTL2 -0.18 9
- H11A HAL2 0.09 9
- H11B HAL2 0.09 9
- C12 CTL2 -0.18 10
- H12A HAL2 0.09 10
- H12B HAL2 0.09 10
- C13 CTL2 -0.18 11
- H13A HAL2 0.09 11
- H13B HAL2 0.09 11
- C14 CTL2 -0.18 12
- H14A HAL2 0.09 12
- H14B HAL2 0.09 12
- C15 CTL2 -0.18 13
- H15A HAL2 0.09 13
- H15B HAL2 0.09 13
- C16 CTL2 -0.18 14
- H16A HAL2 0.09 14
- H16B HAL2 0.09 14
- C17 CTL2 -0.18 15
- H17A HAL2 0.09 15
- H17B HAL2 0.09 15
- C18 CTL3 -0.27 16
- H18A HAL3 0.09 16
- H18B HAL3 0.09 16
- H18C HAL3 0.09 16
+ O1 OCL -0.76 1
+ O2 OCL -0.76 2
+ C2 CTL2 -0.28 3
+ H2A HAL2 0.09 4
+ H2B HAL2 0.09 5
+ C3 CTL2 -0.18 6
+ H3A HAL2 0.09 7
+ H3B HAL2 0.09 8
+ C4 CTL2 -0.18 9
+ H4A HAL2 0.09 10
+ H4B HAL2 0.09 11
+ C5 CTL2 -0.18 12
+ H5A HAL2 0.09 13
+ H5B HAL2 0.09 14
+ C6 CTL2 -0.18 15
+ H6A HAL2 0.09 16
+ H6B HAL2 0.09 17
+ C7 CTL2 -0.18 18
+ H7A HAL2 0.09 19
+ H7B HAL2 0.09 20
+ C8 CTL2 -0.18 21
+ H8A HAL2 0.09 22
+ H8B HAL2 0.09 23
+ C9 CEL1 -0.15 24
+ H9A HEL1 0.15 25
+ C10 CEL1 -0.15 26
+ H10A HEL1 0.15 27
+ C11 CTL2 -0.18 28
+ H11A HAL2 0.09 29
+ H11B HAL2 0.09 30
+ C12 CTL2 -0.18 31
+ H12A HAL2 0.09 32
+ H12B HAL2 0.09 33
+ C13 CTL2 -0.18 34
+ H13A HAL2 0.09 35
+ H13B HAL2 0.09 36
+ C14 CTL2 -0.18 37
+ H14A HAL2 0.09 38
+ H14B HAL2 0.09 39
+ C15 CTL2 -0.18 40
+ H15A HAL2 0.09 41
+ H15B HAL2 0.09 42
+ C16 CTL2 -0.18 43
+ H16A HAL2 0.09 44
+ H16B HAL2 0.09 45
+ C17 CTL2 -0.18 46
+ H17A HAL2 0.09 47
+ H17B HAL2 0.09 48
+ C18 CTL3 -0.27 49
+ H18A HAL3 0.09 50
+ H18B HAL3 0.09 51
+ H18C HAL3 0.09 52
[ bonds ]
C1 O1
C1 C2
[ DHA ]
[ atoms ]
C1 CL 0.62 0
- O1 OCL -0.76 0
- O2 OCL -0.76 0
- C2 CTL2 -0.28 0
- H2A HAL2 0.09 0
- H2B HAL2 0.09 0
- C3 CTL2 -0.18 1
- H3A HAL2 0.09 1
- H3B HAL2 0.09 1
- C4 CEL1 -0.15 2
- H4 HEL1 0.15 2
- C5 CEL1 -0.15 3
- H5 HEL1 0.15 3
- C6 CTL2 -0.18 4
- H6A HAL2 0.09 4
- H6B HAL2 0.09 4
- C7 CEL1 -0.15 5
- H7 HEL1 0.15 5
- C8 CEL1 -0.15 6
- H8 HEL1 0.15 6
- C9 CTL2 -0.18 7
- H9A HAL2 0.09 7
- H9B HAL2 0.09 7
- C10 CEL1 -0.15 8
- H10 HEL1 0.15 8
- C11 CEL1 -0.15 9
- H11 HEL1 0.15 9
- C12 CTL2 -0.18 10
- H12A HAL2 0.09 10
- H12B HAL2 0.09 10
- C13 CEL1 -0.15 11
- H13 HEL1 0.15 11
- C14 CEL1 -0.15 12
- H14 HEL1 0.15 12
- C15 CTL2 -0.18 13
- H15A HAL2 0.09 13
- H15B HAL2 0.09 13
- C16 CEL1 -0.15 14
- H16 HEL1 0.15 14
- C17 CEL1 -0.15 15
- H17 HEL1 0.15 15
- C18 CTL2 -0.18 16
- H18A HAL2 0.09 16
- H18B HAL2 0.09 16
- C19 CEL1 -0.15 17
- H19 HEL1 0.15 17
- C20 CEL1 -0.15 18
- H20 HEL1 0.15 18
- C21 CTL2 -0.18 19
- H21A HAL2 0.09 19
- H21B HAL2 0.09 19
- C22 CTL3 -0.27 20
- H22A HAL3 0.09 20
- H22B HAL3 0.09 20
- H22C HAL3 0.09 20
+ O1 OCL -0.76 1
+ O2 OCL -0.76 2
+ C2 CTL2 -0.28 3
+ H2A HAL2 0.09 4
+ H2B HAL2 0.09 5
+ C3 CTL2 -0.18 6
+ H3A HAL2 0.09 7
+ H3B HAL2 0.09 8
+ C4 CEL1 -0.15 9
+ H4 HEL1 0.15 10
+ C5 CEL1 -0.15 11
+ H5 HEL1 0.15 12
+ C6 CTL2 -0.18 13
+ H6A HAL2 0.09 14
+ H6B HAL2 0.09 15
+ C7 CEL1 -0.15 16
+ H7 HEL1 0.15 17
+ C8 CEL1 -0.15 18
+ H8 HEL1 0.15 19
+ C9 CTL2 -0.18 20
+ H9A HAL2 0.09 21
+ H9B HAL2 0.09 22
+ C10 CEL1 -0.15 23
+ H10 HEL1 0.15 24
+ C11 CEL1 -0.15 25
+ H11 HEL1 0.15 26
+ C12 CTL2 -0.18 27
+ H12A HAL2 0.09 28
+ H12B HAL2 0.09 29
+ C13 CEL1 -0.15 30
+ H13 HEL1 0.15 31
+ C14 CEL1 -0.15 32
+ H14 HEL1 0.15 33
+ C15 CTL2 -0.18 34
+ H15A HAL2 0.09 35
+ H15B HAL2 0.09 36
+ C16 CEL1 -0.15 37
+ H16 HEL1 0.15 38
+ C17 CEL1 -0.15 39
+ H17 HEL1 0.15 40
+ C18 CTL2 -0.18 41
+ H18A HAL2 0.09 42
+ H18B HAL2 0.09 43
+ C19 CEL1 -0.15 44
+ H19 HEL1 0.15 45
+ C20 CEL1 -0.15 46
+ H20 HEL1 0.15 47
+ C21 CTL2 -0.18 48
+ H21A HAL2 0.09 49
+ H21B HAL2 0.09 50
+ C22 CTL3 -0.27 51
+ H22A HAL3 0.09 52
+ H22B HAL3 0.09 53
+ H22C HAL3 0.09 54
[ bonds ]
C1 O1
C1 C2
[ STEA ]
[ atoms ]
C1 CL 0.62 0
- O1 OCL -0.76 0
- O2 OCL -0.76 0
- C2 CTL2 -0.28 0
- H2A HAL2 0.09 0
- H2B HAL2 0.09 0
- C3 CTL2 -0.18 1
- H3A HAL2 0.09 1
- H3B HAL2 0.09 1
- C4 CTL2 -0.18 2
- H4A HAL2 0.09 2
- H4B HAL2 0.09 2
- C5 CTL2 -0.18 3
- H5A HAL2 0.09 3
- H5B HAL2 0.09 3
- C6 CTL2 -0.18 4
- H6A HAL2 0.09 4
- H6B HAL2 0.09 4
- C7 CTL2 -0.18 5
- H7A HAL2 0.09 5
- H7B HAL2 0.09 5
- C8 CTL2 -0.18 6
- H8A HAL2 0.09 6
- H8B HAL2 0.09 6
- C9 CTL2 -0.18 7
- H9A HAL2 0.09 7
- H9B HAL2 0.09 7
- C10 CTL2 -0.18 8
- H10A HAL2 0.09 8
- H10B HAL2 0.09 8
- C11 CTL2 -0.18 9
- H11A HAL2 0.09 9
- H11B HAL2 0.09 9
- C12 CTL2 -0.18 10
- H12A HAL2 0.09 10
- H12B HAL2 0.09 10
- C13 CTL2 -0.18 11
- H13A HAL2 0.09 11
- H13B HAL2 0.09 11
- C14 CTL2 -0.18 12
- H14A HAL2 0.09 12
- H14B HAL2 0.09 12
- C15 CTL2 -0.18 13
- H15A HAL2 0.09 13
- H15B HAL2 0.09 13
- C16 CTL2 -0.18 14
- H16A HAL2 0.09 14
- H16B HAL2 0.09 14
- C17 CTL2 -0.18 15
- H17A HAL2 0.09 15
- H17B HAL2 0.09 15
- C18 CTL3 -0.27 16
- H18A HAL3 0.09 16
- H18B HAL3 0.09 16
- H18C HAL3 0.09 16
+ O1 OCL -0.76 1
+ O2 OCL -0.76 2
+ C2 CTL2 -0.28 3
+ H2A HAL2 0.09 4
+ H2B HAL2 0.09 5
+ C3 CTL2 -0.18 6
+ H3A HAL2 0.09 7
+ H3B HAL2 0.09 8
+ C4 CTL2 -0.18 9
+ H4A HAL2 0.09 10
+ H4B HAL2 0.09 11
+ C5 CTL2 -0.18 12
+ H5A HAL2 0.09 13
+ H5B HAL2 0.09 14
+ C6 CTL2 -0.18 15
+ H6A HAL2 0.09 16
+ H6B HAL2 0.09 17
+ C7 CTL2 -0.18 18
+ H7A HAL2 0.09 19
+ H7B HAL2 0.09 20
+ C8 CTL2 -0.18 21
+ H8A HAL2 0.09 22
+ H8B HAL2 0.09 23
+ C9 CTL2 -0.18 24
+ H9A HAL2 0.09 25
+ H9B HAL2 0.09 26
+ C10 CTL2 -0.18 27
+ H10A HAL2 0.09 28
+ H10B HAL2 0.09 29
+ C11 CTL2 -0.18 30
+ H11A HAL2 0.09 31
+ H11B HAL2 0.09 32
+ C12 CTL2 -0.18 33
+ H12A HAL2 0.09 34
+ H12B HAL2 0.09 35
+ C13 CTL2 -0.18 36
+ H13A HAL2 0.09 37
+ H13B HAL2 0.09 38
+ C14 CTL2 -0.18 39
+ H14A HAL2 0.09 40
+ H14B HAL2 0.09 41
+ C15 CTL2 -0.18 42
+ H15A HAL2 0.09 43
+ H15B HAL2 0.09 44
+ C16 CTL2 -0.18 45
+ H16A HAL2 0.09 46
+ H16B HAL2 0.09 47
+ C17 CTL2 -0.18 48
+ H17A HAL2 0.09 49
+ H17B HAL2 0.09 50
+ C18 CTL3 -0.27 51
+ H18A HAL3 0.09 52
+ H18B HAL3 0.09 53
+ H18C HAL3 0.09 54
[ bonds ]
C1 O1
C1 C2
[ PCGL ]
[ atoms ]
N NTL -0.60 0
- C5 CTL2 -0.10 0
- C6 CTL5 -0.35 0
- C7 CTL5 -0.35 0
- C8 CTL5 -0.35 0
- H5A HL 0.25 0
- H5B HL 0.25 0
- H6A HL 0.25 0
- H6B HL 0.25 0
- H6C HL 0.25 0
- H7A HL 0.25 0
- H7B HL 0.25 0
- H7C HL 0.25 0
- H8A HL 0.25 0
- H8B HL 0.25 0
- H8C HL 0.25 0
- C4 CTL2 -0.08 1
- H4A HAL2 0.09 1
- H4B HAL2 0.09 1
- P PL 1.50 1
- OP3 O2L -0.78 1
- OP4 O2L -0.78 1
- OP1 OSL -0.57 1
- OP2 OSL -0.57 1
- C3 CTL2 -0.08 1
- H3A HAL2 0.09 1
- H3B HAL2 0.09 1
- C2 CTL1 0.14 2
- H2A HAL1 0.09 2
- O2 OHL -0.66 2
- H2 HOL 0.43 2
- C1 CTL2 0.05 3
- H1A HAL2 0.09 3
- H1B HAL2 0.09 3
- O1 OHL -0.66 3
- H1 HOL 0.43 3
+ C5 CTL2 -0.10 1
+ C6 CTL5 -0.35 2
+ C7 CTL5 -0.35 3
+ C8 CTL5 -0.35 4
+ H5A HL 0.25 5
+ H5B HL 0.25 6
+ H6A HL 0.25 7
+ H6B HL 0.25 8
+ H6C HL 0.25 9
+ H7A HL 0.25 10
+ H7B HL 0.25 11
+ H7C HL 0.25 12
+ H8A HL 0.25 13
+ H8B HL 0.25 14
+ H8C HL 0.25 15
+ C4 CTL2 -0.08 16
+ H4A HAL2 0.09 17
+ H4B HAL2 0.09 18
+ P PL 1.50 19
+ OP3 O2L -0.78 20
+ OP4 O2L -0.78 21
+ OP1 OSL -0.57 22
+ OP2 OSL -0.57 23
+ C3 CTL2 -0.08 24
+ H3A HAL2 0.09 25
+ H3B HAL2 0.09 26
+ C2 CTL1 0.14 27
+ H2A HAL1 0.09 28
+ O2 OHL -0.66 29
+ H2 HOL 0.43 30
+ C1 CTL2 0.05 31
+ H1A HAL2 0.09 32
+ H1B HAL2 0.09 33
+ O1 OHL -0.66 34
+ H1 HOL 0.43 35
[ bonds ]
N C5
N C6
;
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2 -0.05 2
-C5 CN5 0.28 2
-N7 NN4 -0.71 2
-C8 CN4 0.34 2
-H8 HN3 0.12 2
-N1 NN3A -0.74 2
-C2 CN4 0.50 2
-H2 HN3 0.13 2
-N3 NN3A -0.75 2
-C4 CN5 0.43 2
-C6 CN2 0.46 2
-N6 NN1 -0.77 2
-H61 HN1 0.38 2
-H62 HN1 0.38 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6B -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N9 NN2 -0.05 12
+C5 CN5 0.28 13
+N7 NN4 -0.71 14
+C8 CN4 0.34 15
+H8 HN3 0.12 16
+N1 NN3A -0.74 17
+C2 CN4 0.50 18
+H2 HN3 0.13 19
+N3 NN3A -0.75 20
+C4 CN5 0.43 21
+C6 CN2 0.46 22
+N6 NN1 -0.77 23
+H61 HN1 0.38 24
+H62 HN1 0.38 25
+C2' CN7B 0.14 26
+H2'2 HN7 0.09 27
+O2' ON5 -0.66 28
+H2'1 HN5 0.43 29
+C3' CN7 0.01 30
+H3' HN7 0.09 31
+O3' ON2 -0.57 32
[ bonds ]
-O3' P
P O1P
;
[ atoms ]
H5T HN5 0.43 0
-O5' ON5 -0.66 0
-C5' CN8B 0.05 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2 -0.05 2
-C5 CN5 0.28 2
-N7 NN4 -0.71 2
-C8 CN4 0.34 2
-H8 HN3 0.12 2
-N1 NN3A -0.74 2
-C2 CN4 0.50 2
-H2 HN3 0.13 2
-N3 NN3A -0.75 2
-C4 CN5 0.43 2
-C6 CN2 0.46 2
-N6 NN1 -0.77 2
-H61 HN1 0.38 2
-H62 HN1 0.38 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O5' ON5 -0.66 1
+C5' CN8B 0.05 2
+H5'1 HN8 0.09 3
+H5'2 HN8 0.09 4
+C4' CN7 0.16 5
+H4' HN7 0.09 6
+O4' ON6B -0.50 7
+C1' CN7B 0.16 8
+H1' HN7 0.09 9
+N9 NN2 -0.05 10
+C5 CN5 0.28 11
+N7 NN4 -0.71 12
+C8 CN4 0.34 13
+H8 HN3 0.12 14
+N1 NN3A -0.74 15
+C2 CN4 0.50 16
+H2 HN3 0.13 17
+N3 NN3A -0.75 18
+C4 CN5 0.43 19
+C6 CN2 0.46 20
+N6 NN1 -0.77 21
+H61 HN1 0.38 22
+H62 HN1 0.38 23
+C2' CN7B 0.14 24
+H2'2 HN7 0.09 25
+O2' ON5 -0.66 26
+H2'1 HN5 0.43 27
+C3' CN7 0.01 28
+H3' HN7 0.09 29
+O3' ON2 -0.57 30
[ bonds ]
H5T O5'
O5' C5'
;
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2 -0.05 2
-C5 CN5 0.28 2
-N7 NN4 -0.71 2
-C8 CN4 0.34 2
-H8 HN3 0.12 2
-N1 NN3A -0.74 2
-C2 CN4 0.50 2
-H2 HN3 0.13 2
-N3 NN3A -0.75 2
-C4 CN5 0.43 2
-C6 CN2 0.46 2
-N6 NN1 -0.77 2
-H61 HN1 0.38 2
-H62 HN1 0.38 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.14 4
-H3' HN7 0.09 4
-O3' ON5 -0.66 4
-H3T HN5 0.43 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6B -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N9 NN2 -0.05 12
+C5 CN5 0.28 13
+N7 NN4 -0.71 14
+C8 CN4 0.34 15
+H8 HN3 0.12 16
+N1 NN3A -0.74 17
+C2 CN4 0.50 18
+H2 HN3 0.13 19
+N3 NN3A -0.75 20
+C4 CN5 0.43 21
+C6 CN2 0.46 22
+N6 NN1 -0.77 23
+H61 HN1 0.38 24
+H62 HN1 0.38 25
+C2' CN7B 0.14 26
+H2'2 HN7 0.09 27
+O2' ON5 -0.66 28
+H2'1 HN5 0.43 29
+C3' CN7 0.14 30
+H3' HN7 0.09 31
+O3' ON5 -0.66 32
+H3T HN5 0.43 33
[ bonds ]
-O3' P
P O1P
; H2'1
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2 -0.13 2
-C6 CN3 0.05 2
-H6 HN3 0.17 2
-C5 CN3 -0.13 2
-H5 HN3 0.07 2
-C2 CN1 0.52 2
-O2 ON1C -0.49 2
-N3 NN3 -0.66 2
-C4 CN2 0.65 2
-N4 NN1 -0.75 2
-H41 HN1 0.37 2
-H42 HN1 0.33 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6B -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N1 NN2 -0.13 12
+C6 CN3 0.05 13
+H6 HN3 0.17 14
+C5 CN3 -0.13 15
+H5 HN3 0.07 16
+C2 CN1 0.52 17
+O2 ON1C -0.49 18
+N3 NN3 -0.66 19
+C4 CN2 0.65 20
+N4 NN1 -0.75 21
+H41 HN1 0.37 22
+H42 HN1 0.33 23
+C2' CN7B 0.14 24
+H2'2 HN7 0.09 25
+O2' ON5 -0.66 26
+H2'1 HN5 0.43 27
+C3' CN7 0.01 28
+H3' HN7 0.09 29
+O3' ON2 -0.57 30
[ bonds ]
-O3' P
P O1P
; H2'1
[ atoms ]
H5T HN5 0.43 0
-O5' ON5 -0.66 0
-C5' CN8B 0.05 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2 -0.13 2
-C6 CN3 0.05 2
-H6 HN3 0.17 2
-C5 CN3 -0.13 2
-H5 HN3 0.07 2
-C2 CN1 0.52 2
-O2 ON1C -0.49 2
-N3 NN3 -0.66 2
-C4 CN2 0.65 2
-N4 NN1 -0.75 2
-H41 HN1 0.37 2
-H42 HN1 0.33 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O5' ON5 -0.66 1
+C5' CN8B 0.05 2
+H5'1 HN8 0.09 3
+H5'2 HN8 0.09 4
+C4' CN7 0.16 5
+H4' HN7 0.09 6
+O4' ON6B -0.50 7
+C1' CN7B 0.16 8
+H1' HN7 0.09 9
+N1 NN2 -0.13 10
+C6 CN3 0.05 11
+H6 HN3 0.17 12
+C5 CN3 -0.13 13
+H5 HN3 0.07 14
+C2 CN1 0.52 15
+O2 ON1C -0.49 16
+N3 NN3 -0.66 17
+C4 CN2 0.65 18
+N4 NN1 -0.75 19
+H41 HN1 0.37 20
+H42 HN1 0.33 21
+C2' CN7B 0.14 22
+H2'2 HN7 0.09 23
+O2' ON5 -0.66 24
+H2'1 HN5 0.43 25
+C3' CN7 0.01 26
+H3' HN7 0.09 27
+O3' ON2 -0.57 28
[ bonds ]
H5T O5'
O5' C5'
; H3T H2'1
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2 -0.13 2
-C6 CN3 0.05 2
-H6 HN3 0.17 2
-C5 CN3 -0.13 2
-H5 HN3 0.07 2
-C2 CN1 0.52 2
-O2 ON1C -0.49 2
-N3 NN3 -0.66 2
-C4 CN2 0.65 2
-N4 NN1 -0.75 2
-H41 HN1 0.37 2
-H42 HN1 0.33 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.14 4
-H3' HN7 0.09 4
-O3' ON5 -0.66 4
-H3T HN5 0.43 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6B -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N1 NN2 -0.13 12
+C6 CN3 0.05 13
+H6 HN3 0.17 14
+C5 CN3 -0.13 15
+H5 HN3 0.07 16
+C2 CN1 0.52 17
+O2 ON1C -0.49 18
+N3 NN3 -0.66 19
+C4 CN2 0.65 20
+N4 NN1 -0.75 21
+H41 HN1 0.37 22
+H42 HN1 0.33 23
+C2' CN7B 0.14 24
+H2'2 HN7 0.09 25
+O2' ON5 -0.66 26
+H2'1 HN5 0.43 27
+C3' CN7 0.14 28
+H3' HN7 0.09 29
+O3' ON5 -0.66 30
+H3T HN5 0.43 31
[ bonds ]
-O3' P
P O1P
; H2'1
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2B -0.02 2
-C4 CN5 0.26 2
-N2 NN1 -0.68 2
-H21 HN1 0.32 2
-H22 HN1 0.35 2
-N3 NN3G -0.74 2
-C2 CN2 0.75 2
-N1 NN2G -0.34 2
-H1 HN2 0.26 2
-C6 CN1 0.54 2
-O6 ON1 -0.51 2
-C5 CN5G 0.00 2
-N7 NN4 -0.60 2
-C8 CN4 0.25 2
-H8 HN3 0.16 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6B -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N9 NN2B -0.02 12
+C4 CN5 0.26 13
+N2 NN1 -0.68 14
+H21 HN1 0.32 15
+H22 HN1 0.35 16
+N3 NN3G -0.74 17
+C2 CN2 0.75 18
+N1 NN2G -0.34 19
+H1 HN2 0.26 20
+C6 CN1 0.54 21
+O6 ON1 -0.51 22
+C5 CN5G 0.00 23
+N7 NN4 -0.60 24
+C8 CN4 0.25 25
+H8 HN3 0.16 26
+C2' CN7B 0.14 27
+H2'2 HN7 0.09 28
+O2' ON5 -0.66 29
+H2'1 HN5 0.43 30
+C3' CN7 0.01 31
+H3' HN7 0.09 32
+O3' ON2 -0.57 33
[ bonds ]
-O3' P
P O1P
; H2'1
[ atoms ]
H5T HN5 0.43 0
-O5' ON5 -0.66 0
-C5' CN8B 0.05 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2B -0.02 2
-C4 CN5 0.26 2
-N2 NN1 -0.68 2
-H21 HN1 0.32 2
-H22 HN1 0.35 2
-N3 NN3G -0.74 2
-C2 CN2 0.75 2
-N1 NN2G -0.34 2
-H1 HN2 0.26 2
-C6 CN1 0.54 2
-O6 ON1 -0.51 2
-C5 CN5G 0.00 2
-N7 NN4 -0.60 2
-C8 CN4 0.25 2
-H8 HN3 0.16 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O5' ON5 -0.66 1
+C5' CN8B 0.05 2
+H5'1 HN8 0.09 3
+H5'2 HN8 0.09 4
+C4' CN7 0.16 5
+H4' HN7 0.09 6
+O4' ON6B -0.50 7
+C1' CN7B 0.16 8
+H1' HN7 0.09 9
+N9 NN2B -0.02 10
+C4 CN5 0.26 11
+N2 NN1 -0.68 12
+H21 HN1 0.32 13
+H22 HN1 0.35 14
+N3 NN3G -0.74 15
+C2 CN2 0.75 16
+N1 NN2G -0.34 17
+H1 HN2 0.26 18
+C6 CN1 0.54 19
+O6 ON1 -0.51 20
+C5 CN5G 0.00 21
+N7 NN4 -0.60 22
+C8 CN4 0.25 23
+H8 HN3 0.16 24
+C2' CN7B 0.14 25
+H2'2 HN7 0.09 26
+O2' ON5 -0.66 27
+H2'1 HN5 0.43 28
+C3' CN7 0.01 29
+H3' HN7 0.09 30
+O3' ON2 -0.57 31
[ bonds ]
H5T O5'
O5' C5'
; H3T H2'1
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N9 NN2B -0.02 2
-C4 CN5 0.26 2
-N2 NN1 -0.68 2
-H21 HN1 0.32 2
-H22 HN1 0.35 2
-N3 NN3G -0.74 2
-C2 CN2 0.75 2
-N1 NN2G -0.34 2
-H1 HN2 0.26 2
-C6 CN1 0.54 2
-O6 ON1 -0.51 2
-C5 CN5G 0.00 2
-N7 NN4 -0.60 2
-C8 CN4 0.25 2
-H8 HN3 0.16 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.14 4
-H3' HN7 0.09 4
-O3' ON5 -0.66 4
-H3T HN5 0.43 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6B -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N9 NN2B -0.02 12
+C4 CN5 0.26 13
+N2 NN1 -0.68 14
+H21 HN1 0.32 15
+H22 HN1 0.35 16
+N3 NN3G -0.74 17
+C2 CN2 0.75 18
+N1 NN2G -0.34 19
+H1 HN2 0.26 20
+C6 CN1 0.54 21
+O6 ON1 -0.51 22
+C5 CN5G 0.00 23
+N7 NN4 -0.60 24
+C8 CN4 0.25 25
+H8 HN3 0.16 26
+C2' CN7B 0.14 27
+H2'2 HN7 0.09 28
+O2' ON5 -0.66 29
+H2'1 HN5 0.43 30
+C3' CN7 0.14 31
+H3' HN7 0.09 32
+O3' ON5 -0.66 33
+H3T HN5 0.43 34
[ bonds ]
-O3' P
P O1P
;
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2B -0.34 2
-C6 CN3 0.20 2
-H6 HN3 0.14 2
-C2 CN1T 0.55 2
-O2 ON1 -0.45 2
-N3 NN2U -0.46 2
-H3 HN2 0.36 2
-C4 CN1 0.53 2
-O4 ON1 -0.48 2
-C5 CN3 -0.15 2
-H5 HN3 0.10 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6B -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N1 NN2B -0.34 12
+C6 CN3 0.20 13
+H6 HN3 0.14 14
+C2 CN1T 0.55 15
+O2 ON1 -0.45 16
+N3 NN2U -0.46 17
+H3 HN2 0.36 18
+C4 CN1 0.53 19
+O4 ON1 -0.48 20
+C5 CN3 -0.15 21
+H5 HN3 0.10 22
+C2' CN7B 0.14 23
+H2'2 HN7 0.09 24
+O2' ON5 -0.66 25
+H2'1 HN5 0.43 26
+C3' CN7 0.01 27
+H3' HN7 0.09 28
+O3' ON2 -0.57 29
[ bonds ]
-O3' P
P O1P
;
[ atoms ]
H5T HN5 0.43 0
-O5' ON5 -0.66 0
-C5' CN8B 0.05 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2B -0.34 2
-C6 CN3 0.20 2
-H6 HN3 0.14 2
-C2 CN1T 0.55 2
-O2 ON1 -0.45 2
-N3 NN2U -0.46 2
-H3 HN2 0.36 2
-C4 CN1 0.53 2
-O4 ON1 -0.48 2
-C5 CN3 -0.15 2
-H5 HN3 0.10 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.01 4
-H3' HN7 0.09 4
-O3' ON2 -0.57 4
+O5' ON5 -0.66 1
+C5' CN8B 0.05 2
+H5'1 HN8 0.09 3
+H5'2 HN8 0.09 4
+C4' CN7 0.16 5
+H4' HN7 0.09 6
+O4' ON6B -0.50 7
+C1' CN7B 0.16 8
+H1' HN7 0.09 9
+N1 NN2B -0.34 10
+C6 CN3 0.20 11
+H6 HN3 0.14 12
+C2 CN1T 0.55 13
+O2 ON1 -0.45 14
+N3 NN2U -0.46 15
+H3 HN2 0.36 16
+C4 CN1 0.53 17
+O4 ON1 -0.48 18
+C5 CN3 -0.15 19
+H5 HN3 0.10 20
+C2' CN7B 0.14 21
+H2'2 HN7 0.09 22
+O2' ON5 -0.66 23
+H2'1 HN5 0.43 24
+C3' CN7 0.01 25
+H3' HN7 0.09 26
+O3' ON2 -0.57 27
[ bonds ]
H5T O5'
O5' C5'
;
[ atoms ]
P P 1.50 0
-O1P ON3 -0.78 0
-O2P ON3 -0.78 0
-O5' ON2 -0.57 0
-C5' CN8B -0.08 0
-H5'1 HN8 0.09 0
-H5'2 HN8 0.09 0
-C4' CN7 0.16 1
-H4' HN7 0.09 1
-O4' ON6B -0.50 1
-C1' CN7B 0.16 1
-H1' HN7 0.09 1
-N1 NN2B -0.34 2
-C6 CN3 0.20 2
-H6 HN3 0.14 2
-C2 CN1T 0.55 2
-O2 ON1 -0.45 2
-N3 NN2U -0.46 2
-H3 HN2 0.36 2
-C4 CN1 0.53 2
-O4 ON1 -0.48 2
-C5 CN3 -0.15 2
-H5 HN3 0.10 2
-C2' CN7B 0.14 3
-H2'2 HN7 0.09 3
-O2' ON5 -0.66 3
-H2'1 HN5 0.43 3
-C3' CN7 0.14 4
-H3' HN7 0.09 4
-O3' ON5 -0.66 4
-H3T HN5 0.43 4
+O1P ON3 -0.78 1
+O2P ON3 -0.78 2
+O5' ON2 -0.57 3
+C5' CN8B -0.08 4
+H5'1 HN8 0.09 5
+H5'2 HN8 0.09 6
+C4' CN7 0.16 7
+H4' HN7 0.09 8
+O4' ON6B -0.50 9
+C1' CN7B 0.16 10
+H1' HN7 0.09 11
+N1 NN2B -0.34 12
+C6 CN3 0.20 13
+H6 HN3 0.14 14
+C2 CN1T 0.55 15
+O2 ON1 -0.45 16
+N3 NN2U -0.46 17
+H3 HN2 0.36 18
+C4 CN1 0.53 19
+O4 ON1 -0.48 20
+C5 CN3 -0.15 21
+H5 HN3 0.10 22
+C2' CN7B 0.14 23
+H2'2 HN7 0.09 24
+O2' ON5 -0.66 25
+H2'1 HN5 0.43 26
+C3' CN7 0.14 27
+H3' HN7 0.09 28
+O3' ON5 -0.66 29
+H3T HN5 0.43 30
[ bonds ]
-O3' P
P O1P
-364
+365
��ߦ��ߨ���߬�����������ߦ��߷���ߋ��߶�ߦ�����������������߶��
�߳���ߋ��߳���߫���ߨ���߫������������
�����߽����߲�߷������ײ��������
�ߓ���ߋ�߈����ߋ���߶ߙ���ߓ���߶ߛ�ߌ�������������������
���߶ߗ���ߚ���������ߓ�����ߋ���ߚ���������ߚ�������߯������
�����ߐ�ߜ�����������ߞ��ߋ��ߌ������߲�ߌ������ߖ�߈�������ߑ�����ߜ��������ײ�������
+��،ߊ����ߜ���ߋ���ߐ���߆��ߞ��߶ߔ����״���߽����
[ atoms ]
; id at type res nr residu name at name cg nr charge mass
-1 CU2+ 1 CU2+ CU 1 2 63.54600
+1 Cu2+ 1 CU2+ CU 1 2 63.54600
[ moleculetype ]
; molname nrexcl
[ atoms ]
; id at type res nr residu name at name cg nr charge mass
-1 ZN2+ 1 ZN2+ ZN 1 2 65.37000
+1 Zn2+ 1 ZN2+ ZN 1 2 65.37000
[ moleculetype ]
; molname nrexcl
if ( $?DISPLAY ) then
xterm -title pdb2gmx -sb -e tail +0f output.pdb2gmx &
endif
-echo 0 | pdb2gmx -f ${MOL}.pdb -o ${MOL}.gro -p ${MOL}.top >& ! output.pdb2gmx
+pdb2gmx -f ${MOL}.pdb -o ${MOL}.gro -p ${MOL}.top >& ! output.pdb2gmx << KOKO
+1
+1
+KOKO
+
echo "pdb2gmx finished"
echo -n "Press <enter>"
set ans = $<
EXTRA_PROGRAMS = copyrgt \
options hrefify \
addquote compnl \
- gen_table ehole g_sdf
+ gen_table ehole g_sdf\
+ do_multiprot
compnl_SOURCES = compnl.c
compnl_LDADD = ../mdlib/libmd@LIBSUFFIX@.la ../gmxlib/libgmx@LIBSUFFIX@.la
--- /dev/null
+/* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
+ *
+ * This source code is NOT REALLY part of
+ *
+ * G R O M A C S
+ *
+ * GROningen MAchine for Chemical Simulations
+ *
+ * VERSION 4.2.5
+ * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
+ * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
+ * Copyright (c) 2001-2004, 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
+ *
+ * Author: do_multiprot was written by Ran Friedman <r.friedman@bioc.uzh.ch>
+ *
+ * And Hey:
+ * Green Red Orange Magenta Azure Cyan Skyblue
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "sysstuff.h"
+#include "typedefs.h"
+#include "string2.h"
+#include "strdb.h"
+#include "macros.h"
+#include "smalloc.h"
+#include "mshift.h"
+#include "statutil.h"
+#include "copyrite.h"
+#include "pdbio.h"
+#include "gmx_fatal.h"
+#include "xvgr.h"
+#include "matio.h"
+#include "index.h"
+#include "gstat.h"
+#include "tpxio.h"
+#include "viewit.h"
+#include "gbutil.h"
+#include "vec.h"
+#include "confio.h"
+#include "gmxfio.h"
+
+typedef struct {
+ int resnr;
+ int count;
+} t_countres;
+
+static void process_multiprot_output(const char *fn, real *rmsd, int *nres, rvec rotangles,
+ rvec translation, bool bCountres, t_countres *countres)
+{
+ FILE *mpoutput;
+ char line[256];
+ char *string;
+ int i=0,j=0,res;
+
+ (*rmsd)=-1;
+ (*nres)=0;
+ mpoutput=ffopen (fn,"r");
+
+ if (bCountres) {
+ do {
+ fgets(line, 256, mpoutput);
+ } while (strstr(line,"Match List") == NULL);
+ fgets(line, 256, mpoutput);
+ do {
+ string = strtok (line,".");
+ while (i<2 && string != NULL) {
+ string = strtok (NULL,". ");
+ i++;
+ }
+ i=0;
+ res=atoi(string);
+ if (res > 0) {
+ while (countres[j].resnr!=res)
+ j++;
+ countres[j].count++;
+ }
+ fgets(line, 256, mpoutput);
+ } while (strstr(line,"End of Match List") == NULL);
+ rewind(mpoutput);
+ }
+ do {
+ fgets(line, 256, mpoutput);
+ } while (strstr(line,"Trans : ") == NULL);
+
+ string = strtok (line," :");
+ string = strtok (NULL," ");
+ while (i<3 && string != NULL) {
+ string = strtok (NULL," ");
+ rotangles[i]=atof(string);
+ i++;
+ }
+ i=0;
+ while (i<3 && string != NULL) {
+ string = strtok (NULL," ");
+ translation[i]=atof(string)/10;
+ i++;
+ }
+ if (i!=3) {
+ gmx_warning("Not enough values for rotation and translation vectors in the output of multiprot");
+ }
+
+ rotangles[YY]=rotangles[YY]*(-1);
+
+ while ((*rmsd) <0) {
+ fgets(line, 256, mpoutput);
+ if (strstr(line,"RMSD : ") != NULL) {
+ string = strtok (line,":");
+ string = strtok (NULL,":");
+ (*rmsd)=atof(string)/10;
+ }
+ }
+ while (!(*nres)) {
+ fgets(line,256, mpoutput);
+ if (strstr(line,"Match List") != NULL) {
+ string = strtok (line,":");
+ string = strtok (NULL,":");
+ (*nres) = atoi(string);
+ }
+ }
+ ffclose(mpoutput);
+}
+
+int main(int argc,char *argv[])
+{
+ const char *desc[] = {
+ "do_multiprot ",
+ "reads a trajectory file and aligns it to a reference structure ",
+ "each time frame",
+ "calling the multiprot program. This allows you to use a reference",
+ "structure whose sequence is different than that of the protein in the ",
+ "trajectory, since the alignment is based on the geometry, not sequence.",
+ "The output of do_multiprot includes the rmsd and the number of residues",
+ "on which it was calculated.",
+ "[PAR]",
+ "An aligned trajectory file is generated with the [TT] -ox [tt] option.[PAR]",
+ "With the [TT] -cr [tt] option, the number of hits in the alignment is given",
+ "per residue. This number can be between 0 and the number of frames, and",
+ "indicates the structural conservation of this residue.[PAR]",
+ "If you do not have the multiprot program, get it. do_multiprot assumes",
+ "that the multiprot executable is /usr/local/bin/multiprot. If this is ",
+ "not the case, then you should set an environment variable [BB]MULTIPROT[bb]",
+ "pointing to the multiprot executable, e.g.: [PAR]",
+ "[TT]setenv MULTIPROT /usr/MultiProtInstall/multiprot.Linux[tt][PAR]",
+ "Note that at the current implementation only binary alignment (your",
+ "molecule to a reference) is supported. In addition, note that the ",
+ "by default multiprot aligns the two proteins on their C-alpha carbons.",
+ "and that this depends on the multiprot parameters which are not dealt ",
+ "with here. Thus, the C-alpha carbons is expected to give the same "
+ "results as choosing the whole protein and will be slightly faster.[PAR]",
+ "For information about multiprot, see:",
+ "http://bioinfo3d.cs.tau.ac.il/MultiProt/.[PAR]"
+ };
+ static bool bVerbose;
+ t_pargs pa[] = {
+ { "-v", FALSE, etBOOL, {&bVerbose},
+ "HIDDENGenerate miles of useless information" }
+ };
+
+ const char *bugs[] = {
+ "The program is very slow, since multiprot is run externally"
+ };
+
+ t_trxstatus *status;
+ t_trxstatus *trxout=NULL;
+ FILE *tapein,*fo,*frc,*tmpf,*out=NULL,*fres=NULL;
+ const char *fnRef;
+ const char *fn="2_sol.res";
+ t_topology top;
+ int ePBC;
+ t_atoms *atoms,ratoms,useatoms;
+ t_trxframe fr;
+ t_pdbinfo p;
+ int nres,nres2,nr0;
+ real t;
+ int i,j,natoms,nratoms,nframe=0,model_nr=-1;
+ int cur_res,prev_res;
+ int nout;
+ t_countres *countres=NULL;
+ matrix box,rbox;
+ int gnx;
+ char *grpnm,*ss_str;
+ atom_id *index;
+ rvec *xp,*x,*xr;
+ char pdbfile[32],refpdb[256],title[256],rtitle[256],filemode[5];
+ char out_title[256];
+ char multiprot[256],*mptr;
+ int ftp;
+ int outftp=-1;
+ real rmsd;
+ bool bTrjout,bCountres;
+ const char *TrjoutFile=NULL;
+ output_env_t oenv;
+ static rvec translation={0,0,0},rotangles={0,0,0};
+ gmx_rmpbc_t gpbc=NULL;
+
+ t_filenm fnm[] = {
+ { efTRX, "-f", NULL, ffREAD },
+ { efTPS, NULL, NULL, ffREAD },
+ { efNDX, NULL, NULL, ffOPTRD },
+ { efSTX, "-r", NULL , ffREAD },
+ { efXVG, "-o", "rmss", ffWRITE },
+ { efXVG, "-rc", "rescount", ffWRITE},
+ { efXVG, "-cr", "countres", ffOPTWR},
+ { efTRX, "-ox", "aligned", ffOPTWR }
+ };
+#define NFILE asize(fnm)
+
+ CopyRight(stderr,argv[0]);
+ parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_CAN_VIEW | PCA_TIME_UNIT | PCA_BE_NICE ,
+ NFILE,fnm, asize(pa),pa, asize(desc),desc,
+ asize(bugs),bugs,&oenv
+ );
+ fnRef=opt2fn("-r",NFILE,fnm);
+ bTrjout = opt2bSet("-ox",NFILE,fnm);
+ bCountres= opt2bSet("-cr",NFILE,fnm);
+
+ if (bTrjout) {
+ TrjoutFile = opt2fn_null("-ox",NFILE,fnm);
+ }
+
+ read_tps_conf(ftp2fn(efTPS,NFILE,fnm),title,&top,&ePBC,&xp,NULL,box,FALSE);
+ gpbc = gmx_rmpbc_init(&top.idef,ePBC,top.atoms.nr,box);
+ atoms=&(top.atoms);
+
+ ftp=fn2ftp(fnRef);
+
+ get_stx_coordnum(fnRef,&nratoms);
+ init_t_atoms(&ratoms,nratoms,TRUE);
+ snew(xr,nratoms);
+ read_stx_conf(fnRef,rtitle,&ratoms,xr,NULL,&ePBC,rbox);
+
+ if (bVerbose) {
+ fprintf(stderr,"Read %d atoms\n",atoms->nr);
+ fprintf(stderr,"Read %d reference atoms\n",ratoms.nr);
+ }
+ if (bCountres) {
+ snew(countres,ratoms.nres);
+ j=0;
+ cur_res=0;
+ for (i=0;i<ratoms.nr;i++) {
+ prev_res=cur_res;
+ cur_res=ratoms.atom[i].resind;
+ if (cur_res != prev_res) {
+ countres[j].resnr=cur_res;
+ countres[j].count=0;
+ j++;
+ }
+ }
+ }
+ get_index(atoms,ftp2fn_null(efNDX,NFILE,fnm),1,&gnx,&index,&grpnm);
+ nres=0;
+ nr0=-1;
+ for(i=0; (i<gnx); i++) {
+ if (atoms->atom[index[i]].resind != nr0) {
+ nr0=atoms->atom[index[i]].resind;
+ nres++;
+ }
+ }
+ fprintf(stderr,"There are %d residues in your selected group\n",nres);
+
+ strcpy(pdbfile,"ddXXXXXX");
+ gmx_tmpnam(pdbfile);
+ if ((tmpf = fopen(pdbfile,"w")) == NULL) {
+ sprintf(pdbfile,"%ctmp%cfilterXXXXXX",DIR_SEPARATOR,DIR_SEPARATOR);
+ gmx_tmpnam(pdbfile);
+ if ((tmpf = fopen(pdbfile,"w")) == NULL) {
+ gmx_fatal(FARGS,"Can not open tmp file %s",pdbfile);
+ }
+ }
+ else {
+ ffclose(tmpf);
+ }
+
+ if (ftp != efPDB) {
+ strcpy(refpdb,"ddXXXXXX");
+ gmx_tmpnam(refpdb);
+ strcat(refpdb,".pdb");
+ write_sto_conf(refpdb,rtitle,&ratoms,xr,NULL,ePBC,rbox);
+ }
+ else {
+ strcpy(refpdb,fnRef);
+ }
+
+ if ((mptr=getenv("MULTIPROT")) == NULL) {
+ mptr="/usr/local/bin/multiprot";
+ }
+ if (!gmx_fexist(mptr)) {
+ gmx_fatal(FARGS,"MULTIPROT executable (%s) does not exist (use setenv MULTIPROT)",
+ mptr);
+ }
+ sprintf (multiprot,"%s %s %s > /dev/null %s",
+ mptr, refpdb, pdbfile, "2> /dev/null");
+
+ if (bVerbose)
+ fprintf(stderr,"multiprot cmd='%s'\n",multiprot);
+
+ if (!read_first_frame(oenv,&status,ftp2fn(efTRX,NFILE,fnm),&fr,TRX_READ_X))
+ gmx_fatal(FARGS,"Could not read a frame from %s",ftp2fn(efTRX,NFILE,fnm));
+ natoms = fr.natoms;
+
+ if (bTrjout) {
+ nout=natoms;
+ /* open file now */
+ outftp=fn2ftp(TrjoutFile);
+ if (bVerbose)
+ fprintf(stderr,"Will write %s: %s\n",ftp2ext(ftp),ftp2desc(outftp));
+ strcpy(filemode,"w");
+ switch (outftp) {
+ case efXTC:
+ case efG87:
+ case efTRR:
+ case efTRJ:
+ out=NULL;
+ trxout = open_trx(TrjoutFile,filemode);
+ break;
+ case efGRO:
+ case efG96:
+ case efPDB:
+ /* Make atoms struct for output in GRO or PDB files */
+ /* get memory for stuff to go in pdb file */
+ init_t_atoms(&useatoms,nout,FALSE);
+ sfree(useatoms.resinfo);
+ useatoms.resinfo=atoms->resinfo;
+ for(i=0;(i<nout);i++) {
+ useatoms.atomname[i]=atoms->atomname[i];
+ useatoms.atom[i]=atoms->atom[i];
+ useatoms.nres=max(useatoms.nres,useatoms.atom[i].resind+1);
+ }
+ useatoms.nr=nout;
+ out=ffopen(TrjoutFile,filemode);
+ break;
+ }
+ if (outftp == efG87)
+ fprintf(gmx_fio_getfp(trx_get_fileio(trxout)),"Generated by %s. #atoms=%d, a BOX is"
+ " stored in this file.\n",Program(),nout);
+ }
+
+ if (natoms > atoms->nr) {
+ gmx_fatal(FARGS,"\nTrajectory does not match topology!");
+ }
+ if (gnx > natoms) {
+ gmx_fatal(FARGS,"\nTrajectory does not match selected group!");
+ }
+
+ fo = xvgropen(opt2fn("-o",NFILE,fnm),"RMSD","Time (ps)","RMSD (nm)",oenv);
+ frc = xvgropen(opt2fn("-rc",NFILE,fnm),"Number of Residues in the alignment","Time (ps)","Residues",oenv);
+
+ do {
+ t = output_env_conv_time(oenv,fr.time);
+ gmx_rmpbc(gpbc,natoms,fr.box,fr.x);
+ tapein=ffopen(pdbfile,"w");
+ write_pdbfile_indexed(tapein,NULL,atoms,fr.x,ePBC,fr.box,' ',-1,gnx,index,NULL,TRUE);
+ ffclose(tapein);
+ system(multiprot);
+ remove(pdbfile);
+ process_multiprot_output(fn, &rmsd, &nres2,rotangles,translation,bCountres,countres);
+ fprintf(fo,"%12.7f",t);
+ fprintf(fo," %12.7f\n",rmsd);
+ fprintf(frc,"%12.7f",t);
+ fprintf(frc,"%12d\n",nres2);
+ if (bTrjout) {
+ rotate_conf(natoms,fr.x,NULL,rotangles[XX],rotangles[YY],rotangles[ZZ]);
+ for(i=0; i<natoms; i++) {
+ rvec_inc(fr.x[i],translation);
+ }
+ switch(outftp) {
+ case efTRJ:
+ case efTRR:
+ case efG87:
+ case efXTC:
+ write_trxframe(trxout,&fr,NULL);
+ break;
+ case efGRO:
+ case efG96:
+ case efPDB:
+ sprintf(out_title,"Generated by do_multiprot : %s t= %g %s",
+ title,output_env_conv_time(oenv,fr.time),output_env_get_time_unit(oenv));
+ switch(outftp) {
+ case efGRO:
+ write_hconf_p(out,out_title,&useatoms,prec2ndec(fr.prec),
+ fr.x,NULL,fr.box);
+ break;
+ case efPDB:
+ fprintf(out,"REMARK GENERATED BY DO_MULTIPROT\n");
+ sprintf(out_title,"%s t= %g %s",title,output_env_conv_time(oenv,fr.time),output_env_get_time_unit(oenv));
+ /* if reading from pdb, we want to keep the original
+ model numbering else we write the output frame
+ number plus one, because model 0 is not allowed in pdb */
+ if (ftp==efPDB && fr.step > model_nr) {
+ model_nr = fr.step;
+ }
+ else {
+ model_nr++;
+ }
+ write_pdbfile(out,out_title,&useatoms,fr.x,ePBC,fr.box,' ',model_nr,NULL,TRUE);
+ break;
+ case efG96:
+ fr.title = out_title;
+ fr.bTitle = (nframe == 0);
+ fr.bAtoms = FALSE;
+ fr.bStep = TRUE;
+ fr.bTime = TRUE;
+ write_g96_conf(out,&fr,-1,NULL);
+ }
+ break;
+ }
+ }
+ nframe++;
+ } while(read_next_frame(oenv,status,&fr));
+ if (bCountres) {
+ fres= xvgropen(opt2fn("-cr",NFILE,fnm),"Number of frames in which the residues are aligned to","Residue","Number",oenv);
+ for (i=0;i<ratoms.nres;i++) {
+ fprintf(fres,"%10d %12d\n",countres[i].resnr,countres[i].count);
+ }
+ ffclose(fres);
+ }
+ ffclose(fo);
+ ffclose(frc);
+ fprintf(stderr,"\n");
+ close_trj(status);
+ if (trxout != NULL) {
+ close_trx(trxout);
+ }
+ else if (out != NULL) {
+ ffclose(out);
+ }
+ view_all(oenv,NFILE, fnm);
+ sfree(xr);
+ if (bCountres) {
+ sfree(countres);
+ }
+ free_t_atoms(&ratoms,TRUE);
+ if (bTrjout) {
+ if (outftp==efPDB || outftp==efGRO || outftp==efG96) {
+ free_t_atoms(&useatoms,TRUE);
+ }
+ }
+ thanx(stderr);
+ return 0;
+}
real posres(int nbonds,
- const t_iatom forceatoms[],const t_iparams forceparams[],
- const rvec x[],rvec f[],rvec vir_diag,
- t_pbc *pbc,
- real lambda,real *dvdlambda,
- int refcoord_scaling,int ePBC,rvec comA,rvec comB)
+ const t_iatom forceatoms[],const t_iparams forceparams[],
+ const rvec x[],rvec f[],rvec vir_diag,
+ t_pbc *pbc,
+ real lambda,real *dvdlambda,
+ int refcoord_scaling,int ePBC,rvec comA,rvec comB)
{
- int i,ai,m,d,type,ki,npbcdim=0;
- const t_iparams *pr;
- real v,vtot,fm,*fc;
- real posA,posB,ref=0;
- rvec comA_sc,comB_sc,rdist,dpdl,pos,dx;
-
- npbcdim = ePBC2npbcdim(ePBC);
-
- if (refcoord_scaling == erscCOM) {
- clear_rvec(comA_sc);
- clear_rvec(comB_sc);
- for(m=0; m<npbcdim; m++) {
- for(d=m; d<npbcdim; d++) {
- comA_sc[m] += comA[d]*pbc->box[d][m];
- comB_sc[m] += comB[d]*pbc->box[d][m];
- }
- }
- }
+ int i,ai,m,d,type,ki,npbcdim=0;
+ const t_iparams *pr;
+ real L1;
+ real vtot,kk,fm;
+ real posA,posB,ref=0;
+ rvec comA_sc,comB_sc,rdist,dpdl,pos,dx;
- vtot = 0.0;
- for(i=0; (i<nbonds); ) {
- type = forceatoms[i++];
- ai = forceatoms[i++];
- pr = &forceparams[type];
-
- for(m=0; m<DIM; m++) {
- posA = forceparams[type].posres.pos0A[m];
- posB = forceparams[type].posres.pos0B[m];
- if (m < npbcdim) {
- switch (refcoord_scaling) {
- case erscNO:
- ref = 0;
- rdist[m] = (1 - lambda)*posA + lambda*posB;
- dpdl[m] = posB - posA;
- break;
- case erscALL:
- /* Box relative coordinates are stored for dimensions with pbc */
- posA *= pbc->box[m][m];
- posB *= pbc->box[m][m];
- for(d=m+1; d<npbcdim; d++) {
- posA += forceparams[type].posres.pos0A[d]*pbc->box[d][m];
- posB += forceparams[type].posres.pos0B[d]*pbc->box[d][m];
- }
- ref = (1 - lambda)*posA + lambda*posB;
- rdist[m] = 0;
- dpdl[m] = posB - posA;
- break;
- case erscCOM:
- ref = (1 - lambda)*comA_sc[m] + lambda*comB_sc[m];
- rdist[m] = (1 - lambda)*posA + lambda*posB;
- dpdl[m] = comB_sc[m] - comA_sc[m] + posB - posA;
- break;
- }
- } else {
- ref = (1 - lambda)*posA + lambda*posB;
- rdist[m] = 0;
- dpdl[m] = posB - posA;
- }
+ npbcdim = ePBC2npbcdim(ePBC);
- /* We do pbc_dx with ref+rdist,
- * since with only ref we can be up to half a box vector wrong.
- */
- pos[m] = ref + rdist[m];
+ if (refcoord_scaling == erscCOM)
+ {
+ clear_rvec(comA_sc);
+ clear_rvec(comB_sc);
+ for(m=0; m<npbcdim; m++)
+ {
+ for(d=m; d<npbcdim; d++)
+ {
+ comA_sc[m] += comA[d]*pbc->box[d][m];
+ comB_sc[m] += comB[d]*pbc->box[d][m];
+ }
+ }
}
- if (pbc) {
- pbc_dx(pbc,x[ai],pos,dx);
- } else {
- rvec_sub(x[ai],pos,dx);
- }
+ L1 = 1.0 - lambda;
- v=0;
- for (m=0; (m<DIM); m++) {
- *dvdlambda += harmonic(pr->posres.fcA[m],pr->posres.fcB[m],
- 0,dpdl[m],dx[m],lambda,&v,&fm);
- vtot += v;
- f[ai][m] += fm;
+ vtot = 0.0;
+ for(i=0; (i<nbonds); )
+ {
+ type = forceatoms[i++];
+ ai = forceatoms[i++];
+ pr = &forceparams[type];
+
+ for(m=0; m<DIM; m++)
+ {
+ posA = forceparams[type].posres.pos0A[m];
+ posB = forceparams[type].posres.pos0B[m];
+ if (m < npbcdim)
+ {
+ switch (refcoord_scaling)
+ {
+ case erscNO:
+ ref = 0;
+ rdist[m] = L1*posA + lambda*posB;
+ dpdl[m] = posB - posA;
+ break;
+ case erscALL:
+ /* Box relative coordinates are stored for dimensions with pbc */
+ posA *= pbc->box[m][m];
+ posB *= pbc->box[m][m];
+ for(d=m+1; d<npbcdim; d++)
+ {
+ posA += forceparams[type].posres.pos0A[d]*pbc->box[d][m];
+ posB += forceparams[type].posres.pos0B[d]*pbc->box[d][m];
+ }
+ ref = L1*posA + lambda*posB;
+ rdist[m] = 0;
+ dpdl[m] = posB - posA;
+ break;
+ case erscCOM:
+ ref = L1*comA_sc[m] + lambda*comB_sc[m];
+ rdist[m] = L1*posA + lambda*posB;
+ dpdl[m] = comB_sc[m] - comA_sc[m] + posB - posA;
+ break;
+ }
+ }
+ else
+ {
+ ref = L1*posA + lambda*posB;
+ rdist[m] = 0;
+ dpdl[m] = posB - posA;
+ }
+
+ /* We do pbc_dx with ref+rdist,
+ * since with only ref we can be up to half a box vector wrong.
+ */
+ pos[m] = ref + rdist[m];
+ }
- /* Here we correct for the pbc_dx which included rdist */
- vir_diag[m] -= 0.5*(dx[m] + rdist[m])*fm;
+ if (pbc)
+ {
+ pbc_dx(pbc,x[ai],pos,dx);
+ }
+ else
+ {
+ rvec_sub(x[ai],pos,dx);
+ }
+
+ for (m=0; (m<DIM); m++)
+ {
+ kk = L1*pr->posres.fcA[m] + lambda*pr->posres.fcB[m];
+ fm = -kk*dx[m];
+ f[ai][m] += fm;
+ 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];
+
+ /* Here we correct for the pbc_dx which included rdist */
+ vir_diag[m] -= 0.5*(dx[m] + rdist[m])*fm;
+ }
}
- }
- return vtot;
+ return vtot;
}
static real low_angres(int nbonds,
real *rcoul1,real *rcoul2)
{
real r2v1,r2v2,r2c1,r2c2,r2;
- int mb,m,cg,a_mol,a0,a1,a;
- t_iparams *ip;
+ int ntype,i,j,mb,m,cg,a_mol,a0,a1,a;
+ gmx_bool *bLJ;
gmx_molblock_t *molb;
gmx_moltype_t *molt;
t_block *cgs;
r2c1 = 0;
r2c2 = 0;
- ip = mtop->ffparams.iparams;
+ ntype = mtop->ffparams.atnr;
+ snew(bLJ,ntype);
+ for(i=0; i<ntype; i++)
+ {
+ bLJ[i] = FALSE;
+ for(j=0; j<ntype; j++)
+ {
+ if (mtop->ffparams.iparams[i*ntype+j].lj.c6 != 0 ||
+ mtop->ffparams.iparams[i*ntype+j].lj.c12 != 0)
+ {
+ bLJ[i] = TRUE;
+ }
+ }
+ }
a_mol = 0;
for(mb=0; mb<mtop->nmolblock; mb++)
for(a=a0; a<a1; a++)
{
r2 = distance2(cen,x[a_mol+a]);
- if (r2 > r2v2 &&
- (ip[atom[a].type ].lj.c6 != 0 ||
- ip[atom[a].type ].lj.c12 != 0 ||
- ip[atom[a].typeB].lj.c6 != 0 ||
- ip[atom[a].typeB].lj.c12 != 0))
+ if (r2 > r2v2 && (bLJ[atom[a].type ] ||
+ bLJ[atom[a].typeB]))
{
if (r2 > r2v1)
{
}
}
+ sfree(bLJ);
+
*rvdw1 = sqrt(r2v1);
*rvdw2 = sqrt(r2v2);
*rcoul1 = sqrt(r2c1);
eenhENERGY_SUM_SIM, eenhENERGY_NSUM_SIM,
eenhENERGY_NSTEPS, eenhENERGY_NSTEPS_SIM,
eenhENERGY_DELTA_H_NN,
- eenhENERGY_DELTA_H_LIST, eenhENERGY_DELTA_H_STARTTIME,
+ eenhENERGY_DELTA_H_LIST,
+ eenhENERGY_DELTA_H_STARTTIME,
eenhENERGY_DELTA_H_STARTLAMBDA,
eenhNR };
"energy_sum_sim", "energy_nsum_sim",
"energy_nsteps", "energy_nsteps_sim",
"energy_delta_h_nn",
- "energy_delta_h_list", "energy_delta_h_start_time",
+ "energy_delta_h_list",
+ "energy_delta_h_start_time",
"energy_delta_h_start_lambda"
};
snew(enerhist->dht,1);
enerhist->dht->ndh = NULL;
enerhist->dht->dh = NULL;
+ enerhist->dht->start_lambda_set=FALSE;
}
}
ret=do_cpte_double(xd, 2, i, fflags, &(enerhist->dht->start_time), list); break;
case eenhENERGY_DELTA_H_STARTLAMBDA:
ret=do_cpte_double(xd, 2, i, fflags, &(enerhist->dht->start_lambda), list); break;
+ enerhist->dht->start_lambda_set=TRUE;
default:
gmx_fatal(FARGS,"Unknown energy history entry %d\n"
"You are probably reading a new checkpoint file with old code",i);
{
flags_enh |= ( (1<< eenhENERGY_DELTA_H_NN) |
(1<< eenhENERGY_DELTA_H_LIST) |
- (1<< eenhENERGY_DELTA_H_STARTTIME) );
+ (1<< eenhENERGY_DELTA_H_STARTTIME) |
+ (1<< eenhENERGY_DELTA_H_STARTLAMBDA) );
}
}
"You can try with the -noappend option, and get more info in the log file.\n");
}
- fprintf(stderr,
- "WARNING: The checkpoint state entries do not match the simulation,\n"
- " see the log file for details\n\n");
+ if (getenv("GMX_ALLOW_CPT_MISMATCH") == NULL)
+ {
+ gmx_fatal(FARGS,"You seem to have switched ensemble, integrator, T and/or P-coupling algorithm between the cpt and tpr file. The recommended way of doing this is passing the cpt file to grompp (with option -t) instead of to mdrun. If you know what you are doing, you can override this error by setting the env.var. GMX_ALLOW_CPT_MISMATCH");
+ }
+ else
+ {
+ fprintf(stderr,
+ "WARNING: The checkpoint state entries do not match the simulation,\n"
+ " see the log file for details\n\n");
+ }
}
if(fplog)
if (outputfiles[i].chksum_size != -1)
{
if (gmx_fio_get_file_md5(chksum_file,outputfiles[i].offset,
- digest) != outputfiles[i].chksum_size)
+ digest) != outputfiles[i].chksum_size) /*at the end of the call the file position is at the end of the file*/
{
gmx_fatal(FARGS,"Can't read %d bytes of '%s' to compute checksum. The file has been replaced or its contents has been modified.",
outputfiles[i].chksum_size,
outputfiles[i].filename);
}
}
- else if (i==0) /*log file need to be seeked even when not reading md5*/
+ if (i==0) /*log file needs to be seeked in case we need to truncate (other files are truncated below)*/
{
- gmx_fio_seek(chksum_file,outputfiles[i].offset);
+ if (gmx_fio_seek(chksum_file,outputfiles[i].offset))
+ {
+ gmx_fatal(FARGS,"Seek error! Failed to truncate log-file: %s.", strerror(errno));
+ }
}
#endif
{
gmx_fatal(FARGS,
"Library file %s not found %sin your GMXLIB path.",
- bAddCWD ? "in current dir nor " : "",file);
+ file, bAddCWD ? "in current dir nor " : "");
}
else
{
gmx_fatal(FARGS,
"Library file %s not found %sin default directories.\n"
"(You can set the directories to search with the GMXLIB path variable)",
- bAddCWD ? "in current dir nor " : "",file);
+ file, bAddCWD ? "in current dir nor " : "");
}
}
}
# Git before 1.5.3 does not support any sensible date format,
# so we need to massage the output.
if git --git-dir=$GITDIR rev-list -n1 --pretty=format:%ci HEAD | grep '[0-9]\{4\}' >/dev/null 2>&1; then
- date=`git --git-dir=$GITDIR rev-list -n1 --pretty=format:%ci HEAD | sed -ne '/commit/!{s/-\| .*$//g;p;}'`
+ date=`git --git-dir=$GITDIR rev-list -n1 --pretty=format:%ci HEAD | sed -ne '/commit/!{s/ .*$//;s/-//g;p;}'`
else
date=`git --git-dir=$GITDIR rev-list -n1 --pretty=format:%cD HEAD | \
sed -ne '/commit/!{s/^.*, *\([ 0-9][0-9]\) \([a-zA-Z]*\) \([0-9]*\) .*$/\3\2\1/;y/ /0/;\
void gmx_fio_lock(t_fileio *fio)
{
#ifdef GMX_THREADS
- tMPI_Spinlock_lock(&(fio->mtx));
+ tMPI_Lock_lock(&(fio->mtx));
#endif
}
/* unlock the mutex associated with this fio. */
void gmx_fio_unlock(t_fileio *fio)
{
#ifdef GMX_THREADS
- tMPI_Spinlock_unlock(&(fio->mtx));
+ tMPI_Lock_unlock(&(fio->mtx));
#endif
}
open_files->next=open_files;
open_files->prev=open_files;
#ifdef GMX_THREADS
- tMPI_Spinlock_init(&(open_files->mtx));
+ tMPI_Lock_init(&(open_files->mtx));
#endif
}
}
snew(fio, 1);
#ifdef GMX_THREADS
- tMPI_Spinlock_init(&(fio->mtx));
+ tMPI_Lock_init(&(fio->mtx));
#endif
bRead = (newmode[0]=='r' && newmode[1]!='+');
bReadWrite = (newmode[1]=='+');
gmx_fio_lock(fio);
if (fio->fp)
{
- gmx_fseek(fio->fp, fpos, SEEK_SET);
+ rc = gmx_fseek(fio->fp, fpos, SEEK_SET);
}
else
{
t_fileio *next, *prev; /* next and previous file pointers in the
linked list */
#ifdef GMX_THREADS
- tMPI_Spinlock_t mtx; /* content locking mutex. This is a spinlock
- for performance reasons: in some cases every
- single byte that gets read/written requires
- a lock */
+ tMPI_Lock_t mtx; /* content locking mutex. This is a fast lock
+ for performance reasons: in some cases every
+ single byte that gets read/written requires
+ a lock */
#endif
};
def_bonded ("PIDIHS", "Improper Dih.", 4, 3, 3, eNR_PROPER, pdihs ),
def_bondedt ("TABDIHS", "Tab. Dih.", 4, 2, 2, eNR_TABDIHS, tab_dihs ),
def_bonded ("CMAP", "CMAP Dih.", 5, -1, -1, eNR_CMAP, unimplemented ),
- def_bonded ("GB12", "GB 1-2 Pol.", 2, 2, 2, eNR_GB, unimplemented ),
- def_bonded ("GB13", "GB 1-3 Pol.", 2, 2, 2, eNR_GB, unimplemented ),
- def_bonded ("GB14", "GB 1-4 Pol.", 2, 2, 2, eNR_GB, unimplemented ),
+ def_bonded ("GB12", "GB 1-2 Pol.", 2, 4, 0, eNR_GB, unimplemented ),
+ def_bonded ("GB13", "GB 1-3 Pol.", 2, 4, 0, eNR_GB, unimplemented ),
+ def_bonded ("GB14", "GB 1-4 Pol.", 2, 4, 0, eNR_GB, unimplemented ),
def_nofc ("GBPOL", "GB Polarization" ),
- def_nofc ("NPSOLVATION", "Nonpolar sol." ),
+ def_nofc ("NPSOLVATION", "Nonpolar Sol." ),
def_bondedz ("LJ14", "LJ-14", 2, 2, 2, eNR_NB14, unimplemented ),
def_nofc ("COUL14", "Coulomb-14" ),
def_bondedz ("LJC14_Q", "LJC-14 q", 2, 5, 0, eNR_NB14, unimplemented ),
return rc;
}
+/* Return the size of the arrays */
+int
+gmx_residuetype_get_size(gmx_residuetype_t rt)
+{
+ return rt->n;
+}
+
+/* Search for a residuetype with name resnm within the
+ * gmx_residuetype database. Return the index if found,
+ * otherwise -1.
+ */
+int
+gmx_residuetype_get_index(gmx_residuetype_t rt, const char *resnm)
+{
+ int i,rc;
+
+ rc=-1;
+ for(i=0;i<rt->n && rc;i++)
+ {
+ rc=gmx_strcasecmp(rt->resname[i],resnm);
+ }
+
+ return (0 == rc) ? i-1 : -1;
+}
+
+/* Return the name of the residuetype with the given index, or
+ * NULL if not found. */
+const char *
+gmx_residuetype_get_name(gmx_residuetype_t rt, int index)
+{
+ if(index >= 0 && index < rt->n) {
+ return rt->resname[index];
+ } else {
+ return NULL;
+ }
+}
par_fn(tmpnm,efLOG,cr,FALSE,!bMasterOnly,buf,255);
fp = gmx_fio_fopen(buf, bAppend ? "a+" : "w+" );
}
+#ifdef GMX_FAHCORE
+ else if (!bAppend)
+#else
else
+#endif
{
fp = gmx_fio_fopen(tmpnm, bAppend ? "a+" : "w+" );
}
line[c-i] = line[c];
c++;
}
- line[i-c] = '\0';
+ line[c-i] = '\0';
}
char *line2string(char **line)
void read_xpm_entry(FILE *in,t_matrix *mm)
{
t_mapping *map;
- char *line=NULL,*str,buf[256];
+ char *line_buf=NULL,*line=NULL,*str,buf[256];
int i,m,col_len,nch,n_axis_x,n_axis_y,llmax;
int llalloc=0;
unsigned int r,g,b;
double u;
- gmx_bool bGetOnWithIt;
+ gmx_bool bGetOnWithIt,bSetLine;
t_xpmelmt c;
mm->flags=0;
llmax = STRLEN;
- while ((NULL != fgetline(&line,llmax,&llalloc,in)) &&
- (strncmp(line,"static",6) != 0)) {
+ while ((NULL != fgetline(&line_buf,llmax,&llalloc,in)) &&
+ (strncmp(line_buf,"static",6) != 0)) {
+ line = line_buf;
parsestring(line,"title",(mm->title));
parsestring(line,"legend",(mm->legend));
parsestring(line,"x-label",(mm->label_x));
gmx_input("Invalid XPixMap");
/* Read sizes */
bGetOnWithIt=FALSE;
- while (!bGetOnWithIt && (NULL != fgetline(&line,llmax,&llalloc,in))) {
+ while (!bGetOnWithIt && (NULL != fgetline(&line_buf,llmax,&llalloc,in))) {
+ line = line_buf;
while (( line[0] != '\"' ) && ( line[0] != '\0' ))
line++;
/* Read color map */
snew(map,mm->nmap);
m=0;
- while ((m < mm->nmap) && (NULL != fgetline(&line,llmax,&llalloc,in))) {
- line=strchr(line,'\"');
+ while ((m < mm->nmap) && (NULL != fgetline(&line_buf,llmax,&llalloc,in))) {
+ line = strchr(line_buf,'\"');
if (line) {
line++;
/* Read xpm color map entry */
n_axis_x=0;
n_axis_y=0;
bGetOnWithIt=FALSE;
+ bSetLine=FALSE;
do {
+ if (bSetLine)
+ line = line_buf;
+ bSetLine = TRUE;
if (strstr(line,"x-axis")) {
line=strstr(line,"x-axis");
skipstr(line);
skipstr(line);
}
}
- } while ((line[0] != '\"') && (NULL != fgetline(&line,llmax,&llalloc,in)));
+ } while ((line[0] != '\"') && (NULL != fgetline(&line_buf,llmax,&llalloc,in)));
/* Read matrix */
snew(mm->matrix,mm->nx);
for(i=0; i<mm->nx; i++)
snew(mm->matrix[i],mm->ny);
m=mm->ny-1;
+ bSetLine = FALSE;
do {
+ if (bSetLine)
+ line = line_buf;
+ bSetLine = TRUE;
if(m%(1+mm->ny/100)==0)
fprintf(stderr,"%3d%%\b\b\b\b",(100*(mm->ny-m))/mm->ny);
while ((line[0] != '\"') && (line[0] != '\0'))
}
m--;
}
- } while ((m>=0) && (NULL != fgetline(&line,llmax,&llalloc,in)));
+ } while ((m>=0) && (NULL != fgetline(&line_buf,llmax,&llalloc,in)));
if (m>=0)
gmx_incons("Not enough rows in the matrix");
};
const char *esa_names[esaNR+1] = {
- "No", "Ace-approximation", "Still", NULL
+ "Ace-approx", "None", "Still", NULL
};
const char *ewt_names[ewtNR+1] = {
nb_kernel323_power6.h nb_kernel324_power6.h nb_kernel330_power6.h nb_kernel331_power6.h \
nb_kernel332_power6.h nb_kernel333_power6.h nb_kernel334_power6.h nb_kernel400_power6.h \
nb_kernel410_power6.h nb_kernel420_power6.h nb_kernel430_power6.h \
- nb_kernel_power6.c nb_kernel_power6.h nb_kernel_f77sync.c \
+ nb_kernel_power6.c nb_kernel_power6.h nb_kernel_pwr6sync.c \
pwr6kernel010.F pwr6kernel020.F pwr6kernel030.F pwr6kernel100.F \
pwr6kernel101.F pwr6kernel102.F pwr6kernel103.F pwr6kernel104.F \
pwr6kernel110.F pwr6kernel111.F pwr6kernel112.F pwr6kernel113.F \
#include <pthread.h>
#endif
+#include <stdio.h>
/*! \brief Lock innerloop mutex and read lists indices
*
* Gromacs without any Fortran nonbonded kernels.
*/
void
-F77_FUNC(f77kernelsync,F77KERNELSYNC)
+F77_FUNC(pwr6kernelsync,PWR6KERNELSYNC)
(int * mtx,
int * count,
int * nri,
int * nn1)
{
int n0,n1;
+
+
#ifdef HAVE_PTHREADS_H
pthread_mutex_lock((pthread_mutex_t *)mtx);
#endif
#ifdef HAVE_PTHREADS_H
pthread_mutex_unlock((pthread_mutex_t *)mtx);
#endif
- n0 = *count;
*nn0 = n0;
*nn1 = n1;
}
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
ninner = 0
C Loop over thread workunits
- 10 call f77kernelsync(mtx,count,nri,nthreads,nn0,nn1)
+ 10 call pwr6kernelsync(mtx,count,nri,nthreads,nn0,nn1)
if(nn1.gt.nri) nn1=nri
C Start outer loop over neighborlists
void get_pdb_atomnumber(t_atoms *atoms,gmx_atomprop_t aps)
{
- int i,atomnumber;
+ int i,atomnumber,len;
size_t k;
char anm[6],anm_copy[6];
char nc='\0';
for(i=0; (i<atoms->nr); i++) {
strcpy(anm,atoms->pdbinfo[i].atomnm);
strcpy(anm_copy,atoms->pdbinfo[i].atomnm);
+ len = strlen(anm);
atomnumber = NOTSET;
- if (anm[0] != ' ') {
+ if ((anm[0] != ' ') && ((len <=2) || ((len > 2) && !isdigit(anm[2])))) {
anm_copy[2] = nc;
if (gmx_atomprop_query(aps,epropElement,"???",anm_copy,&eval))
atomnumber = gmx_nint(eval);
if (!_gmx_sel_parse_params(params, mod->u.expr.method->nparams,
mod->u.expr.method->param, mod, scanner))
{
- if (mod->child != sel)
- {
- _gmx_selelem_free(sel);
- }
_gmx_selelem_free(mod);
return NULL;
}
child = child->child;
if (child->type == SEL_SUBEXPRREF)
{
- child = child->child->child;
+ child = child->child;
+ /* Because most subexpression elements are created
+ * during compilation, we need to check for them
+ * explicitly here.
+ */
+ if (child->type == SEL_SUBEXPR)
+ {
+ child = child->child;
+ }
}
}
/* For variable references, we should skip the
**************************************************************************/
-/* Buffer structure. Every thread structure has several of these ready to
- be used when the data transmission is small enough for double copying to
- occur (i.e. the size of the transmission is less than N*MAX_COPY_BUFFER_SIZE,
- where N is the number of receiving threads).
-
- These buffers come in two sizes: one pre-allocated to MAX_COPY_BUFFER_SIZE
- (for point-to-point transmissions, and one pre-allocated to
- Nthreads*MAX_COPY_BUFFE_SIZE). */
+/* Buffer structure for collective communications. Every thread structure
+ has several of these ready to be used when the collective data
+ transmission is small enough for double copying to occur (i.e. the size
+ of the transmission is less than N*MAX_COPY_BUFFER_SIZE, where N is the
+ number of receiving threads). */
struct copy_buffer
{
void *buf; /* the actual buffer */
void tMPI_Lock_lock(tMPI_Lock_t *lock)
{
- while(!tMPI_Spinlock_trylock(&(lock->lock)))
+ while(tMPI_Spinlock_trylock(&(lock->lock)))
{
TMPI_YIELD_WAIT(lock);
}
case F_ANGLES:
case F_G96ANGLES:
case F_IDIHS:
+ case F_PIDIHS:
bPert = (ip->harmonic.rA != ip->harmonic.rB ||
ip->harmonic.krA != ip->harmonic.krB);
break;
ir->sa_algorithm = esaAPPROX;
}
gmx_fio_do_real(fio,ir->sa_surface_tension);
+
+ /* Override sa_surface_tension if it is not changed in the mpd-file */
+ if(ir->sa_surface_tension<0)
+ {
+ if(ir->gb_algorithm==egbSTILL)
+ {
+ ir->sa_surface_tension = 0.0049 * 100 * CAL2JOULE;
+ }
+ else if(ir->gb_algorithm==egbHCT || ir->gb_algorithm==egbOBC)
+ {
+ ir->sa_surface_tension = 0.0054 * 100 * CAL2JOULE;
+ }
+ }
+
}
else
{
#endif
fr->bX = 1;
- vec[0] = .1*ts.A; vec[1] = .1*ts.B; vec[2] = .1*ts.B;
+ fr->bBox = 1;
+ vec[0] = .1*ts.A; vec[1] = .1*ts.B; vec[2] = .1*ts.C;
angle[0] = ts.alpha; angle[1] = ts.beta; angle[2] = ts.gamma;
matrix_convert(fr->box,vec,angle);
- fr->bTime = 1;
- fr->time = ts.physical_time;
-
+ if (fr->vmdplugin.api->abiversion>10)
+ {
+ fr->bTime = TRUE;
+ fr->time = ts.physical_time;
+ }
+ else
+ {
+ fr->bTime = FALSE;
+ }
return 1;
return 0;
}
- if (fr->natoms < 1) {
- fprintf(stderr, "\nNo atoms found by VMD plugin in %s.\n"
- "Or format does not record number of atoms.\n", fn );
+ if (fr->natoms == MOLFILE_NUMATOMS_UNKNOWN) {
+ fprintf(stderr, "\nFormat of file %s does not record number of atoms.\n", fn);
+ return 0;
+ } else if (fr->natoms == MOLFILE_NUMATOMS_NONE) {
+ fprintf(stderr, "\nNo atoms found by VMD plugin in file %s.\n", fn );
+ return 0;
+ } else if (fr->natoms < 1) { /*should not be reached*/
+ fprintf(stderr, "\nUnknown number of atoms %d for VMD plugin opening file %s.\n",
+ fr->natoms, fn );
return 0;
}
snew(fr->x,fr->natoms);
fr->vmdplugin.bV = 0;
- if (fr->vmdplugin.api->read_timestep_metadata)
+ if (fr->vmdplugin.api->abiversion > 10 && fr->vmdplugin.api->read_timestep_metadata)
{
fr->vmdplugin.api->read_timestep_metadata(fr->vmdplugin.handle, metadata);
fr->vmdplugin.bV = metadata->has_velocities;
set(MDRUN_SOURCES
gctio.c ionize.c runner.c
do_gct.c repl_ex.c xutils.c
- md.c mdrun.c genalg.c gmx_membed.c
+ md.c mdrun.c genalg.c membed.c
md_openmm.c)
add_library(gmxpreprocess ${GMXPREPROCESS_SOURCES})
add_definitions( -DOPENMM_PLUGIN_DIR="" )
endif()
add_library(openmm_api_wrapper openmm_wrapper.cpp)
+ target_link_libraries(openmm_api_wrapper gmx gmx_gpu_utils ${OpenMM_LIBRARIES})
# remove_definitions( -DOPENMM_PLUGIN_DIR="${OpenMM_PLUGIN_DIR}" ) # TODO where should this go?!
set(GMX_OPENMM_LIBRARIES openmm_api_wrapper gmx_gpu_utils ${OpenMM_LIBRARIES})
+ install(TARGETS openmm_api_wrapper DESTINATION ${LIB_INSTALL_DIR})
endif(GMX_OPENMM)
if(GMX_FAHCORE)
g_x2top_SOURCES = g_x2top.c nm2type.c g_x2top.h
mdrun_SOURCES = \
- gctio.c gmx_membed.c gmx_membed.h \
+ gctio.c membed.c membed.h \
ionize.c ionize.h xmdrun.h \
do_gct.c repl_ex.c repl_ex.h \
xutils.c runner.c md.c mdrun.c \
endif()
CUDA_BUILD_CLEAN_TARGET()
+target_link_libraries(gmx_gpu_utils gmx)
install(TARGETS gmx_gpu_utils DESTINATION ${LIB_INSTALL_DIR})
}
}
+static void check_bonds_timestep(gmx_mtop_t *mtop,double dt,warninp_t wi)
+{
+ /* This check is not intended to ensure accurate integration,
+ * rather it is to signal mistakes in the mdp settings.
+ * A common mistake is to forget to turn on constraints
+ * for MD after energy minimization with flexible bonds.
+ * This check can also detect too large time steps for flexible water
+ * models, but such errors will often be masked by the constraints
+ * mdp options, which turns flexible water into water with bond constraints,
+ * but without an angle constraint. Unfortunately such incorrect use
+ * of water models can not easily be detected without checking
+ * for specific model names.
+ *
+ * The stability limit of leap-frog or velocity verlet is 4.44 steps
+ * per oscillational period.
+ * But accurate bonds distributions are lost far before that limit.
+ * To allow relatively common schemes (although not common with Gromacs)
+ * of dt=1 fs without constraints and dt=2 fs with only H-bond constraints
+ * we set the note limit to 10.
+ */
+ int min_steps_warn=5;
+ int min_steps_note=10;
+ t_iparams *ip;
+ int molt;
+ gmx_moltype_t *moltype,*w_moltype;
+ t_atom *atom;
+ t_ilist *ilist,*ilb,*ilc,*ils;
+ int ftype;
+ int i,a1,a2,w_a1,w_a2,j;
+ real twopi2,limit2,fc,re,m1,m2,period2,w_period2;
+ gmx_bool bFound,bWater,bWarn;
+ char warn_buf[STRLEN];
+
+ ip = mtop->ffparams.iparams;
+
+ twopi2 = sqr(2*M_PI);
+
+ limit2 = sqr(min_steps_note*dt);
+
+ w_moltype = NULL;
+ for(molt=0; molt<mtop->nmoltype; molt++)
+ {
+ moltype = &mtop->moltype[molt];
+ atom = moltype->atoms.atom;
+ ilist = moltype->ilist;
+ ilc = &ilist[F_CONSTR];
+ ils = &ilist[F_SETTLE];
+ for(ftype=0; ftype<F_NRE; ftype++)
+ {
+ if (!(ftype == F_BONDS || ftype == F_G96BONDS || ftype == F_HARMONIC))
+ {
+ continue;
+ }
+
+ ilb = &ilist[ftype];
+ for(i=0; i<ilb->nr; i+=3)
+ {
+ fc = ip[ilb->iatoms[i]].harmonic.krA;
+ re = ip[ilb->iatoms[i]].harmonic.rA;
+ if (ftype == F_G96BONDS)
+ {
+ /* Convert squared sqaure fc to harmonic fc */
+ fc = 2*fc*re;
+ }
+ a1 = ilb->iatoms[i+1];
+ a2 = ilb->iatoms[i+2];
+ m1 = atom[a1].m;
+ m2 = atom[a2].m;
+ if (fc > 0 && m1 > 0 && m2 > 0)
+ {
+ period2 = twopi2*m1*m2/((m1 + m2)*fc);
+ }
+ else
+ {
+ period2 = GMX_FLOAT_MAX;
+ }
+ if (debug)
+ {
+ fprintf(debug,"fc %g m1 %g m2 %g period %g\n",
+ fc,m1,m2,sqrt(period2));
+ }
+ if (period2 < limit2)
+ {
+ bFound = FALSE;
+ for(j=0; j<ilc->nr; j+=3)
+ {
+ if ((ilc->iatoms[j+1] == a1 && ilc->iatoms[j+2] == a2) ||
+ (ilc->iatoms[j+1] == a2 && ilc->iatoms[j+2] == a1))
+ {
+ bFound = TRUE;
+ }
+ }
+ for(j=0; j<ils->nr; j+=2)
+ {
+ if ((a1 >= ils->iatoms[j+1] && a1 < ils->iatoms[j+1]+3) &&
+ (a2 >= ils->iatoms[j+1] && a2 < ils->iatoms[j+1]+3))
+ {
+ bFound = TRUE;
+ }
+ }
+ if (!bFound &&
+ (w_moltype == NULL || period2 < w_period2))
+ {
+ w_moltype = moltype;
+ w_a1 = a1;
+ w_a2 = a2;
+ w_period2 = period2;
+ }
+ }
+ }
+ }
+ }
+
+ if (w_moltype != NULL)
+ {
+ bWarn = (w_period2 < sqr(min_steps_warn*dt));
+ /* A check that would recognize most water models */
+ bWater = ((*w_moltype->atoms.atomname[0])[0] == 'O' &&
+ w_moltype->atoms.nr <= 5);
+ sprintf(warn_buf,"The bond in molecule-type %s between atoms %d %s and %d %s has an estimated oscillational period of %.1e ps, which is less than %d times the time step of %.1e ps.\n"
+ "%s",
+ *w_moltype->name,
+ w_a1+1,*w_moltype->atoms.atomname[w_a1],
+ w_a2+1,*w_moltype->atoms.atomname[w_a2],
+ sqrt(w_period2),bWarn ? min_steps_warn : min_steps_note,dt,
+ bWater ?
+ "Maybe you asked for fexible water." :
+ "Maybe you forgot to change the constraints mdp option.");
+ if (bWarn)
+ {
+ warning(wi,warn_buf);
+ }
+ else
+ {
+ warning_note(wi,warn_buf);
+ }
+ }
+}
+
static void check_vel(gmx_mtop_t *mtop,rvec v[])
{
gmx_mtop_atomloop_all_t aloop;
*mi = molinfo;
}
+static void copy_state(const char *slog,t_trxframe *fr,
+ gmx_bool bReadVel,t_state *state,
+ double *use_time)
+{
+ int i;
+
+ if (fr->not_ok & FRAME_NOT_OK)
+ {
+ gmx_fatal(FARGS,"Can not start from an incomplete frame");
+ }
+ if (!fr->bX)
+ {
+ gmx_fatal(FARGS,"Did not find a frame with coordinates in file %s",
+ slog);
+ }
+
+ for(i=0; i<state->natoms; i++)
+ {
+ copy_rvec(fr->x[i],state->x[i]);
+ }
+ if (bReadVel)
+ {
+ if (!fr->bV)
+ {
+ gmx_incons("Trajecory frame unexpectedly does not contain velocities");
+ }
+ for(i=0; i<state->natoms; i++)
+ {
+ copy_rvec(fr->v[i],state->v[i]);
+ }
+ }
+ if (fr->bBox)
+ {
+ copy_mat(fr->box,state->box);
+ }
+
+ *use_time = fr->time;
+}
+
static void cont_status(const char *slog,const char *ener,
gmx_bool bNeedVel,gmx_bool bGenVel, real fr_time,
t_inputrec *ir,t_state *state,
const output_env_t oenv)
/* If fr_time == -1 read the last frame available which is complete */
{
- t_trxframe fr;
- t_trxstatus *fp;
-
- fprintf(stderr,
- "Reading Coordinates%s and Box size from old trajectory\n",
- (!bNeedVel || bGenVel) ? "" : ", Velocities");
- if (fr_time == -1)
- fprintf(stderr,"Will read whole trajectory\n");
- else
- fprintf(stderr,"Will read till time %g\n",fr_time);
- if (!bNeedVel || bGenVel) {
- if (bGenVel)
- fprintf(stderr,"Velocities generated: "
- "ignoring velocities in input trajectory\n");
- read_first_frame(oenv,&fp,slog,&fr,TRX_NEED_X);
- } else
- read_first_frame(oenv,&fp,slog,&fr,TRX_NEED_X | TRX_NEED_V);
-
- state->natoms = fr.natoms;
+ gmx_bool bReadVel;
+ t_trxframe fr;
+ t_trxstatus *fp;
+ int i;
+ double use_time;
- if (sys->natoms != state->natoms)
- gmx_fatal(FARGS,"Number of atoms in Topology "
- "is not the same as in Trajectory");
+ bReadVel = (bNeedVel && !bGenVel);
- /* Find the appropriate frame */
- while ((fr_time == -1 || fr.time < fr_time) && read_next_frame(oenv,fp,&fr));
+ fprintf(stderr,
+ "Reading Coordinates%s and Box size from old trajectory\n",
+ bReadVel ? ", Velocities" : "");
+ if (fr_time == -1)
+ {
+ fprintf(stderr,"Will read whole trajectory\n");
+ }
+ else
+ {
+ fprintf(stderr,"Will read till time %g\n",fr_time);
+ }
+ if (!bReadVel)
+ {
+ if (bGenVel)
+ {
+ fprintf(stderr,"Velocities generated: "
+ "ignoring velocities in input trajectory\n");
+ }
+ read_first_frame(oenv,&fp,slog,&fr,TRX_NEED_X);
+ }
+ else
+ {
+ read_first_frame(oenv,&fp,slog,&fr,TRX_NEED_X | TRX_NEED_V);
+
+ if (!fr.bV)
+ {
+ fprintf(stderr,
+ "\n"
+ "WARNING: Did not find a frame with velocities in file %s,\n"
+ " all velocities will be set to zero!\n\n",slog);
+ for(i=0; i<sys->natoms; i++)
+ {
+ clear_rvec(state->v[i]);
+ }
+ close_trj(fp);
+ /* Search for a frame without velocities */
+ bReadVel = FALSE;
+ read_first_frame(oenv,&fp,slog,&fr,TRX_NEED_X);
+ }
+ }
+
+ state->natoms = fr.natoms;
+
+ if (sys->natoms != state->natoms)
+ {
+ gmx_fatal(FARGS,"Number of atoms in Topology "
+ "is not the same as in Trajectory");
+ }
+ copy_state(slog,&fr,bReadVel,state,&use_time);
+
+ /* Find the appropriate frame */
+ while ((fr_time == -1 || fr.time < fr_time) &&
+ read_next_frame(oenv,fp,&fr))
+ {
+ copy_state(slog,&fr,bReadVel,state,&use_time);
+ }
- close_trj(fp);
-
- if (fr.not_ok & FRAME_NOT_OK)
- gmx_fatal(FARGS,"Can not start from an incomplete frame");
-
- state->x = fr.x;
- if (bNeedVel && !bGenVel)
- state->v = fr.v;
- copy_mat(fr.box,state->box);
- /* Set the relative box lengths for preserving the box shape.
- * Note that this call can lead to differences in the last bit
- * with respect to using tpbconv to create a tpx file.
- */
- set_box_rel(ir,state);
+ close_trj(fp);
- fprintf(stderr,"Using frame at t = %g ps\n",fr.time);
- fprintf(stderr,"Starting time for run is %g ps\n",ir->init_t);
+ /* Set the relative box lengths for preserving the box shape.
+ * Note that this call can lead to differences in the last bit
+ * with respect to using tpbconv to create a tpx file.
+ */
+ set_box_rel(ir,state);
+
+ fprintf(stderr,"Using frame at t = %g ps\n",use_time);
+ fprintf(stderr,"Starting time for run is %g ps\n",ir->init_t);
- if ((ir->epc != epcNO || ir->etc ==etcNOSEHOOVER) && ener) {
- get_enx_state(ener,fr.time,&sys->groups,ir,state);
- preserve_box_shape(ir,state->box_rel,state->boxv);
- }
+ if ((ir->epc != epcNO || ir->etc ==etcNOSEHOOVER) && ener)
+ {
+ get_enx_state(ener,use_time,&sys->groups,ir,state);
+ preserve_box_shape(ir,state->box_rel,state->boxv);
+ }
}
static void read_posres(gmx_mtop_t *mtop,t_molinfo *molinfo,gmx_bool bTopB,
check_cg_sizes(ftp2fn(efTOP,NFILE,fnm),&sys->moltype[i].cgs,wi);
}
+ if (EI_DYNAMICS(ir->eI) && ir->eI != eiBD)
+ {
+ check_bonds_timestep(sys,ir->delta_t,wi);
+ }
+
check_warning_error(wi,FARGS);
if (bVerbose)
#include "checkpoint.h"
#include "mtop_util.h"
#include "sighandler.h"
-#include "gmx_membed.h"
+#include "membed.h"
#ifdef GMX_LIB_MPI
#include <mpi.h>
* or at the last step (but not when we do not want confout),
* but never at the first step or with rerun.
*/
- bCPT = (((gs.set[eglsCHKPT] && bNS) ||
+ bCPT = (((gs.set[eglsCHKPT] && (bNS || ir->nstlist == 0)) ||
(bLastStep && (Flags & MD_CONFOUT))) &&
step > ir->init_step && !bRerunMD);
if (bCPT)
#include "genborn.h"
#include "string2.h"
#include "copyrite.h"
-#include "gmx_membed.h"
+#include "membed.h"
#ifdef GMX_THREADS
#include "tmpi.h"
openmm_copy_state(openmmData, state, &t, f, enerd, bX, bV, bF, do_ene);
- upd_mdebin(mdebin, FALSE,TRUE,
+ upd_mdebin(mdebin,FALSE,TRUE,
t,mdatoms->tmass,enerd,state,lastbox,
shake_vir,force_vir,total_vir,pres,
ekind,mu_tot,constr);
#include "mtop_util.h"
#include "tpxio.h"
#include "string2.h"
-#include "gmx_membed.h"
+#include "membed.h"
#include "pbc.h"
#include "readinp.h"
"setting implicit_solvent value to \"GBSA\" in input section.\n");
}
+ if(ir->sa_algorithm==esaSTILL)
+ {
+ sprintf(err_buf,"Still SA algorithm not available yet, use %s or %s instead\n",esa_names[esaAPPROX],esa_names[esaNO]);
+ CHECK(ir->sa_algorithm == esaSTILL);
+ }
+
if(ir->implicit_solvent==eisGBSA)
{
- sprintf(err_buf,"With GBSA implicit solvent, rgbradii must be equal to rlist.");
- CHECK(ir->rgbradii != ir->rlist);
+ sprintf(err_buf,"With GBSA implicit solvent, rgbradii must be equal to rlist.");
+ CHECK(ir->rgbradii != ir->rlist);
- if(ir->coulombtype!=eelCUT)
+ if(ir->coulombtype!=eelCUT)
{
sprintf(err_buf,"With GBSA, coulombtype must be equal to %s\n",eel_names[eelCUT]);
CHECK(ir->coulombtype!=eelCUT);
sprintf(err_buf,"With GBSA, vdw-type must be equal to %s\n",evdw_names[evdwCUT]);
CHECK(ir->vdwtype!=evdwCUT);
}
-
if(ir->nstgbradii<1)
{
sprintf(warn_buf,"Using GBSA with nstgbradii<1, setting nstgbradii=1");
warning_note(wi,warn_buf);
ir->nstgbradii=1;
}
+ if(ir->sa_algorithm==esaNO)
+ {
+ sprintf(warn_buf,"No SA (non-polar) calculation requested together with GB. Are you sure this is what you want?\n");
+ warning_note(wi,warn_buf);
+ }
+ if(ir->sa_surface_tension<0 && ir->sa_algorithm!=esaNO)
+ {
+ sprintf(warn_buf,"Value of sa_surface_tension is < 0. Changing it to 2.05016 or 2.25936 kJ/nm^2/mol for Still and HCT/OBC respectively\n");
+ warning_note(wi,warn_buf);
+
+ if(ir->gb_algorithm==egbSTILL)
+ {
+ ir->sa_surface_tension = 0.0049 * CAL2JOULE * 100;
+ }
+ else
+ {
+ ir->sa_surface_tension = 0.0054 * CAL2JOULE * 100;
+ }
+ }
+ if(ir->sa_surface_tension==0 && ir->sa_algorithm!=esaNO)
+ {
+ sprintf(err_buf, "Surface tension set to 0 while SA-calculation requested\n");
+ CHECK(ir->sa_surface_tension==0 && ir->sa_algorithm!=esaNO);
+ }
+
}
}
RTYPE ("gb_dielectric_offset", ir->gb_dielectric_offset, 0.009);
EETYPE("sa_algorithm", ir->sa_algorithm, esa_names);
CTYPE ("Surface tension (kJ/mol/nm^2) for the SA (nonpolar surface) part of GBSA");
- CTYPE ("The default value (2.092) corresponds to 0.005 kcal/mol/Angstrom^2.");
- RTYPE ("sa_surface_tension", ir->sa_surface_tension, 2.092);
+ CTYPE ("The value -1 will set default value for Still/HCT/OBC GB-models.");
+ RTYPE ("sa_surface_tension", ir->sa_surface_tension, -1);
/* Coupling stuff */
CCTYPE ("OPTIONS FOR WEAK COUPLING ALGORITHMS");
for(i=0; (i<nr); i++)
{
ir->opts.tau_t[i] = strtod(ptr1[i],NULL);
- if (ir->opts.tau_t[i] < 0)
+ if ((ir->eI == eiBD || ir->eI == eiSD2) && ir->opts.tau_t[i] <= 0)
+ {
+ sprintf(warn_buf,"With integrator %s tau_t should be larger than 0",ei_names[ir->eI]);
+ warning_error(wi,warn_buf);
+ }
+ if ((ir->etc == etcVRESCALE && ir->opts.tau_t[i] >= 0) ||
+ (ir->etc != etcVRESCALE && ir->opts.tau_t[i] > 0))
{
- gmx_fatal(FARGS,"tau_t for group %d negative",i);
- } else if (ir->opts.tau_t[i] > 0) {
tau_min = min(tau_min,ir->opts.tau_t[i]);
}
}
warning(wi,err_buf);
}
} else {
- if (ir->coulombtype == eelCUT && ir->rcoulomb > 0) {
+ if (ir->coulombtype == eelCUT && ir->rcoulomb > 0 && !ir->implicit_solvent) {
sprintf(err_buf,
"You are using a plain Coulomb cut-off, which might produce artifacts.\n"
"You might want to consider using %s electrostatics.\n",
* not be zero at the cut-off.
*/
if (EVDW_IS_ZERO_AT_CUTOFF(ir->vdwtype) &&
- rvdw1 + rvdw2 > ir->rlistlong - ir->rvdw)
+ rvdw1 + rvdw2 > ir->rlist - ir->rvdw)
{
- sprintf(warn_buf,"The sum of the two largest charge group radii (%f) is larger than %s (%f) - rvdw (%f)\n",
+ sprintf(warn_buf,"The sum of the two largest charge group radii (%f) is larger than rlist (%f) - rvdw (%f)\n",
rvdw1+rvdw2,
- ir->rlistlong > ir->rlist ? "rlistlong" : "rlist",
ir->rlist,ir->rvdw);
if (ir_NVE(ir))
{
#include "sighandler.h"
#include "tpxio.h"
#include "txtdump.h"
-#include "gmx_membed.h"
+#include "membed.h"
#include "md_openmm.h"
{
int nthreads,nthreads_new;
int min_atoms_per_thread;
+ char *env;
nthreads = nthreads_requested;
/* determine # of hardware threads. */
if (nthreads_requested < 1)
{
- nthreads = tMPI_Get_recommended_nthreads();
+ if ((env = getenv("GMX_MAX_THREADS")) != NULL)
+ {
+ nthreads = 0;
+ sscanf(env,"%d",&nthreads);
+ if (nthreads < 1)
+ {
+ gmx_fatal(FARGS,"GMX_MAX_THREADS (%d) should be larger than 0",
+ nthreads);
+ }
+ }
+ else
+ {
+ nthreads = tMPI_Get_recommended_nthreads();
+ }
}
if (inputrec->eI == eiNM || EI_TPI(inputrec->eI))
char *tmp_line=NULL;
char warn_buf[STRLEN];
- /* open input and output file */
+ /* We need to open the output file before opening the input file,
+ * because cpp_open_file can change the current working directory.
+ */
+ if (outfile) {
+ out = gmx_fio_fopen(outfile,"w");
+ } else {
+ out = NULL;
+ }
+
+ /* open input file */
status = cpp_open_file(infile,&handle,cpp_opts(define,include,infile,wi));
if (status != 0)
gmx_fatal(FARGS,cpp_error(&handle,status));
- if (outfile)
- out = gmx_fio_fopen(outfile,"w");
- else
- out = NULL;
+
/* some local variables */
DS_Init(&DS); /* directive stack */
nmol = 0; /* no molecules yet... */
int i,j,ft,ftype,nn,nrfp,nrfpA,nrfpB;
int start;
int nxcmap,nycmap,ncmap,read_cmap,sl,nct;
- char s[20],alc[MAXATOMLIST+1][20];
+ char s[20],alc[MAXATOMLIST+2][20];
t_param p;
gmx_bool bAllowRepeat;
char errbuf[256];
cmp_real(fp,"inputrec->sc_sigma",-1,ir1->sc_sigma,ir2->sc_sigma,ftol,abstol);
cmp_real(fp,"inputrec->sc_sigma_min",-1,ir1->sc_sigma_min,ir2->sc_sigma_min,ftol,abstol);
cmp_int(fp,"inputrec->nstdhdl",-1,ir1->nstdhdl,ir2->nstdhdl);
- cmp_int(fp,"inputrec->separate_dhdl_file",-1,ir1->separate_dhdl_file,ir2->nstdhdl);
+ cmp_int(fp,"inputrec->separate_dhdl_file",-1,ir1->separate_dhdl_file,ir2->separate_dhdl_file);
cmp_int(fp,"inputrec->dhdl_derivatives",-1,ir1->dhdl_derivatives,ir2->dhdl_derivatives);
cmp_int(fp,"inputrec->dh_hist_size",-1,ir1->dh_hist_size,ir2->dh_hist_size);
cmp_double(fp,"inputrec->dh_hist_spacing",-1,ir1->dh_hist_spacing,ir2->dh_hist_spacing,ftol,abstol);
* to the solvation forces */
if (ir->implicit_solvent) {
calc_gb_forces(cr,md,born,top,atype,x,f,fr,idef,
- ir->gb_algorithm,nrnb,bBornRadii,&pbc,graph,enerd);
+ ir->gb_algorithm,ir->sa_algorithm,nrnb,bBornRadii,&pbc,graph,enerd);
}
#ifdef GMX_MPI
born->epsilon_r = ir->epsilon_r;
doffset = born->gb_doffset;
-
+
+ /* Set the surface tension */
+ born->sa_surface_tension = ir->sa_surface_tension;
+
/* If Still model, initialise the polarisation energies */
if(gb_algorithm==egbSTILL)
{
at1=natoms;
}
- /* The surface area factor is 0.0049 for Still model, 0.0054 for HCT/OBC */
+ /* factor is the surface tension */
+ factor = born->sa_surface_tension;
+ /*
+
+ // The surface tension factor is 0.0049 for Still model, 0.0054 for HCT/OBC
if(gb_algorithm==egbSTILL)
{
factor=0.0049*100*CAL2JOULE;
{
factor=0.0054*100*CAL2JOULE;
}
-
+ */
/* if(gb_algorithm==egbHCT || gb_algorithm==egbOBC) */
es = 0;
void
calc_gb_forces(t_commrec *cr, t_mdatoms *md, gmx_genborn_t *born, gmx_localtop_t *top, const t_atomtypes *atype,
- rvec x[], rvec f[], t_forcerec *fr, t_idef *idef, int gb_algorithm, t_nrnb *nrnb, gmx_bool bRad,
+ rvec x[], rvec f[], t_forcerec *fr, t_idef *idef, int gb_algorithm, int sa_algorithm, t_nrnb *nrnb, gmx_bool bRad,
const t_pbc *pbc, const t_graph *graph, gmx_enerdata_t *enerd)
{
real v=0;
pbc_null = pbc;
else
pbc_null = NULL;
-
+
+ if(sa_algorithm == esaAPPROX)
+ {
/* Do a simple ACE type approximation for the non-polar solvation */
enerd->term[F_NPSOLVATION] += calc_gb_nonpolar(cr, fr,born->nr, born, top, atype, fr->dvda, gb_algorithm,md);
-
- /* Calculate the bonded GB-interactions using either table or analytical formula */
+ }
+
+ /* Calculate the bonded GB-interactions using either table or analytical formula */
enerd->term[F_GBPOL] += gb_bonds_tab(x,f,fr->fshift, md->chargeA,&(fr->gbtabscale),
fr->invsqrta,fr->dvda,fr->gbtab.tab,idef,born->epsilon_r,born->gb_epsilon_solvent, fr->epsfac, pbc_null, graph);
md->bEInd[i]=FALSE;
}
- for(i=0; i<F_NRE; i++) {
+#ifndef GMX_OPENMM
+ for(i=0; i<F_NRE; i++)
+ {
md->bEner[i] = FALSE;
if (i == F_LJ)
md->bEner[i] = !bBHAM;
else
md->bEner[i] = (gmx_mtop_ftype_count(mtop,i) > 0);
}
+#else
+ /* OpenMM always produces only the following 4 energy terms */
+ md->bEner[F_EPOT] = TRUE;
+ md->bEner[F_EKIN] = TRUE;
+ md->bEner[F_ETOT] = TRUE;
+ md->bEner[F_TEMP] = TRUE;
+#endif
md->f_nre=0;
for(i=0; i<F_NRE; i++)
snew(enerhist->dht->ndh, dhc->ndh);
snew(enerhist->dht->dh, dhc->ndh);
enerhist->dht->nndh=dhc->ndh;
-
- /* these don't change during the simulation */
- for(i=0;i<dhc->ndh;i++)
- {
- enerhist->dht->dh[i] = dhc->dh[i].dh;
- }
}
else
{
}
for(i=0;i<dhc->ndh;i++)
{
+ enerhist->dht->dh[i] = dhc->dh[i].dh;
enerhist->dht->ndh[i] = dhc->dh[i].ndh;
}
enerhist->dht->start_time=dhc->start_time;
+ enerhist->dht->start_lambda=dhc->start_lambda;
}
}
}
dhc->start_time=enerhist->dht->start_time;
- dhc->start_lambda=enerhist->dht->start_lambda;
+ if (enerhist->dht->start_lambda_set)
+ dhc->start_lambda=enerhist->dht->start_lambda;
if (dhc->dh[0].ndh > 0)
dhc->start_time_set=TRUE;
else
#include "mtop_util.h"
#include "gmxfio.h"
#include "pme.h"
-#include "gmx_membed.h"
+#include "membed.h"
typedef struct {
t_state s;
gmx_bool bEnergyOutOfBounds;
const char *tpid_leg[2]={"direct","reweighted"};
- /* Since numerical problems can lead to extreme negative energies
- * when atoms overlap, we need to set a lower limit for beta*U.
- */
- real bU_neg_limit = -50;
-
/* Since there is no upper limit to the insertion energies,
* we need to set an upper limit for the distribution output.
*/
mdatoms->nr,a_tp1-a_tp0);
refvolshift = log(det(rerun_fr.box));
-
+
+#if ( defined(GMX_IA32_SSE) || defined(GMX_X86_64_SSE) || defined(GMX_X86_64_SSE2) )
+ /* Make sure we don't detect SSE overflow generated before this point */
+ gmx_mm_check_and_reset_overflow();
+#endif
+
while (bNotLastFrame)
{
lambda = rerun_fr.lambda;
}
#endif
/* If the compiler doesn't optimize this check away
- * we catch the NAN energies. With tables extreme negative
- * energies might occur close to r=0.
+ * we catch the NAN energies.
+ * The epot>GMX_REAL_MAX check catches inf values,
+ * which should nicely result in embU=0 through the exp below,
+ * but it does not hurt to check anyhow.
+ */
+ /* Non-bonded Interaction usually diverge at r=0.
+ * With tabulated interaction functions the first few entries
+ * should be capped in a consistent fashion between
+ * repulsion, dispersion and Coulomb to avoid accidental
+ * negative values in the total energy.
+ * The table generation code in tables.c does this.
+ * With user tbales the user should take care of this.
*/
- if (epot != epot || epot*beta < bU_neg_limit)
+ if (epot != epot || epot > GMX_REAL_MAX)
{
bEnergyOutOfBounds = TRUE;
}
int ngtc,n;
real y;
- snew(sd,1);
+ snew(sd,1);
- /* Initiate random number generator for langevin type dynamics,
- * for BD, SD or velocity rescaling temperature coupling.
- */
- sd->gaussrand = gmx_rng_init(ir->ld_seed);
+ /* Initiate random number generator for langevin type dynamics,
+ * for BD, SD or velocity rescaling temperature coupling.
+ */
+ sd->gaussrand = gmx_rng_init(ir->ld_seed);
- ngtc = ir->opts.ngtc;
+ ngtc = ir->opts.ngtc;
- if (ir->eI == eiBD) {
- snew(sd->bd_rf,ngtc);
- } else if (EI_SD(ir->eI)) {
- snew(sd->sdc,ngtc);
- snew(sd->sdsig,ngtc);
+ if (ir->eI == eiBD)
+ {
+ snew(sd->bd_rf,ngtc);
+ }
+ else if (EI_SD(ir->eI))
+ {
+ snew(sd->sdc,ngtc);
+ snew(sd->sdsig,ngtc);
- sdc = sd->sdc;
- for(n=0; n<ngtc; n++) {
- sdc[n].gdt = ir->delta_t/ir->opts.tau_t[n];
- sdc[n].eph = exp(sdc[n].gdt/2);
- sdc[n].emh = exp(-sdc[n].gdt/2);
- sdc[n].em = exp(-sdc[n].gdt);
- if (sdc[n].gdt >= 0.05) {
- sdc[n].b = sdc[n].gdt*(sdc[n].eph*sdc[n].eph - 1)
- - 4*(sdc[n].eph - 1)*(sdc[n].eph - 1);
- sdc[n].c = sdc[n].gdt - 3 + 4*sdc[n].emh - sdc[n].em;
- sdc[n].d = 2 - sdc[n].eph - sdc[n].emh;
- } else {
- y = sdc[n].gdt/2;
- /* Seventh order expansions for small y */
- sdc[n].b = y*y*y*y*(1/3.0+y*(1/3.0+y*(17/90.0+y*7/9.0)));
- sdc[n].c = y*y*y*(2/3.0+y*(-1/2.0+y*(7/30.0+y*(-1/12.0+y*31/1260.0))));
- sdc[n].d = y*y*(-1+y*y*(-1/12.0-y*y/360.0));
- }
- if(debug)
- fprintf(debug,"SD const tc-grp %d: b %g c %g d %g\n",
- n,sdc[n].b,sdc[n].c,sdc[n].d);
+ sdc = sd->sdc;
+ for(n=0; n<ngtc; n++)
+ {
+ if (ir->opts.tau_t[n] > 0)
+ {
+ sdc[n].gdt = ir->delta_t/ir->opts.tau_t[n];
+ sdc[n].eph = exp(sdc[n].gdt/2);
+ sdc[n].emh = exp(-sdc[n].gdt/2);
+ sdc[n].em = exp(-sdc[n].gdt);
+ }
+ else
+ {
+ /* No friction and noise on this group */
+ sdc[n].gdt = 0;
+ sdc[n].eph = 1;
+ sdc[n].emh = 1;
+ sdc[n].em = 1;
+ }
+ if (sdc[n].gdt >= 0.05)
+ {
+ sdc[n].b = sdc[n].gdt*(sdc[n].eph*sdc[n].eph - 1)
+ - 4*(sdc[n].eph - 1)*(sdc[n].eph - 1);
+ sdc[n].c = sdc[n].gdt - 3 + 4*sdc[n].emh - sdc[n].em;
+ sdc[n].d = 2 - sdc[n].eph - sdc[n].emh;
+ }
+ else
+ {
+ y = sdc[n].gdt/2;
+ /* Seventh order expansions for small y */
+ sdc[n].b = y*y*y*y*(1/3.0+y*(1/3.0+y*(17/90.0+y*7/9.0)));
+ sdc[n].c = y*y*y*(2/3.0+y*(-1/2.0+y*(7/30.0+y*(-1/12.0+y*31/1260.0))));
+ sdc[n].d = y*y*(-1+y*y*(-1/12.0-y*y/360.0));
+ }
+ if(debug)
+ fprintf(debug,"SD const tc-grp %d: b %g c %g d %g\n",
+ n,sdc[n].b,sdc[n].c,sdc[n].d);
+ }
}
- }
- return sd;
+ return sd;
}
void get_stochd_state(gmx_update_t upd,t_state *state)
gmx_editconf.c gmx_genbox.c gmx_genion.c gmx_genconf.c
gmx_genpr.c gmx_eneconv.c gmx_vanhove.c gmx_wheel.c
addconf.c calcpot.c edittop.c gmx_bar.c
- gmx_membed.c gmx_pme_error.c )
+ gmx_pme_error.c )
target_link_libraries(gmxana md gmx)
g_rmsf g_rotacf g_saltbr g_sas g_select g_sgangle g_sham g_sorient
g_spol g_spatial g_tcaf g_traj g_tune_pme g_vanhove
g_velacc g_clustsize g_mdmat g_wham g_sigeps g_bar
- g_membed g_pme_error g_rmsdist g_rotmat)
+ g_pme_error g_rmsdist g_rotmat)
gmx_polystat.c gmx_potential.c gmx_rama.c \
gmx_rdf.c gmx_rms.c gmx_rmsdist.c gmx_rmsf.c \
gmx_rotacf.c gmx_rotmat.c gmx_saltbr.c gmx_sas.c \
- gmx_select.c gmx_pme_error.c \
+ gmx_select.c gmx_pme_error.c gmx_membed.c \
gmx_sgangle.c gmx_sorient.c gmx_spol.c gmx_tcaf.c \
gmx_traj.c gmx_velacc.c gmx_helixorient.c \
gmx_clustsize.c gmx_mdmat.c gmx_wham.c eigio.h \
g_enemat g_energy g_lie g_filter \
g_gyrate g_h2order g_hbond g_helix \
g_mindist g_msd g_morph g_nmeig \
- g_nmens g_order \
+ g_nmens g_order g_membed \
g_polystat g_potential g_rama \
g_rdf g_rms g_rmsdist g_rmsf \
g_rotacf g_rotmat g_saltbr g_sas \
real tbeginfit,real tendfit,real dt,real c1[],real *fit)
{
real fitparm[3];
- real tStart,tail_corr,sum,sumtot=0,ct_estimate,*sig;
+ real tStart,tail_corr,sum,sumtot=0,c_start,ct_estimate,*sig;
int i,j,jmax,nf_int;
gmx_bool bPrint;
"Fit from","Integral","Tail Value","Sum (ps)"," a1 (ps)",
(nfp_ffn[fitfn]>=2) ? " a2 ()" : "",
(nfp_ffn[fitfn]>=3) ? " a3 (ps)" : "");
- if (tbeginfit > 0)
+
+ snew(sig,ncorr);
+
+ if (tbeginfit > 0) {
jmax = 3;
- else
- jmax = 1;
- if (fitfn == effnEXP3) {
- fitparm[0] = 0.002*ncorr*dt;
- fitparm[1] = 0.95;
- fitparm[2] = 0.2*ncorr*dt;
} else {
- /* Good initial guess, this increases the probability of convergence */
- fitparm[0] = ct_estimate;
- fitparm[1] = 1.0;
- fitparm[2] = 1.0;
+ jmax = 1;
}
+ for(j=0; ((j<jmax) && (tStart < tendfit) && (tStart < ncorr*dt)); j++) {
+ /* Estimate the correlation time for better fitting */
+ c_start = -1;
+ ct_estimate = 0;
+ for(i=0; (i<ncorr) && (dt*i < tStart || c1[i]>0); i++) {
+ if (c_start < 0) {
+ if (dt*i >= tStart) {
+ c_start = c1[i];
+ ct_estimate = 0.5*c1[i];
+ }
+ } else {
+ ct_estimate += c1[i];
+ }
+ }
+ if (c_start > 0) {
+ ct_estimate *= dt/c_start;
+ } else {
+ /* The data is strange, so we need to choose somehting */
+ ct_estimate = tendfit;
+ }
+ if (debug) {
+ fprintf(debug,"tStart %g ct_estimate: %g\n",tStart,ct_estimate);
+ }
+
+ if (fitfn == effnEXP3) {
+ fitparm[0] = 0.002*ncorr*dt;
+ fitparm[1] = 0.95;
+ fitparm[2] = 0.2*ncorr*dt;
+ } else {
+ /* Good initial guess, this increases the probability of convergence */
+ fitparm[0] = ct_estimate;
+ fitparm[1] = 1.0;
+ fitparm[2] = 1.0;
+ }
- /* Generate more or less appropriate sigma's */
- snew(sig,ncorr);
- for(i=0; i<ncorr; i++)
- sig[i] = sqrt(ct_estimate+dt*i);
+ /* Generate more or less appropriate sigma's */
+ for(i=0; i<ncorr; i++) {
+ sig[i] = sqrt(ct_estimate+dt*i);
+ }
- for(j=0; ((j<jmax) && (tStart < tendfit)); j++) {
- /* Use the previous fitparm as starting values for the next fit */
nf_int = min(ncorr,(int)((tStart+1e-4)/dt));
sum = print_and_integrate(debug,nf_int,dt,c1,NULL,1);
tail_corr = do_lmfit(ncorr,c1,sig,dt,NULL,tStart,tendfit,oenv,
#include "smalloc.h"
#include "gstat.h"
#include "gmx_fatal.h"
+#include "index.h"
t_dlist *mk_dlist(FILE *log,
t_atoms *atoms, int *nlist,
gmx_bool bPhi, gmx_bool bPsi, gmx_bool bChi, gmx_bool bHChi,
- int maxchi,int r0,int naa,char **aa)
+ int maxchi, int r0, gmx_residuetype_t rt)
{
int ires,i,j,k,ii;
t_dihatms atm,prev;
}
if ((atm.minC != -1) && (atm.minO != -1))
nc[6]++;
- for(k=0; (k<naa); k++) {
- if (gmx_strcasecmp(aa[k],thisres) == 0)
- break;
- }
- dl[nl].index=k;
+ dl[nl].index=gmx_residuetype_get_index(rt,thisres);
sprintf(dl[nl].name,"%s%d",thisres,ires+r0);
nl++;
sfree(filt);
}
-static void do_fit(FILE *out,int n,gmx_bool bYdy,int ny,real *x0,real **val,
- int npargs,t_pargs *ppa,const output_env_t oenv)
+static void do_fit(FILE *out,int n,gmx_bool bYdy,
+ int ny,real *x0,real **val,
+ int npargs,t_pargs *ppa,const output_env_t oenv)
{
real *c1=NULL,*sig=NULL,*fitparm;
- real dt=0,tendfit,tbeginfit;
+ real tendfit,tbeginfit;
int i,efitfn,nparm;
efitfn = get_acffitfn();
if (opt2parg_bSet("-beginfit",npargs,ppa)) {
tbeginfit = opt2parg_real("-beginfit",npargs,ppa);
} else {
- tbeginfit = x0 ? x0[0] : 0;
+ tbeginfit = x0[0];
}
if (opt2parg_bSet("-endfit",npargs,ppa)) {
tendfit = opt2parg_real("-endfit",npargs,ppa);
} else {
- tendfit = x0 ? x0[ny-1] : (ny-1)*dt;
+ tendfit = x0[ny-1];
}
snew(fitparm,nparm);
fprintf(out,"Starting parameters:\n");
for(i=0; (i<nparm); i++)
fprintf(out,"a%-2d = %12.5e\n",i+1,fitparm[i]);
- if (do_lmfit(ny,c1,sig,dt,x0,tbeginfit,tendfit,
+ if (do_lmfit(ny,c1,sig,0,x0,tbeginfit,tendfit,
oenv,bDebugMode(),efitfn,fitparm,0)) {
for(i=0; (i<nparm); i++)
fprintf(out,"a%-2d = %12.5e\n",i+1,fitparm[i]);
eefile = opt2fn_null("-ee",NFILE,fnm);
balfile = opt2fn_null("-bal",NFILE,fnm);
/* gemfile = opt2fn_null("-gem",NFILE,fnm); */
- if (opt2parg_bSet("-fitfn",npargs,ppa))
- fitfile = opt2fn("-g",NFILE,fnm);
- else
- fitfile = opt2fn_null("-g",NFILE,fnm);
+ /* When doing autocorrelation we don't want a fitlog for fitting
+ * the function itself (not the acf) when the user did not ask for it.
+ */
+ if (opt2parg_bSet("-fitfn",npargs,ppa) && acfile == NULL)
+ {
+ fitfile = opt2fn("-g",NFILE,fnm);
+ }
+ else
+ {
+ fitfile = opt2fn_null("-g",NFILE,fnm);
+ }
- val=read_xvg_time(opt2fn("-f",NFILE,fnm),bHaveT,
- opt2parg_bSet("-b",npargs,ppa),tb,
- opt2parg_bSet("-e",npargs,ppa),te,
- nsets_in,&nset,&n,&dt,&t);
- printf("Read %d sets of %d points, dt = %g\n\n",nset,n,dt);
+ val = read_xvg_time(opt2fn("-f",NFILE,fnm),bHaveT,
+ opt2parg_bSet("-b",npargs,ppa),tb,
+ opt2parg_bSet("-e",npargs,ppa),te,
+ nsets_in,&nset,&n,&dt,&t);
+ printf("Read %d sets of %d points, dt = %g\n\n",nset,n,dt);
- if (bDer) {
- printf("Calculating the derivative as (f[i+%d]-f[i])/(%d*dt)\n\n",
- d,d);
- n -= d;
- for(s=0; s<nset; s++)
- for(i=0; (i<n); i++)
- val[s][i] = (val[s][i+d]-val[s][i])/(d*dt);
- }
- if (bIntegrate) {
- real sum,stddev;
- printf("Calculating the integral using the trapezium rule\n");
-
- if (bXYdy) {
- sum = evaluate_integral(n,t,val[0],val[1],aver_start,&stddev);
- printf("Integral %10.3f +/- %10.5f\n",sum,stddev);
+ if (bDer)
+ {
+ printf("Calculating the derivative as (f[i+%d]-f[i])/(%d*dt)\n\n",
+ d,d);
+ n -= d;
+ for(s=0; s<nset; s++)
+ {
+ for(i=0; (i<n); i++)
+ {
+ val[s][i] = (val[s][i+d]-val[s][i])/(d*dt);
+ }
+ }
}
- else {
- for(s=0; s<nset; s++) {
- sum = evaluate_integral(n,t,val[s],NULL,aver_start,&stddev);
- printf("Integral %d %10.5f +/- %10.5f\n",s+1,sum,stddev);
- }
+
+ if (bIntegrate)
+ {
+ real sum,stddev;
+
+ printf("Calculating the integral using the trapezium rule\n");
+
+ if (bXYdy)
+ {
+ sum = evaluate_integral(n,t,val[0],val[1],aver_start,&stddev);
+ printf("Integral %10.3f +/- %10.5f\n",sum,stddev);
+ }
+ else
+ {
+ for(s=0; s<nset; s++)
+ {
+ sum = evaluate_integral(n,t,val[s],NULL,aver_start,&stddev);
+ printf("Integral %d %10.5f +/- %10.5f\n",s+1,sum,stddev);
+ }
+ }
}
- }
- if (fitfile) {
- out_fit = ffopen(fitfile,"w");
- if (bXYdy && nset>=2) {
- do_fit(out_fit,0,TRUE,n,t,val,npargs,ppa,oenv);
- } else {
- for(s=0; s<nset; s++)
- do_fit(out_fit,s,FALSE,n,t,val,npargs,ppa,oenv);
+
+ if (fitfile != NULL)
+ {
+ out_fit = ffopen(fitfile,"w");
+ if (bXYdy && nset >= 2)
+ {
+ do_fit(out_fit,0,TRUE,n,t,val,npargs,ppa,oenv);
+ }
+ else
+ {
+ for(s=0; s<nset; s++)
+ {
+ do_fit(out_fit,s,FALSE,n,t,val,npargs,ppa,oenv);
+ }
+ }
+ ffclose(out_fit);
}
- ffclose(out_fit);
- }
printf(" std. dev. relative deviation of\n");
printf(" standard --------- cumulants from those of\n");
/* nFitPoints, fit_start, fit_end, oenv); */
if (bPower)
power_fit(n,nset,val,t);
- if (acfile) {
- if (bSubAv)
- for(s=0; s<nset; s++)
- for(i=0; i<n; i++)
- val[s][i] -= av[s];
- do_autocorr(acfile,oenv,"Autocorrelation",n,nset,val,dt,
- eacNormal,bAverCorr);
- }
+
+ if (acfile != NULL)
+ {
+ if (bSubAv)
+ {
+ for(s=0; s<nset; s++)
+ {
+ for(i=0; i<n; i++)
+ {
+ val[s][i] -= av[s];
+ }
+ }
+ }
+ do_autocorr(acfile,oenv,"Autocorrelation",n,nset,val,dt,
+ eacNormal,bAverCorr);
+ }
+
if (bRegression)
regression_analysis(n,bXYdy,t,nset,val);
/* allocation data: (not NULL for data 'owned' by this struct) */
double *du_alloc, *t_alloc; /* allocated delta u arrays */
+ size_t ndu_alloc, nt_alloc; /* pre-allocated sizes */
hist_t *hist_alloc; /* allocated hist */
gmx_large_int_t ntot; /* total number of samples */
s->du_alloc=NULL;
s->t_alloc=NULL;
s->hist_alloc=NULL;
+ s->ndu_alloc=0;
+ s->nt_alloc=0;
s->ntot=0;
s->filename=filename;
printf("\n\n");
}
-static samples_t *read_edr_rawdh_block(int *nsamples, t_enxblock *blk,
- double start_time, double delta_time,
- double native_lambda, double temp,
- const char *filename)
+static void read_edr_rawdh_block(samples_t **smp, int *ndu, t_enxblock *blk,
+ double start_time, double delta_time,
+ double native_lambda, double temp,
+ double *last_t, const char *filename)
{
int j;
gmx_bool allocated;
double foreign_lambda;
int derivative;
- samples_t *s;
+ samples_t *s; /* convenience pointer */
+ int startj;
/* check the block types etc. */
if ( (blk->nsub < 3) ||
derivative = blk->sub[0].ival[0];
foreign_lambda = blk->sub[1].dval[0];
- /* initialize the samples structure */
- snew(s, 1);
- *nsamples=1;
- samples_init(s, native_lambda, foreign_lambda, temp,
- derivative!=0, filename);
+ if (! *smp)
+ {
+ /* initialize the samples structure if it's empty. */
+ snew(*smp, 1);
+ samples_init(*smp, native_lambda, foreign_lambda, temp,
+ derivative!=0, filename);
+ (*smp)->start_time=start_time;
+ (*smp)->delta_time=delta_time;
+ }
- s->start_time=start_time;
- s->delta_time=delta_time;
+ /* set convenience pointer */
+ s=*smp;
+
+ /* now double check */
+ if ( ! lambda_same(s->foreign_lambda, foreign_lambda) ||
+ ( (derivative!=0) != (s->derivative!=0) ) )
+ {
+ fprintf(stderr, "Got foreign lambda=%g, expected: %g\n",
+ s->foreign_lambda, foreign_lambda);
+ fprintf(stderr, "Got derivative=%d, derivative: %d\n",
+ derivative, s->derivative);
+ gmx_fatal(FARGS, "Inconsistent data in file %s around t=%g", filename,
+ start_time);
+ }
/* make room for the data */
- snew(s->du, blk->sub[2].nr);
- s->ndu = blk->sub[2].nr;
- s->ntot = s->ndu;
+ if (s->ndu_alloc < (s->ndu + blk->sub[2].nr) )
+ {
+ s->ndu_alloc += (s->ndu_alloc < blk->sub[2].nr) ?
+ blk->sub[2].nr*2 : s->ndu_alloc;
+ srenew(s->du_alloc, s->ndu_alloc);
+ s->du=s->du_alloc;
+ }
+ startj = s->ndu;
+ s->ndu += blk->sub[2].nr;
+ s->ntot += blk->sub[2].nr;
+ *ndu = blk->sub[2].nr;
/* and copy the data*/
for(j=0;j<blk->sub[2].nr;j++)
{
if (blk->sub[2].type == xdr_datatype_float)
{
- s->du[j] = blk->sub[2].fval[j];
+ s->du[startj+j] = blk->sub[2].fval[j];
}
else
{
- s->du[j] = blk->sub[2].dval[j];
+ s->du[startj+j] = blk->sub[2].dval[j];
}
}
- return s;
+ if (start_time + blk->sub[2].nr*delta_time > *last_t)
+ {
+ *last_t = start_time + blk->sub[2].nr*delta_time;
+ }
}
static samples_t *read_edr_hist_block(int *nsamples, t_enxblock *blk,
double start_time, double delta_time,
double native_lambda, double temp,
- const char *filename)
+ double *last_t, const char *filename)
{
int i,j;
samples_t *s;
}
}
+ if (start_time + s->hist->sum*delta_time > *last_t)
+ {
+ *last_t = start_time + s->hist->sum*delta_time;
+ }
return s;
}
gmx_enxnm_t *enm=NULL;
double first_t=-1;
double last_t=-1;
- int *nhists=NULL;
- int *npts=NULL;
- double *lambdas=NULL;
+ samples_t **samples_rawdh=NULL; /* contains samples for raw delta_h */
+ int *nhists=NULL; /* array to keep count & print at end */
+ int *npts=NULL; /* array to keep count & print at end */
+ double *lambdas=NULL; /* array to keep count & print at end */
double native_lambda=-1;
-
+ double end_time; /* the end time of the last batch of samples */
int nsamples=0;
fp = open_enx(fn,"r");
if (delta_lambda>0)
{
- gmx_fatal(FARGS, "Lambda values change in %s: can't apply BAR method", fn);
+ gmx_fatal(FARGS, "Lambda values not constant in %s: can't apply BAR method", fn);
}
if ( ( *temp != rtemp) && (*temp > 0) )
{
gmx_fatal(FARGS,"Temperature in file %s different from earlier files or setting\n", fn);
}
*temp=rtemp;
- native_lambda=start_lambda;
if (first_t < 0)
first_t=start_time;
if (nsamples > 0)
{
+ /* check the native lambda */
+ if (!lambda_same(start_lambda, native_lambda) )
+ {
+ gmx_fatal(FARGS, "Native lambda not constant in file %s: started at %g, and becomes %g at time %g",
+ fn, native_lambda, start_lambda, start_time);
+ }
/* check the number of samples against the previous number */
if ( ((nblocks_raw+nblocks_hist)!=nsamples) || (nlam!=1 ) )
{
gmx_fatal(FARGS, "Unexpected block count in %s: was %d, now %d\n",
fn, nsamples+1, nblocks_raw+nblocks_hist+nlam);
}
+ /* check whether last iterations's end time matches with
+ the currrent start time */
+ if ( (fabs(last_t - start_time) > 2*delta_time) && last_t>=0)
+ {
+ /* it didn't. We need to store our samples and reallocate */
+ for(i=0;i<nsamples;i++)
+ {
+ if (samples_rawdh[i])
+ {
+ /* insert it into the existing list */
+ lambda_list_insert_sample(lambda_head,
+ samples_rawdh[i]);
+ /* and make sure we'll allocate a new one this time
+ around */
+ samples_rawdh[i]=NULL;
+ }
+ }
+ }
}
else
{
+ /* this is the first round; allocate the associated data
+ structures */
+ native_lambda=start_lambda;
nsamples=nblocks_raw+nblocks_hist;
snew(nhists, nsamples);
snew(npts, nsamples);
snew(lambdas, nsamples);
+ snew(samples_rawdh, nsamples);
for(i=0;i<nsamples;i++)
{
nhists[i]=0;
npts[i]=0;
lambdas[i]=-1;
+ samples_rawdh[i]=NULL; /* init to NULL so we know which
+ ones contain values */
}
}
/* and read them */
- k=0;
+ k=0; /* counter for the lambdas, etc. arrays */
for(i=0;i<fr->nblock;i++)
{
- int j;
- int nb=0;
- samples_t *s=NULL; /* this is where the data will go */
-
if (fr->block[i].id == enxDH)
{
- s=read_edr_rawdh_block(&nb, &(fr->block[i]),
- start_time, delta_time,
- start_lambda, rtemp, fn);
- npts[k] += s->ndu;
- lambdas[k]=s->foreign_lambda;
+ int ndu;
+ read_edr_rawdh_block(&(samples_rawdh[k]),
+ &ndu,
+ &(fr->block[i]),
+ start_time, delta_time,
+ start_lambda, rtemp,
+ &last_t, fn);
+ npts[k] += ndu;
+ if (samples_rawdh[k])
+ {
+ lambdas[k]=samples_rawdh[k]->foreign_lambda;
+ }
k++;
}
else if (fr->block[i].id == enxDHHIST)
{
+ int j;
+ int nb=0;
+ samples_t *s; /* this is where the data will go */
s=read_edr_hist_block(&nb, &(fr->block[i]),
start_time, delta_time,
- start_lambda, rtemp, fn);
+ start_lambda, rtemp,
+ &last_t, fn);
nhists[k] += nb;
if (nb>0)
{
lambdas[k]= s->foreign_lambda;
}
k++;
- }
- for(j=0;j<nb;j++)
- {
- double endt;
- lambda_list_insert_sample(lambda_head, s+j);
- if (s[j].hist)
+ /* and insert the new sample immediately */
+ for(j=0;j<nb;j++)
{
- endt=s[j].hist->sum*delta_time + start_time;
+ lambda_list_insert_sample(lambda_head, s+j);
}
- else
- {
- endt=s[j].ndu*delta_time + start_time;
- }
- if (endt > last_t)
- last_t = endt;
}
}
}
+ /* Now store all our extant sample collections */
+ for(i=0;i<nsamples;i++)
+ {
+ if (samples_rawdh[i])
+ {
+ /* insert it into the existing list */
+ lambda_list_insert_sample(lambda_head, samples_rawdh[i]);
+ }
+ }
+
+
fprintf(stderr, "\n");
printf("%s: %.1f - %.1f; lambda = %.3f\n foreign lambdas:",
fn, first_t, last_t, native_lambda);
return j ;
}
-static void histogramming(FILE *log,int nbin, int naa,char **aa,
+static void histogramming(FILE *log,int nbin,gmx_residuetype_t rt,
int nf,int maxchi,real **dih,
int nlist,t_dlist dlist[],
atom_id index[],
gmx_bool bBfac,bOccup;
char hisfile[256],hhisfile[256],sshisfile[256],title[256],*ss_str=NULL;
char **leg;
-
+ const char *residue_name;
+ int rt_size;
+
+ rt_size = gmx_residuetype_get_size(rt);
if (bSSHisto) {
fp = ffopen(ssdump,"r");
if(1 != fscanf(fp,"%d",&nres))
/* Four dimensional array... Very cool */
snew(his_aa_ss,3);
for(i=0; (i<3); i++) {
- snew(his_aa_ss[i],naa+1);
- for(j=0; (j<=naa); j++) {
+ snew(his_aa_ss[i],rt_size+1);
+ for(j=0; (j<=rt_size); j++) {
snew(his_aa_ss[i][j],edMax);
for(Dih=0; (Dih<edMax); Dih++)
snew(his_aa_ss[i][j][Dih],nbin+1);
}
snew(his_aa,edMax);
for(Dih=0; (Dih<edMax); Dih++) {
- snew(his_aa[Dih],naa+1);
- for(i=0; (i<=naa); i++) {
+ snew(his_aa[Dih],rt_size+1);
+ for(i=0; (i<=rt_size); i++) {
snew(his_aa[Dih][i],nbin+1);
}
}
/* finished -jc stuff */
snew(normhisto,nbin);
- for(i=0; (i<naa); i++) {
+ for(i=0; (i<rt_size); i++) {
for(Dih=0; (Dih<edMax); Dih++){
/* First check whether something is in there */
for(j=0; (j<nbin); j++)
if (bNormalize)
normalize_histo(nbin,his_aa[Dih][i],(360.0/nbin),normhisto);
+ residue_name = gmx_residuetype_get_name(rt,i);
switch (Dih) {
case edPhi:
- sprintf(hisfile,"histo-phi%s",aa[i]);
- sprintf(title,"\\xf\\f{} Distribution for %s",aa[i]);
+ sprintf(hisfile,"histo-phi%s",residue_name);
+ sprintf(title,"\\xf\\f{} Distribution for %s",residue_name);
break;
case edPsi:
- sprintf(hisfile,"histo-psi%s",aa[i]);
- sprintf(title,"\\xy\\f{} Distribution for %s",aa[i]);
+ sprintf(hisfile,"histo-psi%s",residue_name);
+ sprintf(title,"\\xy\\f{} Distribution for %s",residue_name);
break;
case edOmega:
- sprintf(hisfile,"histo-omega%s",aa[i]);
- sprintf(title,"\\xw\\f{} Distribution for %s",aa[i]);
+ sprintf(hisfile,"histo-omega%s",residue_name);
+ sprintf(title,"\\xw\\f{} Distribution for %s",residue_name);
break;
default:
- sprintf(hisfile,"histo-chi%d%s",Dih-NONCHI+1,aa[i]);
+ sprintf(hisfile,"histo-chi%d%s",Dih-NONCHI+1,residue_name);
sprintf(title,"\\xc\\f{}\\s%d\\N Distribution for %s",
- Dih-NONCHI+1,aa[i]);
+ Dih-NONCHI+1,residue_name);
}
strcpy(hhisfile,hisfile);
strcat(hhisfile,".xvg");
if (bSSHisto) {
/* Four dimensional array... Very cool */
for(i=0; (i<3); i++) {
- for(j=0; (j<=naa); j++) {
+ for(j=0; (j<=rt_size); j++) {
for(Dih=0; (Dih<edMax); Dih++)
sfree(his_aa_ss[i][j][Dih]);
sfree(his_aa_ss[i][j]);
};
FILE *log;
- int natoms,nlist,naa,idum,nbin;
+ int natoms,nlist,idum,nbin;
t_atoms atoms;
rvec *x;
int ePBC;
matrix box;
char title[256],grpname[256];
t_dlist *dlist;
- char **aa;
gmx_bool bChi,bCorr,bSSHisto;
gmx_bool bDo_rt, bDo_oh, bDo_ot, bDo_jc ;
real dt=0, traj_t_ns;
output_env_t oenv;
+ gmx_residuetype_t rt;
atom_id isize,*index;
int ndih,nactdih,nf;
read_stx_conf(ftp2fn(efSTX,NFILE,fnm),title,&atoms,x,NULL,&ePBC,box);
fprintf(log,"Title: %s\n",title);
- naa=get_strings("aminoacids.dat",&aa);
- dlist=mk_dlist(log,&atoms,&nlist,bPhi,bPsi,bChi,bHChi,maxchi,r0,naa,aa);
+ gmx_residuetype_init(&rt);
+ dlist=mk_dlist(log,&atoms,&nlist,bPhi,bPsi,bChi,bHChi,maxchi,r0,rt);
fprintf(stderr,"%d residues with dihedrals found\n", nlist);
if (nlist == 0)
dump_em_all(nlist,dlist,nf,time,dih,maxchi,bPhi,bPsi,bChi,bOmega,bRAD,oenv);
/* Histogramming & J coupling constants & calc of S2 order params */
- histogramming(log,nbin,naa,aa,nf,maxchi,dih,nlist,dlist,index,
+ histogramming(log,nbin,rt,nf,maxchi,dih,nlist,dlist,index,
bPhi,bPsi,bOmega,bChi,
bNormHisto,bSSHisto,ftp2fn(efDAT,NFILE,fnm),bfac_max,&atoms,
bDo_jc,opt2fn("-jc",NFILE,fnm),oenv);
if (bCorr)
do_view(oenv,opt2fn("-corr",NFILE,fnm),"-nxy");
+ gmx_residuetype_destroy(rt);
+
thanx(stderr);
return 0;
{
rvec *x0; /* coordinates without pbc */
matrix box; /* box (3x3) */
+ double invvol;
int natoms; /* nr. atoms in trj */
t_trxstatus *status;
int i,n, /* loop indices */
- ax1=0, ax2=0,
nr_frames = 0, /* number of frames */
slice; /* current slice */
t_electron *found; /* found by bsearch */
real t,
z;
- switch(axis) {
- case 0:
- ax1 = 1; ax2 = 2;
- break;
- case 1:
- ax1 = 0; ax2 = 2;
- break;
- case 2:
- ax1 = 0; ax2 = 1;
- break;
- default:
+ if (axis < 0 || axis >= DIM) {
gmx_fatal(FARGS,"Invalid axes. Terminating\n");
}
center_coords(&top->atoms,box,x0,axis);
*slWidth = box[axis][axis]/(*nslices);
+ invvol = *nslices/(box[XX][XX]*box[YY][YY]*box[ZZ][ZZ]);
+
for (n = 0; n < nr_grps; n++) {
for (i = 0; i < gnx[n]; i++) { /* loop over all atoms in index file */
z = x0[index[n][i]][axis];
fprintf(stderr,"Couldn't find %s. Add it to the .dat file\n",
*(top->atoms.atomname[index[n][i]]));
else
- (*slDensity)[n][slice] += found->nr_el -
- top->atoms.atom[index[n][i]].q;
+ (*slDensity)[n][slice] += (found->nr_el -
+ top->atoms.atom[index[n][i]].q)*invvol;
free(sought.atomname);
}
}
for (n =0; n < nr_grps; n++) {
for (i = 0; i < *nslices; i++)
- (*slDensity)[n][i] = (*slDensity)[n][i] * (*nslices) /
- ( nr_frames * box[axis][axis] * box[ax1][ax1] * box[ax2][ax2]);
+ (*slDensity)[n][i] /= nr_frames;
}
sfree(x0); /* free memory used by coordinate array */
{
rvec *x0; /* coordinates without pbc */
matrix box; /* box (3x3) */
+ double invvol;
int natoms; /* nr. atoms in trj */
t_trxstatus *status;
int **slCount, /* nr. of atoms in one slice for a group */
char *buf; /* for tmp. keeping atomname */
gmx_rmpbc_t gpbc=NULL;
- switch(axis) {
- case 0:
- ax1 = 1; ax2 = 2;
- break;
- case 1:
- ax1 = 0; ax2 = 2;
- break;
- case 2:
- ax1 = 0; ax2 = 1;
- break;
- default:
+ if (axis < 0 || axis >= DIM) {
gmx_fatal(FARGS,"Invalid axes. Terminating\n");
}
center_coords(&top->atoms,box,x0,axis);
*slWidth = box[axis][axis]/(*nslices);
+ invvol = *nslices/(box[XX][XX]*box[YY][YY]*box[ZZ][ZZ]);
teller++;
for (n = 0; n < nr_grps; n++) {
/* determine which slice atom is in */
slice = (int)(z / (*slWidth));
- (*slDensity)[n][slice] += top->atoms.atom[index[n][i]].m;
+ (*slDensity)[n][slice] += top->atoms.atom[index[n][i]].m*invvol;
}
}
-
nr_frames++;
} while (read_next_x(oenv,status,&t,natoms,x0,box));
gmx_rmpbc_done(gpbc);
for (n =0; n < nr_grps; n++) {
for (i = 0; i < *nslices; i++) {
- (*slDensity)[n][i] = (*slDensity)[n][i] * (*nslices) /
- (nr_frames * box[axis][axis] * box[ax1][ax1] * box[ax2][ax2]);
+ (*slDensity)[n][i] /= nr_frames;
}
}
-/*
+/* -*- mode: c; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup"; -*-
*
* This source code is part of
*
#define CM2D SPEED_OF_LIGHT*1.0e+24 /* Coulomb meter to Debye */
typedef struct {
- int nelem;
- real spacing,radius;
- real *elem;
- int *count;
- gmx_bool bPhi;
- int nx,ny;
- real **cmap;
+ int nelem;
+ real spacing,radius;
+ real *elem;
+ int *count;
+ gmx_bool bPhi;
+ int nx,ny;
+ real **cmap;
} t_gkrbin;
static t_gkrbin *mk_gkrbin(real radius,real rcmax,gmx_bool bPhi,int ndegrees)
{
- t_gkrbin *gb;
- char *ptr;
- int i;
+ t_gkrbin *gb;
+ char *ptr;
+ int i;
- snew(gb,1);
+ snew(gb,1);
- if ((ptr = getenv("GKRWIDTH")) != NULL) {
- double bw;
-
- sscanf(ptr,"%lf",&bw);
- gb->spacing = bw;
- }
- else
- gb->spacing = 0.01; /* nm */
- gb->nelem = 1 + radius/gb->spacing;
- if (rcmax == 0)
- gb->nx = gb->nelem;
- else
- gb->nx = 1 + rcmax/gb->spacing;
- gb->radius = radius;
- snew(gb->elem,gb->nelem);
- snew(gb->count,gb->nelem);
+ if ((ptr = getenv("GKRWIDTH")) != NULL) {
+ double bw;
+
+ sscanf(ptr,"%lf",&bw);
+ gb->spacing = bw;
+ }
+ else
+ gb->spacing = 0.01; /* nm */
+ gb->nelem = 1 + radius/gb->spacing;
+ if (rcmax == 0)
+ gb->nx = gb->nelem;
+ else
+ gb->nx = 1 + rcmax/gb->spacing;
+ gb->radius = radius;
+ snew(gb->elem,gb->nelem);
+ snew(gb->count,gb->nelem);
- snew(gb->cmap,gb->nx);
- gb->ny = max(2,ndegrees);
- for(i=0; (i<gb->nx); i++)
- snew(gb->cmap[i],gb->ny);
- gb->bPhi = bPhi;
+ snew(gb->cmap,gb->nx);
+ gb->ny = max(2,ndegrees);
+ for(i=0; (i<gb->nx); i++)
+ snew(gb->cmap[i],gb->ny);
+ gb->bPhi = bPhi;
- return gb;
+ return gb;
}
static void done_gkrbin(t_gkrbin **gb)
{
- sfree((*gb)->elem);
- sfree((*gb)->count);
- sfree((*gb));
- *gb = NULL;
+ sfree((*gb)->elem);
+ sfree((*gb)->count);
+ sfree((*gb));
+ *gb = NULL;
}
static void add2gkr(t_gkrbin *gb,real r,real cosa,real phi)
{
- int cy,index = gmx_nint(r/gb->spacing);
- real alpha;
+ int cy,index = gmx_nint(r/gb->spacing);
+ real alpha;
- if (index < gb->nelem) {
- gb->elem[index] += cosa;
- gb->count[index] ++;
- }
- if (index < gb->nx) {
- alpha = acos(cosa);
- if (gb->bPhi)
- cy = (M_PI+phi)*gb->ny/(2*M_PI);
- else
- cy = (alpha*gb->ny)/M_PI;/*((1+cosa)*0.5*(gb->ny));*/
- cy = min(gb->ny-1,max(0,cy));
- if (debug)
- fprintf(debug,"CY: %10f %5d\n",alpha,cy);
- gb->cmap[index][cy] += 1;
- }
+ if (index < gb->nelem) {
+ gb->elem[index] += cosa;
+ gb->count[index] ++;
+ }
+ if (index < gb->nx) {
+ alpha = acos(cosa);
+ if (gb->bPhi)
+ cy = (M_PI+phi)*gb->ny/(2*M_PI);
+ else
+ cy = (alpha*gb->ny)/M_PI;/*((1+cosa)*0.5*(gb->ny));*/
+ cy = min(gb->ny-1,max(0,cy));
+ if (debug)
+ fprintf(debug,"CY: %10f %5d\n",alpha,cy);
+ gb->cmap[index][cy] += 1;
+ }
}
static void rvec2sprvec(rvec dipcart,rvec dipsp)
{
- clear_rvec(dipsp);
- dipsp[0] = sqrt(dipcart[XX]*dipcart[XX]+dipcart[YY]*dipcart[YY]+dipcart[ZZ]*dipcart[ZZ]); /* R */
- dipsp[1] = atan2(dipcart[YY],dipcart[XX]); /* Theta */
- dipsp[2] = atan2(sqrt(dipcart[XX]*dipcart[XX]+dipcart[YY]*dipcart[YY]),dipcart[ZZ]); /* Phi */
+ clear_rvec(dipsp);
+ dipsp[0] = sqrt(dipcart[XX]*dipcart[XX]+dipcart[YY]*dipcart[YY]+dipcart[ZZ]*dipcart[ZZ]); /* R */
+ dipsp[1] = atan2(dipcart[YY],dipcart[XX]); /* Theta */
+ dipsp[2] = atan2(sqrt(dipcart[XX]*dipcart[XX]+dipcart[YY]*dipcart[YY]),dipcart[ZZ]); /* Phi */
}
void do_gkr(t_gkrbin *gb,int ncos,int *ngrp,int *molindex[],
- int mindex[],rvec x[],rvec mu[],
- int ePBC,matrix box,t_atom *atom,int *nAtom)
+ int mindex[],rvec x[],rvec mu[],
+ int ePBC,matrix box,t_atom *atom,int *nAtom)
{
- static rvec *xcm[2] = { NULL, NULL};
- int gi,gj,j0,j1,i,j,k,n,index,grp0,grp1;
- real qtot,q,r2,cosa,rr,phi;
- rvec dx;
- t_pbc pbc;
+ static rvec *xcm[2] = { NULL, NULL};
+ int gi,gj,j0,j1,i,j,k,n,index,grp0,grp1;
+ real qtot,q,r2,cosa,rr,phi;
+ rvec dx;
+ t_pbc pbc;
- for(n=0; (n<ncos); n++) {
- if (!xcm[n])
- snew(xcm[n],ngrp[n]);
- for(i=0; (i<ngrp[n]); i++) {
- /* Calculate center of mass of molecule */
- gi = molindex[n][i];
- j0 = mindex[gi];
+ for(n=0; (n<ncos); n++) {
+ if (!xcm[n])
+ snew(xcm[n],ngrp[n]);
+ for(i=0; (i<ngrp[n]); i++) {
+ /* Calculate center of mass of molecule */
+ gi = molindex[n][i];
+ j0 = mindex[gi];
- if (nAtom[n] > 0)
- copy_rvec(x[j0+nAtom[n]-1],xcm[n][i]);
- else {
- j1 = mindex[gi+1];
- clear_rvec(xcm[n][i]);
- qtot = 0;
- for(j=j0; j<j1; j++) {
- q = fabs(atom[j].q);
- qtot += q;
- for(k=0; k<DIM; k++)
- xcm[n][i][k] += q*x[j][k];
- }
- svmul(1/qtot,xcm[n][i],xcm[n][i]);
- }
+ if (nAtom[n] > 0)
+ copy_rvec(x[j0+nAtom[n]-1],xcm[n][i]);
+ else {
+ j1 = mindex[gi+1];
+ clear_rvec(xcm[n][i]);
+ qtot = 0;
+ for(j=j0; j<j1; j++) {
+ q = fabs(atom[j].q);
+ qtot += q;
+ for(k=0; k<DIM; k++)
+ xcm[n][i][k] += q*x[j][k];
+ }
+ svmul(1/qtot,xcm[n][i],xcm[n][i]);
+ }
+ }
}
- }
- set_pbc(&pbc,ePBC,box);
- grp0 = 0;
- grp1 = ncos-1;
- for(i=0; i<ngrp[grp0]; i++) {
- gi = molindex[grp0][i];
- j0 = (ncos == 2) ? 0 : i+1;
- for(j=j0; j<ngrp[grp1]; j++) {
- gj = molindex[grp1][j];
- if ((iprod(mu[gi],mu[gi]) > 0) && (iprod(mu[gj],mu[gj]) > 0)) {
- /* Compute distance between molecules including PBC */
- pbc_dx(&pbc,xcm[grp0][i],xcm[grp1][j],dx);
- rr = norm(dx);
+ set_pbc(&pbc,ePBC,box);
+ grp0 = 0;
+ grp1 = ncos-1;
+ for(i=0; i<ngrp[grp0]; i++) {
+ gi = molindex[grp0][i];
+ j0 = (ncos == 2) ? 0 : i+1;
+ for(j=j0; j<ngrp[grp1]; j++) {
+ gj = molindex[grp1][j];
+ if ((iprod(mu[gi],mu[gi]) > 0) && (iprod(mu[gj],mu[gj]) > 0)) {
+ /* Compute distance between molecules including PBC */
+ pbc_dx(&pbc,xcm[grp0][i],xcm[grp1][j],dx);
+ rr = norm(dx);
- if (gb->bPhi) {
- rvec xi,xj,xk,xl;
- rvec r_ij,r_kj,r_kl,mm,nn;
- real sign;
- int t1,t2,t3;
+ if (gb->bPhi) {
+ rvec xi,xj,xk,xl;
+ rvec r_ij,r_kj,r_kl,mm,nn;
+ real sign;
+ int t1,t2,t3;
- copy_rvec(xcm[grp0][i],xj);
- copy_rvec(xcm[grp1][j],xk);
- rvec_add(xj,mu[gi],xi);
- rvec_add(xk,mu[gj],xl);
- phi = dih_angle(xi,xj,xk,xl,&pbc,
- r_ij,r_kj,r_kl,mm,nn, /* out */
- &sign,&t1,&t2,&t3);
- cosa = cos(phi);
- }
- else {
- cosa = cos_angle(mu[gi],mu[gj]);
- phi = 0;
- }
- if (debug || (cosa != cosa)) {
- fprintf(debug ? debug : stderr,
- "mu[%d] = %5.2f %5.2f %5.2f |mi| = %5.2f, mu[%d] = %5.2f %5.2f %5.2f |mj| = %5.2f rr = %5.2f cosa = %5.2f\n",
- gi,mu[gi][XX],mu[gi][YY],mu[gi][ZZ],norm(mu[gi]),
- gj,mu[gj][XX],mu[gj][YY],mu[gj][ZZ],norm(mu[gj]),
- rr,cosa);
- }
+ copy_rvec(xcm[grp0][i],xj);
+ copy_rvec(xcm[grp1][j],xk);
+ rvec_add(xj,mu[gi],xi);
+ rvec_add(xk,mu[gj],xl);
+ phi = dih_angle(xi,xj,xk,xl,&pbc,
+ r_ij,r_kj,r_kl,mm,nn, /* out */
+ &sign,&t1,&t2,&t3);
+ cosa = cos(phi);
+ }
+ else {
+ cosa = cos_angle(mu[gi],mu[gj]);
+ phi = 0;
+ }
+ if (debug || (cosa != cosa)) {
+ fprintf(debug ? debug : stderr,
+ "mu[%d] = %5.2f %5.2f %5.2f |mi| = %5.2f, mu[%d] = %5.2f %5.2f %5.2f |mj| = %5.2f rr = %5.2f cosa = %5.2f\n",
+ gi,mu[gi][XX],mu[gi][YY],mu[gi][ZZ],norm(mu[gi]),
+ gj,mu[gj][XX],mu[gj][YY],mu[gj][ZZ],norm(mu[gj]),
+ rr,cosa);
+ }
- add2gkr(gb,rr,cosa,phi);
- }
+ add2gkr(gb,rr,cosa,phi);
+ }
+ }
}
- }
}
static real normalize_cmap(t_gkrbin *gb)
{
- int i,j;
- double hi,vol;
+ int i,j;
+ double hi,vol;
- hi = 0;
- for(i=0; (i<gb->nx); i++) {
- vol = 4*M_PI*sqr(gb->spacing*i)*gb->spacing;
- for(j=0; (j<gb->ny); j++) {
- gb->cmap[i][j] /= vol;
- hi = max(hi,gb->cmap[i][j]);
+ hi = 0;
+ for(i=0; (i<gb->nx); i++) {
+ vol = 4*M_PI*sqr(gb->spacing*i)*gb->spacing;
+ for(j=0; (j<gb->ny); j++) {
+ gb->cmap[i][j] /= vol;
+ hi = max(hi,gb->cmap[i][j]);
+ }
}
- }
- if (hi <= 0)
- gmx_fatal(FARGS,"No data in the cmap");
- return hi;
+ if (hi <= 0)
+ gmx_fatal(FARGS,"No data in the cmap");
+ return hi;
}
static void print_cmap(const char *cmap,t_gkrbin *gb,int *nlevels)
{
- FILE *out;
- int i,j;
- real hi;
+ FILE *out;
+ int i,j;
+ real hi;
- real *xaxis,*yaxis;
- t_rgb rlo = { 1, 1, 1 };
- t_rgb rhi = { 0, 0, 0 };
+ real *xaxis,*yaxis;
+ t_rgb rlo = { 1, 1, 1 };
+ t_rgb rhi = { 0, 0, 0 };
- hi = normalize_cmap(gb);
- snew(xaxis,gb->nx+1);
- for(i=0; (i<gb->nx+1); i++)
- xaxis[i] = i*gb->spacing;
- snew(yaxis,gb->ny);
- for(j=0; (j<gb->ny); j++) {
- if (gb->bPhi)
- yaxis[j] = (360.0*j)/(gb->ny-1.0)-180;
- else
- yaxis[j] = (180.0*j)/(gb->ny-1.0);
- /*2.0*j/(gb->ny-1.0)-1.0;*/
- }
- out = ffopen(cmap,"w");
- write_xpm(out,0,
- "Dipole Orientation Distribution","Fraction","r (nm)",
- gb->bPhi ? "Phi" : "Alpha",
- gb->nx,gb->ny,xaxis,yaxis,
- gb->cmap,0,hi,rlo,rhi,nlevels);
- ffclose(out);
- sfree(xaxis);
- sfree(yaxis);
+ hi = normalize_cmap(gb);
+ snew(xaxis,gb->nx+1);
+ for(i=0; (i<gb->nx+1); i++)
+ xaxis[i] = i*gb->spacing;
+ snew(yaxis,gb->ny);
+ for(j=0; (j<gb->ny); j++) {
+ if (gb->bPhi)
+ yaxis[j] = (360.0*j)/(gb->ny-1.0)-180;
+ else
+ yaxis[j] = (180.0*j)/(gb->ny-1.0);
+ /*2.0*j/(gb->ny-1.0)-1.0;*/
+ }
+ out = ffopen(cmap,"w");
+ write_xpm(out,0,
+ "Dipole Orientation Distribution","Fraction","r (nm)",
+ gb->bPhi ? "Phi" : "Alpha",
+ gb->nx,gb->ny,xaxis,yaxis,
+ gb->cmap,0,hi,rlo,rhi,nlevels);
+ ffclose(out);
+ sfree(xaxis);
+ sfree(yaxis);
}
static void print_gkrbin(const char *fn,t_gkrbin *gb,
- int ngrp,int nframes,real volume,
+ int ngrp,int nframes,real volume,
const output_env_t oenv)
{
- /* We compute Gk(r), gOO and hOO according to
- * Nymand & Linse, JCP 112 (2000) pp 6386-6395.
- * In this implementation the angle between dipoles is stored
- * rather than their inner product. This allows to take polarizible
- * models into account. The RDF is calculated as well, almost for free!
- */
- FILE *fp;
- const char *leg[] = { "G\\sk\\N(r)", "< cos >", "h\\sOO\\N", "g\\sOO\\N", "Energy" };
- int i,j,n,last;
- real x0,x1,ggg,Gkr,vol_s,rho,gOO,hOO,cosav,ener;
- double fac;
+ /* We compute Gk(r), gOO and hOO according to
+ * Nymand & Linse, JCP 112 (2000) pp 6386-6395.
+ * In this implementation the angle between dipoles is stored
+ * rather than their inner product. This allows to take polarizible
+ * models into account. The RDF is calculated as well, almost for free!
+ */
+ FILE *fp;
+ const char *leg[] = { "G\\sk\\N(r)", "< cos >", "h\\sOO\\N", "g\\sOO\\N", "Energy" };
+ int i,j,n,last;
+ real x0,x1,ggg,Gkr,vol_s,rho,gOO,hOO,cosav,ener;
+ double fac;
- fp=xvgropen(fn,"Distance dependent Gk","r (nm)","G\\sk\\N(r)",oenv);
- xvgr_legend(fp,asize(leg),leg,oenv);
+ fp=xvgropen(fn,"Distance dependent Gk","r (nm)","G\\sk\\N(r)",oenv);
+ xvgr_legend(fp,asize(leg),leg,oenv);
- Gkr = 1; /* Self-dipole inproduct = 1 */
- rho = ngrp/volume;
+ Gkr = 1; /* Self-dipole inproduct = 1 */
+ rho = ngrp/volume;
- if (debug) {
- fprintf(debug,"Number density is %g molecules / nm^3\n",rho);
- fprintf(debug,"ngrp = %d, nframes = %d\n",ngrp,nframes);
- }
+ if (debug) {
+ fprintf(debug,"Number density is %g molecules / nm^3\n",rho);
+ fprintf(debug,"ngrp = %d, nframes = %d\n",ngrp,nframes);
+ }
- last = gb->nelem-1;
- while(last>1 && gb->elem[last-1]==0)
- last--;
-
- /* Divide by dipole squared, by number of frames, by number of origins.
- * Multiply by 2 because we only take half the matrix of interactions
- * into account.
- */
- fac = 2.0/((double) ngrp * (double) nframes);
-
- x0 = 0;
- for(i=0; i<last; i++) {
- /* Centre of the coordinate in the spherical layer */
- x1 = x0+gb->spacing;
+ last = gb->nelem-1;
+ while(last>1 && gb->elem[last-1]==0)
+ last--;
+
+ /* Divide by dipole squared, by number of frames, by number of origins.
+ * Multiply by 2 because we only take half the matrix of interactions
+ * into account.
+ */
+ fac = 2.0/((double) ngrp * (double) nframes);
+
+ x0 = 0;
+ for(i=0; i<last; i++) {
+ /* Centre of the coordinate in the spherical layer */
+ x1 = x0+gb->spacing;
- /* Volume of the layer */
- vol_s = (4.0/3.0)*M_PI*(x1*x1*x1-x0*x0*x0);
+ /* Volume of the layer */
+ vol_s = (4.0/3.0)*M_PI*(x1*x1*x1-x0*x0*x0);
- /* gOO */
- gOO = gb->count[i]*fac/(rho*vol_s);
+ /* gOO */
+ gOO = gb->count[i]*fac/(rho*vol_s);
- /* Dipole correlation hOO, normalized by the relative number density, like
- * in a Radial distribution function.
- */
- ggg = gb->elem[i]*fac;
- hOO = 3.0*ggg/(rho*vol_s);
- Gkr += ggg;
- if (gb->count[i])
- cosav = gb->elem[i]/gb->count[i];
- else
- cosav = 0;
- ener = -0.5*cosav*ONE_4PI_EPS0/(x1*x1*x1);
+ /* Dipole correlation hOO, normalized by the relative number density, like
+ * in a Radial distribution function.
+ */
+ ggg = gb->elem[i]*fac;
+ hOO = 3.0*ggg/(rho*vol_s);
+ Gkr += ggg;
+ if (gb->count[i])
+ cosav = gb->elem[i]/gb->count[i];
+ else
+ cosav = 0;
+ ener = -0.5*cosav*ONE_4PI_EPS0/(x1*x1*x1);
- fprintf(fp,"%10.5e %12.5e %12.5e %12.5e %12.5e %12.5e\n",
- x1,Gkr,cosav,hOO,gOO,ener);
+ fprintf(fp,"%10.5e %12.5e %12.5e %12.5e %12.5e %12.5e\n",
+ x1,Gkr,cosav,hOO,gOO,ener);
- /* Swap x0 and x1 */
- x0 = x1;
- }
- ffclose(fp);
+ /* Swap x0 and x1 */
+ x0 = x1;
+ }
+ ffclose(fp);
}
gmx_bool read_mu_from_enx(ener_file_t fmu,int Vol,ivec iMu,rvec mu,real *vol,
- real *t, int nre,t_enxframe *fr)
+ real *t, int nre,t_enxframe *fr)
{
- int i;
- gmx_bool bCont;
- char buf[22];
-
- bCont = do_enx(fmu,fr);
- if (fr->nre != nre)
- fprintf(stderr,"Something strange: expected %d entries in energy file at step %s\n(time %g) but found %d entries\n",
- nre,gmx_step_str(fr->step,buf),fr->t,fr->nre);
+ int i;
+ gmx_bool bCont;
+ char buf[22];
+
+ bCont = do_enx(fmu,fr);
+ if (fr->nre != nre)
+ fprintf(stderr,"Something strange: expected %d entries in energy file at step %s\n(time %g) but found %d entries\n",
+ nre,gmx_step_str(fr->step,buf),fr->t,fr->nre);
- if (bCont) {
- if (Vol != -1) /* we've got Volume in the energy file */
- *vol = fr->ener[Vol].e;
- for (i=0; i<DIM; i++)
- mu[i] = fr->ener[iMu[i]].e;
- *t = fr->t;
- }
+ if (bCont) {
+ if (Vol != -1) /* we've got Volume in the energy file */
+ *vol = fr->ener[Vol].e;
+ for (i=0; i<DIM; i++)
+ mu[i] = fr->ener[iMu[i]].e;
+ *t = fr->t;
+ }
- return bCont;
+ return bCont;
}
static void neutralize_mols(int n,int *index,t_block *mols,t_atom *atom)
{
- double mtot,qtot;
- int ncharged,m,a0,a1,a;
-
- ncharged = 0;
- for(m=0; m<n; m++) {
- a0 = mols->index[index[m]];
- a1 = mols->index[index[m]+1];
- mtot = 0;
- qtot = 0;
- for(a=a0; a<a1; a++) {
- mtot += atom[a].m;
- qtot += atom[a].q;
+ double mtot,qtot;
+ int ncharged,m,a0,a1,a;
+
+ ncharged = 0;
+ for(m=0; m<n; m++) {
+ a0 = mols->index[index[m]];
+ a1 = mols->index[index[m]+1];
+ mtot = 0;
+ qtot = 0;
+ for(a=a0; a<a1; a++) {
+ mtot += atom[a].m;
+ qtot += atom[a].q;
+ }
+ /* This check is only for the count print */
+ if (fabs(qtot) > 0.01)
+ ncharged++;
+ if (mtot > 0) {
+ /* Remove the net charge at the center of mass */
+ for(a=a0; a<a1; a++)
+ atom[a].q -= qtot*atom[a].m/mtot;
+ }
}
- /* This check is only for the count print */
- if (fabs(qtot) > 0.01)
- ncharged++;
- if (mtot > 0) {
- /* Remove the net charge at the center of mass */
- for(a=a0; a<a1; a++)
- atom[a].q -= qtot*atom[a].m/mtot;
- }
- }
- if (ncharged)
- printf("There are %d charged molecules in the selection,\n"
- "will subtract their charge at their center of mass\n",ncharged);
+ if (ncharged)
+ printf("There are %d charged molecules in the selection,\n"
+ "will subtract their charge at their center of mass\n",ncharged);
}
static void mol_dip(int k0,int k1,rvec x[],t_atom atom[],rvec mu)
{
- int k,m;
- real q;
+ int k,m;
+ real q;
- clear_rvec(mu);
- for(k=k0; (k<k1); k++) {
- q = e2d(atom[k].q);
- for(m=0; (m<DIM); m++)
- mu[m] += q*x[k][m];
- }
+ clear_rvec(mu);
+ for(k=k0; (k<k1); k++) {
+ q = e2d(atom[k].q);
+ for(m=0; (m<DIM); m++)
+ mu[m] += q*x[k][m];
+ }
}
static void mol_quad(int k0,int k1,rvec x[],t_atom atom[],rvec quad)
{
- int i,k,m,n,niter;
- real q,r2,mass,masstot;
- rvec com; /* center of mass */
- rvec r; /* distance of atoms to center of mass */
- real rcom_m,rcom_n;
- double **inten;
- double dd[DIM],**ev,tmp;
-
- snew(inten,DIM);
- snew(ev,DIM);
- for(i=0; (i<DIM); i++) {
- snew(inten[i],DIM);
- snew(ev[i],DIM);
- dd[i]=0.0;
- }
-
- /* Compute center of mass */
- clear_rvec(com);
- masstot = 0.0;
- for(k=k0; (k<k1); k++) {
- mass = atom[k].m;
- masstot += mass;
- for(i=0; (i<DIM); i++)
- com[i] += mass*x[k][i];
- }
- svmul((1.0/masstot),com,com);
-
- /* We want traceless quadrupole moments, so let us calculate the complete
- * quadrupole moment tensor and diagonalize this tensor to get
- * the individual components on the diagonal.
- */
+ int i,k,m,n,niter;
+ real q,r2,mass,masstot;
+ rvec com; /* center of mass */
+ rvec r; /* distance of atoms to center of mass */
+ real rcom_m,rcom_n;
+ double **inten;
+ double dd[DIM],**ev,tmp;
+
+ snew(inten,DIM);
+ snew(ev,DIM);
+ for(i=0; (i<DIM); i++) {
+ snew(inten[i],DIM);
+ snew(ev[i],DIM);
+ dd[i]=0.0;
+ }
+
+ /* Compute center of mass */
+ clear_rvec(com);
+ masstot = 0.0;
+ for(k=k0; (k<k1); k++) {
+ mass = atom[k].m;
+ masstot += mass;
+ for(i=0; (i<DIM); i++)
+ com[i] += mass*x[k][i];
+ }
+ svmul((1.0/masstot),com,com);
+
+ /* We want traceless quadrupole moments, so let us calculate the complete
+ * quadrupole moment tensor and diagonalize this tensor to get
+ * the individual components on the diagonal.
+ */
#define delta(a,b) (( a == b ) ? 1.0 : 0.0)
- for(m=0; (m<DIM); m++)
- for(n=0; (n<DIM); n++)
- inten[m][n] = 0;
- for(k=k0; (k<k1); k++) { /* loop over atoms in a molecule */
- q = (atom[k].q)*100.0;
- rvec_sub(x[k],com,r);
- r2 = iprod(r,r);
- for(m=0; (m<DIM); m++)
- for(n=0; (n<DIM); n++)
- inten[m][n] += 0.5*q*(3.0*r[m]*r[n] - r2*delta(m,n))*EANG2CM*CM2D;
- }
- if (debug)
- for(i=0; (i<DIM); i++)
- fprintf(debug,"Q[%d] = %8.3f %8.3f %8.3f\n",
- i,inten[i][XX],inten[i][YY],inten[i][ZZ]);
+ for(m=0; (m<DIM); m++)
+ for(n=0; (n<DIM); n++)
+ inten[m][n] = 0;
+ for(k=k0; (k<k1); k++) { /* loop over atoms in a molecule */
+ q = (atom[k].q)*100.0;
+ rvec_sub(x[k],com,r);
+ r2 = iprod(r,r);
+ for(m=0; (m<DIM); m++)
+ for(n=0; (n<DIM); n++)
+ inten[m][n] += 0.5*q*(3.0*r[m]*r[n] - r2*delta(m,n))*EANG2CM*CM2D;
+ }
+ if (debug)
+ for(i=0; (i<DIM); i++)
+ fprintf(debug,"Q[%d] = %8.3f %8.3f %8.3f\n",
+ i,inten[i][XX],inten[i][YY],inten[i][ZZ]);
- /* We've got the quadrupole tensor, now diagonalize the sucker */
- jacobi(inten,3,dd,ev,&niter);
+ /* We've got the quadrupole tensor, now diagonalize the sucker */
+ jacobi(inten,3,dd,ev,&niter);
+
+ if (debug) {
+ for(i=0; (i<DIM); i++)
+ fprintf(debug,"ev[%d] = %8.3f %8.3f %8.3f\n",
+ i,ev[i][XX],ev[i][YY],ev[i][ZZ]);
+ for(i=0; (i<DIM); i++)
+ fprintf(debug,"Q'[%d] = %8.3f %8.3f %8.3f\n",
+ i,inten[i][XX],inten[i][YY],inten[i][ZZ]);
+ }
+ /* Sort the eigenvalues, for water we know that the order is as follows:
+ *
+ * Q_yy, Q_zz, Q_xx
+ *
+ * At the moment I have no idea how this will work out for other molecules...
+ */
- if (debug) {
- for(i=0; (i<DIM); i++)
- fprintf(debug,"ev[%d] = %8.3f %8.3f %8.3f\n",
- i,ev[i][XX],ev[i][YY],ev[i][ZZ]);
- for(i=0; (i<DIM); i++)
- fprintf(debug,"Q'[%d] = %8.3f %8.3f %8.3f\n",
- i,inten[i][XX],inten[i][YY],inten[i][ZZ]);
- }
- /* Sort the eigenvalues, for water we know that the order is as follows:
- *
- * Q_yy, Q_zz, Q_xx
- *
- * At the moment I have no idea how this will work out for other molecules...
- */
-
-#define SWAP(i) \
- if (dd[i+1] > dd[i]) { \
- tmp=dd[i]; \
- dd[i]=dd[i+1]; \
- dd[i+1]=tmp; \
- }
- SWAP(0);
- SWAP(1);
- SWAP(0);
-
- for(m=0; (m<DIM); m++) {
- quad[0]=dd[2]; /* yy */
- quad[1]=dd[0]; /* zz */
- quad[2]=dd[1]; /* xx */
- }
-
- if (debug)
- pr_rvec(debug,0,"Quadrupole",quad,DIM,TRUE);
-
- /* clean-up */
- for(i=0; (i<DIM); i++) {
- sfree(inten[i]);
- sfree(ev[i]);
- }
- sfree(inten);
- sfree(ev);
+#define SWAP(i) \
+ if (dd[i+1] > dd[i]) { \
+ tmp=dd[i]; \
+ dd[i]=dd[i+1]; \
+ dd[i+1]=tmp; \
+ }
+ SWAP(0);
+ SWAP(1);
+ SWAP(0);
+
+ for(m=0; (m<DIM); m++) {
+ quad[0]=dd[2]; /* yy */
+ quad[1]=dd[0]; /* zz */
+ quad[2]=dd[1]; /* xx */
+ }
+
+ if (debug)
+ pr_rvec(debug,0,"Quadrupole",quad,DIM,TRUE);
+
+ /* clean-up */
+ for(i=0; (i<DIM); i++) {
+ sfree(inten[i]);
+ sfree(ev[i]);
+ }
+ sfree(inten);
+ sfree(ev);
}
/*
*/
real calc_eps(double M_diff,double volume,double epsRF,double temp)
{
- double eps,A,teller,noemer;
- double eps_0=8.854187817e-12; /* epsilon_0 in C^2 J^-1 m^-1 */
- double fac=1.112650021e-59; /* converts Debye^2 to C^2 m^2 */
+ double eps,A,teller,noemer;
+ double eps_0=8.854187817e-12; /* epsilon_0 in C^2 J^-1 m^-1 */
+ double fac=1.112650021e-59; /* converts Debye^2 to C^2 m^2 */
- A = M_diff*fac/(3*eps_0*volume*NANO*NANO*NANO*BOLTZMANN*temp);
+ A = M_diff*fac/(3*eps_0*volume*NANO*NANO*NANO*BOLTZMANN*temp);
- if (epsRF == 0.0) {
- teller = 1 + A;
- noemer = 1;
- } else {
- teller = 1 + (A*2*epsRF/(2*epsRF+1));
- noemer = 1 - (A/(2*epsRF+1));
- }
- eps = teller / noemer;
-
- return eps;
+ if (epsRF == 0.0) {
+ teller = 1 + A;
+ noemer = 1;
+ } else {
+ teller = 1 + (A*2*epsRF/(2*epsRF+1));
+ noemer = 1 - (A/(2*epsRF+1));
+ }
+ eps = teller / noemer;
+
+ return eps;
}
static void update_slab_dipoles(int k0,int k1,rvec x[],rvec mu,
- int idim,int nslice,rvec slab_dipole[],
- matrix box)
+ int idim,int nslice,rvec slab_dipole[],
+ matrix box)
{
- int k;
- real xdim=0;
+ int k;
+ real xdim=0;
- for(k=k0; (k<k1); k++)
- xdim += x[k][idim];
- xdim /= (k1-k0);
- k = ((int)(xdim*nslice/box[idim][idim] + nslice)) % nslice;
- rvec_inc(slab_dipole[k],mu);
+ for(k=k0; (k<k1); k++)
+ xdim += x[k][idim];
+ xdim /= (k1-k0);
+ k = ((int)(xdim*nslice/box[idim][idim] + nslice)) % nslice;
+ rvec_inc(slab_dipole[k],mu);
}
static void dump_slab_dipoles(const char *fn,int idim,int nslice,
rvec slab_dipole[], matrix box,int nframes,
const output_env_t oenv)
{
- FILE *fp;
- char buf[STRLEN];
- int i;
- real mutot;
- const char *leg_dim[4] = {
- "\\f{12}m\\f{4}\\sX\\N",
- "\\f{12}m\\f{4}\\sY\\N",
- "\\f{12}m\\f{4}\\sZ\\N",
- "\\f{12}m\\f{4}\\stot\\N"
- };
+ FILE *fp;
+ char buf[STRLEN];
+ int i;
+ real mutot;
+ const char *leg_dim[4] = {
+ "\\f{12}m\\f{4}\\sX\\N",
+ "\\f{12}m\\f{4}\\sY\\N",
+ "\\f{12}m\\f{4}\\sZ\\N",
+ "\\f{12}m\\f{4}\\stot\\N"
+ };
- sprintf(buf,"Box-%c (nm)",'X'+idim);
- fp = xvgropen(fn,"Average dipole moment per slab",buf,"\\f{12}m\\f{4} (D)",
- oenv);
- xvgr_legend(fp,DIM,leg_dim,oenv);
- for(i=0; (i<nslice); i++) {
- mutot = norm(slab_dipole[i])/nframes;
- fprintf(fp,"%10.3f %10.3f %10.3f %10.3f %10.3f\n",
- ((i+0.5)*box[idim][idim])/nslice,
- slab_dipole[i][XX]/nframes,
- slab_dipole[i][YY]/nframes,
- slab_dipole[i][ZZ]/nframes,
- mutot);
- }
- ffclose(fp);
- do_view(oenv,fn,"-autoscale xy -nxy");
+ sprintf(buf,"Box-%c (nm)",'X'+idim);
+ fp = xvgropen(fn,"Average dipole moment per slab",buf,"\\f{12}m\\f{4} (D)",
+ oenv);
+ xvgr_legend(fp,DIM,leg_dim,oenv);
+ for(i=0; (i<nslice); i++) {
+ mutot = norm(slab_dipole[i])/nframes;
+ fprintf(fp,"%10.3f %10.3f %10.3f %10.3f %10.3f\n",
+ ((i+0.5)*box[idim][idim])/nslice,
+ slab_dipole[i][XX]/nframes,
+ slab_dipole[i][YY]/nframes,
+ slab_dipole[i][ZZ]/nframes,
+ mutot);
+ }
+ ffclose(fp);
+ do_view(oenv,fn,"-autoscale xy -nxy");
}
static void compute_avercos(int n,rvec dip[],real *dd,rvec axis,gmx_bool bPairs)
{
- int i,j,k;
- double dc,dc1,d,n5,ddc1,ddc2,ddc3;
- rvec xxx = { 1, 0, 0 };
- rvec yyy = { 0, 1, 0 };
- rvec zzz = { 0, 0, 1 };
+ int i,j,k;
+ double dc,dc1,d,n5,ddc1,ddc2,ddc3;
+ rvec xxx = { 1, 0, 0 };
+ rvec yyy = { 0, 1, 0 };
+ rvec zzz = { 0, 0, 1 };
- d=0;
- ddc1 = ddc2 = ddc3 = 0;
- for(i=k=0; (i<n); i++) {
- ddc1 += fabs(cos_angle(dip[i],xxx));
- ddc2 += fabs(cos_angle(dip[i],yyy));
- ddc3 += fabs(cos_angle(dip[i],zzz));
- if (bPairs)
- for(j=i+1; (j<n); j++,k++) {
- dc = cos_angle(dip[i],dip[j]);
- d += fabs(dc);
- }
- }
- *dd = d/k;
- axis[XX] = ddc1/n;
- axis[YY] = ddc2/n;
- axis[ZZ] = ddc3/n;
+ d=0;
+ ddc1 = ddc2 = ddc3 = 0;
+ for(i=k=0; (i<n); i++)
+ {
+ ddc1 += fabs(cos_angle(dip[i],xxx));
+ ddc2 += fabs(cos_angle(dip[i],yyy));
+ ddc3 += fabs(cos_angle(dip[i],zzz));
+ if (bPairs)
+ for(j=i+1; (j<n); j++,k++)
+ {
+ dc = cos_angle(dip[i],dip[j]);
+ d += fabs(dc);
+ }
+ }
+ *dd = d/k;
+ axis[XX] = ddc1/n;
+ axis[YY] = ddc2/n;
+ axis[ZZ] = ddc3/n;
}
static void do_dip(t_topology *top,int ePBC,real volume,
- const char *fn,
- const char *out_mtot,const char *out_eps,
+ const char *fn,
+ const char *out_mtot,const char *out_eps,
const char *out_aver, const char *dipdist,
- const char *cosaver, const char *fndip3d,
- const char *fnadip, gmx_bool bPairs,
- const char *corrtype,const char *corf,
- gmx_bool bGkr, const char *gkrfn,
- gmx_bool bPhi, int *nlevels, int ndegrees,
- int ncos,
- const char *cmap, real rcmax,
- gmx_bool bQuad, const char *quadfn,
- gmx_bool bMU, const char *mufn,
- int *gnx, int *molindex[],
- real mu_max, real mu_aver,
- real epsilonRF,real temp,
- int *gkatom, int skip,
- gmx_bool bSlab, int nslices,
- const char *axtitle, const char *slabfn,
+ const char *cosaver, const char *fndip3d,
+ const char *fnadip, gmx_bool bPairs,
+ const char *corrtype,const char *corf,
+ gmx_bool bGkr, const char *gkrfn,
+ gmx_bool bPhi, int *nlevels, int ndegrees,
+ int ncos,
+ const char *cmap, real rcmax,
+ gmx_bool bQuad, const char *quadfn,
+ gmx_bool bMU, const char *mufn,
+ int *gnx, int *molindex[],
+ real mu_max, real mu_aver,
+ real epsilonRF,real temp,
+ int *gkatom, int skip,
+ gmx_bool bSlab, int nslices,
+ const char *axtitle, const char *slabfn,
const output_env_t oenv)
{
- const char *leg_mtot[] = {
- "M\\sx \\N",
- "M\\sy \\N",
- "M\\sz \\N",
- "|M\\stot \\N|"
- };
+ const char *leg_mtot[] = {
+ "M\\sx \\N",
+ "M\\sy \\N",
+ "M\\sz \\N",
+ "|M\\stot \\N|"
+ };
#define NLEGMTOT asize(leg_mtot)
- const char *leg_eps[] = {
- "epsilon",
- "G\\sk",
- "g\\sk"
- };
+ const char *leg_eps[] = {
+ "epsilon",
+ "G\\sk",
+ "g\\sk"
+ };
#define NLEGEPS asize(leg_eps)
- const char *leg_aver[] = {
- "< |M|\\S2\\N >",
- "< |M| >\\S2\\N",
- "< |M|\\S2\\N > - < |M| >\\S2\\N",
- "< |M| >\\S2\\N / < |M|\\S2\\N >"
- };
+ const char *leg_aver[] = {
+ "< |M|\\S2\\N >",
+ "< |M| >\\S2\\N",
+ "< |M|\\S2\\N > - < |M| >\\S2\\N",
+ "< |M| >\\S2\\N / < |M|\\S2\\N >"
+ };
#define NLEGAVER asize(leg_aver)
- const char *leg_cosaver[] = {
- "\\f{4}<|cos\\f{12}q\\f{4}\\sij\\N|>",
- "RMSD cos",
- "\\f{4}<|cos\\f{12}q\\f{4}\\siX\\N|>",
- "\\f{4}<|cos\\f{12}q\\f{4}\\siY\\N|>",
- "\\f{4}<|cos\\f{12}q\\f{4}\\siZ\\N|>"
- };
+ const char *leg_cosaver[] = {
+ "\\f{4}<|cos\\f{12}q\\f{4}\\sij\\N|>",
+ "RMSD cos",
+ "\\f{4}<|cos\\f{12}q\\f{4}\\siX\\N|>",
+ "\\f{4}<|cos\\f{12}q\\f{4}\\siY\\N|>",
+ "\\f{4}<|cos\\f{12}q\\f{4}\\siZ\\N|>"
+ };
#define NLEGCOSAVER asize(leg_cosaver)
- const char *leg_adip[] = {
- "<mu>",
- "Std. Dev.",
- "Error"
- };
+ const char *leg_adip[] = {
+ "<mu>",
+ "Std. Dev.",
+ "Error"
+ };
#define NLEGADIP asize(leg_adip)
- FILE *outdd,*outmtot,*outaver,*outeps,*caver=NULL;
- FILE *dip3d=NULL,*adip=NULL;
- rvec *x,*dipole=NULL,mu_t,quad,*dipsp=NULL;
- t_gkrbin *gkrbin = NULL;
- gmx_enxnm_t *enm=NULL;
- t_enxframe *fr;
- int nframes=1000,nre,timecheck=0,ncolour=0;
- ener_file_t fmu=NULL;
- int i,j,k,n,m,natom=0,nmol,gnx_tot,teller,tel3;
- t_trxstatus *status;
- int *dipole_bin,ndipbin,ibin,iVol,step,idim=-1;
- unsigned long mode;
- char buf[STRLEN];
- real rcut=0,t,t0,t1,dt,lambda,dd,rms_cos;
- rvec dipaxis;
- matrix box;
- gmx_bool bCorr,bTotal,bCont;
- double M_diff=0,epsilon,invtel,vol_aver;
- double mu_ave,mu_mol,M2_ave=0,M_ave2=0,M_av[DIM],M_av2[DIM];
- double M[3],M2[3],M4[3],Gk=0,g_k=0;
- gmx_stats_t Mx,My,Mz,Msq,Vol,*Qlsq,mulsq,muframelsq=NULL;
- ivec iMu;
- real **muall=NULL;
- rvec *slab_dipoles=NULL;
- t_atom *atom=NULL;
- t_block *mols=NULL;
- gmx_rmpbc_t gpbc=NULL;
-
- gnx_tot = gnx[0];
- if (ncos > 1) {
- gnx_tot += gnx[1];
- }
-
- vol_aver = 0.0;
+ FILE *outdd,*outmtot,*outaver,*outeps,*caver=NULL;
+ FILE *dip3d=NULL,*adip=NULL;
+ rvec *x,*dipole=NULL,mu_t,quad,*dipsp=NULL;
+ t_gkrbin *gkrbin = NULL;
+ gmx_enxnm_t *enm=NULL;
+ t_enxframe *fr;
+ int nframes=1000,nre,timecheck=0,ncolour=0;
+ ener_file_t fmu=NULL;
+ int i,j,k,n,m,natom=0,nmol,gnx_tot,teller,tel3;
+ t_trxstatus *status;
+ int *dipole_bin,ndipbin,ibin,iVol,step,idim=-1;
+ unsigned long mode;
+ char buf[STRLEN];
+ real rcut=0,t,t0,t1,dt,lambda,dd,rms_cos;
+ rvec dipaxis;
+ matrix box;
+ gmx_bool bCorr,bTotal,bCont;
+ double M_diff=0,epsilon,invtel,vol_aver;
+ double mu_ave,mu_mol,M2_ave=0,M_ave2=0,M_av[DIM],M_av2[DIM];
+ double M[3],M2[3],M4[3],Gk=0,g_k=0;
+ gmx_stats_t Mx,My,Mz,Msq,Vol,*Qlsq,mulsq,muframelsq=NULL;
+ ivec iMu;
+ real **muall=NULL;
+ rvec *slab_dipoles=NULL;
+ t_atom *atom=NULL;
+ t_block *mols=NULL;
+ gmx_rmpbc_t gpbc=NULL;
+
+ gnx_tot = gnx[0];
+ if (ncos > 1) {
+ gnx_tot += gnx[1];
+ }
+
+ vol_aver = 0.0;
- iVol=-1;
- if (bMU) {
- fmu = open_enx(mufn,"r");
- do_enxnms(fmu,&nre,&enm);
-
- /* Determine the indexes of the energy grps we need */
- for (i=0; (i<nre); i++) {
- if (strstr(enm[i].name,"Volume"))
- iVol=i;
- else if (strstr(enm[i].name,"Mu-X"))
- iMu[XX]=i;
- else if (strstr(enm[i].name,"Mu-Y"))
- iMu[YY]=i;
- else if (strstr(enm[i].name,"Mu-Z"))
- iMu[ZZ]=i;
+ iVol=-1;
+ if (bMU)
+ {
+ fmu = open_enx(mufn,"r");
+ do_enxnms(fmu,&nre,&enm);
+
+ /* Determine the indexes of the energy grps we need */
+ for (i=0; (i<nre); i++) {
+ if (strstr(enm[i].name,"Volume"))
+ iVol=i;
+ else if (strstr(enm[i].name,"Mu-X"))
+ iMu[XX]=i;
+ else if (strstr(enm[i].name,"Mu-Y"))
+ iMu[YY]=i;
+ else if (strstr(enm[i].name,"Mu-Z"))
+ iMu[ZZ]=i;
+ }
}
- }
- else {
- atom = top->atoms.atom;
- mols = &(top->mols);
- }
-
- if (iVol == -1)
- printf("Using Volume from topology: %g nm^3\n",volume);
-
- /* Correlation stuff */
- bCorr = (corrtype[0] != 'n');
- bTotal = (corrtype[0] == 't');
- if (bCorr) {
- if (bTotal) {
- snew(muall,1);
- snew(muall[0],nframes*DIM);
+ else
+ {
+ atom = top->atoms.atom;
+ mols = &(top->mols);
}
- else {
- snew(muall,gnx[0]);
- for(i=0; (i<gnx[0]); i++)
- snew(muall[i],nframes*DIM);
+
+ if (iVol == -1)
+ printf("Using Volume from topology: %g nm^3\n",volume);
+
+ /* Correlation stuff */
+ bCorr = (corrtype[0] != 'n');
+ bTotal = (corrtype[0] == 't');
+ if (bCorr)
+ {
+ if (bTotal)
+ {
+ snew(muall,1);
+ snew(muall[0],nframes*DIM);
+ }
+ else
+ {
+ snew(muall,gnx[0]);
+ for(i=0; (i<gnx[0]); i++)
+ snew(muall[i],nframes*DIM);
+ }
}
- }
-
- /* Allocate array which contains for every molecule in a frame the
- * dipole moment.
- */
- if (!bMU)
- snew(dipole,gnx_tot);
-
- /* Statistics */
- snew(Qlsq,DIM);
- for(i=0; (i<DIM); i++)
- Qlsq[i] = gmx_stats_init();
- mulsq = gmx_stats_init();
+
+ /* Allocate array which contains for every molecule in a frame the
+ * dipole moment.
+ */
+ if (!bMU)
+ snew(dipole,gnx_tot);
+
+ /* Statistics */
+ snew(Qlsq,DIM);
+ for(i=0; (i<DIM); i++)
+ Qlsq[i] = gmx_stats_init();
+ mulsq = gmx_stats_init();
- /* Open all the files */
- outmtot = xvgropen(out_mtot,
- "Total dipole moment of the simulation box vs. time",
- "Time (ps)","Total Dipole Moment (Debye)",oenv);
- outeps = xvgropen(out_eps,"Epsilon and Kirkwood factors",
- "Time (ps)","",oenv);
- outaver = xvgropen(out_aver,"Total dipole moment",
- "Time (ps)","D",oenv);
- if (bSlab) {
- idim = axtitle[0] - 'X';
- if ((idim < 0) || (idim >= DIM))
- idim = axtitle[0] - 'x';
- if ((idim < 0) || (idim >= DIM))
- bSlab = FALSE;
- if (nslices < 2)
- bSlab = FALSE;
- fprintf(stderr,"axtitle = %s, nslices = %d, idim = %d\n",
- axtitle,nslices,idim);
- if (bSlab) {
- snew(slab_dipoles,nslices);
- fprintf(stderr,"Doing slab analysis\n");
+ /* Open all the files */
+ outmtot = xvgropen(out_mtot,
+ "Total dipole moment of the simulation box vs. time",
+ "Time (ps)","Total Dipole Moment (Debye)",oenv);
+ outeps = xvgropen(out_eps,"Epsilon and Kirkwood factors",
+ "Time (ps)","",oenv);
+ outaver = xvgropen(out_aver,"Total dipole moment",
+ "Time (ps)","D",oenv);
+ if (bSlab)
+ {
+ idim = axtitle[0] - 'X';
+ if ((idim < 0) || (idim >= DIM))
+ idim = axtitle[0] - 'x';
+ if ((idim < 0) || (idim >= DIM))
+ bSlab = FALSE;
+ if (nslices < 2)
+ bSlab = FALSE;
+ fprintf(stderr,"axtitle = %s, nslices = %d, idim = %d\n",
+ axtitle,nslices,idim);
+ if (bSlab)
+ {
+ snew(slab_dipoles,nslices);
+ fprintf(stderr,"Doing slab analysis\n");
+ }
}
- }
- if (fnadip) {
- adip = xvgropen(fnadip, "Average molecular dipole","Dipole (D)","",oenv);
- xvgr_legend(adip,NLEGADIP,leg_adip, oenv);
+ if (fnadip)
+ {
+ adip = xvgropen(fnadip, "Average molecular dipole","Dipole (D)","",oenv);
+ xvgr_legend(adip,NLEGADIP,leg_adip, oenv);
- }
- if (cosaver) {
- caver = xvgropen(cosaver,bPairs ? "Average pair orientation" :
- "Average absolute dipole orientation","Time (ps)","",oenv);
- xvgr_legend(caver,NLEGCOSAVER,bPairs ? leg_cosaver : &(leg_cosaver[1]),
- oenv);
- }
+ }
+ if (cosaver)
+ {
+ caver = xvgropen(cosaver,bPairs ? "Average pair orientation" :
+ "Average absolute dipole orientation","Time (ps)","",oenv);
+ xvgr_legend(caver,NLEGCOSAVER,bPairs ? leg_cosaver : &(leg_cosaver[1]),
+ oenv);
+ }
- if (fndip3d) {
- snew(dipsp,gnx_tot);
+ if (fndip3d)
+ {
+ snew(dipsp,gnx_tot);
- /* we need a dummy file for gnuplot */
- dip3d = (FILE *)ffopen("dummy.dat","w");
- fprintf(dip3d,"%f %f %f", 0.0,0.0,0.0);
- ffclose(dip3d);
-
- dip3d = (FILE *)ffopen(fndip3d,"w");
- fprintf(dip3d,"# This file was created by %s\n",Program());
- fprintf(dip3d,"# which is part of G R O M A C S:\n");
- fprintf(dip3d,"#\n");
- }
+ /* we need a dummy file for gnuplot */
+ dip3d = (FILE *)ffopen("dummy.dat","w");
+ fprintf(dip3d,"%f %f %f", 0.0,0.0,0.0);
+ ffclose(dip3d);
+
+ dip3d = (FILE *)ffopen(fndip3d,"w");
+ fprintf(dip3d,"# This file was created by %s\n",Program());
+ fprintf(dip3d,"# which is part of G R O M A C S:\n");
+ fprintf(dip3d,"#\n");
+ }
- /* Write legends to all the files */
- xvgr_legend(outmtot,NLEGMTOT,leg_mtot,oenv);
- xvgr_legend(outaver,NLEGAVER,leg_aver,oenv);
+ /* Write legends to all the files */
+ xvgr_legend(outmtot,NLEGMTOT,leg_mtot,oenv);
+ xvgr_legend(outaver,NLEGAVER,leg_aver,oenv);
- if (bMU && (mu_aver == -1))
- xvgr_legend(outeps,NLEGEPS-2,leg_eps,oenv);
- else
- xvgr_legend(outeps,NLEGEPS,leg_eps,oenv);
+ if (bMU && (mu_aver == -1))
+ xvgr_legend(outeps,NLEGEPS-2,leg_eps,oenv);
+ else
+ xvgr_legend(outeps,NLEGEPS,leg_eps,oenv);
- snew(fr,1);
- clear_rvec(mu_t);
- teller = 0;
- /* Read the first frame from energy or traj file */
- if (bMU)
- do {
- bCont = read_mu_from_enx(fmu,iVol,iMu,mu_t,&volume,&t,nre,fr);
- if (bCont) {
- timecheck=check_times(t);
- if (timecheck < 0)
- teller++;
- if ((teller % 10) == 0)
- fprintf(stderr,"\r Skipping Frame %6d, time: %8.3f", teller, t);
- }
- else {
- printf("End of %s reached\n",mufn);
- break;
- }
- } while (bCont && (timecheck < 0));
- else
- natom = read_first_x(oenv,&status,fn,&t,&x,box);
-
- /* Calculate spacing for dipole bin (simple histogram) */
- ndipbin = 1+(mu_max/0.01);
- snew(dipole_bin, ndipbin);
- epsilon = 0.0;
- mu_ave = 0.0;
- for(m=0; (m<DIM); m++) {
- M[m] = M2[m] = M4[m] = 0.0;
- }
+ snew(fr,1);
+ clear_rvec(mu_t);
+ teller = 0;
+ /* Read the first frame from energy or traj file */
+ if (bMU)
+ do
+ {
+ bCont = read_mu_from_enx(fmu,iVol,iMu,mu_t,&volume,&t,nre,fr);
+ if (bCont)
+ {
+ timecheck=check_times(t);
+ if (timecheck < 0)
+ teller++;
+ if ((teller % 10) == 0)
+ fprintf(stderr,"\r Skipping Frame %6d, time: %8.3f", teller, t);
+ }
+ else
+ {
+ printf("End of %s reached\n",mufn);
+ break;
+ }
+ } while (bCont && (timecheck < 0));
+ else
+ natom = read_first_x(oenv,&status,fn,&t,&x,box);
- if (bGkr) {
- /* Use 0.7 iso 0.5 to account for pressure scaling */
- /* rcut = 0.7*sqrt(max_cutoff2(box)); */
- rcut = 0.7*sqrt(sqr(box[XX][XX])+sqr(box[YY][YY])+sqr(box[ZZ][ZZ]));
-
- gkrbin = mk_gkrbin(rcut,rcmax,bPhi,ndegrees);
- }
- gpbc = gmx_rmpbc_init(&top->idef,ePBC,natom,box);
-
- /* Start while loop over frames */
- t1 = t0 = t;
- teller = 0;
- do {
- if (bCorr && (teller >= nframes)) {
- nframes += 1000;
- if (bTotal) {
- srenew(muall[0],nframes*DIM);
- }
- else {
- for(i=0; (i<gnx_tot); i++)
- srenew(muall[i],nframes*DIM);
- }
+ /* Calculate spacing for dipole bin (simple histogram) */
+ ndipbin = 1+(mu_max/0.01);
+ snew(dipole_bin, ndipbin);
+ epsilon = 0.0;
+ mu_ave = 0.0;
+ for(m=0; (m<DIM); m++)
+ {
+ M[m] = M2[m] = M4[m] = 0.0;
}
- t1 = t;
+
+ if (bGkr)
+ {
+ /* Use 0.7 iso 0.5 to account for pressure scaling */
+ /* rcut = 0.7*sqrt(max_cutoff2(box)); */
+ rcut = 0.7*sqrt(sqr(box[XX][XX])+sqr(box[YY][YY])+sqr(box[ZZ][ZZ]));
- if (bMU) {
- /* Copy rvec into double precision local variable */
- for(m=0; (m<DIM); m++)
- M_av[m] = mu_t[m];
+ gkrbin = mk_gkrbin(rcut,rcmax,bPhi,ndegrees);
}
- else {
- /* Initialise */
- for(m=0; (m<DIM); m++) {
- M_av[m] = 0;
- M_av2[m] = 0;
- }
- gmx_rmpbc(gpbc,natom,box,x);
+ gpbc = gmx_rmpbc_init(&top->idef,ePBC,natom,box);
+
+ /* Start while loop over frames */
+ t1 = t0 = t;
+ teller = 0;
+ do
+ {
+ if (bCorr && (teller >= nframes))
+ {
+ nframes += 1000;
+ if (bTotal)
+ {
+ srenew(muall[0],nframes*DIM);
+ }
+ else
+ {
+ for(i=0; (i<gnx_tot); i++)
+ srenew(muall[i],nframes*DIM);
+ }
+ }
+ t1 = t;
+
+ muframelsq = gmx_stats_init();
+
+ if (bMU)
+ {
+ /* Copy rvec into double precision local variable */
+ for(m=0; (m<DIM); m++)
+ M_av[m] = mu_t[m];
+ }
+ else
+ {
+ /* Initialise */
+ for(m=0; (m<DIM); m++)
+ {
+ M_av[m] = 0;
+ M_av2[m] = 0;
+ }
+ gmx_rmpbc(gpbc,natom,box,x);
- muframelsq = gmx_stats_init();
- /* Begin loop of all molecules in frame */
- for(n=0; (n<ncos); n++) {
- for(i=0; (i<gnx[n]); i++) {
- int gi,ind0,ind1;
+ /* Begin loop of all molecules in frame */
+ for(n=0; (n<ncos); n++)
+ {
+ for(i=0; (i<gnx[n]); i++)
+ {
+ int gi,ind0,ind1;
- ind0 = mols->index[molindex[n][i]];
- ind1 = mols->index[molindex[n][i]+1];
+ ind0 = mols->index[molindex[n][i]];
+ ind1 = mols->index[molindex[n][i]+1];
- mol_dip(ind0,ind1,x,atom,dipole[i]);
- gmx_stats_add_point(mulsq,0,norm(dipole[i]),0,0);
- gmx_stats_add_point(muframelsq,0,norm(dipole[i]),0,0);
- if (bSlab)
- update_slab_dipoles(ind0,ind1,x,
- dipole[i],idim,nslices,slab_dipoles,box);
- if (bQuad) {
- mol_quad(ind0,ind1,x,atom,quad);
- for(m=0; (m<DIM); m++)
- gmx_stats_add_point(Qlsq[m],0,quad[m],0,0);
- }
- if (bCorr && !bTotal) {
- tel3=DIM*teller;
- muall[i][tel3+XX] = dipole[i][XX];
- muall[i][tel3+YY] = dipole[i][YY];
- muall[i][tel3+ZZ] = dipole[i][ZZ];
- }
- mu_mol = 0.0;
- for(m=0; (m<DIM); m++) {
- M_av[m] += dipole[i][m]; /* M per frame */
- mu_mol += dipole[i][m]*dipole[i][m]; /* calc. mu for distribution */
- }
- mu_mol = sqrt(mu_mol);
+ mol_dip(ind0,ind1,x,atom,dipole[i]);
+ gmx_stats_add_point(mulsq,0,norm(dipole[i]),0,0);
+ gmx_stats_add_point(muframelsq,0,norm(dipole[i]),0,0);
+ if (bSlab)
+ update_slab_dipoles(ind0,ind1,x,
+ dipole[i],idim,nslices,slab_dipoles,box);
+ if (bQuad)
+ {
+ mol_quad(ind0,ind1,x,atom,quad);
+ for(m=0; (m<DIM); m++)
+ gmx_stats_add_point(Qlsq[m],0,quad[m],0,0);
+ }
+ if (bCorr && !bTotal)
+ {
+ tel3=DIM*teller;
+ muall[i][tel3+XX] = dipole[i][XX];
+ muall[i][tel3+YY] = dipole[i][YY];
+ muall[i][tel3+ZZ] = dipole[i][ZZ];
+ }
+ mu_mol = 0.0;
+ for(m=0; (m<DIM); m++)
+ {
+ M_av[m] += dipole[i][m]; /* M per frame */
+ mu_mol += dipole[i][m]*dipole[i][m]; /* calc. mu for distribution */
+ }
+ mu_mol = sqrt(mu_mol);
- mu_ave += mu_mol; /* calc. the average mu */
+ mu_ave += mu_mol; /* calc. the average mu */
- /* Update the dipole distribution */
- ibin = (int)(ndipbin*mu_mol/mu_max + 0.5);
- if (ibin < ndipbin)
- dipole_bin[ibin]++;
+ /* Update the dipole distribution */
+ ibin = (int)(ndipbin*mu_mol/mu_max + 0.5);
+ if (ibin < ndipbin)
+ dipole_bin[ibin]++;
- if (fndip3d) {
- rvec2sprvec(dipole[i],dipsp[i]);
+ if (fndip3d)
+ {
+ rvec2sprvec(dipole[i],dipsp[i]);
- if (dipsp[i][YY] > -M_PI && dipsp[i][YY] < -0.5*M_PI) {
- if (dipsp[i][ZZ] < 0.5 * M_PI) {
- ncolour = 1;
- } else {
- ncolour = 2;
- }
- }else if (dipsp[i][YY] > -0.5*M_PI && dipsp[i][YY] < 0.0*M_PI) {
- if (dipsp[i][ZZ] < 0.5 * M_PI) {
- ncolour = 3;
- } else {
- ncolour = 4;
- }
- }else if (dipsp[i][YY] > 0.0 && dipsp[i][YY] < 0.5*M_PI) {
- if (dipsp[i][ZZ] < 0.5 * M_PI) {
- ncolour = 5;
- } else {
- ncolour = 6;
- }
- }else if (dipsp[i][YY] > 0.5*M_PI && dipsp[i][YY] < M_PI) {
- if (dipsp[i][ZZ] < 0.5 * M_PI) {
- ncolour = 7;
- } else {
- ncolour = 8;
- }
- }
- if (dip3d)
- fprintf(dip3d,"set arrow %d from %f, %f, %f to %f, %f, %f lt %d # %d %d\n",
- i+1,
- x[ind0][XX],
- x[ind0][YY],
- x[ind0][ZZ],
- x[ind0][XX]+dipole[i][XX]/25,
- x[ind0][YY]+dipole[i][YY]/25,
- x[ind0][ZZ]+dipole[i][ZZ]/25,
- ncolour, ind0, i);
- }
- } /* End loop of all molecules in frame */
+ if (dipsp[i][YY] > -M_PI && dipsp[i][YY] < -0.5*M_PI) {
+ if (dipsp[i][ZZ] < 0.5 * M_PI)
+ {
+ ncolour = 1;
+ }
+ else
+ {
+ ncolour = 2;
+ }
+ }
+ else if (dipsp[i][YY] > -0.5*M_PI && dipsp[i][YY] < 0.0*M_PI)
+ {
+ if (dipsp[i][ZZ] < 0.5 * M_PI)
+ {
+ ncolour = 3;
+ }
+ else
+ {
+ ncolour = 4;
+ }
+ }else if (dipsp[i][YY] > 0.0 && dipsp[i][YY] < 0.5*M_PI) {
+ if (dipsp[i][ZZ] < 0.5 * M_PI) {
+ ncolour = 5;
+ } else {
+ ncolour = 6;
+ }
+ }
+ else if (dipsp[i][YY] > 0.5*M_PI && dipsp[i][YY] < M_PI)
+ {
+ if (dipsp[i][ZZ] < 0.5 * M_PI)
+ {
+ ncolour = 7;
+ }
+ else
+ {
+ ncolour = 8;
+ }
+ }
+ if (dip3d)
+ fprintf(dip3d,"set arrow %d from %f, %f, %f to %f, %f, %f lt %d # %d %d\n",
+ i+1,
+ x[ind0][XX],
+ x[ind0][YY],
+ x[ind0][ZZ],
+ x[ind0][XX]+dipole[i][XX]/25,
+ x[ind0][YY]+dipole[i][YY]/25,
+ x[ind0][ZZ]+dipole[i][ZZ]/25,
+ ncolour, ind0, i);
+ }
+ } /* End loop of all molecules in frame */
- if (dip3d) {
- fprintf(dip3d,"set title \"t = %4.3f\"\n",t);
- fprintf(dip3d,"set xrange [0.0:%4.2f]\n",box[XX][XX]);
- fprintf(dip3d,"set yrange [0.0:%4.2f]\n",box[YY][YY]);
- fprintf(dip3d,"set zrange [0.0:%4.2f]\n\n",box[ZZ][ZZ]);
- fprintf(dip3d,"splot 'dummy.dat' using 1:2:3 w vec\n");
- fprintf(dip3d,"pause -1 'Hit return to continue'\n");
- }
- }
- }
- /* Compute square of total dipole */
- for(m=0; (m<DIM); m++)
- M_av2[m] = M_av[m]*M_av[m];
+ if (dip3d)
+ {
+ fprintf(dip3d,"set title \"t = %4.3f\"\n",t);
+ fprintf(dip3d,"set xrange [0.0:%4.2f]\n",box[XX][XX]);
+ fprintf(dip3d,"set yrange [0.0:%4.2f]\n",box[YY][YY]);
+ fprintf(dip3d,"set zrange [0.0:%4.2f]\n\n",box[ZZ][ZZ]);
+ fprintf(dip3d,"splot 'dummy.dat' using 1:2:3 w vec\n");
+ fprintf(dip3d,"pause -1 'Hit return to continue'\n");
+ }
+ }
+ }
+ /* Compute square of total dipole */
+ for(m=0; (m<DIM); m++)
+ M_av2[m] = M_av[m]*M_av[m];
- if (cosaver) {
- compute_avercos(gnx_tot,dipole,&dd,dipaxis,bPairs);
- rms_cos = sqrt(sqr(dipaxis[XX]-0.5)+
- sqr(dipaxis[YY]-0.5)+
- sqr(dipaxis[ZZ]-0.5));
- if (bPairs)
- fprintf(caver,"%10.3e %10.3e %10.3e %10.3e %10.3e %10.3e\n",
- t,dd,rms_cos,dipaxis[XX],dipaxis[YY],dipaxis[ZZ]);
- else
- fprintf(caver,"%10.3e %10.3e %10.3e %10.3e %10.3e\n",
- t,rms_cos,dipaxis[XX],dipaxis[YY],dipaxis[ZZ]);
- }
+ if (cosaver)
+ {
+ compute_avercos(gnx_tot,dipole,&dd,dipaxis,bPairs);
+ rms_cos = sqrt(sqr(dipaxis[XX]-0.5)+
+ sqr(dipaxis[YY]-0.5)+
+ sqr(dipaxis[ZZ]-0.5));
+ if (bPairs)
+ fprintf(caver,"%10.3e %10.3e %10.3e %10.3e %10.3e %10.3e\n",
+ t,dd,rms_cos,dipaxis[XX],dipaxis[YY],dipaxis[ZZ]);
+ else
+ fprintf(caver,"%10.3e %10.3e %10.3e %10.3e %10.3e\n",
+ t,rms_cos,dipaxis[XX],dipaxis[YY],dipaxis[ZZ]);
+ }
- if (bGkr) {
- do_gkr(gkrbin,ncos,gnx,molindex,mols->index,x,dipole,ePBC,box,
- atom,gkatom);
- }
+ if (bGkr)
+ {
+ do_gkr(gkrbin,ncos,gnx,molindex,mols->index,x,dipole,ePBC,box,
+ atom,gkatom);
+ }
- if (bTotal) {
- tel3 = DIM*teller;
- muall[0][tel3+XX] = M_av[XX];
- muall[0][tel3+YY] = M_av[YY];
- muall[0][tel3+ZZ] = M_av[ZZ];
- }
-
- /* Write to file the total dipole moment of the box, and its components
- * for this frame.
- */
- if ((skip == 0) || ((teller % skip) == 0))
- fprintf(outmtot,"%10g %12.8e %12.8e %12.8e %12.8e\n",
- t,M_av[XX],M_av[YY],M_av[ZZ],
- sqrt(M_av2[XX]+M_av2[YY]+M_av2[ZZ]));
-
- for(m=0; (m<DIM); m++) {
- M[m] += M_av[m];
- M2[m] += M_av2[m];
- M4[m] += sqr(M_av2[m]);
- }
- /* Increment loop counter */
- teller++;
+ if (bTotal)
+ {
+ tel3 = DIM*teller;
+ muall[0][tel3+XX] = M_av[XX];
+ muall[0][tel3+YY] = M_av[YY];
+ muall[0][tel3+ZZ] = M_av[ZZ];
+ }
+
+ /* Write to file the total dipole moment of the box, and its components
+ * for this frame.
+ */
+ if ((skip == 0) || ((teller % skip) == 0))
+ fprintf(outmtot,"%10g %12.8e %12.8e %12.8e %12.8e\n",
+ t,M_av[XX],M_av[YY],M_av[ZZ],
+ sqrt(M_av2[XX]+M_av2[YY]+M_av2[ZZ]));
+
+ for(m=0; (m<DIM); m++)
+ {
+ M[m] += M_av[m];
+ M2[m] += M_av2[m];
+ M4[m] += sqr(M_av2[m]);
+ }
+ /* Increment loop counter */
+ teller++;
- /* Calculate for output the running averages */
- invtel = 1.0/teller;
- M2_ave = (M2[XX]+M2[YY]+M2[ZZ])*invtel;
- M_ave2 = invtel*(invtel*(M[XX]*M[XX] + M[YY]*M[YY] + M[ZZ]*M[ZZ]));
- M_diff = M2_ave - M_ave2;
-
- /* Compute volume from box in traj, else we use the one from above */
- if (!bMU)
- volume = det(box);
- vol_aver += volume;
+ /* Calculate for output the running averages */
+ invtel = 1.0/teller;
+ M2_ave = (M2[XX]+M2[YY]+M2[ZZ])*invtel;
+ M_ave2 = invtel*(invtel*(M[XX]*M[XX] + M[YY]*M[YY] + M[ZZ]*M[ZZ]));
+ M_diff = M2_ave - M_ave2;
+
+ /* Compute volume from box in traj, else we use the one from above */
+ if (!bMU)
+ volume = det(box);
+ vol_aver += volume;
- epsilon = calc_eps(M_diff,(vol_aver/teller),epsilonRF,temp);
+ epsilon = calc_eps(M_diff,(vol_aver/teller),epsilonRF,temp);
- /* Calculate running average for dipole */
- if (mu_ave != 0)
- mu_aver = (mu_ave/gnx_tot)*invtel;
+ /* Calculate running average for dipole */
+ if (mu_ave != 0)
+ mu_aver = (mu_ave/gnx_tot)*invtel;
- if ((skip == 0) || ((teller % skip) == 0)) {
- /* Write to file < |M|^2 >, |< M >|^2. And the difference between
- * the two. Here M is sum mu_i. Further write the finite system
- * Kirkwood G factor and epsilon.
- */
- fprintf(outaver,"%10g %10.3e %10.3e %10.3e %10.3e\n",
- t,M2_ave,M_ave2,M_diff,M_ave2/M2_ave);
+ if ((skip == 0) || ((teller % skip) == 0))
+ {
+ /* Write to file < |M|^2 >, |< M >|^2. And the difference between
+ * the two. Here M is sum mu_i. Further write the finite system
+ * Kirkwood G factor and epsilon.
+ */
+ fprintf(outaver,"%10g %10.3e %10.3e %10.3e %10.3e\n",
+ t,M2_ave,M_ave2,M_diff,M_ave2/M2_ave);
- if (fnadip) {
- real aver;
- gmx_stats_get_average(muframelsq,&aver);
- fprintf(adip, "%10g %f \n", t,aver);
- }
- /*if (dipole)
- printf("%f %f\n", norm(dipole[0]), norm(dipole[1]));
- */
- if (!bMU || (mu_aver != -1)) {
- /* Finite system Kirkwood G-factor */
- Gk = M_diff/(gnx_tot*mu_aver*mu_aver);
- /* Infinite system Kirkwood G-factor */
- if (epsilonRF == 0.0)
- g_k = ((2*epsilon+1)*Gk/(3*epsilon));
- else
- g_k = ((2*epsilonRF+epsilon)*(2*epsilon+1)*
- Gk/(3*epsilon*(2*epsilonRF+1)));
+ if (fnadip)
+ {
+ real aver;
+ gmx_stats_get_average(muframelsq,&aver);
+ fprintf(adip, "%10g %f \n", t,aver);
+ }
+ /*if (dipole)
+ printf("%f %f\n", norm(dipole[0]), norm(dipole[1]));
+ */
+ if (!bMU || (mu_aver != -1))
+ {
+ /* Finite system Kirkwood G-factor */
+ Gk = M_diff/(gnx_tot*mu_aver*mu_aver);
+ /* Infinite system Kirkwood G-factor */
+ if (epsilonRF == 0.0)
+ g_k = ((2*epsilon+1)*Gk/(3*epsilon));
+ else
+ g_k = ((2*epsilonRF+epsilon)*(2*epsilon+1)*
+ Gk/(3*epsilon*(2*epsilonRF+1)));
- fprintf(outeps,"%10g %10.3e %10.3e %10.3e\n",t,epsilon,Gk,g_k);
+ fprintf(outeps,"%10g %10.3e %10.3e %10.3e\n",t,epsilon,Gk,g_k);
- }
- else
- fprintf(outeps,"%10g %12.8e\n",t,epsilon);
- }
+ }
+ else
+ fprintf(outeps,"%10g %12.8e\n",t,epsilon);
+ }
+ gmx_stats_done(muframelsq);
- if (bMU)
- bCont = read_mu_from_enx(fmu,iVol,iMu,mu_t,&volume,&t,nre,fr);
- else
- bCont = read_next_x(oenv,status,&t,natom,x,box);
- } while (bCont);
+ if (bMU)
+ bCont = read_mu_from_enx(fmu,iVol,iMu,mu_t,&volume,&t,nre,fr);
+ else
+ bCont = read_next_x(oenv,status,&t,natom,x,box);
+ } while (bCont);
- gmx_rmpbc_done(gpbc);
+ gmx_rmpbc_done(gpbc);
- if (!bMU)
- close_trj(status);
+ if (!bMU)
+ close_trj(status);
- ffclose(outmtot);
- ffclose(outaver);
- ffclose(outeps);
-
- if (fnadip)
- ffclose(adip);
-
- if (cosaver)
- ffclose(caver);
-
- if (dip3d) {
- fprintf(dip3d,"set xrange [0.0:%4.2f]\n",box[XX][XX]);
- fprintf(dip3d,"set yrange [0.0:%4.2f]\n",box[YY][YY]);
- fprintf(dip3d,"set zrange [0.0:%4.2f]\n\n",box[ZZ][ZZ]);
- fprintf(dip3d,"splot 'dummy.dat' using 1:2:3 w vec\n");
- fprintf(dip3d,"pause -1 'Hit return to continue'\n");
- ffclose(dip3d);
- }
-
- if (bSlab) {
- dump_slab_dipoles(slabfn,idim,nslices,slab_dipoles,box,teller,oenv);
- sfree(slab_dipoles);
- }
+ ffclose(outmtot);
+ ffclose(outaver);
+ ffclose(outeps);
+
+ if (fnadip)
+ ffclose(adip);
+
+ if (cosaver)
+ ffclose(caver);
+
+ if (dip3d) {
+ fprintf(dip3d,"set xrange [0.0:%4.2f]\n",box[XX][XX]);
+ fprintf(dip3d,"set yrange [0.0:%4.2f]\n",box[YY][YY]);
+ fprintf(dip3d,"set zrange [0.0:%4.2f]\n\n",box[ZZ][ZZ]);
+ fprintf(dip3d,"splot 'dummy.dat' using 1:2:3 w vec\n");
+ fprintf(dip3d,"pause -1 'Hit return to continue'\n");
+ ffclose(dip3d);
+ }
+
+ if (bSlab) {
+ dump_slab_dipoles(slabfn,idim,nslices,slab_dipoles,box,teller,oenv);
+ sfree(slab_dipoles);
+ }
- vol_aver /= teller;
- printf("Average volume over run is %g\n",vol_aver);
- if (bGkr) {
- print_gkrbin(gkrfn,gkrbin,gnx[0],teller,vol_aver,oenv);
- print_cmap(cmap,gkrbin,nlevels);
- }
- /* Autocorrelation function */
- if (bCorr) {
- if (teller < 2) {
- printf("Not enough frames for autocorrelation\n");
+ vol_aver /= teller;
+ printf("Average volume over run is %g\n",vol_aver);
+ if (bGkr) {
+ print_gkrbin(gkrfn,gkrbin,gnx[0],teller,vol_aver,oenv);
+ print_cmap(cmap,gkrbin,nlevels);
}
- else {
- dt=(t1 - t0)/(teller-1);
- printf("t0 %g, t %g, teller %d\n", t0,t,teller);
+ /* Autocorrelation function */
+ if (bCorr) {
+ if (teller < 2) {
+ printf("Not enough frames for autocorrelation\n");
+ }
+ else {
+ dt=(t1 - t0)/(teller-1);
+ printf("t0 %g, t %g, teller %d\n", t0,t,teller);
- mode = eacVector;
-
- if (bTotal)
- do_autocorr(corf,oenv,"Autocorrelation Function of Total Dipole",
- teller,1,muall,dt,mode,TRUE);
- else
- do_autocorr(corf,oenv,"Dipole Autocorrelation Function",
- teller,gnx_tot,muall,dt,
- mode,strcmp(corrtype,"molsep"));
+ mode = eacVector;
+
+ if (bTotal)
+ do_autocorr(corf,oenv,"Autocorrelation Function of Total Dipole",
+ teller,1,muall,dt,mode,TRUE);
+ else
+ do_autocorr(corf,oenv,"Dipole Autocorrelation Function",
+ teller,gnx_tot,muall,dt,
+ mode,strcmp(corrtype,"molsep"));
+ }
}
- }
- if (!bMU) {
- real aver,sigma,error,lsq;
-
- gmx_stats_get_ase(mulsq,&aver,&sigma,&error);
- printf("\nDipole moment (Debye)\n");
- printf("---------------------\n");
- printf("Average = %8.4f Std. Dev. = %8.4f Error = %8.4f\n",
- aver,sigma,error);
- if (bQuad) {
- rvec a,s,e;
- int mm;
- for(m=0; (m<DIM); m++)
- gmx_stats_get_ase(mulsq,&(a[m]),&(s[m]),&(e[m]));
+ if (!bMU) {
+ real aver,sigma,error,lsq;
+
+ gmx_stats_get_ase(mulsq,&aver,&sigma,&error);
+ printf("\nDipole moment (Debye)\n");
+ printf("---------------------\n");
+ printf("Average = %8.4f Std. Dev. = %8.4f Error = %8.4f\n",
+ aver,sigma,error);
+ if (bQuad) {
+ rvec a,s,e;
+ int mm;
+ for(m=0; (m<DIM); m++)
+ gmx_stats_get_ase(mulsq,&(a[m]),&(s[m]),&(e[m]));
- printf("\nQuadrupole moment (Debye-Ang)\n");
- printf("-----------------------------\n");
- printf("Averages = %8.4f %8.4f %8.4f\n",a[XX],a[YY],a[ZZ]);
- printf("Std. Dev. = %8.4f %8.4f %8.4f\n",s[XX],s[YY],s[ZZ]);
- printf("Error = %8.4f %8.4f %8.4f\n",e[XX],e[YY],e[ZZ]);
+ printf("\nQuadrupole moment (Debye-Ang)\n");
+ printf("-----------------------------\n");
+ printf("Averages = %8.4f %8.4f %8.4f\n",a[XX],a[YY],a[ZZ]);
+ printf("Std. Dev. = %8.4f %8.4f %8.4f\n",s[XX],s[YY],s[ZZ]);
+ printf("Error = %8.4f %8.4f %8.4f\n",e[XX],e[YY],e[ZZ]);
+ }
+ printf("\n");
}
- printf("\n");
- }
- printf("The following averages for the complete trajectory have been calculated:\n\n");
- printf(" Total < M_x > = %g Debye\n", M[XX]/teller);
- printf(" Total < M_y > = %g Debye\n", M[YY]/teller);
- printf(" Total < M_z > = %g Debye\n\n", M[ZZ]/teller);
+ printf("The following averages for the complete trajectory have been calculated:\n\n");
+ printf(" Total < M_x > = %g Debye\n", M[XX]/teller);
+ printf(" Total < M_y > = %g Debye\n", M[YY]/teller);
+ printf(" Total < M_z > = %g Debye\n\n", M[ZZ]/teller);
- printf(" Total < M_x^2 > = %g Debye^2\n", M2[XX]/teller);
- printf(" Total < M_y^2 > = %g Debye^2\n", M2[YY]/teller);
- printf(" Total < M_z^2 > = %g Debye^2\n\n", M2[ZZ]/teller);
+ printf(" Total < M_x^2 > = %g Debye^2\n", M2[XX]/teller);
+ printf(" Total < M_y^2 > = %g Debye^2\n", M2[YY]/teller);
+ printf(" Total < M_z^2 > = %g Debye^2\n\n", M2[ZZ]/teller);
- printf(" Total < |M|^2 > = %g Debye^2\n", M2_ave);
- printf(" Total |< M >|^2 = %g Debye^2\n\n", M_ave2);
+ printf(" Total < |M|^2 > = %g Debye^2\n", M2_ave);
+ printf(" Total |< M >|^2 = %g Debye^2\n\n", M_ave2);
- printf(" < |M|^2 > - |< M >|^2 = %g Debye^2\n\n", M_diff);
+ printf(" < |M|^2 > - |< M >|^2 = %g Debye^2\n\n", M_diff);
- if (!bMU || (mu_aver != -1)) {
- printf("Finite system Kirkwood g factor G_k = %g\n", Gk);
- printf("Infinite system Kirkwood g factor g_k = %g\n\n", g_k);
- }
- printf("Epsilon = %g\n", epsilon);
-
- if (!bMU) {
- /* Write to file the dipole moment distibution during the simulation.
- */
- outdd=xvgropen(dipdist,"Dipole Moment Distribution","mu (Debye)","",oenv);
- for(i=0; (i<ndipbin); i++)
- fprintf(outdd,"%10g %10f\n",
- (i*mu_max)/ndipbin,dipole_bin[i]/(double)teller);
- ffclose(outdd);
- sfree(dipole_bin);
- }
- if (bGkr)
- done_gkrbin(&gkrbin);
+ if (!bMU || (mu_aver != -1)) {
+ printf("Finite system Kirkwood g factor G_k = %g\n", Gk);
+ printf("Infinite system Kirkwood g factor g_k = %g\n\n", g_k);
+ }
+ printf("Epsilon = %g\n", epsilon);
+
+ if (!bMU) {
+ /* Write to file the dipole moment distibution during the simulation.
+ */
+ outdd=xvgropen(dipdist,"Dipole Moment Distribution","mu (Debye)","",oenv);
+ for(i=0; (i<ndipbin); i++)
+ fprintf(outdd,"%10g %10f\n",
+ (i*mu_max)/ndipbin,dipole_bin[i]/(double)teller);
+ ffclose(outdd);
+ sfree(dipole_bin);
+ }
+ if (bGkr)
+ done_gkrbin(&gkrbin);
}
void dipole_atom2molindex(int *n,int *index,t_block *mols)
{
- int nmol,i,j,m;
-
- nmol = 0;
- i=0;
- while (i < *n) {
- m=0;
- while(m < mols->nr && index[i] != mols->index[m])
- m++;
- if (m == mols->nr)
- gmx_fatal(FARGS,"index[%d]=%d does not correspond to the first atom of a molecule",i+1,index[i]+1);
- for(j=mols->index[m]; j<mols->index[m+1]; j++) {
- if (i >= *n || index[i] != j)
- gmx_fatal(FARGS,"The index group is not a set of whole molecules");
- i++;
+ int nmol,i,j,m;
+
+ nmol = 0;
+ i=0;
+ while (i < *n) {
+ m=0;
+ while(m < mols->nr && index[i] != mols->index[m])
+ m++;
+ if (m == mols->nr)
+ gmx_fatal(FARGS,"index[%d]=%d does not correspond to the first atom of a molecule",i+1,index[i]+1);
+ for(j=mols->index[m]; j<mols->index[m+1]; j++) {
+ if (i >= *n || index[i] != j)
+ gmx_fatal(FARGS,"The index group is not a set of whole molecules");
+ i++;
+ }
+ /* Modify the index in place */
+ index[nmol++] = m;
}
- /* Modify the index in place */
- index[nmol++] = m;
- }
- printf("There are %d molecules in the selection\n",nmol);
+ printf("There are %d molecules in the selection\n",nmol);
- *n = nmol;
+ *n = nmol;
}
int gmx_dipoles(int argc,char *argv[])
{
- const char *desc[] = {
- "g_dipoles computes the total dipole plus fluctuations of a simulation",
- "system. From this you can compute e.g. the dielectric constant for",
- "low dielectric media.",
- "For molecules with a net charge, the net charge is subtracted at",
- "center of mass of the molecule.[PAR]",
- "The file Mtot.xvg contains the total dipole moment of a frame, the",
- "components as well as the norm of the vector.",
- "The file aver.xvg contains < |Mu|^2 > and |< Mu >|^2 during the",
- "simulation.",
- "The file dipdist.xvg contains the distribution of dipole moments during",
- "the simulation",
- "The mu_max is used as the highest value in the distribution graph.[PAR]",
- "Furthermore the dipole autocorrelation function will be computed when",
- "option -corr is used. The output file name is given with the [TT]-c[tt]",
- "option.",
- "The correlation functions can be averaged over all molecules",
- "([TT]mol[tt]), plotted per molecule separately ([TT]molsep[tt])",
- "or it can be computed over the total dipole moment of the simulation box",
- "([TT]total[tt]).[PAR]",
- "Option [TT]-g[tt] produces a plot of the distance dependent Kirkwood",
- "G-factor, as well as the average cosine of the angle between the dipoles",
- "as a function of the distance. The plot also includes gOO and hOO",
- "according to Nymand & Linse, JCP 112 (2000) pp 6386-6395. In the same plot",
- "we also include the energy per scale computed by taking the inner product of",
- "the dipoles divided by the distance to the third power.[PAR]",
- "[PAR]",
- "EXAMPLES[PAR]",
- "g_dipoles -corr mol -P1 -o dip_sqr -mu 2.273 -mumax 5.0 -nofft[PAR]",
- "This will calculate the autocorrelation function of the molecular",
- "dipoles using a first order Legendre polynomial of the angle of the",
- "dipole vector and itself a time t later. For this calculation 1001",
- "frames will be used. Further the dielectric constant will be calculated",
- "using an epsilonRF of infinity (default), temperature of 300 K (default) and",
- "an average dipole moment of the molecule of 2.273 (SPC). For the",
- "distribution function a maximum of 5.0 will be used."
- };
- real mu_max=5, mu_aver=-1,rcmax=0;
- real epsilonRF=0.0, temp=300;
- gmx_bool bAverCorr=FALSE,bMolCorr=FALSE,bPairs=TRUE,bPhi=FALSE;
- const char *corrtype[]={NULL, "none", "mol", "molsep", "total", NULL};
- const char *axtitle="Z";
- int nslices = 10; /* nr of slices defined */
- int skip=0,nFA=0,nFB=0,ncos=1;
- int nlevels=20,ndegrees=90;
- output_env_t oenv;
- t_pargs pa[] = {
- { "-mu", FALSE, etREAL, {&mu_aver},
- "dipole of a single molecule (in Debye)" },
- { "-mumax", FALSE, etREAL, {&mu_max},
- "max dipole in Debye (for histrogram)" },
- { "-epsilonRF",FALSE, etREAL, {&epsilonRF},
- "epsilon of the reaction field used during the simulation, needed for dielectric constant calculation. WARNING: 0.0 means infinity (default)" },
- { "-skip", FALSE, etINT, {&skip},
- "Skip steps in the output (but not in the computations)" },
- { "-temp", FALSE, etREAL, {&temp},
- "Average temperature of the simulation (needed for dielectric constant calculation)" },
- { "-corr", FALSE, etENUM, {corrtype},
- "Correlation function to calculate" },
- { "-pairs", FALSE, etBOOL, {&bPairs},
- "Calculate |cos theta| between all pairs of molecules. May be slow" },
- { "-ncos", FALSE, etINT, {&ncos},
- "Must be 1 or 2. Determines whether the <cos> is computed between all mole cules in one group, or between molecules in two different groups. This turns on the -gkr flag." },
- { "-axis", FALSE, etSTR, {&axtitle},
- "Take the normal on the computational box in direction X, Y or Z." },
- { "-sl", FALSE, etINT, {&nslices},
- "Divide the box in #nr slices." },
- { "-gkratom", FALSE, etINT, {&nFA},
- "Use the n-th atom of a molecule (starting from 1) to calculate the distance between molecules rather than the center of charge (when 0) in the calculation of distance dependent Kirkwood factors" },
- { "-gkratom2", FALSE, etINT, {&nFB},
- "Same as previous option in case ncos = 2, i.e. dipole interaction between two groups of molecules" },
- { "-rcmax", FALSE, etREAL, {&rcmax},
- "Maximum distance to use in the dipole orientation distribution (with ncos == 2). If zero, a criterium based on the box length will be used." },
- { "-phi", FALSE, etBOOL, {&bPhi},
- "Plot the 'torsion angle' defined as the rotation of the two dipole vectors around the distance vector between the two molecules in the xpm file from the -cmap option. By default the cosine of the angle between the dipoles is plotted." },
- { "-nlevels", FALSE, etINT, {&nlevels},
- "Number of colors in the cmap output" },
- { "-ndegrees", FALSE, etINT, {&ndegrees},
- "Number of divisions on the y-axis in the camp output (for 180 degrees)" }
- };
- int *gnx;
- int nFF[2];
- atom_id **grpindex;
- char **grpname=NULL;
- gmx_bool bCorr,bQuad,bGkr,bMU,bSlab;
- t_filenm fnm[] = {
- { efEDR, "-en", NULL, ffOPTRD },
- { efTRX, "-f", NULL, ffREAD },
- { efTPX, NULL, NULL, ffREAD },
- { efNDX, NULL, NULL, ffOPTRD },
- { efXVG, "-o", "Mtot", ffWRITE },
- { efXVG, "-eps", "epsilon", ffWRITE },
- { efXVG, "-a", "aver", ffWRITE },
- { efXVG, "-d", "dipdist", ffWRITE },
- { efXVG, "-c", "dipcorr", ffOPTWR },
- { efXVG, "-g", "gkr", ffOPTWR },
- { efXVG, "-adip","adip", ffOPTWR },
- { efXVG, "-dip3d", "dip3d", ffOPTWR },
- { efXVG, "-cos", "cosaver", ffOPTWR },
- { efXPM, "-cmap","cmap", ffOPTWR },
- { efXVG, "-q", "quadrupole", ffOPTWR },
- { efXVG, "-slab","slab", ffOPTWR }
- };
+ const char *desc[] = {
+ "g_dipoles computes the total dipole plus fluctuations of a simulation",
+ "system. From this you can compute e.g. the dielectric constant for",
+ "low dielectric media.",
+ "For molecules with a net charge, the net charge is subtracted at",
+ "center of mass of the molecule.[PAR]",
+ "The file Mtot.xvg contains the total dipole moment of a frame, the",
+ "components as well as the norm of the vector.",
+ "The file aver.xvg contains < |Mu|^2 > and |< Mu >|^2 during the",
+ "simulation.",
+ "The file dipdist.xvg contains the distribution of dipole moments during",
+ "the simulation",
+ "The mu_max is used as the highest value in the distribution graph.[PAR]",
+ "Furthermore the dipole autocorrelation function will be computed when",
+ "option -corr is used. The output file name is given with the [TT]-c[tt]",
+ "option.",
+ "The correlation functions can be averaged over all molecules",
+ "([TT]mol[tt]), plotted per molecule separately ([TT]molsep[tt])",
+ "or it can be computed over the total dipole moment of the simulation box",
+ "([TT]total[tt]).[PAR]",
+ "Option [TT]-g[tt] produces a plot of the distance dependent Kirkwood",
+ "G-factor, as well as the average cosine of the angle between the dipoles",
+ "as a function of the distance. The plot also includes gOO and hOO",
+ "according to Nymand & Linse, JCP 112 (2000) pp 6386-6395. In the same plot",
+ "we also include the energy per scale computed by taking the inner product of",
+ "the dipoles divided by the distance to the third power.[PAR]",
+ "[PAR]",
+ "EXAMPLES[PAR]",
+ "g_dipoles -corr mol -P1 -o dip_sqr -mu 2.273 -mumax 5.0 -nofft[PAR]",
+ "This will calculate the autocorrelation function of the molecular",
+ "dipoles using a first order Legendre polynomial of the angle of the",
+ "dipole vector and itself a time t later. For this calculation 1001",
+ "frames will be used. Further the dielectric constant will be calculated",
+ "using an epsilonRF of infinity (default), temperature of 300 K (default) and",
+ "an average dipole moment of the molecule of 2.273 (SPC). For the",
+ "distribution function a maximum of 5.0 will be used."
+ };
+ real mu_max=5, mu_aver=-1,rcmax=0;
+ real epsilonRF=0.0, temp=300;
+ gmx_bool bAverCorr=FALSE,bMolCorr=FALSE,bPairs=TRUE,bPhi=FALSE;
+ const char *corrtype[]={NULL, "none", "mol", "molsep", "total", NULL};
+ const char *axtitle="Z";
+ int nslices = 10; /* nr of slices defined */
+ int skip=0,nFA=0,nFB=0,ncos=1;
+ int nlevels=20,ndegrees=90;
+ output_env_t oenv;
+ t_pargs pa[] = {
+ { "-mu", FALSE, etREAL, {&mu_aver},
+ "dipole of a single molecule (in Debye)" },
+ { "-mumax", FALSE, etREAL, {&mu_max},
+ "max dipole in Debye (for histrogram)" },
+ { "-epsilonRF",FALSE, etREAL, {&epsilonRF},
+ "epsilon of the reaction field used during the simulation, needed for dielectric constant calculation. WARNING: 0.0 means infinity (default)" },
+ { "-skip", FALSE, etINT, {&skip},
+ "Skip steps in the output (but not in the computations)" },
+ { "-temp", FALSE, etREAL, {&temp},
+ "Average temperature of the simulation (needed for dielectric constant calculation)" },
+ { "-corr", FALSE, etENUM, {corrtype},
+ "Correlation function to calculate" },
+ { "-pairs", FALSE, etBOOL, {&bPairs},
+ "Calculate |cos theta| between all pairs of molecules. May be slow" },
+ { "-ncos", FALSE, etINT, {&ncos},
+ "Must be 1 or 2. Determines whether the <cos> is computed between all mole cules in one group, or between molecules in two different groups. This turns on the -gkr flag." },
+ { "-axis", FALSE, etSTR, {&axtitle},
+ "Take the normal on the computational box in direction X, Y or Z." },
+ { "-sl", FALSE, etINT, {&nslices},
+ "Divide the box in #nr slices." },
+ { "-gkratom", FALSE, etINT, {&nFA},
+ "Use the n-th atom of a molecule (starting from 1) to calculate the distance between molecules rather than the center of charge (when 0) in the calculation of distance dependent Kirkwood factors" },
+ { "-gkratom2", FALSE, etINT, {&nFB},
+ "Same as previous option in case ncos = 2, i.e. dipole interaction between two groups of molecules" },
+ { "-rcmax", FALSE, etREAL, {&rcmax},
+ "Maximum distance to use in the dipole orientation distribution (with ncos == 2). If zero, a criterium based on the box length will be used." },
+ { "-phi", FALSE, etBOOL, {&bPhi},
+ "Plot the 'torsion angle' defined as the rotation of the two dipole vectors around the distance vector between the two molecules in the xpm file from the -cmap option. By default the cosine of the angle between the dipoles is plotted." },
+ { "-nlevels", FALSE, etINT, {&nlevels},
+ "Number of colors in the cmap output" },
+ { "-ndegrees", FALSE, etINT, {&ndegrees},
+ "Number of divisions on the y-axis in the camp output (for 180 degrees)" }
+ };
+ int *gnx;
+ int nFF[2];
+ atom_id **grpindex;
+ char **grpname=NULL;
+ gmx_bool bCorr,bQuad,bGkr,bMU,bSlab;
+ t_filenm fnm[] = {
+ { efEDR, "-en", NULL, ffOPTRD },
+ { efTRX, "-f", NULL, ffREAD },
+ { efTPX, NULL, NULL, ffREAD },
+ { efNDX, NULL, NULL, ffOPTRD },
+ { efXVG, "-o", "Mtot", ffWRITE },
+ { efXVG, "-eps", "epsilon", ffWRITE },
+ { efXVG, "-a", "aver", ffWRITE },
+ { efXVG, "-d", "dipdist", ffWRITE },
+ { efXVG, "-c", "dipcorr", ffOPTWR },
+ { efXVG, "-g", "gkr", ffOPTWR },
+ { efXVG, "-adip","adip", ffOPTWR },
+ { efXVG, "-dip3d", "dip3d", ffOPTWR },
+ { efXVG, "-cos", "cosaver", ffOPTWR },
+ { efXPM, "-cmap","cmap", ffOPTWR },
+ { efXVG, "-q", "quadrupole", ffOPTWR },
+ { efXVG, "-slab","slab", ffOPTWR }
+ };
#define NFILE asize(fnm)
- int npargs;
- t_pargs *ppa;
- t_topology *top;
- int ePBC;
- int k,natoms;
- matrix box;
+ int npargs;
+ t_pargs *ppa;
+ t_topology *top;
+ int ePBC;
+ int k,natoms;
+ matrix box;
- CopyRight(stderr,argv[0]);
- npargs = asize(pa);
- ppa = add_acf_pargs(&npargs,pa);
- parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
- NFILE,fnm,npargs,ppa,asize(desc),desc,0,NULL,&oenv);
-
- printf("Using %g as mu_max and %g as the dipole moment.\n",
- mu_max,mu_aver);
- if (epsilonRF == 0.0)
- printf("WARNING: EpsilonRF = 0.0, this really means EpsilonRF = infinity\n");
-
- bMU = opt2bSet("-en",NFILE,fnm);
- bQuad = opt2bSet("-q",NFILE,fnm);
- bGkr = opt2bSet("-g",NFILE,fnm);
- if (opt2parg_bSet("-ncos",asize(pa),pa)) {
- if ((ncos != 1) && (ncos != 2))
- gmx_fatal(FARGS,"ncos has to be either 1 or 2");
- bGkr = TRUE;
- }
- bSlab = (opt2bSet("-slab",NFILE,fnm) || opt2parg_bSet("-sl",asize(pa),pa) ||
- opt2parg_bSet("-axis",asize(pa),pa));
- if (bMU) {
- bAverCorr = TRUE;
- if (bQuad) {
- printf("WARNING: Can not determine quadrupoles from energy file\n");
- bQuad = FALSE;
+ CopyRight(stderr,argv[0]);
+ npargs = asize(pa);
+ ppa = add_acf_pargs(&npargs,pa);
+ parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_CAN_VIEW | PCA_BE_NICE,
+ NFILE,fnm,npargs,ppa,asize(desc),desc,0,NULL,&oenv);
+
+ printf("Using %g as mu_max and %g as the dipole moment.\n",
+ mu_max,mu_aver);
+ if (epsilonRF == 0.0)
+ printf("WARNING: EpsilonRF = 0.0, this really means EpsilonRF = infinity\n");
+
+ bMU = opt2bSet("-en",NFILE,fnm);
+ bQuad = opt2bSet("-q",NFILE,fnm);
+ bGkr = opt2bSet("-g",NFILE,fnm);
+ if (opt2parg_bSet("-ncos",asize(pa),pa)) {
+ if ((ncos != 1) && (ncos != 2))
+ gmx_fatal(FARGS,"ncos has to be either 1 or 2");
+ bGkr = TRUE;
}
- if (bGkr) {
- printf("WARNING: Can not determine Gk(r) from energy file\n");
- bGkr = FALSE;
- ncos = 1;
+ bSlab = (opt2bSet("-slab",NFILE,fnm) || opt2parg_bSet("-sl",asize(pa),pa) ||
+ opt2parg_bSet("-axis",asize(pa),pa));
+ if (bMU) {
+ bAverCorr = TRUE;
+ if (bQuad) {
+ printf("WARNING: Can not determine quadrupoles from energy file\n");
+ bQuad = FALSE;
+ }
+ if (bGkr) {
+ printf("WARNING: Can not determine Gk(r) from energy file\n");
+ bGkr = FALSE;
+ ncos = 1;
+ }
+ if (mu_aver == -1)
+ printf("WARNING: Can not calculate Gk and gk, since you did\n"
+ " not enter a valid dipole for the molecules\n");
}
- if (mu_aver == -1)
- printf("WARNING: Can not calculate Gk and gk, since you did\n"
- " not enter a valid dipole for the molecules\n");
- }
-
- snew(top,1);
- ePBC = read_tpx_top(ftp2fn(efTPX,NFILE,fnm),NULL,box,
- &natoms,NULL,NULL,NULL,top);
+
+ snew(top,1);
+ ePBC = read_tpx_top(ftp2fn(efTPX,NFILE,fnm),NULL,box,
+ &natoms,NULL,NULL,NULL,top);
- snew(gnx,ncos);
- snew(grpname,ncos);
- snew(grpindex,ncos);
- get_index(&top->atoms,ftp2fn_null(efNDX,NFILE,fnm),
- ncos,gnx,grpindex,grpname);
- for(k=0; (k<ncos); k++) {
- dipole_atom2molindex(&gnx[k],grpindex[k],&(top->mols));
- neutralize_mols(gnx[k],grpindex[k],&(top->mols),top->atoms.atom);
- }
- nFF[0] = nFA;
- nFF[1] = nFB;
- do_dip(top,ePBC,det(box),ftp2fn(efTRX,NFILE,fnm),
- opt2fn("-o",NFILE,fnm),opt2fn("-eps",NFILE,fnm),
- opt2fn("-a",NFILE,fnm),opt2fn("-d",NFILE,fnm),
- opt2fn_null("-cos",NFILE,fnm),
- opt2fn_null("-dip3d",NFILE,fnm),opt2fn_null("-adip",NFILE,fnm),
- bPairs,corrtype[0],
- opt2fn("-c",NFILE,fnm),
- bGkr, opt2fn("-g",NFILE,fnm),
- bPhi, &nlevels, ndegrees,
- ncos,
- opt2fn("-cmap",NFILE,fnm),rcmax,
- bQuad, opt2fn("-q",NFILE,fnm),
- bMU, opt2fn("-en",NFILE,fnm),
- gnx,grpindex,mu_max,mu_aver,epsilonRF,temp,nFF,skip,
- bSlab,nslices,axtitle,opt2fn("-slab",NFILE,fnm),oenv);
+ snew(gnx,ncos);
+ snew(grpname,ncos);
+ snew(grpindex,ncos);
+ get_index(&top->atoms,ftp2fn_null(efNDX,NFILE,fnm),
+ ncos,gnx,grpindex,grpname);
+ for(k=0; (k<ncos); k++)
+ {
+ dipole_atom2molindex(&gnx[k],grpindex[k],&(top->mols));
+ neutralize_mols(gnx[k],grpindex[k],&(top->mols),top->atoms.atom);
+ }
+ nFF[0] = nFA;
+ nFF[1] = nFB;
+ do_dip(top,ePBC,det(box),ftp2fn(efTRX,NFILE,fnm),
+ opt2fn("-o",NFILE,fnm),opt2fn("-eps",NFILE,fnm),
+ opt2fn("-a",NFILE,fnm),opt2fn("-d",NFILE,fnm),
+ opt2fn_null("-cos",NFILE,fnm),
+ opt2fn_null("-dip3d",NFILE,fnm),opt2fn_null("-adip",NFILE,fnm),
+ bPairs,corrtype[0],
+ opt2fn("-c",NFILE,fnm),
+ bGkr, opt2fn("-g",NFILE,fnm),
+ bPhi, &nlevels, ndegrees,
+ ncos,
+ opt2fn("-cmap",NFILE,fnm),rcmax,
+ bQuad, opt2fn("-q",NFILE,fnm),
+ bMU, opt2fn("-en",NFILE,fnm),
+ gnx,grpindex,mu_max,mu_aver,epsilonRF,temp,nFF,skip,
+ bSlab,nslices,axtitle,opt2fn("-slab",NFILE,fnm),oenv);
- do_view(oenv,opt2fn("-o",NFILE,fnm),"-autoscale xy -nxy");
- do_view(oenv,opt2fn("-eps",NFILE,fnm),"-autoscale xy -nxy");
- do_view(oenv,opt2fn("-a",NFILE,fnm),"-autoscale xy -nxy");
- do_view(oenv,opt2fn("-d",NFILE,fnm),"-autoscale xy");
- do_view(oenv,opt2fn("-c",NFILE,fnm),"-autoscale xy");
+ do_view(oenv,opt2fn("-o",NFILE,fnm),"-autoscale xy -nxy");
+ do_view(oenv,opt2fn("-eps",NFILE,fnm),"-autoscale xy -nxy");
+ do_view(oenv,opt2fn("-a",NFILE,fnm),"-autoscale xy -nxy");
+ do_view(oenv,opt2fn("-d",NFILE,fnm),"-autoscale xy");
+ do_view(oenv,opt2fn("-c",NFILE,fnm),"-autoscale xy");
- thanx(stderr);
+ thanx(stderr);
- return 0;
+ return 0;
}
int *cont_type;
gmx_bool bNewFile,bFirst,bNewOutput;
output_env_t oenv;
+ gmx_bool warned_about_dh=FALSE;
+ t_enxblock *blocks=NULL;
+ int nblocks=0;
+ int nblocks_alloc=0;
t_filenm fnm[] = {
{ efEDR, "-f", NULL, ffRDMULT },
static gmx_bool bSort=TRUE,bError=TRUE;
static real begin=-1;
static real end=-1;
+ gmx_bool remove_dh=FALSE;
t_pargs pa[] = {
{ "-b", FALSE, etREAL, {&begin},
"Change starting time interactively" },
{ "-sort", FALSE, etBOOL, {&bSort},
"Sort energy files (not frames)"},
+ { "-rmdh", FALSE, etBOOL, {&remove_dh},
+ "Remove free energy block data" },
{ "-scalefac", FALSE, etREAL, {&scalefac},
"Multiply energy component by this factor" },
{ "-error", FALSE, etBOOL, {&bError},
fro->nblock = fr->nblock;
/*fro->nr = fr->nr;*/
fro->block = fr->block;
+
+ /* check if we have blocks with delta_h data and are throwing
+ away data */
+ if (fro->nblock > 0)
+ {
+ if (remove_dh)
+ {
+ int i;
+ if (!blocks || nblocks_alloc < fr->nblock)
+ {
+ /* we pre-allocate the blocks */
+ nblocks_alloc=fr->nblock;
+ snew(blocks, nblocks_alloc);
+ }
+ nblocks=0; /* number of blocks so far */
+
+ for(i=0;i<fr->nblock;i++)
+ {
+ if ( (fr->block[i].id != enxDHCOLL) &&
+ (fr->block[i].id != enxDH) &&
+ (fr->block[i].id != enxDHHIST) )
+ {
+ /* copy everything verbatim */
+ blocks[nblocks] = fr->block[i];
+ nblocks++;
+ }
+ }
+ /* now set the block pointer to the new blocks */
+ fro->nblock = nblocks;
+ fro->block = blocks;
+ }
+ else if (delta_t > 0)
+ {
+ if (!warned_about_dh)
+ {
+ for(i=0;i<fr->nblock;i++)
+ {
+ if (fr->block[i].id == enxDH ||
+ fr->block[i].id == enxDHHIST)
+ {
+ int size;
+ if (fr->block[i].id == enxDH )
+ {
+ size=fr->block[i].sub[2].nr;
+ }
+ else
+ {
+ size=fr->nsteps;
+ }
+ if (size>0)
+ {
+ printf("\nWARNING: %s contains delta H blocks or histograms for which\n"
+ " some data is thrown away on a block-by-block basis, where each block\n"
+ " contains up to %d samples.\n"
+ " This is almost certainly not what you want.\n"
+ " Use the -rmdh option to throw all delta H samples away.\n"
+ " Use g_energy -odh option to extract these samples.\n",
+ fnms[f], size);
+ warned_about_dh=TRUE;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
do_enx(out,fro);
if (noutfr % 1000 == 0)
#include "main.h"
#include "gmx_ana.h"
-#ifdef GMX_LIB_MPI
-#include <mpi.h>
-#endif
-#ifdef GMX_THREADS
-#include "tmpi.h"
-#endif
-
-/* afm stuf */
-#include "pull.h"
-
-/* We use the same defines as in mvdata.c here */
-#define block_bc(cr, d) gmx_bcast( sizeof(d), &(d),(cr))
-#define nblock_bc(cr,nr,d) gmx_bcast((nr)*sizeof((d)[0]), (d),(cr))
-#define snew_bc(cr,d,nr) { if (!MASTER(cr)) snew((d),(nr)); }
-
-/* The following two variables and the signal_handler function
- * is used from pme.c as well
- */
-
-typedef struct {
- t_state s;
- rvec *f;
- real epot;
- real fnorm;
- real fmax;
- int a_fmax;
-} em_state_t;
-
-typedef struct {
- int it_xy;
- int it_z;
- int xy_step;
- int z_step;
- rvec xmin;
- rvec xmax;
- rvec *geom_cent;
- int pieces;
- int *nidx;
- atom_id **subindex;
-} pos_ins_t;
-
-typedef struct {
- int id;
- char *name;
- int nr;
- int natoms; /*nr of atoms per lipid*/
- int mol1; /*id of the first lipid molecule*/
- real area;
-} lip_t;
-
-typedef struct {
- char *name;
- t_block mem_at;
- int *mol_id;
- int nmol;
- real lip_area;
- real zmin;
- real zmax;
- real zmed;
-} mem_t;
-
-typedef struct {
- int *mol;
- int *block;
- int nr;
-} rm_t;
-
-int search_string(char *s,int ng,char ***gn)
-{
- int i;
-
- for(i=0; (i<ng); i++)
- if (gmx_strcasecmp(s,*gn[i]) == 0)
- return i;
-
- gmx_fatal(FARGS,"Group %s not found in indexfile.\nMaybe you have non-default groups in your mdp file, while not using the '-n' option of grompp.\nIn that case use the '-n' option.\n",s);
-
- return -1;
-}
-
-int get_mol_id(int at,int nmblock,gmx_molblock_t *mblock, int *type, int *block)
-{
- int mol_id=0;
- int i;
-
- for(i=0;i<nmblock;i++)
- {
- if(at<(mblock[i].nmol*mblock[i].natoms_mol))
- {
- mol_id+=at/mblock[i].natoms_mol;
- *type = mblock[i].type;
- *block = i;
- return mol_id;
- } else {
- at-= mblock[i].nmol*mblock[i].natoms_mol;
- mol_id+=mblock[i].nmol;
- }
- }
-
- gmx_fatal(FARGS,"Something is wrong in mol ids, at %d, mol_id %d",at,mol_id);
-
- return -1;
-}
-
-int get_block(int mol_id,int nmblock,gmx_molblock_t *mblock)
-{
- int i;
- int nmol=0;
-
- for(i=0;i<nmblock;i++)
- {
- nmol+=mblock[i].nmol;
- if(mol_id<nmol)
- return i;
- }
-
- gmx_fatal(FARGS,"mol_id %d larger than total number of molecules %d.\n",mol_id,nmol);
-
- return -1;
-}
-
-int get_tpr_version(const char *infile)
-{
- char buf[STRLEN];
- gmx_bool bDouble;
- int precision,fver;
- t_fileio *fio;
-
- fio = open_tpx(infile,"r");
- gmx_fio_checktype(fio);
-
- precision = sizeof(real);
-
- gmx_fio_do_string(fio,buf);
- if (strncmp(buf,"VERSION",7))
- gmx_fatal(FARGS,"Can not read file %s,\n"
- " this file is from a Gromacs version which is older than 2.0\n"
- " Make a new one with grompp or use a gro or pdb file, if possible",
- gmx_fio_getname(fio));
- gmx_fio_do_int(fio,precision);
- bDouble = (precision == sizeof(double));
- if ((precision != sizeof(float)) && !bDouble)
- gmx_fatal(FARGS,"Unknown precision in file %s: real is %d bytes "
- "instead of %d or %d",
- gmx_fio_getname(fio),precision,sizeof(float),sizeof(double));
- gmx_fio_setprecision(fio,bDouble);
- fprintf(stderr,"Reading file %s, %s (%s precision)\n",
- gmx_fio_getname(fio),buf,bDouble ? "double" : "single");
-
- gmx_fio_do_int(fio,fver);
-
- close_tpx(fio);
-
- return fver;
-}
-
-void set_inbox(int natom, rvec *x)
-{
- rvec tmp;
- int i;
-
- tmp[XX]=tmp[YY]=tmp[ZZ]=0.0;
- for(i=0;i<natom;i++)
- {
- if(x[i][XX]<tmp[XX]) tmp[XX]=x[i][XX];
- if(x[i][YY]<tmp[YY]) tmp[YY]=x[i][YY];
- if(x[i][ZZ]<tmp[ZZ]) tmp[ZZ]=x[i][ZZ];
- }
-
- for(i=0;i<natom;i++)
- rvec_inc(x[i],tmp);
-}
-
-int get_mtype_list(t_block *at, gmx_mtop_t *mtop, t_block *tlist)
-{
- int i,j,nr,mol_id;
- int type=0,block=0;
- gmx_bool bNEW;
-
- nr=0;
- snew(tlist->index,at->nr);
- for (i=0;i<at->nr;i++)
- {
- bNEW=TRUE;
- mol_id = get_mol_id(at->index[i],mtop->nmolblock,mtop->molblock,&type,&block);
- for(j=0;j<nr;j++)
- {
- if(tlist->index[j]==type)
- bNEW=FALSE;
- }
- if(bNEW==TRUE)
- {
- tlist->index[nr]=type;
- nr++;
- }
- }
-
- srenew(tlist->index,nr);
- return nr;
-}
-
-void check_types(t_block *ins_at,t_block *rest_at,gmx_mtop_t *mtop)
-{
- t_block *ins_mtype,*rest_mtype;
- int i,j;
-
- snew(ins_mtype,1);
- snew(rest_mtype,1);
- ins_mtype->nr = get_mtype_list(ins_at , mtop, ins_mtype );
- rest_mtype->nr = get_mtype_list(rest_at, mtop, rest_mtype);
-
- for(i=0;i<ins_mtype->nr;i++)
- {
- for(j=0;j<rest_mtype->nr;j++)
- {
- if(ins_mtype->index[i]==rest_mtype->index[j])
- gmx_fatal(FARGS,"Moleculetype %s is found both in the group to insert and the rest of the system.\n"
- "Because we need to exclude all interactions between the atoms in the group to\n"
- "insert, the same moleculetype can not be used in both groups. Change the\n"
- "moleculetype of the molecules %s in the inserted group. Do not forget to provide\n"
- "an appropriate *.itp file",*(mtop->moltype[rest_mtype->index[j]].name),
- *(mtop->moltype[rest_mtype->index[j]].name));
- }
- }
-
- sfree(ins_mtype->index);
- sfree(rest_mtype->index);
- sfree(ins_mtype);
- sfree(rest_mtype);
-}
-
-int init_ins_at(t_block *ins_at,t_block *rest_at,t_state *state, pos_ins_t *pos_ins,gmx_groups_t *groups,int ins_grp_id, real xy_max)
-{
- int i,gid,c=0;
- real x,xmin,xmax,y,ymin,ymax,z,zmin,zmax;
-
- snew(rest_at->index,state->natoms);
-
- xmin=xmax=state->x[ins_at->index[0]][XX];
- ymin=ymax=state->x[ins_at->index[0]][YY];
- zmin=zmax=state->x[ins_at->index[0]][ZZ];
-
- for(i=0;i<state->natoms;i++)
- {
- gid = groups->grpnr[egcFREEZE][i];
- if(groups->grps[egcFREEZE].nm_ind[gid]==ins_grp_id)
- {
- x=state->x[i][XX];
- if (x<xmin) xmin=x;
- if (x>xmax) xmax=x;
- y=state->x[i][YY];
- if (y<ymin) ymin=y;
- if (y>ymax) ymax=y;
- z=state->x[i][ZZ];
- if (z<zmin) zmin=z;
- if (z>zmax) zmax=z;
- } else {
- rest_at->index[c]=i;
- c++;
- }
- }
-
- rest_at->nr=c;
- srenew(rest_at->index,c);
-
- if(xy_max>1.000001)
- {
- pos_ins->xmin[XX]=xmin-((xmax-xmin)*xy_max-(xmax-xmin))/2;
- pos_ins->xmin[YY]=ymin-((ymax-ymin)*xy_max-(ymax-ymin))/2;
-
- pos_ins->xmax[XX]=xmax+((xmax-xmin)*xy_max-(xmax-xmin))/2;
- pos_ins->xmax[YY]=ymax+((ymax-ymin)*xy_max-(ymax-ymin))/2;
- } else {
- pos_ins->xmin[XX]=xmin;
- pos_ins->xmin[YY]=ymin;
-
- pos_ins->xmax[XX]=xmax;
- pos_ins->xmax[YY]=ymax;
- }
-
- /* 6.0 is estimated thickness of bilayer */
- if( (zmax-zmin) < 6.0 )
- {
- pos_ins->xmin[ZZ]=zmin+(zmax-zmin)/2.0-3.0;
- pos_ins->xmax[ZZ]=zmin+(zmax-zmin)/2.0+3.0;
- } else {
- pos_ins->xmin[ZZ]=zmin;
- pos_ins->xmax[ZZ]=zmax;
- }
-
- return c;
-}
-
-real est_prot_area(pos_ins_t *pos_ins,rvec *r,t_block *ins_at, mem_t *mem_p)
-{
- real x,y,dx=0.15,dy=0.15,area=0.0;
- real add;
- int c,at;
-
- for(x=pos_ins->xmin[XX];x<pos_ins->xmax[XX];x+=dx)
- {
- for(y=pos_ins->xmin[YY];y<pos_ins->xmax[YY];y+=dy)
- {
- c=0;
- add=0.0;
- do
- {
- at=ins_at->index[c];
- if ( (r[at][XX]>=x) && (r[at][XX]<x+dx) &&
- (r[at][YY]>=y) && (r[at][YY]<y+dy) &&
- (r[at][ZZ]>mem_p->zmin+1.0) && (r[at][ZZ]<mem_p->zmax-1.0) )
- add=1.0;
- c++;
- } while ( (c<ins_at->nr) && (add<0.5) );
- area+=add;
- }
- }
- area=area*dx*dy;
-
- return area;
-}
-
-void init_lip(matrix box, gmx_mtop_t *mtop, lip_t *lip)
-{
- int i;
- real mem_area;
- int mol1=0;
-
- mem_area = box[XX][XX]*box[YY][YY]-box[XX][YY]*box[YY][XX];
- for(i=0;i<mtop->nmolblock;i++)
- {
- if(mtop->molblock[i].type == lip->id)
- {
- lip->nr=mtop->molblock[i].nmol;
- lip->natoms=mtop->molblock[i].natoms_mol;
- }
- }
- lip->area=2.0*mem_area/(double)lip->nr;
-
- for (i=0;i<lip->id;i++)
- mol1+=mtop->molblock[i].nmol;
- lip->mol1=mol1;
-}
-
-int init_mem_at(mem_t *mem_p, gmx_mtop_t *mtop, rvec *r, matrix box, pos_ins_t *pos_ins)
-{
- int i,j,at,mol,nmol,nmolbox,count;
- t_block *mem_a;
- real z,zmin,zmax,mem_area;
- gmx_bool bNew;
- atom_id *mol_id;
- int type=0,block=0;
-
- nmol=count=0;
- mem_a=&(mem_p->mem_at);
- snew(mol_id,mem_a->nr);
-/* snew(index,mem_a->nr); */
- zmin=pos_ins->xmax[ZZ];
- zmax=pos_ins->xmin[ZZ];
- for(i=0;i<mem_a->nr;i++)
- {
- at=mem_a->index[i];
- if( (r[at][XX]>pos_ins->xmin[XX]) && (r[at][XX]<pos_ins->xmax[XX]) &&
- (r[at][YY]>pos_ins->xmin[YY]) && (r[at][YY]<pos_ins->xmax[YY]) &&
- (r[at][ZZ]>pos_ins->xmin[ZZ]) && (r[at][ZZ]<pos_ins->xmax[ZZ]) )
- {
- mol = get_mol_id(at,mtop->nmolblock,mtop->molblock,&type,&block);
-
- bNew=TRUE;
- for(j=0;j<nmol;j++)
- if(mol == mol_id[j])
- bNew=FALSE;
-
- if(bNew)
- {
- mol_id[nmol]=mol;
- nmol++;
- }
-
- z=r[at][ZZ];
- if(z<zmin) zmin=z;
- if(z>zmax) zmax=z;
-
-/* index[count]=at;*/
- count++;
- }
- }
-
- mem_p->nmol=nmol;
- srenew(mol_id,nmol);
- mem_p->mol_id=mol_id;
-/* srenew(index,count);*/
-/* mem_p->mem_at.nr=count;*/
-/* sfree(mem_p->mem_at.index);*/
-/* mem_p->mem_at.index=index;*/
-
- if((zmax-zmin)>(box[ZZ][ZZ]-0.5))
- gmx_fatal(FARGS,"Something is wrong with your membrane. Max and min z values are %f and %f.\n"
- "Maybe your membrane is not centered in the box, but located at the box edge in the z-direction,\n"
- "so that one membrane is distributed over two periodic box images. Another possibility is that\n"
- "your water layer is not thick enough.\n",zmax,zmin);
- mem_p->zmin=zmin;
- mem_p->zmax=zmax;
- mem_p->zmed=(zmax-zmin)/2+zmin;
-
- /*number of membrane molecules in protein box*/
- nmolbox = count/mtop->molblock[block].natoms_mol;
- /*mem_area = box[XX][XX]*box[YY][YY]-box[XX][YY]*box[YY][XX];
- mem_p->lip_area = 2.0*mem_area/(double)mem_p->nmol;*/
- mem_area = (pos_ins->xmax[XX]-pos_ins->xmin[XX])*(pos_ins->xmax[YY]-pos_ins->xmin[YY]);
- mem_p->lip_area = 2.0*mem_area/(double)nmolbox;
-
- return mem_p->mem_at.nr;
-}
-
-void init_resize(t_block *ins_at,rvec *r_ins,pos_ins_t *pos_ins,mem_t *mem_p,rvec *r, gmx_bool bALLOW_ASYMMETRY)
-{
- int i,j,at,c,outsidesum,gctr=0;
- int idxsum=0;
-
- /*sanity check*/
- for (i=0;i<pos_ins->pieces;i++)
- idxsum+=pos_ins->nidx[i];
- if (idxsum!=ins_at->nr)
- gmx_fatal(FARGS,"Piecewise sum of inserted atoms not same as size of group selected to insert.");
-
- snew(pos_ins->geom_cent,pos_ins->pieces);
- for (i=0;i<pos_ins->pieces;i++)
- {
- c=0;
- outsidesum=0;
- for(j=0;j<DIM;j++)
- pos_ins->geom_cent[i][j]=0;
-
- for(j=0;j<DIM;j++)
- pos_ins->geom_cent[i][j]=0;
- for (j=0;j<pos_ins->nidx[i];j++)
- {
- at=pos_ins->subindex[i][j];
- copy_rvec(r[at],r_ins[gctr]);
- if( (r_ins[gctr][ZZ]<mem_p->zmax) && (r_ins[gctr][ZZ]>mem_p->zmin) )
- {
- rvec_inc(pos_ins->geom_cent[i],r_ins[gctr]);
- c++;
- }
- else
- outsidesum++;
- gctr++;
- }
- if (c>0)
- svmul(1/(double)c,pos_ins->geom_cent[i],pos_ins->geom_cent[i]);
- if (!bALLOW_ASYMMETRY)
- pos_ins->geom_cent[i][ZZ]=mem_p->zmed;
-
- fprintf(stderr,"Embedding piece %d with center of geometry: %f %f %f\n",i,pos_ins->geom_cent[i][XX],pos_ins->geom_cent[i][YY],pos_ins->geom_cent[i][ZZ]);
- }
- fprintf(stderr,"\n");
-}
-
-void resize(t_block *ins_at, rvec *r_ins, rvec *r, pos_ins_t *pos_ins,rvec fac)
-{
- int i,j,k,at,c=0;
- for (k=0;k<pos_ins->pieces;k++)
- for(i=0;i<pos_ins->nidx[k];i++)
- {
- at=pos_ins->subindex[k][i];
- for(j=0;j<DIM;j++)
- r[at][j]=pos_ins->geom_cent[k][j]+fac[j]*(r_ins[c][j]-pos_ins->geom_cent[k][j]);
- c++;
- }
-}
-
-int gen_rm_list(rm_t *rm_p,t_block *ins_at,t_block *rest_at,t_pbc *pbc, gmx_mtop_t *mtop,
- rvec *r, rvec *r_ins, mem_t *mem_p, pos_ins_t *pos_ins, real probe_rad, int low_up_rm, gmx_bool bALLOW_ASYMMETRY)
-{
- int i,j,k,l,at,at2,mol_id;
- int type=0,block=0;
- int nrm,nupper,nlower;
- real r_min_rad,z_lip,min_norm;
- gmx_bool bRM;
- rvec dr,dr_tmp;
- real *dist;
- int *order;
-
- r_min_rad=probe_rad*probe_rad;
- snew(rm_p->mol,mtop->mols.nr);
- snew(rm_p->block,mtop->mols.nr);
- nrm=nupper=0;
- nlower=low_up_rm;
- for(i=0;i<ins_at->nr;i++)
- {
- at=ins_at->index[i];
- for(j=0;j<rest_at->nr;j++)
- {
- at2=rest_at->index[j];
- pbc_dx(pbc,r[at],r[at2],dr);
-
- if(norm2(dr)<r_min_rad)
- {
- mol_id = get_mol_id(at2,mtop->nmolblock,mtop->molblock,&type,&block);
- bRM=TRUE;
- for(l=0;l<nrm;l++)
- if(rm_p->mol[l]==mol_id)
- bRM=FALSE;
- if(bRM)
- {
- /*fprintf(stderr,"%d wordt toegevoegd\n",mol_id);*/
- rm_p->mol[nrm]=mol_id;
- rm_p->block[nrm]=block;
- nrm++;
- z_lip=0.0;
- for(l=0;l<mem_p->nmol;l++)
- {
- if(mol_id==mem_p->mol_id[l])
- {
- for(k=mtop->mols.index[mol_id];k<mtop->mols.index[mol_id+1];k++)
- z_lip+=r[k][ZZ];
- z_lip/=mtop->molblock[block].natoms_mol;
- if(z_lip<mem_p->zmed)
- nlower++;
- else
- nupper++;
- }
- }
- }
- }
- }
- }
-
- /*make sure equal number of lipids from upper and lower layer are removed */
- if( (nupper!=nlower) && (!bALLOW_ASYMMETRY) )
- {
- snew(dist,mem_p->nmol);
- snew(order,mem_p->nmol);
- for(i=0;i<mem_p->nmol;i++)
- {
- at = mtop->mols.index[mem_p->mol_id[i]];
- pbc_dx(pbc,r[at],pos_ins->geom_cent[0],dr);
- if (pos_ins->pieces>1)
- {
- /*minimum dr value*/
- min_norm=norm2(dr);
- for (k=1;k<pos_ins->pieces;k++)
- {
- pbc_dx(pbc,r[at],pos_ins->geom_cent[k],dr_tmp);
- if (norm2(dr_tmp) < min_norm)
- {
- min_norm=norm2(dr_tmp);
- copy_rvec(dr_tmp,dr);
- }
- }
- }
- dist[i]=dr[XX]*dr[XX]+dr[YY]*dr[YY];
- j=i-1;
- while (j>=0 && dist[i]<dist[order[j]])
- {
- order[j+1]=order[j];
- j--;
- }
- order[j+1]=i;
- }
-
- i=0;
- while(nupper!=nlower)
- {
- mol_id=mem_p->mol_id[order[i]];
- block=get_block(mol_id,mtop->nmolblock,mtop->molblock);
-
- bRM=TRUE;
- for(l=0;l<nrm;l++)
- if(rm_p->mol[l]==mol_id)
- bRM=FALSE;
- if(bRM)
- {
- z_lip=0;
- for(k=mtop->mols.index[mol_id];k<mtop->mols.index[mol_id+1];k++)
- z_lip+=r[k][ZZ];
- z_lip/=mtop->molblock[block].natoms_mol;
- if(nupper>nlower && z_lip<mem_p->zmed)
- {
- rm_p->mol[nrm]=mol_id;
- rm_p->block[nrm]=block;
- nrm++;
- nlower++;
- }
- else if (nupper<nlower && z_lip>mem_p->zmed)
- {
- rm_p->mol[nrm]=mol_id;
- rm_p->block[nrm]=block;
- nrm++;
- nupper++;
- }
- }
- i++;
-
- if(i>mem_p->nmol)
- gmx_fatal(FARGS,"Trying to remove more lipid molecules than there are in the membrane");
- }
- sfree(dist);
- sfree(order);
- }
-
- rm_p->nr=nrm;
- srenew(rm_p->mol,nrm);
- srenew(rm_p->block,nrm);
-
- return nupper+nlower;
-}
-
-void rm_group(t_inputrec *ir, gmx_groups_t *groups, gmx_mtop_t *mtop, rm_t *rm_p, t_state *state, t_block *ins_at, pos_ins_t *pos_ins)
-{
- int i,j,k,n,rm,mol_id,at,block;
- rvec *x_tmp,*v_tmp;
- atom_id *list,*new_mols;
- unsigned char *new_egrp[egcNR];
- gmx_bool bRM;
-
- snew(list,state->natoms);
- n=0;
- for(i=0;i<rm_p->nr;i++)
- {
- mol_id=rm_p->mol[i];
- at=mtop->mols.index[mol_id];
- block =rm_p->block[i];
- mtop->molblock[block].nmol--;
- for(j=0;j<mtop->molblock[block].natoms_mol;j++)
- {
- list[n]=at+j;
- n++;
- }
-
- mtop->mols.index[mol_id]=-1;
- }
-
- mtop->mols.nr-=rm_p->nr;
- mtop->mols.nalloc_index-=rm_p->nr;
- snew(new_mols,mtop->mols.nr);
- for(i=0;i<mtop->mols.nr+rm_p->nr;i++)
- {
- j=0;
- if(mtop->mols.index[i]!=-1)
- {
- new_mols[j]=mtop->mols.index[i];
- j++;
- }
- }
- sfree(mtop->mols.index);
- mtop->mols.index=new_mols;
-
-
- mtop->natoms-=n;
- state->natoms-=n;
- state->nalloc=state->natoms;
- snew(x_tmp,state->nalloc);
- snew(v_tmp,state->nalloc);
-
- for(i=0;i<egcNR;i++)
- {
- if(groups->grpnr[i]!=NULL)
- {
- groups->ngrpnr[i]=state->natoms;
- snew(new_egrp[i],state->natoms);
- }
- }
-
- rm=0;
- for (i=0;i<state->natoms+n;i++)
- {
- bRM=FALSE;
- for(j=0;j<n;j++)
- {
- if(i==list[j])
- {
- bRM=TRUE;
- rm++;
- }
- }
-
- if(!bRM)
- {
- for(j=0;j<egcNR;j++)
- {
- if(groups->grpnr[j]!=NULL)
- {
- new_egrp[j][i-rm]=groups->grpnr[j][i];
- }
- }
- copy_rvec(state->x[i],x_tmp[i-rm]);
- copy_rvec(state->v[i],v_tmp[i-rm]);
- for(j=0;j<ins_at->nr;j++)
- {
- if (i==ins_at->index[j])
- ins_at->index[j]=i-rm;
- }
- for(j=0;j<pos_ins->pieces;j++)
- {
- for(k=0;k<pos_ins->nidx[j];k++)
- {
- if (i==pos_ins->subindex[j][k])
- pos_ins->subindex[j][k]=i-rm;
- }
- }
- }
- }
- sfree(state->x);
- state->x=x_tmp;
- sfree(state->v);
- state->v=v_tmp;
-
- for(i=0;i<egcNR;i++)
- {
- if(groups->grpnr[i]!=NULL)
- {
- sfree(groups->grpnr[i]);
- groups->grpnr[i]=new_egrp[i];
- }
- }
-}
-
-int rm_bonded(t_block *ins_at, gmx_mtop_t *mtop)
-{
- int i,j,m;
- int type,natom,nmol,at,atom1=0,rm_at=0;
- gmx_bool *bRM,bINS;
- /*this routine lives dangerously by assuming that all molecules of a given type are in order in the structure*/
- /*this routine does not live as dangerously as it seems. There is namely a check in mdrunner_membed to make
- *sure that g_membed exits with a warning when there are molecules of the same type not in the
- *ins_at index group. MGWolf 050710 */
-
-
- snew(bRM,mtop->nmoltype);
- for (i=0;i<mtop->nmoltype;i++)
- {
- bRM[i]=TRUE;
- }
-
- for (i=0;i<mtop->nmolblock;i++)
- {
- /*loop over molecule blocks*/
- type =mtop->molblock[i].type;
- natom =mtop->molblock[i].natoms_mol;
- nmol =mtop->molblock[i].nmol;
-
- for(j=0;j<natom*nmol && bRM[type]==TRUE;j++)
- {
- /*loop over atoms in the block*/
- at=j+atom1; /*atom index = block index + offset*/
- bINS=FALSE;
-
- for (m=0;(m<ins_at->nr) && (bINS==FALSE);m++)
- {
- /*loop over atoms in insertion index group to determine if we're inserting one*/
- if(at==ins_at->index[m])
- {
- bINS=TRUE;
- }
- }
- bRM[type]=bINS;
- }
- atom1+=natom*nmol; /*update offset*/
- if(bRM[type])
- {
- rm_at+=natom*nmol; /*increment bonded removal counter by # atoms in block*/
- }
- }
-
- for(i=0;i<mtop->nmoltype;i++)
- {
- if(bRM[i])
- {
- for(j=0;j<F_LJ;j++)
- {
- mtop->moltype[i].ilist[j].nr=0;
- }
- for(j=F_POSRES;j<=F_VSITEN;j++)
- {
- mtop->moltype[i].ilist[j].nr=0;
- }
- }
- }
- sfree(bRM);
-
- return rm_at;
-}
-
-void top_update(const char *topfile, char *ins, rm_t *rm_p, gmx_mtop_t *mtop)
-{
-#define TEMP_FILENM "temp.top"
- int bMolecules=0;
- FILE *fpin,*fpout;
- char buf[STRLEN],buf2[STRLEN],*temp;
- int i,*nmol_rm,nmol,line;
-
- fpin = ffopen(topfile,"r");
- fpout = ffopen(TEMP_FILENM,"w");
-
- snew(nmol_rm,mtop->nmoltype);
- for(i=0;i<rm_p->nr;i++)
- nmol_rm[rm_p->block[i]]++;
-
- line=0;
- while(fgets(buf,STRLEN,fpin))
- {
- line++;
- if(buf[0]!=';')
- {
- strcpy(buf2,buf);
- if ((temp=strchr(buf2,'\n')) != NULL)
- temp[0]='\0';
- ltrim(buf2);
-
- if (buf2[0]=='[')
- {
- buf2[0]=' ';
- if ((temp=strchr(buf2,'\n')) != NULL)
- temp[0]='\0';
- rtrim(buf2);
- if (buf2[strlen(buf2)-1]==']')
- {
- buf2[strlen(buf2)-1]='\0';
- ltrim(buf2);
- rtrim(buf2);
- if (gmx_strcasecmp(buf2,"molecules")==0)
- bMolecules=1;
- }
- fprintf(fpout,"%s",buf);
- } else if (bMolecules==1)
- {
- for(i=0;i<mtop->nmolblock;i++)
- {
- nmol=mtop->molblock[i].nmol;
- sprintf(buf,"%-15s %5d\n",*(mtop->moltype[mtop->molblock[i].type].name),nmol);
- fprintf(fpout,"%s",buf);
- }
- bMolecules=2;
- } else if (bMolecules==2)
- {
- /* print nothing */
- } else
- {
- fprintf(fpout,"%s",buf);
- }
- } else
- {
- fprintf(fpout,"%s",buf);
- }
- }
-
- fclose(fpout);
- /* use ffopen to generate backup of topinout */
- fpout=ffopen(topfile,"w");
- fclose(fpout);
- rename(TEMP_FILENM,topfile);
-#undef TEMP_FILENM
-}
-
-void md_print_warning(const t_commrec *cr,FILE *fplog,const char *buf)
-{
- if (MASTER(cr))
- {
- fprintf(stderr,"\n%s\n",buf);
- }
- if (fplog)
- {
- fprintf(fplog,"\n%s\n",buf);
- }
-}
-
-/* simulation conditions to transmit. Keep in mind that they are
- transmitted to other nodes through an MPI_Reduce after
- casting them to a real (so the signals can be sent together with other
- data). This means that the only meaningful values are positive,
- negative or zero. */
-enum { eglsNABNSB, eglsCHKPT, eglsSTOPCOND, eglsRESETCOUNTERS, eglsNR };
-/* Is the signal in one simulation independent of other simulations? */
-gmx_bool gs_simlocal[eglsNR] = { TRUE, FALSE, FALSE, TRUE };
-
-typedef struct {
- int nstms; /* The frequency for intersimulation communication */
- int sig[eglsNR]; /* The signal set by one process in do_md */
- int set[eglsNR]; /* The communicated signal, equal for all processes */
-} globsig_t;
-
-
-static int multisim_min(const gmx_multisim_t *ms,int nmin,int n)
-{
- int *buf;
- gmx_bool bPos,bEqual;
- int s,d;
-
- snew(buf,ms->nsim);
- buf[ms->sim] = n;
- gmx_sumi_sim(ms->nsim,buf,ms);
- bPos = TRUE;
- bEqual = TRUE;
- for(s=0; s<ms->nsim; s++)
- {
- bPos = bPos && (buf[s] > 0);
- bEqual = bEqual && (buf[s] == buf[0]);
- }
- if (bPos)
- {
- if (bEqual)
- {
- nmin = min(nmin,buf[0]);
- }
- else
- {
- /* Find the least common multiple */
- for(d=2; d<nmin; d++)
- {
- s = 0;
- while (s < ms->nsim && d % buf[s] == 0)
- {
- s++;
- }
- if (s == ms->nsim)
- {
- /* We found the LCM and it is less than nmin */
- nmin = d;
- break;
- }
- }
- }
- }
- sfree(buf);
-
- return nmin;
-}
-
-static int multisim_nstsimsync(const t_commrec *cr,
- const t_inputrec *ir,int repl_ex_nst)
-{
- int nmin;
-
- if (MASTER(cr))
- {
- nmin = INT_MAX;
- nmin = multisim_min(cr->ms,nmin,ir->nstlist);
- nmin = multisim_min(cr->ms,nmin,ir->nstcalcenergy);
- nmin = multisim_min(cr->ms,nmin,repl_ex_nst);
- if (nmin == INT_MAX)
- {
- gmx_fatal(FARGS,"Can not find an appropriate interval for inter-simulation communication, since nstlist, nstcalcenergy and -replex are all <= 0");
- }
- /* Avoid inter-simulation communication at every (second) step */
- if (nmin <= 2)
- {
- nmin = 10;
- }
- }
-
- gmx_bcast(sizeof(int),&nmin,cr);
-
- return nmin;
-}
-
-static void init_global_signals(globsig_t *gs,const t_commrec *cr,
- const t_inputrec *ir,int repl_ex_nst)
-{
- int i;
-
- if (MULTISIM(cr))
- {
- gs->nstms = multisim_nstsimsync(cr,ir,repl_ex_nst);
- if (debug)
- {
- fprintf(debug,"Syncing simulations for checkpointing and termination every %d steps\n",gs->nstms);
- }
- }
- else
- {
- gs->nstms = 1;
- }
-
- for(i=0; i<eglsNR; i++)
- {
- gs->sig[i] = 0;
- gs->set[i] = 0;
- }
-}
-
-static void copy_coupling_state(t_state *statea,t_state *stateb,
- gmx_ekindata_t *ekinda,gmx_ekindata_t *ekindb, t_grpopts* opts)
-{
-
- /* MRS note -- might be able to get rid of some of the arguments. Look over it when it's all debugged */
-
- int i,j,nc;
-
- /* Make sure we have enough space for x and v */
- if (statea->nalloc > stateb->nalloc)
- {
- stateb->nalloc = statea->nalloc;
- srenew(stateb->x,stateb->nalloc);
- srenew(stateb->v,stateb->nalloc);
- }
-
- stateb->natoms = statea->natoms;
- stateb->ngtc = statea->ngtc;
- stateb->nnhpres = statea->nnhpres;
- stateb->veta = statea->veta;
- if (ekinda)
- {
- copy_mat(ekinda->ekin,ekindb->ekin);
- for (i=0; i<stateb->ngtc; i++)
- {
- ekindb->tcstat[i].T = ekinda->tcstat[i].T;
- ekindb->tcstat[i].Th = ekinda->tcstat[i].Th;
- copy_mat(ekinda->tcstat[i].ekinh,ekindb->tcstat[i].ekinh);
- copy_mat(ekinda->tcstat[i].ekinf,ekindb->tcstat[i].ekinf);
- ekindb->tcstat[i].ekinscalef_nhc = ekinda->tcstat[i].ekinscalef_nhc;
- ekindb->tcstat[i].ekinscaleh_nhc = ekinda->tcstat[i].ekinscaleh_nhc;
- ekindb->tcstat[i].vscale_nhc = ekinda->tcstat[i].vscale_nhc;
- }
- }
- copy_rvecn(statea->x,stateb->x,0,stateb->natoms);
- copy_rvecn(statea->v,stateb->v,0,stateb->natoms);
- copy_mat(statea->box,stateb->box);
- copy_mat(statea->box_rel,stateb->box_rel);
- copy_mat(statea->boxv,stateb->boxv);
-
- for (i = 0; i<stateb->ngtc; i++)
- {
- nc = i*opts->nhchainlength;
- for (j=0; j<opts->nhchainlength; j++)
- {
- stateb->nosehoover_xi[nc+j] = statea->nosehoover_xi[nc+j];
- stateb->nosehoover_vxi[nc+j] = statea->nosehoover_vxi[nc+j];
- }
- }
- if (stateb->nhpres_xi != NULL)
- {
- for (i = 0; i<stateb->nnhpres; i++)
- {
- nc = i*opts->nhchainlength;
- for (j=0; j<opts->nhchainlength; j++)
- {
- stateb->nhpres_xi[nc+j] = statea->nhpres_xi[nc+j];
- stateb->nhpres_vxi[nc+j] = statea->nhpres_vxi[nc+j];
- }
- }
- }
-}
-
-static void compute_globals(FILE *fplog, gmx_global_stat_t gstat, t_commrec *cr, t_inputrec *ir,
- t_forcerec *fr, gmx_ekindata_t *ekind,
- t_state *state, t_state *state_global, t_mdatoms *mdatoms,
- t_nrnb *nrnb, t_vcm *vcm, gmx_wallcycle_t wcycle,
- gmx_enerdata_t *enerd,tensor force_vir, tensor shake_vir, tensor total_vir,
- tensor pres, rvec mu_tot, gmx_constr_t constr,
- globsig_t *gs,gmx_bool bInterSimGS,
- matrix box, gmx_mtop_t *top_global, real *pcurr,
- int natoms, gmx_bool *bSumEkinhOld, int flags)
-{
- int i,gsi;
- real gs_buf[eglsNR];
- tensor corr_vir,corr_pres;
- gmx_bool bEner,bPres,bTemp;
- gmx_bool bRerunMD, bStopCM, bGStat, bIterate,
- bFirstIterate,bReadEkin,bEkinAveVel,bScaleEkin, bConstrain;
- real prescorr,enercorr,dvdlcorr;
-
- /* translate CGLO flags to gmx_booleans */
- bRerunMD = flags & CGLO_RERUNMD;
- bStopCM = flags & CGLO_STOPCM;
- bGStat = flags & CGLO_GSTAT;
- bReadEkin = (flags & CGLO_READEKIN);
- bScaleEkin = (flags & CGLO_SCALEEKIN);
- bEner = flags & CGLO_ENERGY;
- bTemp = flags & CGLO_TEMPERATURE;
- bPres = (flags & CGLO_PRESSURE);
- bConstrain = (flags & CGLO_CONSTRAINT);
- bIterate = (flags & CGLO_ITERATE);
- bFirstIterate = (flags & CGLO_FIRSTITERATE);
-
- /* we calculate a full state kinetic energy either with full-step velocity verlet
- or half step where we need the pressure */
- bEkinAveVel = (ir->eI==eiVV || (ir->eI==eiVVAK && IR_NPT_TROTTER(ir) && bPres) || bReadEkin);
-
- /* in initalization, it sums the shake virial in vv, and to
- sums ekinh_old in leapfrog (or if we are calculating ekinh_old for other reasons */
-
- /* ########## Kinetic energy ############## */
-
- if (bTemp)
- {
- /* Non-equilibrium MD: this is parallellized, but only does communication
- * when there really is NEMD.
- */
-
- if (PAR(cr) && (ekind->bNEMD))
- {
- accumulate_u(cr,&(ir->opts),ekind);
- }
- debug_gmx();
- if (bReadEkin)
- {
- restore_ekinstate_from_state(cr,ekind,&state_global->ekinstate);
- }
- else
- {
-
- calc_ke_part(state,&(ir->opts),mdatoms,ekind,nrnb,bEkinAveVel,bIterate);
- }
-
- debug_gmx();
-
- /* Calculate center of mass velocity if necessary, also parallellized */
- if (bStopCM && !bRerunMD && bEner)
- {
- calc_vcm_grp(fplog,mdatoms->start,mdatoms->homenr,mdatoms,
- state->x,state->v,vcm);
- }
- }
-
- if (bTemp || bPres || bEner || bConstrain)
- {
- if (!bGStat)
- {
- /* We will not sum ekinh_old,
- * so signal that we still have to do it.
- */
- *bSumEkinhOld = TRUE;
-
- }
- else
- {
- if (gs != NULL)
- {
- for(i=0; i<eglsNR; i++)
- {
- gs_buf[i] = gs->sig[i];
- }
- }
- if (PAR(cr))
- {
- wallcycle_start(wcycle,ewcMoveE);
- GMX_MPE_LOG(ev_global_stat_start);
- global_stat(fplog,gstat,cr,enerd,force_vir,shake_vir,mu_tot,
- ir,ekind,constr,vcm,
- gs != NULL ? eglsNR : 0,gs_buf,
- top_global,state,
- *bSumEkinhOld,flags);
- GMX_MPE_LOG(ev_global_stat_finish);
- wallcycle_stop(wcycle,ewcMoveE);
- }
- if (gs != NULL)
- {
- if (MULTISIM(cr) && bInterSimGS)
- {
- if (MASTER(cr))
- {
- /* Communicate the signals between the simulations */
- gmx_sum_sim(eglsNR,gs_buf,cr->ms);
- }
- /* Communicate the signals form the master to the others */
- gmx_bcast(eglsNR*sizeof(gs_buf[0]),gs_buf,cr);
- }
- for(i=0; i<eglsNR; i++)
- {
- if (bInterSimGS || gs_simlocal[i])
- {
- /* Set the communicated signal only when it is non-zero,
- * since signals might not be processed at each MD step.
- */
- gsi = (gs_buf[i] >= 0 ?
- (int)(gs_buf[i] + 0.5) :
- (int)(gs_buf[i] - 0.5));
- if (gsi != 0)
- {
- gs->set[i] = gsi;
- }
- /* Turn off the local signal */
- gs->sig[i] = 0;
- }
- }
- }
- *bSumEkinhOld = FALSE;
- }
- }
-
- if (!ekind->bNEMD && debug && bTemp && (vcm->nr > 0))
- {
- correct_ekin(debug,
- mdatoms->start,mdatoms->start+mdatoms->homenr,
- state->v,vcm->group_p[0],
- mdatoms->massT,mdatoms->tmass,ekind->ekin);
- }
-
- if (bEner) {
- /* Do center of mass motion removal */
- if (bStopCM && !bRerunMD) /* is this correct? Does it get called too often with this logic? */
- {
- check_cm_grp(fplog,vcm,ir,1);
- do_stopcm_grp(fplog,mdatoms->start,mdatoms->homenr,mdatoms->cVCM,
- state->x,state->v,vcm);
- inc_nrnb(nrnb,eNR_STOPCM,mdatoms->homenr);
- }
- }
-
- if (bTemp)
- {
- /* Sum the kinetic energies of the groups & calc temp */
- /* compute full step kinetic energies if vv, or if vv-avek and we are computing the pressure with IR_NPT_TROTTER */
- /* three maincase: VV with AveVel (md-vv), vv with AveEkin (md-vv-avek), leap with AveEkin (md).
- Leap with AveVel is also an option for the future but not supported now.
- bEkinAveVel: If TRUE, we simply multiply ekin by ekinscale to get a full step kinetic energy.
- If FALSE, we average ekinh_old and ekinh*ekinscale_nhc to get an averaged half step kinetic energy.
- bSaveEkinOld: If TRUE (in the case of iteration = bIterate is TRUE), we don't reset the ekinscale_nhc.
- If FALSE, we go ahead and erase over it.
- */
- enerd->term[F_TEMP] = sum_ekin(&(ir->opts),ekind,&(enerd->term[F_DKDL]),
- bEkinAveVel,bIterate,bScaleEkin);
-
- enerd->term[F_EKIN] = trace(ekind->ekin);
- }
-
- /* ########## Long range energy information ###### */
-
- if (bEner || bPres || bConstrain)
- {
- calc_dispcorr(fplog,ir,fr,0,top_global->natoms,box,state->lambda,
- corr_pres,corr_vir,&prescorr,&enercorr,&dvdlcorr);
- }
-
- if (bEner && bFirstIterate)
- {
- enerd->term[F_DISPCORR] = enercorr;
- enerd->term[F_EPOT] += enercorr;
- enerd->term[F_DVDL] += dvdlcorr;
- if (fr->efep != efepNO) {
- enerd->dvdl_lin += dvdlcorr;
- }
- }
-
- /* ########## Now pressure ############## */
- if (bPres || bConstrain)
- {
-
- m_add(force_vir,shake_vir,total_vir);
-
- /* Calculate pressure and apply LR correction if PPPM is used.
- * Use the box from last timestep since we already called update().
- */
-
- enerd->term[F_PRES] = calc_pres(fr->ePBC,ir->nwall,box,ekind->ekin,total_vir,pres,
- (fr->eeltype==eelPPPM)?enerd->term[F_COUL_RECIP]:0.0);
-
- /* Calculate long range corrections to pressure and energy */
- /* this adds to enerd->term[F_PRES] and enerd->term[F_ETOT],
- and computes enerd->term[F_DISPCORR]. Also modifies the
- total_vir and pres tesors */
-
- m_add(total_vir,corr_vir,total_vir);
- m_add(pres,corr_pres,pres);
- enerd->term[F_PDISPCORR] = prescorr;
- enerd->term[F_PRES] += prescorr;
- *pcurr = enerd->term[F_PRES];
- /* calculate temperature using virial */
- enerd->term[F_VTEMP] = calc_temp(trace(total_vir),ir->opts.nrdf[0]);
-
- }
-}
-
-
-/* Definitions for convergence of iterated constraints */
-
-/* iterate constraints up to 50 times */
-#define MAXITERCONST 50
-
-/* data type */
-typedef struct
-{
- real f,fprev,x,xprev;
- int iter_i;
- gmx_bool bIterate;
- real allrelerr[MAXITERCONST+2];
- int num_close; /* number of "close" violations, caused by limited precision. */
-} gmx_iterate_t;
-
-#ifdef GMX_DOUBLE
-#define CONVERGEITER 0.000000001
-#define CLOSE_ENOUGH 0.000001000
-#else
-#define CONVERGEITER 0.0001
-#define CLOSE_ENOUGH 0.0050
-#endif
-
-/* we want to keep track of the close calls. If there are too many, there might be some other issues.
- so we make sure that it's either less than some predetermined number, or if more than that number,
- only some small fraction of the total. */
-#define MAX_NUMBER_CLOSE 50
-#define FRACTION_CLOSE 0.001
-
-/* maximum length of cyclic traps to check, emerging from limited numerical precision */
-#define CYCLEMAX 20
-
-static void gmx_iterate_init(gmx_iterate_t *iterate,gmx_bool bIterate)
-{
- int i;
-
- iterate->iter_i = 0;
- iterate->bIterate = bIterate;
- iterate->num_close = 0;
- for (i=0;i<MAXITERCONST+2;i++)
- {
- iterate->allrelerr[i] = 0;
- }
-}
-
-static gmx_bool done_iterating(const t_commrec *cr,FILE *fplog, int nsteps, gmx_iterate_t *iterate, gmx_bool bFirstIterate, real fom, real *newf)
-{
- /* monitor convergence, and use a secant search to propose new
- values.
- x_{i} - x_{i-1}
- The secant method computes x_{i+1} = x_{i} - f(x_{i}) * ---------------------
- f(x_{i}) - f(x_{i-1})
-
- The function we are trying to zero is fom-x, where fom is the
- "figure of merit" which is the pressure (or the veta value) we
- would get by putting in an old value of the pressure or veta into
- the incrementor function for the step or half step. I have
- verified that this gives the same answer as self consistent
- iteration, usually in many fewer steps, especially for small tau_p.
-
- We could possibly eliminate an iteration with proper use
- of the value from the previous step, but that would take a bit
- more bookkeeping, especially for veta, since tests indicate the
- function of veta on the last step is not sufficiently close to
- guarantee convergence this step. This is
- good enough for now. On my tests, I could use tau_p down to
- 0.02, which is smaller that would ever be necessary in
- practice. Generally, 3-5 iterations will be sufficient */
-
- real relerr,err;
- char buf[256];
- int i;
- gmx_bool incycle;
-
- if (bFirstIterate)
- {
- iterate->x = fom;
- iterate->f = fom-iterate->x;
- iterate->xprev = 0;
- iterate->fprev = 0;
- *newf = fom;
- }
- else
- {
- iterate->f = fom-iterate->x; /* we want to zero this difference */
- if ((iterate->iter_i > 1) && (iterate->iter_i < MAXITERCONST))
- {
- if (iterate->f==iterate->fprev)
- {
- *newf = iterate->f;
- }
- else
- {
- *newf = iterate->x - (iterate->x-iterate->xprev)*(iterate->f)/(iterate->f-iterate->fprev);
- }
- }
- else
- {
- /* just use self-consistent iteration the first step to initialize, or
- if it's not converging (which happens occasionally -- need to investigate why) */
- *newf = fom;
- }
- }
- /* Consider a slight shortcut allowing us to exit one sooner -- we check the
- difference between the closest of x and xprev to the new
- value. To be 100% certain, we should check the difference between
- the last result, and the previous result, or
-
- relerr = (fabs((x-xprev)/fom));
-
- but this is pretty much never necessary under typical conditions.
- Checking numerically, it seems to lead to almost exactly the same
- trajectories, but there are small differences out a few decimal
- places in the pressure, and eventually in the v_eta, but it could
- save an interation.
-
- if (fabs(*newf-x) < fabs(*newf - xprev)) { xmin = x;} else { xmin = xprev;}
- relerr = (fabs((*newf-xmin) / *newf));
- */
-
- err = fabs((iterate->f-iterate->fprev));
- relerr = fabs(err/fom);
-
- iterate->allrelerr[iterate->iter_i] = relerr;
-
- if (iterate->iter_i > 0)
- {
- if (debug)
- {
- fprintf(debug,"Iterating NPT constraints: %6i %20.12f%14.6g%20.12f\n",
- iterate->iter_i,fom,relerr,*newf);
- }
-
- if ((relerr < CONVERGEITER) || (err < CONVERGEITER) || (fom==0) || ((iterate->x == iterate->xprev) && iterate->iter_i > 1))
- {
- iterate->bIterate = FALSE;
- if (debug)
- {
- fprintf(debug,"Iterating NPT constraints: CONVERGED\n");
- }
- return TRUE;
- }
- if (iterate->iter_i > MAXITERCONST)
- {
- if (relerr < CLOSE_ENOUGH)
- {
- incycle = FALSE;
- for (i=1;i<CYCLEMAX;i++) {
- if ((iterate->allrelerr[iterate->iter_i-(1+i)] == iterate->allrelerr[iterate->iter_i-1]) &&
- (iterate->allrelerr[iterate->iter_i-(1+i)] == iterate->allrelerr[iterate->iter_i-(1+2*i)])) {
- incycle = TRUE;
- if (debug)
- {
- fprintf(debug,"Exiting from an NPT iterating cycle of length %d\n",i);
- }
- break;
- }
- }
-
- if (incycle) {
- /* step 1: trapped in a numerical attractor */
- /* we are trapped in a numerical attractor, and can't converge any more, and are close to the final result.
- Better to give up convergence here than have the simulation die.
- */
- iterate->num_close++;
- return TRUE;
- }
- else
- {
- /* Step #2: test if we are reasonably close for other reasons, then monitor the number. If not, die */
-
- /* how many close calls have we had? If less than a few, we're OK */
- if (iterate->num_close < MAX_NUMBER_CLOSE)
- {
- sprintf(buf,"Slight numerical convergence deviation with NPT at step %d, relative error only %10.5g, likely not a problem, continuing\n",nsteps,relerr);
- md_print_warning(cr,fplog,buf);
- iterate->num_close++;
- return TRUE;
- /* if more than a few, check the total fraction. If too high, die. */
- } else if (iterate->num_close/(double)nsteps > FRACTION_CLOSE) {
- gmx_fatal(FARGS,"Could not converge NPT constraints, too many exceptions (%d%%\n",iterate->num_close/(double)nsteps);
- }
- }
- }
- else
- {
- gmx_fatal(FARGS,"Could not converge NPT constraints\n");
- }
- }
- }
-
- iterate->xprev = iterate->x;
- iterate->x = *newf;
- iterate->fprev = iterate->f;
- iterate->iter_i++;
-
- return FALSE;
-}
-
-static void check_nst_param(FILE *fplog,t_commrec *cr,
- const char *desc_nst,int nst,
- const char *desc_p,int *p)
-{
- char buf[STRLEN];
-
- if (*p > 0 && *p % nst != 0)
- {
- /* Round up to the next multiple of nst */
- *p = ((*p)/nst + 1)*nst;
- sprintf(buf,"NOTE: %s changes %s to %d\n",desc_nst,desc_p,*p);
- md_print_warning(cr,fplog,buf);
- }
-}
-
-static void reset_all_counters(FILE *fplog,t_commrec *cr,
- gmx_large_int_t step,
- gmx_large_int_t *step_rel,t_inputrec *ir,
- gmx_wallcycle_t wcycle,t_nrnb *nrnb,
- gmx_runtime_t *runtime)
-{
- char buf[STRLEN],sbuf[STEPSTRSIZE];
-
- /* Reset all the counters related to performance over the run */
- sprintf(buf,"Step %s: resetting all time and cycle counters\n",
- gmx_step_str(step,sbuf));
- md_print_warning(cr,fplog,buf);
-
- wallcycle_stop(wcycle,ewcRUN);
- wallcycle_reset_all(wcycle);
- if (DOMAINDECOMP(cr))
- {
- reset_dd_statistics_counters(cr->dd);
- }
- init_nrnb(nrnb);
- ir->init_step += *step_rel;
- ir->nsteps -= *step_rel;
- *step_rel = 0;
- wallcycle_start(wcycle,ewcRUN);
- runtime_start(runtime);
- print_date_and_time(fplog,cr->nodeid,"Restarted time",runtime);
-}
-
-static int check_nstglobalcomm(FILE *fplog,t_commrec *cr,
- int nstglobalcomm,t_inputrec *ir)
-{
- char buf[STRLEN];
-
- if (!EI_DYNAMICS(ir->eI))
- {
- nstglobalcomm = 1;
- }
-
- if (nstglobalcomm == -1)
- {
- if (ir->nstcalcenergy == 0 && ir->nstlist == 0)
- {
- nstglobalcomm = 10;
- if (ir->nstenergy > 0 && ir->nstenergy < nstglobalcomm)
- {
- nstglobalcomm = ir->nstenergy;
- }
- }
- else
- {
- /* We assume that if nstcalcenergy > nstlist,
- * nstcalcenergy is a multiple of nstlist.
- */
- if (ir->nstcalcenergy == 0 ||
- (ir->nstlist > 0 && ir->nstlist < ir->nstcalcenergy))
- {
- nstglobalcomm = ir->nstlist;
- }
- else
- {
- nstglobalcomm = ir->nstcalcenergy;
- }
- }
- }
- else
- {
- if (ir->nstlist > 0 &&
- nstglobalcomm > ir->nstlist && nstglobalcomm % ir->nstlist != 0)
- {
- nstglobalcomm = (nstglobalcomm / ir->nstlist)*ir->nstlist;
- sprintf(buf,"WARNING: nstglobalcomm is larger than nstlist, but not a multiple, setting it to %d\n",nstglobalcomm);
- md_print_warning(cr,fplog,buf);
- }
- if (nstglobalcomm > ir->nstcalcenergy)
- {
- check_nst_param(fplog,cr,"-gcom",nstglobalcomm,
- "nstcalcenergy",&ir->nstcalcenergy);
- }
-
- check_nst_param(fplog,cr,"-gcom",nstglobalcomm,
- "nstenergy",&ir->nstenergy);
-
- check_nst_param(fplog,cr,"-gcom",nstglobalcomm,
- "nstlog",&ir->nstlog);
- }
-
- if (ir->comm_mode != ecmNO && ir->nstcomm < nstglobalcomm)
- {
- sprintf(buf,"WARNING: Changing nstcomm from %d to %d\n",
- ir->nstcomm,nstglobalcomm);
- md_print_warning(cr,fplog,buf);
- ir->nstcomm = nstglobalcomm;
- }
-
- return nstglobalcomm;
-}
-
-void check_ir_old_tpx_versions(t_commrec *cr,FILE *fplog,
- t_inputrec *ir,gmx_mtop_t *mtop)
-{
- /* Check required for old tpx files */
- if (IR_TWINRANGE(*ir) && ir->nstlist > 1 &&
- ir->nstcalcenergy % ir->nstlist != 0)
- {
- md_print_warning(cr,fplog,"Old tpr file with twin-range settings: modifying energy calculation and/or T/P-coupling frequencies");
-
- if (gmx_mtop_ftype_count(mtop,F_CONSTR) +
- gmx_mtop_ftype_count(mtop,F_CONSTRNC) > 0 &&
- ir->eConstrAlg == econtSHAKE)
- {
- md_print_warning(cr,fplog,"With twin-range cut-off's and SHAKE the virial and pressure are incorrect");
- if (ir->epc != epcNO)
- {
- gmx_fatal(FARGS,"Can not do pressure coupling with twin-range cut-off's and SHAKE");
- }
- }
- check_nst_param(fplog,cr,"nstlist",ir->nstlist,
- "nstcalcenergy",&ir->nstcalcenergy);
- check_nst_param(fplog,cr,"nstcalcenergy",ir->nstcalcenergy,
- "nstenergy",&ir->nstenergy);
- check_nst_param(fplog,cr,"nstcalcenergy",ir->nstcalcenergy,
- "nstlog",&ir->nstlog);
- if (ir->efep != efepNO)
- {
- check_nst_param(fplog,cr,"nstcalcenergy",ir->nstcalcenergy,
- "nstdhdl",&ir->nstdhdl);
- }
- }
-}
-
-typedef struct {
- gmx_bool bGStatEveryStep;
- gmx_large_int_t step_ns;
- gmx_large_int_t step_nscheck;
- gmx_large_int_t nns;
- matrix scale_tot;
- int nabnsb;
- double s1;
- double s2;
- double ab;
- double lt_runav;
- double lt_runav2;
-} gmx_nlheur_t;
-
-static void reset_nlistheuristics(gmx_nlheur_t *nlh,gmx_large_int_t step)
-{
- nlh->lt_runav = 0;
- nlh->lt_runav2 = 0;
- nlh->step_nscheck = step;
-}
-
-static void init_nlistheuristics(gmx_nlheur_t *nlh,
- gmx_bool bGStatEveryStep,gmx_large_int_t step)
-{
- nlh->bGStatEveryStep = bGStatEveryStep;
- nlh->nns = 0;
- nlh->nabnsb = 0;
- nlh->s1 = 0;
- nlh->s2 = 0;
- nlh->ab = 0;
-
- reset_nlistheuristics(nlh,step);
-}
-
-static void update_nliststatistics(gmx_nlheur_t *nlh,gmx_large_int_t step)
-{
- gmx_large_int_t nl_lt;
- char sbuf[STEPSTRSIZE],sbuf2[STEPSTRSIZE];
-
- /* Determine the neighbor list life time */
- nl_lt = step - nlh->step_ns;
- if (debug)
- {
- fprintf(debug,"%d atoms beyond ns buffer, updating neighbor list after %s steps\n",nlh->nabnsb,gmx_step_str(nl_lt,sbuf));
- }
- nlh->nns++;
- nlh->s1 += nl_lt;
- nlh->s2 += nl_lt*nl_lt;
- nlh->ab += nlh->nabnsb;
- if (nlh->lt_runav == 0)
- {
- nlh->lt_runav = nl_lt;
- /* Initialize the fluctuation average
- * such that at startup we check after 0 steps.
- */
- nlh->lt_runav2 = sqr(nl_lt/2.0);
- }
- /* Running average with 0.9 gives an exp. history of 9.5 */
- nlh->lt_runav2 = 0.9*nlh->lt_runav2 + 0.1*sqr(nlh->lt_runav - nl_lt);
- nlh->lt_runav = 0.9*nlh->lt_runav + 0.1*nl_lt;
- if (nlh->bGStatEveryStep)
- {
- /* Always check the nlist validity */
- nlh->step_nscheck = step;
- }
- else
- {
- /* We check after: <life time> - 2*sigma
- * The factor 2 is quite conservative,
- * but we assume that with nstlist=-1 the user
- * prefers exact integration over performance.
- */
- nlh->step_nscheck = step
- + (int)(nlh->lt_runav - 2.0*sqrt(nlh->lt_runav2)) - 1;
- }
- if (debug)
- {
- fprintf(debug,"nlist life time %s run av. %4.1f sig %3.1f check %s check with -gcom %d\n",
- gmx_step_str(nl_lt,sbuf),nlh->lt_runav,sqrt(nlh->lt_runav2),
- gmx_step_str(nlh->step_nscheck-step+1,sbuf2),
- (int)(nlh->lt_runav - 2.0*sqrt(nlh->lt_runav2)));
- }
-}
-
-static void set_nlistheuristics(gmx_nlheur_t *nlh,gmx_bool bReset,gmx_large_int_t step)
-{
- int d;
-
- if (bReset)
- {
- reset_nlistheuristics(nlh,step);
- }
- else
- {
- update_nliststatistics(nlh,step);
- }
-
- nlh->step_ns = step;
- /* Initialize the cumulative coordinate scaling matrix */
- clear_mat(nlh->scale_tot);
- for(d=0; d<DIM; d++)
- {
- nlh->scale_tot[d][d] = 1.0;
- }
-}
-
-double do_md_membed(FILE *fplog,t_commrec *cr,int nfile,const t_filenm fnm[],
- const output_env_t oenv, gmx_bool bVerbose,gmx_bool bCompact,
- int nstglobalcomm,
- gmx_vsite_t *vsite,gmx_constr_t constr,
- int stepout,t_inputrec *ir,
- gmx_mtop_t *top_global,
- t_fcdata *fcd,
- t_state *state_global,
- t_mdatoms *mdatoms,
- t_nrnb *nrnb,gmx_wallcycle_t wcycle,
- gmx_edsam_t ed,t_forcerec *fr,
- int repl_ex_nst,int repl_ex_seed,
- real cpt_period,real max_hours,
- const char *deviceOptions,
- unsigned long Flags,
- gmx_runtime_t *runtime,
- rvec fac, rvec *r_ins, pos_ins_t *pos_ins, t_block *ins_at,
- real xy_step, real z_step, int it_xy, int it_z)
-{
- gmx_mdoutf_t *outf;
- gmx_large_int_t step,step_rel;
- double run_time;
- double t,t0,lam0;
- gmx_bool bGStatEveryStep,bGStat,bNstEner,bCalcEnerPres;
- gmx_bool bNS,bNStList,bSimAnn,bStopCM,bRerunMD,bNotLastFrame=FALSE,
- bFirstStep,bStateFromTPX,bInitStep,bLastStep,
- bBornRadii,bStartingFromCpt;
- gmx_bool bDoDHDL=FALSE;
- gmx_bool do_ene,do_log,do_verbose,bRerunWarnNoV=TRUE,
- bForceUpdate=FALSE,bCPT;
- int mdof_flags;
- gmx_bool bMasterState;
- int force_flags,cglo_flags;
- tensor force_vir,shake_vir,total_vir,tmp_vir,pres;
- int i,m;
- t_trxstatus *status;
- rvec mu_tot;
- t_vcm *vcm;
- t_state *bufstate=NULL;
- matrix *scale_tot,pcoupl_mu,M,ebox;
- gmx_nlheur_t nlh;
- t_trxframe rerun_fr;
-/* gmx_repl_ex_t repl_ex=NULL;*/
- int nchkpt=1;
-
- gmx_localtop_t *top;
- t_mdebin *mdebin=NULL;
- t_state *state=NULL;
- rvec *f_global=NULL;
- int n_xtc=-1;
- rvec *x_xtc=NULL;
- gmx_enerdata_t *enerd;
- rvec *f=NULL;
- gmx_global_stat_t gstat;
- gmx_update_t upd=NULL;
- t_graph *graph=NULL;
- globsig_t gs;
-
- gmx_bool bFFscan;
- gmx_groups_t *groups;
- gmx_ekindata_t *ekind, *ekind_save;
- gmx_shellfc_t shellfc;
- int count,nconverged=0;
- real timestep=0;
- double tcount=0;
- gmx_bool bIonize=FALSE;
- gmx_bool bTCR=FALSE,bConverged=TRUE,bOK,bSumEkinhOld,bExchanged;
- gmx_bool bAppend;
- gmx_bool bResetCountersHalfMaxH=FALSE;
- gmx_bool bVV,bIterations,bIterate,bFirstIterate,bTemp,bPres,bTrotter;
- real temp0,dvdl;
- int a0,a1,ii;
- rvec *xcopy=NULL,*vcopy=NULL,*cbuf=NULL;
- matrix boxcopy={{0}},lastbox;
- real veta_save,pcurr,scalevir,tracevir;
- real vetanew = 0;
- double cycles;
- real last_conserved = 0;
- real last_ekin = 0;
- t_extmass MassQ;
- int **trotter_seq;
- char sbuf[STEPSTRSIZE],sbuf2[STEPSTRSIZE];
- int handled_stop_condition=gmx_stop_cond_none; /* compare to get_stop_condition*/
- gmx_iterate_t iterate;
-#ifdef GMX_FAHCORE
- /* Temporary addition for FAHCORE checkpointing */
- int chkpt_ret;
-#endif
-
- /* Check for special mdrun options */
- bRerunMD = (Flags & MD_RERUN);
- bIonize = (Flags & MD_IONIZE);
- bFFscan = (Flags & MD_FFSCAN);
- bAppend = (Flags & MD_APPENDFILES);
- bGStatEveryStep = FALSE;
- if (Flags & MD_RESETCOUNTERSHALFWAY)
- {
- if (ir->nsteps > 0)
- {
- /* Signal to reset the counters half the simulation steps. */
- wcycle_set_reset_counters(wcycle,ir->nsteps/2);
- }
- /* Signal to reset the counters halfway the simulation time. */
- bResetCountersHalfMaxH = (max_hours > 0);
- }
-
- /* md-vv uses averaged full step velocities for T-control
- md-vv-avek uses averaged half step velocities for T-control (but full step ekin for P control)
- md uses averaged half step kinetic energies to determine temperature unless defined otherwise by GMX_EKIN_AVE_VEL; */
- bVV = EI_VV(ir->eI);
- if (bVV) /* to store the initial velocities while computing virial */
- {
- snew(cbuf,top_global->natoms);
- }
- /* all the iteratative cases - only if there are constraints */
- bIterations = ((IR_NPT_TROTTER(ir)) && (constr) && (!bRerunMD));
- bTrotter = (bVV && (IR_NPT_TROTTER(ir) || (IR_NVT_TROTTER(ir))));
-
- if (bRerunMD)
- {
- /* Since we don't know if the frames read are related in any way,
- * rebuild the neighborlist at every step.
- */
- ir->nstlist = 1;
- ir->nstcalcenergy = 1;
- nstglobalcomm = 1;
- }
-
- check_ir_old_tpx_versions(cr,fplog,ir,top_global);
-
- nstglobalcomm = check_nstglobalcomm(fplog,cr,nstglobalcomm,ir);
- /*bGStatEveryStep = (nstglobalcomm == 1);*/
- bGStatEveryStep = FALSE;
-
- if (!bGStatEveryStep && ir->nstlist == -1 && fplog != NULL)
- {
- fprintf(fplog,
- "To reduce the energy communication with nstlist = -1\n"
- "the neighbor list validity should not be checked at every step,\n"
- "this means that exact integration is not guaranteed.\n"
- "The neighbor list validity is checked after:\n"
- " <n.list life time> - 2*std.dev.(n.list life time) steps.\n"
- "In most cases this will result in exact integration.\n"
- "This reduces the energy communication by a factor of 2 to 3.\n"
- "If you want less energy communication, set nstlist > 3.\n\n");
- }
-
- if (bRerunMD || bFFscan)
- {
- ir->nstxtcout = 0;
- }
- groups = &top_global->groups;
-
- /* Initial values */
- init_md(fplog,cr,ir,oenv,&t,&t0,&state_global->lambda,&lam0,
- nrnb,top_global,&upd,
- nfile,fnm,&outf,&mdebin,
- force_vir,shake_vir,mu_tot,&bSimAnn,&vcm,state_global,Flags);
-
- clear_mat(total_vir);
- clear_mat(pres);
- /* Energy terms and groups */
- snew(enerd,1);
- init_enerdata(top_global->groups.grps[egcENER].nr,ir->n_flambda,enerd);
- if (DOMAINDECOMP(cr))
- {
- f = NULL;
- }
- else
- {
- snew(f,top_global->natoms);
- }
-
- /* Kinetic energy data */
- snew(ekind,1);
- init_ekindata(fplog,top_global,&(ir->opts),ekind);
- /* needed for iteration of constraints */
- snew(ekind_save,1);
- init_ekindata(fplog,top_global,&(ir->opts),ekind_save);
- /* Copy the cos acceleration to the groups struct */
- ekind->cosacc.cos_accel = ir->cos_accel;
-
- gstat = global_stat_init(ir);
- debug_gmx();
-
- /* Check for polarizable models and flexible constraints */
- shellfc = init_shell_flexcon(fplog,
- top_global,n_flexible_constraints(constr),
- (ir->bContinuation ||
- (DOMAINDECOMP(cr) && !MASTER(cr))) ?
- NULL : state_global->x);
-
-/* if (DEFORM(*ir))
- {
-#ifdef GMX_THREADS
- tMPI_Thread_mutex_lock(&deform_init_box_mutex);
-#endif
- set_deform_reference_box(upd,
- deform_init_init_step_tpx,
- deform_init_box_tpx);
-#ifdef GMX_THREADS
- tMPI_Thread_mutex_unlock(&deform_init_box_mutex);
-#endif
- }*/
-
-/* {
- double io = compute_io(ir,top_global->natoms,groups,mdebin->ebin->nener,1);
- if ((io > 2000) && MASTER(cr))
- fprintf(stderr,
- "\nWARNING: This run will generate roughly %.0f Mb of data\n\n",
- io);
- }*/
-
- if (DOMAINDECOMP(cr)) {
- top = dd_init_local_top(top_global);
-
- snew(state,1);
- dd_init_local_state(cr->dd,state_global,state);
-
- if (DDMASTER(cr->dd) && ir->nstfout) {
- snew(f_global,state_global->natoms);
- }
- } else {
- if (PAR(cr)) {
- /* Initialize the particle decomposition and split the topology */
- top = split_system(fplog,top_global,ir,cr);
-
- pd_cg_range(cr,&fr->cg0,&fr->hcg);
- pd_at_range(cr,&a0,&a1);
- } else {
- top = gmx_mtop_generate_local_top(top_global,ir);
-
- a0 = 0;
- a1 = top_global->natoms;
- }
-
- state = partdec_init_local_state(cr,state_global);
- f_global = f;
-
- atoms2md(top_global,ir,0,NULL,a0,a1-a0,mdatoms);
-
- if (vsite) {
- set_vsite_top(vsite,top,mdatoms,cr);
- }
-
- if (ir->ePBC != epbcNONE && !ir->bPeriodicMols) {
- graph = mk_graph(fplog,&(top->idef),0,top_global->natoms,FALSE,FALSE);
- }
-
- if (shellfc) {
- make_local_shells(cr,mdatoms,shellfc);
- }
-
- if (ir->pull && PAR(cr)) {
- dd_make_local_pull_groups(NULL,ir->pull,mdatoms);
- }
- }
-
- if (DOMAINDECOMP(cr))
- {
- /* Distribute the charge groups over the nodes from the master node */
- dd_partition_system(fplog,ir->init_step,cr,TRUE,1,
- state_global,top_global,ir,
- state,&f,mdatoms,top,fr,
- vsite,shellfc,constr,
- nrnb,wcycle,FALSE);
- }
-
- update_mdatoms(mdatoms,state->lambda);
-
- if (MASTER(cr))
- {
- if (opt2bSet("-cpi",nfile,fnm))
- {
- /* Update mdebin with energy history if appending to output files */
- if ( Flags & MD_APPENDFILES )
- {
- restore_energyhistory_from_state(mdebin,&state_global->enerhist);
- }
- else
- {
- /* We might have read an energy history from checkpoint,
- * free the allocated memory and reset the counts.
- */
- done_energyhistory(&state_global->enerhist);
- init_energyhistory(&state_global->enerhist);
- }
- }
- /* Set the initial energy history in state by updating once */
- update_energyhistory(&state_global->enerhist,mdebin);
- }
-
- if ((state->flags & (1<<estLD_RNG)) && (Flags & MD_READ_RNG)) {
- /* Set the random state if we read a checkpoint file */
- set_stochd_state(upd,state);
- }
-
- /* Initialize constraints */
- if (constr) {
- if (!DOMAINDECOMP(cr))
- set_constraints(constr,top,ir,mdatoms,cr);
- }
-
- /* Check whether we have to GCT stuff */
- /* bTCR = ftp2bSet(efGCT,nfile,fnm);
- if (bTCR) {
- if (MASTER(cr)) {
- fprintf(stderr,"Will do General Coupling Theory!\n");
- }
- gnx = top_global->mols.nr;
- snew(grpindex,gnx);
- for(i=0; (i<gnx); i++) {
- grpindex[i] = i;
- }
- }*/
-
-/* if (repl_ex_nst > 0 && MASTER(cr))
- repl_ex = init_replica_exchange(fplog,cr->ms,state_global,ir,
- repl_ex_nst,repl_ex_seed);*/
-
- if (!ir->bContinuation && !bRerunMD)
- {
- if (mdatoms->cFREEZE && (state->flags & (1<<estV)))
- {
- /* Set the velocities of frozen particles to zero */
- for(i=mdatoms->start; i<mdatoms->start+mdatoms->homenr; i++)
- {
- for(m=0; m<DIM; m++)
- {
- if (ir->opts.nFreeze[mdatoms->cFREEZE[i]][m])
- {
- state->v[i][m] = 0;
- }
- }
- }
- }
-
- if (constr)
- {
- /* Constrain the initial coordinates and velocities */
- do_constrain_first(fplog,constr,ir,mdatoms,state,f,
- graph,cr,nrnb,fr,top,shake_vir);
- }
- if (vsite)
- {
- /* Construct the virtual sites for the initial configuration */
- construct_vsites(fplog,vsite,state->x,nrnb,ir->delta_t,NULL,
- top->idef.iparams,top->idef.il,
- fr->ePBC,fr->bMolPBC,graph,cr,state->box);
- }
- }
-
- debug_gmx();
-
- /* I'm assuming we need global communication the first time! MRS */
- cglo_flags = (CGLO_TEMPERATURE | CGLO_GSTAT
- | (bVV ? CGLO_PRESSURE:0)
- | (bVV ? CGLO_CONSTRAINT:0)
- | (bRerunMD ? CGLO_RERUNMD:0)
- | ((Flags & MD_READ_EKIN) ? CGLO_READEKIN:0));
-
- bSumEkinhOld = FALSE;
- compute_globals(fplog,gstat,cr,ir,fr,ekind,state,state_global,mdatoms,nrnb,vcm,
- wcycle,enerd,force_vir,shake_vir,total_vir,pres,mu_tot,
- constr,NULL,FALSE,state->box,
- top_global,&pcurr,top_global->natoms,&bSumEkinhOld,cglo_flags);
- if (ir->eI == eiVVAK) {
- /* a second call to get the half step temperature initialized as well */
- /* we do the same call as above, but turn the pressure off -- internally, this
- is recognized as a velocity verlet half-step kinetic energy calculation.
- This minimized excess variables, but perhaps loses some logic?*/
-
- compute_globals(fplog,gstat,cr,ir,fr,ekind,state,state_global,mdatoms,nrnb,vcm,
- wcycle,enerd,force_vir,shake_vir,total_vir,pres,mu_tot,
- constr,NULL,FALSE,state->box,
- top_global,&pcurr,top_global->natoms,&bSumEkinhOld,
- cglo_flags &~ CGLO_PRESSURE);
- }
-
- /* Calculate the initial half step temperature, and save the ekinh_old */
- if (!(Flags & MD_STARTFROMCPT))
- {
- for(i=0; (i<ir->opts.ngtc); i++)
- {
- copy_mat(ekind->tcstat[i].ekinh,ekind->tcstat[i].ekinh_old);
- }
- }
- if (ir->eI != eiVV)
- {
- enerd->term[F_TEMP] *= 2; /* result of averages being done over previous and current step,
- and there is no previous step */
- }
- temp0 = enerd->term[F_TEMP];
-
- /* if using an iterative algorithm, we need to create a working directory for the state. */
- if (bIterations)
- {
- bufstate = init_bufstate(state);
- }
- if (bFFscan)
- {
- snew(xcopy,state->natoms);
- snew(vcopy,state->natoms);
- copy_rvecn(state->x,xcopy,0,state->natoms);
- copy_rvecn(state->v,vcopy,0,state->natoms);
- copy_mat(state->box,boxcopy);
- }
-
- /* need to make an initiation call to get the Trotter variables set, as well as other constants for non-trotter
- temperature control */
- trotter_seq = init_npt_vars(ir,state,&MassQ,bTrotter);
-
- if (MASTER(cr))
- {
- if (constr && !ir->bContinuation && ir->eConstrAlg == econtLINCS)
- {
- fprintf(fplog,
- "RMS relative constraint deviation after constraining: %.2e\n",
- constr_rmsd(constr,FALSE));
- }
- fprintf(fplog,"Initial temperature: %g K\n",enerd->term[F_TEMP]);
- if (bRerunMD)
- {
- fprintf(stderr,"starting md rerun '%s', reading coordinates from"
- " input trajectory '%s'\n\n",
- *(top_global->name),opt2fn("-rerun",nfile,fnm));
- if (bVerbose)
- {
- fprintf(stderr,"Calculated time to finish depends on nsteps from "
- "run input file,\nwhich may not correspond to the time "
- "needed to process input trajectory.\n\n");
- }
- }
- else
- {
- char tbuf[20];
- fprintf(stderr,"starting mdrun '%s'\n",
- *(top_global->name));
- if (ir->nsteps >= 0)
- {
- sprintf(tbuf,"%8.1f",(ir->init_step+ir->nsteps)*ir->delta_t);
- }
- else
- {
- sprintf(tbuf,"%s","infinite");
- }
- if (ir->init_step > 0)
- {
- fprintf(stderr,"%s steps, %s ps (continuing from step %s, %8.1f ps).\n",
- gmx_step_str(ir->init_step+ir->nsteps,sbuf),tbuf,
- gmx_step_str(ir->init_step,sbuf2),
- ir->init_step*ir->delta_t);
- }
- else
- {
- fprintf(stderr,"%s steps, %s ps.\n",
- gmx_step_str(ir->nsteps,sbuf),tbuf);
- }
- }
- fprintf(fplog,"\n");
- }
-
- /* Set and write start time */
- runtime_start(runtime);
- print_date_and_time(fplog,cr->nodeid,"Started mdrun",runtime);
- wallcycle_start(wcycle,ewcRUN);
- if (fplog)
- fprintf(fplog,"\n");
-
- /* safest point to do file checkpointing is here. More general point would be immediately before integrator call */
-/*#ifdef GMX_FAHCORE
- chkpt_ret=fcCheckPointParallel( cr->nodeid,
- NULL,0);
- if ( chkpt_ret == 0 )
- gmx_fatal( 3,__FILE__,__LINE__, "Checkpoint error on step %d\n", 0 );
-#endif*/
-
- debug_gmx();
- /***********************************************************
- *
- * Loop over MD steps
- *
- ************************************************************/
-
- /* if rerunMD then read coordinates and velocities from input trajectory */
- if (bRerunMD)
- {
- if (getenv("GMX_FORCE_UPDATE"))
- {
- bForceUpdate = TRUE;
- }
-
- bNotLastFrame = read_first_frame(oenv,&status,
- opt2fn("-rerun",nfile,fnm),
- &rerun_fr,TRX_NEED_X | TRX_READ_V);
- if (rerun_fr.natoms != top_global->natoms)
- {
- gmx_fatal(FARGS,
- "Number of atoms in trajectory (%d) does not match the "
- "run input file (%d)\n",
- rerun_fr.natoms,top_global->natoms);
- }
- if (ir->ePBC != epbcNONE)
- {
- if (!rerun_fr.bBox)
- {
- gmx_fatal(FARGS,"Rerun trajectory frame step %d time %f does not contain a box, while pbc is used",rerun_fr.step,rerun_fr.time);
- }
- if (max_cutoff2(ir->ePBC,rerun_fr.box) < sqr(fr->rlistlong))
- {
- gmx_fatal(FARGS,"Rerun trajectory frame step %d time %f has too small box dimensions",rerun_fr.step,rerun_fr.time);
- }
-
- /* Set the shift vectors.
- * Necessary here when have a static box different from the tpr box.
- */
- calc_shifts(rerun_fr.box,fr->shift_vec);
- }
- }
-
- /* loop over MD steps or if rerunMD to end of input trajectory */
- bFirstStep = TRUE;
- /* Skip the first Nose-Hoover integration when we get the state from tpx */
- bStateFromTPX = !opt2bSet("-cpi",nfile,fnm);
- bInitStep = bFirstStep && (bStateFromTPX || bVV);
- bStartingFromCpt = (Flags & MD_STARTFROMCPT) && bInitStep;
- bLastStep = FALSE;
- bSumEkinhOld = FALSE;
- bExchanged = FALSE;
-
- init_global_signals(&gs,cr,ir,repl_ex_nst);
-
- step = ir->init_step;
- step_rel = 0;
-
- if (ir->nstlist == -1)
- {
- init_nlistheuristics(&nlh,bGStatEveryStep,step);
- }
-
- bLastStep = (bRerunMD || (ir->nsteps >= 0 && step_rel > ir->nsteps));
- while (!bLastStep || (bRerunMD && bNotLastFrame)) {
-
- wallcycle_start(wcycle,ewcSTEP);
-
- GMX_MPE_LOG(ev_timestep1);
-
- if (bRerunMD) {
- if (rerun_fr.bStep) {
- step = rerun_fr.step;
- step_rel = step - ir->init_step;
- }
- if (rerun_fr.bTime) {
- t = rerun_fr.time;
- }
- else
- {
- t = step;
- }
- }
- else
- {
- bLastStep = (step_rel == ir->nsteps);
- t = t0 + step*ir->delta_t;
- }
-
- if (ir->efep != efepNO)
- {
- if (bRerunMD && rerun_fr.bLambda && (ir->delta_lambda!=0))
- {
- state_global->lambda = rerun_fr.lambda;
- }
- else
- {
- state_global->lambda = lam0 + step*ir->delta_lambda;
- }
- state->lambda = state_global->lambda;
- bDoDHDL = do_per_step(step,ir->nstdhdl);
- }
-
- if (bSimAnn)
- {
- update_annealing_target_temp(&(ir->opts),t);
- }
-
- if (bRerunMD)
- {
- if (!(DOMAINDECOMP(cr) && !MASTER(cr)))
- {
- for(i=0; i<state_global->natoms; i++)
- {
- copy_rvec(rerun_fr.x[i],state_global->x[i]);
- }
- if (rerun_fr.bV)
- {
- for(i=0; i<state_global->natoms; i++)
- {
- copy_rvec(rerun_fr.v[i],state_global->v[i]);
- }
- }
- else
- {
- for(i=0; i<state_global->natoms; i++)
- {
- clear_rvec(state_global->v[i]);
- }
- if (bRerunWarnNoV)
- {
- fprintf(stderr,"\nWARNING: Some frames do not contain velocities.\n"
- " Ekin, temperature and pressure are incorrect,\n"
- " the virial will be incorrect when constraints are present.\n"
- "\n");
- bRerunWarnNoV = FALSE;
- }
- }
- }
- copy_mat(rerun_fr.box,state_global->box);
- copy_mat(state_global->box,state->box);
-
- if (vsite && (Flags & MD_RERUN_VSITE))
- {
- if (DOMAINDECOMP(cr))
- {
- gmx_fatal(FARGS,"Vsite recalculation with -rerun is not implemented for domain decomposition, use particle decomposition");
- }
- if (graph)
- {
- /* Following is necessary because the graph may get out of sync
- * with the coordinates if we only have every N'th coordinate set
- */
- mk_mshift(fplog,graph,fr->ePBC,state->box,state->x);
- shift_self(graph,state->box,state->x);
- }
- construct_vsites(fplog,vsite,state->x,nrnb,ir->delta_t,state->v,
- top->idef.iparams,top->idef.il,
- fr->ePBC,fr->bMolPBC,graph,cr,state->box);
- if (graph)
- {
- unshift_self(graph,state->box,state->x);
- }
- }
- }
-
- /* Stop Center of Mass motion */
- bStopCM = (ir->comm_mode != ecmNO && do_per_step(step,ir->nstcomm));
-
- /* Copy back starting coordinates in case we're doing a forcefield scan */
- if (bFFscan)
- {
- for(ii=0; (ii<state->natoms); ii++)
- {
- copy_rvec(xcopy[ii],state->x[ii]);
- copy_rvec(vcopy[ii],state->v[ii]);
- }
- copy_mat(boxcopy,state->box);
- }
-
- if (bRerunMD)
- {
- /* for rerun MD always do Neighbour Searching */
- bNS = (bFirstStep || ir->nstlist != 0);
- bNStList = bNS;
- }
- else
- {
- /* Determine whether or not to do Neighbour Searching and LR */
- bNStList = (ir->nstlist > 0 && step % ir->nstlist == 0);
-
- bNS = (bFirstStep || bExchanged || bNStList ||
- (ir->nstlist == -1 && nlh.nabnsb > 0));
-
- if (bNS && ir->nstlist == -1)
- {
- set_nlistheuristics(&nlh,bFirstStep || bExchanged,step);
- }
- }
-
- /* < 0 means stop at next step, > 0 means stop at next NS step */
- if ( (gs.set[eglsSTOPCOND] < 0 ) ||
- ( (gs.set[eglsSTOPCOND] > 0 ) && ( bNS || ir->nstlist==0)) )
- {
- bLastStep = TRUE;
- }
-
- /* Determine whether or not to update the Born radii if doing GB */
- bBornRadii=bFirstStep;
- if (ir->implicit_solvent && (step % ir->nstgbradii==0))
- {
- bBornRadii=TRUE;
- }
-
- do_log = do_per_step(step,ir->nstlog) || bFirstStep || bLastStep;
- do_verbose = bVerbose &&
- (step % stepout == 0 || bFirstStep || bLastStep);
-
- if (bNS && !(bFirstStep && ir->bContinuation && !bRerunMD))
- {
- if (bRerunMD)
- {
- bMasterState = TRUE;
- }
- else
- {
- bMasterState = FALSE;
- /* Correct the new box if it is too skewed */
- if (DYNAMIC_BOX(*ir))
- {
- if (correct_box(fplog,step,state->box,graph))
- {
- bMasterState = TRUE;
- }
- }
- if (DOMAINDECOMP(cr) && bMasterState)
- {
- dd_collect_state(cr->dd,state,state_global);
- }
- }
-
- if (DOMAINDECOMP(cr))
- {
- /* Repartition the domain decomposition */
- wallcycle_start(wcycle,ewcDOMDEC);
- dd_partition_system(fplog,step,cr,
- bMasterState,nstglobalcomm,
- state_global,top_global,ir,
- state,&f,mdatoms,top,fr,
- vsite,shellfc,constr,
- nrnb,wcycle,do_verbose);
- wallcycle_stop(wcycle,ewcDOMDEC);
- /* If using an iterative integrator, reallocate space to match the decomposition */
- }
- }
-
- if (MASTER(cr) && do_log && !bFFscan)
- {
- print_ebin_header(fplog,step,t,state->lambda);
- }
-
- if (ir->efep != efepNO)
- {
- update_mdatoms(mdatoms,state->lambda);
- }
-
- if (bRerunMD && rerun_fr.bV)
- {
-
- /* We need the kinetic energy at minus the half step for determining
- * the full step kinetic energy and possibly for T-coupling.*/
- /* This may not be quite working correctly yet . . . . */
- compute_globals(fplog,gstat,cr,ir,fr,ekind,state,state_global,mdatoms,nrnb,vcm,
- wcycle,enerd,NULL,NULL,NULL,NULL,mu_tot,
- constr,NULL,FALSE,state->box,
- top_global,&pcurr,top_global->natoms,&bSumEkinhOld,
- CGLO_RERUNMD | CGLO_GSTAT | CGLO_TEMPERATURE);
- }
- clear_mat(force_vir);
-
- /* Ionize the atoms if necessary */
-/* if (bIonize)
- {
- ionize(fplog,oenv,mdatoms,top_global,t,ir,state->x,state->v,
- mdatoms->start,mdatoms->start+mdatoms->homenr,state->box,cr);
- }*/
-
- /* Update force field in ffscan program */
-/* if (bFFscan)
- {
- if (update_forcefield(fplog,
- nfile,fnm,fr,
- mdatoms->nr,state->x,state->box)) {
- if (gmx_parallel_env_initialized())
- {
- gmx_finalize();
- }
- exit(0);
- }
- }*/
-
- GMX_MPE_LOG(ev_timestep2);
-
- /* We write a checkpoint at this MD step when:
- * either at an NS step when we signalled through gs,
- * or at the last step (but not when we do not want confout),
- * but never at the first step or with rerun.
- */
-/* bCPT = (((gs.set[eglsCHKPT] && bNS) ||
- (bLastStep && (Flags & MD_CONFOUT))) &&
- step > ir->init_step && !bRerunMD);
- if (bCPT)
- {
- gs.set[eglsCHKPT] = 0;
- }*/
-
- /* Determine the energy and pressure:
- * at nstcalcenergy steps and at energy output steps (set below).
- */
- bNstEner = (bGStatEveryStep || do_per_step(step,ir->nstcalcenergy));
- bCalcEnerPres = bNstEner;
-
- /* Do we need global communication ? */
- bGStat = (bCalcEnerPres || bStopCM ||
- (ir->nstlist == -1 && !bRerunMD && step >= nlh.step_nscheck));
-
- do_ene = (do_per_step(step,ir->nstenergy) || bLastStep);
-
- if (do_ene || do_log)
- {
- bCalcEnerPres = TRUE;
- bGStat = TRUE;
- }
-
- /* these CGLO_ options remain the same throughout the iteration */
- cglo_flags = ((bRerunMD ? CGLO_RERUNMD : 0) |
- (bStopCM ? CGLO_STOPCM : 0) |
- (bGStat ? CGLO_GSTAT : 0)
- );
-
- force_flags = (GMX_FORCE_STATECHANGED |
- ((DYNAMIC_BOX(*ir) || bRerunMD) ? GMX_FORCE_DYNAMICBOX : 0) |
- GMX_FORCE_ALLFORCES |
- (bNStList ? GMX_FORCE_DOLR : 0) |
- GMX_FORCE_SEPLRF |
- (bCalcEnerPres ? GMX_FORCE_VIRIAL : 0) |
- (bDoDHDL ? GMX_FORCE_DHDL : 0)
- );
-
- if (shellfc)
- {
- /* Now is the time to relax the shells */
- count=relax_shell_flexcon(fplog,cr,bVerbose,bFFscan ? step+1 : step,
- ir,bNS,force_flags,
- bStopCM,top,top_global,
- constr,enerd,fcd,
- state,f,force_vir,mdatoms,
- nrnb,wcycle,graph,groups,
- shellfc,fr,bBornRadii,t,mu_tot,
- state->natoms,&bConverged,vsite,
- outf->fp_field);
- tcount+=count;
-
- if (bConverged)
- {
- nconverged++;
- }
- }
- else
- {
- /* The coordinates (x) are shifted (to get whole molecules)
- * in do_force.
- * This is parallellized as well, and does communication too.
- * Check comments in sim_util.c
- */
-
- do_force(fplog,cr,ir,step,nrnb,wcycle,top,top_global,groups,
- state->box,state->x,&state->hist,
- f,force_vir,mdatoms,enerd,fcd,
- state->lambda,graph,
- fr,vsite,mu_tot,t,outf->fp_field,ed,bBornRadii,
- (bNS ? GMX_FORCE_NS : 0) | force_flags);
- }
-
- GMX_BARRIER(cr->mpi_comm_mygroup);
-
- /* if (bTCR)
- {
- mu_aver = calc_mu_aver(cr,state->x,mdatoms->chargeA,
- mu_tot,&top_global->mols,mdatoms,gnx,grpindex);
- }
-
- if (bTCR && bFirstStep)
- {
- tcr=init_coupling(fplog,nfile,fnm,cr,fr,mdatoms,&(top->idef));
- fprintf(fplog,"Done init_coupling\n");
- fflush(fplog);
- }*/
-
- /* ############### START FIRST UPDATE HALF-STEP ############### */
-
- if (bVV && !bStartingFromCpt && !bRerunMD)
- {
- if (ir->eI == eiVV)
- {
- if (bInitStep)
- {
- /* if using velocity verlet with full time step Ekin,
- * take the first half step only to compute the
- * virial for the first step. From there,
- * revert back to the initial coordinates
- * so that the input is actually the initial step.
- */
- copy_rvecn(state->v,cbuf,0,state->natoms); /* should make this better for parallelizing? */
- }
-
- /* this is for NHC in the Ekin(t+dt/2) version of vv */
- if (!bInitStep)
- {
- trotter_update(ir,step,ekind,enerd,state,total_vir,mdatoms,&MassQ,trotter_seq,ettTSEQ2);
- }
-
- if (ir->eI == eiVVAK)
- {
- update_tcouple(fplog,step,ir,state,ekind,wcycle,upd,&MassQ,mdatoms);
- }
-
- update_coords(fplog,step,ir,mdatoms,state,
- f,fr->bTwinRange && bNStList,fr->f_twin,fcd,
- ekind,M,wcycle,upd,bInitStep,etrtVELOCITY1,
- cr,nrnb,constr,&top->idef);
-
- if (bIterations)
- {
- gmx_iterate_init(&iterate,bIterations && !bInitStep);
- }
- /* for iterations, we save these vectors, as we will be self-consistently iterating
- the calculations */
- /*#### UPDATE EXTENDED VARIABLES IN TROTTER FORMULATION */
-
- /* save the state */
- if (bIterations && iterate.bIterate) {
- copy_coupling_state(state,bufstate,ekind,ekind_save,&(ir->opts));
- }
- }
-
- bFirstIterate = TRUE;
- while (bFirstIterate || (bIterations && iterate.bIterate))
- {
- if (bIterations && iterate.bIterate)
- {
- copy_coupling_state(bufstate,state,ekind_save,ekind,&(ir->opts));
- if (bFirstIterate && bTrotter)
- {
- /* The first time through, we need a decent first estimate
- of veta(t+dt) to compute the constraints. Do
- this by computing the box volume part of the
- trotter integration at this time. Nothing else
- should be changed by this routine here. If
- !(first time), we start with the previous value
- of veta. */
-
- veta_save = state->veta;
- trotter_update(ir,step,ekind,enerd,state,total_vir,mdatoms,&MassQ,trotter_seq,ettTSEQ0);
- vetanew = state->veta;
- state->veta = veta_save;
- }
- }
-
- bOK = TRUE;
- if ( !bRerunMD || rerun_fr.bV || bForceUpdate) { /* Why is rerun_fr.bV here? Unclear. */
- dvdl = 0;
-
- update_constraints(fplog,step,&dvdl,ir,ekind,mdatoms,state,graph,f,
- &top->idef,shake_vir,NULL,
- cr,nrnb,wcycle,upd,constr,
- bInitStep,TRUE,bCalcEnerPres,vetanew);
-
- if (!bOK && !bFFscan)
- {
- gmx_fatal(FARGS,"Constraint error: Shake, Lincs or Settle could not solve the constrains");
- }
-
- }
- else if (graph)
- { /* Need to unshift here if a do_force has been
- called in the previous step */
- unshift_self(graph,state->box,state->x);
- }
-
-
- if (bVV) {
- /* if VV, compute the pressure and constraints */
- /* if VV2, the pressure and constraints only if using pressure control.*/
- bPres = (ir->eI==eiVV || IR_NPT_TROTTER(ir));
- bTemp = ((ir->eI==eiVV &&(!bInitStep)) || (ir->eI==eiVVAK && IR_NPT_TROTTER(ir)));
- compute_globals(fplog,gstat,cr,ir,fr,ekind,state,state_global,mdatoms,nrnb,vcm,
- wcycle,enerd,force_vir,shake_vir,total_vir,pres,mu_tot,
- constr,NULL,FALSE,state->box,
- top_global,&pcurr,top_global->natoms,&bSumEkinhOld,
- cglo_flags
- | CGLO_ENERGY
- | (bTemp ? CGLO_TEMPERATURE:0)
- | (bPres ? CGLO_PRESSURE : 0)
- | (bPres ? CGLO_CONSTRAINT : 0)
- | (iterate.bIterate ? CGLO_ITERATE : 0)
- | (bFirstIterate ? CGLO_FIRSTITERATE : 0)
- | CGLO_SCALEEKIN
- );
- }
- /* explanation of above:
- a) We compute Ekin at the full time step
- if 1) we are using the AveVel Ekin, and it's not the
- initial step, or 2) if we are using AveEkin, but need the full
- time step kinetic energy for the pressure.
- b) If we are using EkinAveEkin for the kinetic energy for the temperture control, we still feed in
- EkinAveVel because it's needed for the pressure */
-
- /* temperature scaling and pressure scaling to produce the extended variables at t+dt */
- if (bVV && !bInitStep)
- {
- trotter_update(ir,step,ekind,enerd,state,total_vir,mdatoms,&MassQ, trotter_seq,ettTSEQ2);
- }
-
- if (bIterations &&
- done_iterating(cr,fplog,step,&iterate,bFirstIterate,
- state->veta,&vetanew))
- {
- break;
- }
- bFirstIterate = FALSE;
- }
-
- if (bTrotter && !bInitStep) {
- copy_mat(shake_vir,state->svir_prev);
- copy_mat(force_vir,state->fvir_prev);
- if (IR_NVT_TROTTER(ir) && ir->eI==eiVV) {
- /* update temperature and kinetic energy now that step is over - this is the v(t+dt) point */
- enerd->term[F_TEMP] = sum_ekin(&(ir->opts),ekind,NULL,(ir->eI==eiVV),FALSE,FALSE);
- enerd->term[F_EKIN] = trace(ekind->ekin);
- }
- }
- /* if it's the initial step, we performed this first step just to get the constraint virial */
- if (bInitStep && ir->eI==eiVV) {
- copy_rvecn(cbuf,state->v,0,state->natoms);
- }
-
- if (fr->bSepDVDL && fplog && do_log)
- {
- fprintf(fplog,sepdvdlformat,"Constraint",0.0,dvdl);
- }
- enerd->term[F_DHDL_CON] += dvdl;
-
- GMX_MPE_LOG(ev_timestep1);
-
- }
-
- /* MRS -- now done iterating -- compute the conserved quantity */
- if (bVV) {
- last_conserved = 0;
- if (IR_NVT_TROTTER(ir) || IR_NPT_TROTTER(ir))
- {
- last_conserved =
- NPT_energy(ir,state,&MassQ);
- if ((ir->eDispCorr != edispcEnerPres) && (ir->eDispCorr != edispcAllEnerPres))
- {
- last_conserved -= enerd->term[F_DISPCORR];
- }
- }
- if (ir->eI==eiVV) {
- last_ekin = enerd->term[F_EKIN]; /* does this get preserved through checkpointing? */
- }
- }
-
- /* ######## END FIRST UPDATE STEP ############## */
- /* ######## If doing VV, we now have v(dt) ###### */
-
- /* ################## START TRAJECTORY OUTPUT ################# */
-
- /* Now we have the energies and forces corresponding to the
- * coordinates at time t. We must output all of this before
- * the update.
- * for RerunMD t is read from input trajectory
- */
- GMX_MPE_LOG(ev_output_start);
-
- mdof_flags = 0;
- if (do_per_step(step,ir->nstxout)) { mdof_flags |= MDOF_X; }
- if (do_per_step(step,ir->nstvout)) { mdof_flags |= MDOF_V; }
- if (do_per_step(step,ir->nstfout)) { mdof_flags |= MDOF_F; }
- if (do_per_step(step,ir->nstxtcout)) { mdof_flags |= MDOF_XTC; }
-/* if (bCPT) { mdof_flags |= MDOF_CPT; };*/
-
-#ifdef GMX_FAHCORE
- if (MASTER(cr))
- fcReportProgress( ir->nsteps, step );
-
- if (bLastStep)
- {
- /* Enforce writing positions and velocities at end of run */
- mdof_flags |= (MDOF_X | MDOF_V);
- }
- /* sync bCPT and fc record-keeping */
-/* if (bCPT && MASTER(cr))
- fcRequestCheckPoint();*/
-#endif
-
- if (mdof_flags != 0)
- {
- wallcycle_start(wcycle,ewcTRAJ);
-/* if (bCPT)
- {
- if (state->flags & (1<<estLD_RNG))
- {
- get_stochd_state(upd,state);
- }
- if (MASTER(cr))
- {
- if (bSumEkinhOld)
- {
- state_global->ekinstate.bUpToDate = FALSE;
- }
- else
- {
- update_ekinstate(&state_global->ekinstate,ekind);
- state_global->ekinstate.bUpToDate = TRUE;
- }
- update_energyhistory(&state_global->enerhist,mdebin);
- }
- }*/
- write_traj(fplog,cr,outf,mdof_flags,top_global,
- step,t,state,state_global,f,f_global,&n_xtc,&x_xtc);
-/* if (bCPT)
- {
- nchkpt++;
- bCPT = FALSE;
- }*/
- debug_gmx();
- if (bLastStep && step_rel == ir->nsteps &&
- (Flags & MD_CONFOUT) && MASTER(cr) &&
- !bRerunMD && !bFFscan)
- {
- /* x and v have been collected in write_traj,
- * because a checkpoint file will always be written
- * at the last step.
- */
- fprintf(stderr,"\nWriting final coordinates.\n");
- if (ir->ePBC != epbcNONE && !ir->bPeriodicMols &&
- DOMAINDECOMP(cr))
- {
- /* Make molecules whole only for confout writing */
- do_pbc_mtop(fplog,ir->ePBC,state->box,top_global,state_global->x);
- }
-/* write_sto_conf_mtop(ftp2fn(efSTO,nfile,fnm),
- *top_global->name,top_global,
- state_global->x,state_global->v,
- ir->ePBC,state->box);*/
- debug_gmx();
- }
- wallcycle_stop(wcycle,ewcTRAJ);
- }
- GMX_MPE_LOG(ev_output_finish);
-
- /* kludge -- virial is lost with restart for NPT control. Must restart */
- if (bStartingFromCpt && bVV)
- {
- copy_mat(state->svir_prev,shake_vir);
- copy_mat(state->fvir_prev,force_vir);
- }
- /* ################## END TRAJECTORY OUTPUT ################ */
-
- /* Determine the pressure:
- * always when we want exact averages in the energy file,
- * at ns steps when we have pressure coupling,
- * otherwise only at energy output steps (set below).
- */
-
- bNstEner = (bGStatEveryStep || do_per_step(step,ir->nstcalcenergy));
- bCalcEnerPres = bNstEner;
-
- /* Do we need global communication ? */
- bGStat = (bGStatEveryStep || bStopCM || bNS ||
- (ir->nstlist == -1 && !bRerunMD && step >= nlh.step_nscheck));
-
- do_ene = (do_per_step(step,ir->nstenergy) || bLastStep);
-
- if (do_ene || do_log)
- {
- bCalcEnerPres = TRUE;
- bGStat = TRUE;
- }
-
- /* Determine the wallclock run time up till now */
- run_time = gmx_gettime() - (double)runtime->real;
-
- /* Check whether everything is still allright */
- if (((int)gmx_get_stop_condition() > handled_stop_condition)
-#ifdef GMX_THREADS
- && MASTER(cr)
-#endif
- )
- {
- /* this is just make gs.sig compatible with the hack
- of sending signals around by MPI_Reduce with together with
- other floats */
- if ( gmx_get_stop_condition() == gmx_stop_cond_next_ns )
- gs.sig[eglsSTOPCOND]=1;
- if ( gmx_get_stop_condition() == gmx_stop_cond_next )
- gs.sig[eglsSTOPCOND]=-1;
- /* < 0 means stop at next step, > 0 means stop at next NS step */
- if (fplog)
- {
- fprintf(fplog,
- "\n\nReceived the %s signal, stopping at the next %sstep\n\n",
- gmx_get_signal_name(),
- gs.sig[eglsSTOPCOND]==1 ? "NS " : "");
- fflush(fplog);
- }
- fprintf(stderr,
- "\n\nReceived the %s signal, stopping at the next %sstep\n\n",
- gmx_get_signal_name(),
- gs.sig[eglsSTOPCOND]==1 ? "NS " : "");
- fflush(stderr);
- handled_stop_condition=(int)gmx_get_stop_condition();
- }
- else if (MASTER(cr) && (bNS || ir->nstlist <= 0) &&
- (max_hours > 0 && run_time > max_hours*60.0*60.0*0.99) &&
- gs.sig[eglsSTOPCOND] == 0 && gs.set[eglsSTOPCOND] == 0)
- {
- /* Signal to terminate the run */
- gs.sig[eglsSTOPCOND] = 1;
- if (fplog)
- {
- fprintf(fplog,"\nStep %s: Run time exceeded %.3f hours, will terminate the run\n",gmx_step_str(step,sbuf),max_hours*0.99);
- }
- fprintf(stderr, "\nStep %s: Run time exceeded %.3f hours, will terminate the run\n",gmx_step_str(step,sbuf),max_hours*0.99);
- }
-
- if (bResetCountersHalfMaxH && MASTER(cr) &&
- run_time > max_hours*60.0*60.0*0.495)
- {
- gs.sig[eglsRESETCOUNTERS] = 1;
- }
-
- if (ir->nstlist == -1 && !bRerunMD)
- {
- /* When bGStatEveryStep=FALSE, global_stat is only called
- * when we check the atom displacements, not at NS steps.
- * This means that also the bonded interaction count check is not
- * performed immediately after NS. Therefore a few MD steps could
- * be performed with missing interactions.
- * But wrong energies are never written to file,
- * since energies are only written after global_stat
- * has been called.
- */
- if (step >= nlh.step_nscheck)
- {
- nlh.nabnsb = natoms_beyond_ns_buffer(ir,fr,&top->cgs,
- nlh.scale_tot,state->x);
- }
- else
- {
- /* This is not necessarily true,
- * but step_nscheck is determined quite conservatively.
- */
- nlh.nabnsb = 0;
- }
- }
-
- /* In parallel we only have to check for checkpointing in steps
- * where we do global communication,
- * otherwise the other nodes don't know.
- */
- if (MASTER(cr) && ((bGStat || !PAR(cr)) &&
- cpt_period >= 0 &&
- (cpt_period == 0 ||
- run_time >= nchkpt*cpt_period*60.0)) &&
- gs.set[eglsCHKPT] == 0)
- {
- gs.sig[eglsCHKPT] = 1;
- }
-
- if (bIterations)
- {
- gmx_iterate_init(&iterate,bIterations);
- }
-
- /* for iterations, we save these vectors, as we will be redoing the calculations */
- if (bIterations && iterate.bIterate)
- {
- copy_coupling_state(state,bufstate,ekind,ekind_save,&(ir->opts));
- }
- bFirstIterate = TRUE;
- while (bFirstIterate || (bIterations && iterate.bIterate))
- {
- /* We now restore these vectors to redo the calculation with improved extended variables */
- if (bIterations)
- {
- copy_coupling_state(bufstate,state,ekind_save,ekind,&(ir->opts));
- }
-
- /* We make the decision to break or not -after- the calculation of Ekin and Pressure,
- so scroll down for that logic */
-
- /* ######### START SECOND UPDATE STEP ################# */
- GMX_MPE_LOG(ev_update_start);
- bOK = TRUE;
- if (!bRerunMD || rerun_fr.bV || bForceUpdate)
- {
- wallcycle_start(wcycle,ewcUPDATE);
- dvdl = 0;
- /* Box is changed in update() when we do pressure coupling,
- * but we should still use the old box for energy corrections and when
- * writing it to the energy file, so it matches the trajectory files for
- * the same timestep above. Make a copy in a separate array.
- */
- copy_mat(state->box,lastbox);
- /* UPDATE PRESSURE VARIABLES IN TROTTER FORMULATION WITH CONSTRAINTS */
- if (bTrotter)
- {
- if (bIterations && iterate.bIterate)
- {
- if (bFirstIterate)
- {
- scalevir = 1;
- }
- else
- {
- /* we use a new value of scalevir to converge the iterations faster */
- scalevir = tracevir/trace(shake_vir);
- }
- msmul(shake_vir,scalevir,shake_vir);
- m_add(force_vir,shake_vir,total_vir);
- clear_mat(shake_vir);
- }
- trotter_update(ir,step,ekind,enerd,state,total_vir,mdatoms,&MassQ, trotter_seq,ettTSEQ3);
- }
- /* We can only do Berendsen coupling after we have summed
- * the kinetic energy or virial. Since the happens
- * in global_state after update, we should only do it at
- * step % nstlist = 1 with bGStatEveryStep=FALSE.
- */
-
- if (ir->eI != eiVVAK)
- {
- update_tcouple(fplog,step,ir,state,ekind,wcycle,upd,&MassQ,mdatoms);
- }
- update_pcouple(fplog,step,ir,state,pcoupl_mu,M,wcycle,
- upd,bInitStep);
-
- if (bVV)
- {
- /* velocity half-step update */
- update_coords(fplog,step,ir,mdatoms,state,f,fr->bTwinRange && bNStList,fr->f_twin,fcd,
- ekind,M,wcycle,upd,FALSE,etrtVELOCITY2,cr,nrnb,constr,&top->idef);
- }
-
- /* Above, initialize just copies ekinh into ekin,
- * it doesn't copy position (for VV),
- * and entire integrator for MD.
- */
-
- if (ir->eI==eiVVAK)
- {
- copy_rvecn(state->x,cbuf,0,state->natoms);
- }
-
- update_coords(fplog,step,ir,mdatoms,state,f,fr->bTwinRange && bNStList,fr->f_twin,fcd,
- ekind,M,wcycle,upd,bInitStep,etrtPOSITION,cr,nrnb,constr,&top->idef);
- wallcycle_stop(wcycle,ewcUPDATE);
-
- update_constraints(fplog,step,&dvdl,ir,ekind,mdatoms,state,graph,f,
- &top->idef,shake_vir,force_vir,
- cr,nrnb,wcycle,upd,constr,
- bInitStep,FALSE,bCalcEnerPres,state->veta);
-
- if (ir->eI==eiVVAK)
- {
- /* erase F_EKIN and F_TEMP here? */
- /* just compute the kinetic energy at the half step to perform a trotter step */
- compute_globals(fplog,gstat,cr,ir,fr,ekind,state,state_global,mdatoms,nrnb,vcm,
- wcycle,enerd,force_vir,shake_vir,total_vir,pres,mu_tot,
- constr,NULL,FALSE,lastbox,
- top_global,&pcurr,top_global->natoms,&bSumEkinhOld,
- cglo_flags | CGLO_TEMPERATURE | CGLO_CONSTRAINT
- );
- wallcycle_start(wcycle,ewcUPDATE);
- trotter_update(ir,step,ekind,enerd,state,total_vir,mdatoms,&MassQ, trotter_seq,ettTSEQ4);
- /* now we know the scaling, we can compute the positions again again */
- copy_rvecn(cbuf,state->x,0,state->natoms);
-
- update_coords(fplog,step,ir,mdatoms,state,f,fr->bTwinRange && bNStList,fr->f_twin,fcd,
- ekind,M,wcycle,upd,bInitStep,etrtPOSITION,cr,nrnb,constr,&top->idef);
- wallcycle_stop(wcycle,ewcUPDATE);
-
- /* do we need an extra constraint here? just need to copy out of state->v to upd->xp? */
- /* are the small terms in the shake_vir here due
- * to numerical errors, or are they important
- * physically? I'm thinking they are just errors, but not completely sure.
- * For now, will call without actually constraining, constr=NULL*/
- update_constraints(fplog,step,&dvdl,ir,ekind,mdatoms,state,graph,f,
- &top->idef,tmp_vir,force_vir,
- cr,nrnb,wcycle,upd,NULL,
- bInitStep,FALSE,bCalcEnerPres,state->veta);
- }
- if (!bOK && !bFFscan)
- {
- gmx_fatal(FARGS,"Constraint error: Shake, Lincs or Settle could not solve the constrains");
- }
-
- if (fr->bSepDVDL && fplog && do_log)
- {
- fprintf(fplog,sepdvdlformat,"Constraint",0.0,dvdl);
- }
- enerd->term[F_DHDL_CON] += dvdl;
- }
- else if (graph)
- {
- /* Need to unshift here */
- unshift_self(graph,state->box,state->x);
- }
-
- GMX_BARRIER(cr->mpi_comm_mygroup);
- GMX_MPE_LOG(ev_update_finish);
-
- if (vsite != NULL)
- {
- wallcycle_start(wcycle,ewcVSITECONSTR);
- if (graph != NULL)
- {
- shift_self(graph,state->box,state->x);
- }
- construct_vsites(fplog,vsite,state->x,nrnb,ir->delta_t,state->v,
- top->idef.iparams,top->idef.il,
- fr->ePBC,fr->bMolPBC,graph,cr,state->box);
-
- if (graph != NULL)
- {
- unshift_self(graph,state->box,state->x);
- }
- wallcycle_stop(wcycle,ewcVSITECONSTR);
- }
-
- /* ############## IF NOT VV, Calculate globals HERE, also iterate constraints ############ */
- if (ir->nstlist == -1 && bFirstIterate)
- {
- gs.sig[eglsNABNSB] = nlh.nabnsb;
- }
- compute_globals(fplog,gstat,cr,ir,fr,ekind,state,state_global,mdatoms,nrnb,vcm,
- wcycle,enerd,force_vir,shake_vir,total_vir,pres,mu_tot,
- constr,
- bFirstIterate ? &gs : NULL,(step % gs.nstms == 0),
- lastbox,
- top_global,&pcurr,top_global->natoms,&bSumEkinhOld,
- cglo_flags
- | (!EI_VV(ir->eI) ? CGLO_ENERGY : 0)
- | (!EI_VV(ir->eI) ? CGLO_TEMPERATURE : 0)
- | (!EI_VV(ir->eI) || bRerunMD ? CGLO_PRESSURE : 0)
- | (bIterations && iterate.bIterate ? CGLO_ITERATE : 0)
- | (bFirstIterate ? CGLO_FIRSTITERATE : 0)
- | CGLO_CONSTRAINT
- );
- if (ir->nstlist == -1 && bFirstIterate)
- {
- nlh.nabnsb = gs.set[eglsNABNSB];
- gs.set[eglsNABNSB] = 0;
- }
- /* bIterate is set to keep it from eliminating the old ekin kinetic energy terms */
- /* ############# END CALC EKIN AND PRESSURE ################# */
-
- /* Note: this is OK, but there are some numerical precision issues with using the convergence of
- the virial that should probably be addressed eventually. state->veta has better properies,
- but what we actually need entering the new cycle is the new shake_vir value. Ideally, we could
- generate the new shake_vir, but test the veta value for convergence. This will take some thought. */
-
- if (bIterations &&
- done_iterating(cr,fplog,step,&iterate,bFirstIterate,
- trace(shake_vir),&tracevir))
- {
- break;
- }
- bFirstIterate = FALSE;
- }
-
- update_box(fplog,step,ir,mdatoms,state,graph,f,
- ir->nstlist==-1 ? &nlh.scale_tot : NULL,pcoupl_mu,nrnb,wcycle,upd,bInitStep,FALSE);
-
- /* ################# END UPDATE STEP 2 ################# */
- /* #### We now have r(t+dt) and v(t+dt/2) ############# */
-
- /* The coordinates (x) were unshifted in update */
-/* if (bFFscan && (shellfc==NULL || bConverged))
- {
- if (print_forcefield(fplog,enerd->term,mdatoms->homenr,
- f,NULL,xcopy,
- &(top_global->mols),mdatoms->massT,pres))
- {
- if (gmx_parallel_env_initialized())
- {
- gmx_finalize();
- }
- fprintf(stderr,"\n");
- exit(0);
- }
- }*/
- if (!bGStat)
- {
- /* We will not sum ekinh_old,
- * so signal that we still have to do it.
- */
- bSumEkinhOld = TRUE;
- }
-
-/* if (bTCR)
- {*/
- /* Only do GCT when the relaxation of shells (minimization) has converged,
- * otherwise we might be coupling to bogus energies.
- * In parallel we must always do this, because the other sims might
- * update the FF.
- */
-
- /* Since this is called with the new coordinates state->x, I assume
- * we want the new box state->box too. / EL 20040121
- */
-/* do_coupling(fplog,oenv,nfile,fnm,tcr,t,step,enerd->term,fr,
- ir,MASTER(cr),
- mdatoms,&(top->idef),mu_aver,
- top_global->mols.nr,cr,
- state->box,total_vir,pres,
- mu_tot,state->x,f,bConverged);
- debug_gmx();
- }*/
-
- /* ######### BEGIN PREPARING EDR OUTPUT ########### */
-
- sum_dhdl(enerd,state->lambda,ir);
- /* use the directly determined last velocity, not actually the averaged half steps */
- if (bTrotter && ir->eI==eiVV)
- {
- enerd->term[F_EKIN] = last_ekin;
- }
- enerd->term[F_ETOT] = enerd->term[F_EPOT] + enerd->term[F_EKIN];
-
- switch (ir->etc)
- {
- case etcNO:
- break;
- case etcBERENDSEN:
- break;
- case etcNOSEHOOVER:
- if (IR_NVT_TROTTER(ir)) {
- enerd->term[F_ECONSERVED] = enerd->term[F_ETOT] + last_conserved;
- } else {
- enerd->term[F_ECONSERVED] = enerd->term[F_ETOT] +
- NPT_energy(ir,state,&MassQ);
- }
- break;
- case etcVRESCALE:
- enerd->term[F_ECONSERVED] =
- enerd->term[F_ETOT] + vrescale_energy(&(ir->opts),
- state->therm_integral);
- break;
- default:
- break;
- }
-
- /* Check for excessively large energies */
-/* if (bIonize)
- {
-#ifdef GMX_DOUBLE
- real etot_max = 1e200;
-#else
- real etot_max = 1e30;
-#endif
- if (fabs(enerd->term[F_ETOT]) > etot_max)
- {
- fprintf(stderr,"Energy too large (%g), giving up\n",
- enerd->term[F_ETOT]);
- }
- }*/
- /* ######### END PREPARING EDR OUTPUT ########### */
-
- /* Time for performance */
- if (((step % stepout) == 0) || bLastStep)
- {
- runtime_upd_proc(runtime);
- }
-
- /* Output stuff */
- if (MASTER(cr))
- {
- gmx_bool do_dr,do_or;
-
- if (!(bStartingFromCpt && (EI_VV(ir->eI))))
- {
- if (bNstEner)
- {
- upd_mdebin(mdebin,bDoDHDL,TRUE,
- t,mdatoms->tmass,enerd,state,lastbox,
- shake_vir,force_vir,total_vir,pres,
- ekind,mu_tot,constr);
- }
- else
- {
- upd_mdebin_step(mdebin);
- }
-
- do_dr = do_per_step(step,ir->nstdisreout);
- do_or = do_per_step(step,ir->nstorireout);
-
- print_ebin(outf->fp_ene,do_ene,do_dr,do_or,do_log?fplog:NULL,
- step,t,
- eprNORMAL,bCompact,mdebin,fcd,groups,&(ir->opts));
- }
- if (ir->ePull != epullNO)
- {
- pull_print_output(ir->pull,step,t);
- }
-
- if (do_per_step(step,ir->nstlog))
- {
- if(fflush(fplog) != 0)
- {
- gmx_fatal(FARGS,"Cannot flush logfile - maybe you are out of quota?");
- }
- }
- }
-
-
- /* Remaining runtime */
- if (MULTIMASTER(cr) && (do_verbose || gmx_got_usr_signal() ))
- {
- if (shellfc)
- {
- fprintf(stderr,"\n");
- }
- print_time(stderr,runtime,step,ir,cr);
- }
-
- /* Set new positions for the group to embed */
- if(!bLastStep){
- if(step_rel<=it_xy)
- {
- fac[0]+=xy_step;
- fac[1]+=xy_step;
- } else if (step_rel<=(it_xy+it_z))
- {
- fac[2]+=z_step;
- }
- resize(ins_at,r_ins,state_global->x,pos_ins,fac);
- }
-
- /* Replica exchange */
-/* bExchanged = FALSE;
- if ((repl_ex_nst > 0) && (step > 0) && !bLastStep &&
- do_per_step(step,repl_ex_nst))
- {
- bExchanged = replica_exchange(fplog,cr,repl_ex,
- state_global,enerd->term,
- state,step,t);
- }
- if (bExchanged && PAR(cr))
- {
- if (DOMAINDECOMP(cr))
- {
- dd_partition_system(fplog,step,cr,TRUE,1,
- state_global,top_global,ir,
- state,&f,mdatoms,top,fr,
- vsite,shellfc,constr,
- nrnb,wcycle,FALSE);
- }
- else
- {
- bcast_state(cr,state,FALSE);
- }
- }*/
-
- bFirstStep = FALSE;
- bInitStep = FALSE;
- bStartingFromCpt = FALSE;
-
- /* ####### SET VARIABLES FOR NEXT ITERATION IF THEY STILL NEED IT ###### */
- /* Complicated conditional when bGStatEveryStep=FALSE.
- * We can not just use bGStat, since then the simulation results
- * would depend on nstenergy and nstlog or step_nscheck.
- */
- if (((state->flags & (1<<estPRES_PREV)) ||
- (state->flags & (1<<estSVIR_PREV)) ||
- (state->flags & (1<<estFVIR_PREV))) &&
- (bGStatEveryStep ||
- (ir->nstlist > 0 && step % ir->nstlist == 0) ||
- (ir->nstlist < 0 && nlh.nabnsb > 0) ||
- (ir->nstlist == 0 && bGStat)))
- {
- /* Store the pressure in t_state for pressure coupling
- * at the next MD step.
- */
- if (state->flags & (1<<estPRES_PREV))
- {
- copy_mat(pres,state->pres_prev);
- }
- }
-
- /* ####### END SET VARIABLES FOR NEXT ITERATION ###### */
-
- if (bRerunMD)
- {
- /* read next frame from input trajectory */
- bNotLastFrame = read_next_frame(oenv,status,&rerun_fr);
- }
-
- if (!bRerunMD || !rerun_fr.bStep)
- {
- /* increase the MD step number */
- step++;
- step_rel++;
- }
-
- cycles = wallcycle_stop(wcycle,ewcSTEP);
- if (DOMAINDECOMP(cr) && wcycle)
- {
- dd_cycles_add(cr->dd,cycles,ddCyclStep);
- }
-
- if (step_rel == wcycle_get_reset_counters(wcycle) ||
- gs.set[eglsRESETCOUNTERS] != 0)
- {
- /* Reset all the counters related to performance over the run */
- reset_all_counters(fplog,cr,step,&step_rel,ir,wcycle,nrnb,runtime);
- wcycle_set_reset_counters(wcycle,-1);
- bResetCountersHalfMaxH = FALSE;
- gs.set[eglsRESETCOUNTERS] = 0;
- }
- }
- /* End of main MD loop */
- debug_gmx();
- write_sto_conf_mtop(ftp2fn(efSTO,nfile,fnm),
- *top_global->name,top_global,
- state_global->x,state_global->v,
- ir->ePBC,state->box);
-
- /* Stop the time */
- runtime_end(runtime);
-
- if (bRerunMD)
- {
- close_trj(status);
- }
-
- if (!(cr->duty & DUTY_PME))
- {
- /* Tell the PME only node to finish */
- gmx_pme_finish(cr);
- }
-
- if (MASTER(cr))
- {
- if (ir->nstcalcenergy > 0 && !bRerunMD)
- {
- print_ebin(outf->fp_ene,FALSE,FALSE,FALSE,fplog,step,t,
- eprAVER,FALSE,mdebin,fcd,groups,&(ir->opts));
- }
- }
-
- done_mdoutf(outf);
-
- debug_gmx();
-
- if (ir->nstlist == -1 && nlh.nns > 0 && fplog)
- {
- fprintf(fplog,"Average neighborlist lifetime: %.1f steps, std.dev.: %.1f steps\n",nlh.s1/nlh.nns,sqrt(nlh.s2/nlh.nns - sqr(nlh.s1/nlh.nns)));
- fprintf(fplog,"Average number of atoms that crossed the half buffer length: %.1f\n\n",nlh.ab/nlh.nns);
- }
-
- if (shellfc && fplog)
- {
- fprintf(fplog,"Fraction of iterations that converged: %.2f %%\n",
- (nconverged*100.0)/step_rel);
- fprintf(fplog,"Average number of force evaluations per MD step: %.2f\n\n",
- tcount/step_rel);
- }
-
-/* if (repl_ex_nst > 0 && MASTER(cr))
- {
- print_replica_exchange_statistics(fplog,repl_ex);
- }*/
-
- runtime->nsteps_done = step_rel;
-
- return 0;
-}
-
-
-int mdrunner_membed(FILE *fplog,t_commrec *cr,int nfile,const t_filenm fnm[],
- const output_env_t oenv, gmx_bool bVerbose,gmx_bool bCompact,
- int nstglobalcomm,
- ivec ddxyz,int dd_node_order,real rdd,real rconstr,
- const char *dddlb_opt,real dlb_scale,
- const char *ddcsx,const char *ddcsy,const char *ddcsz,
- int nstepout,int resetstep,int nmultisim,int repl_ex_nst,int repl_ex_seed,
- real pforce,real cpt_period,real max_hours,
- const char *deviceOptions,
- unsigned long Flags,
- real xy_fac, real xy_max, real z_fac, real z_max,
- int it_xy, int it_z, real probe_rad, int low_up_rm,
- int pieces, gmx_bool bALLOW_ASYMMETRY, int maxwarn)
-{
- double nodetime=0,realtime;
- t_inputrec *inputrec;
- t_state *state=NULL;
- matrix box;
- gmx_ddbox_t ddbox;
- int npme_major,npme_minor;
- real tmpr1,tmpr2;
- t_nrnb *nrnb;
- gmx_mtop_t *mtop=NULL;
- t_mdatoms *mdatoms=NULL;
- t_forcerec *fr=NULL;
- t_fcdata *fcd=NULL;
- real ewaldcoeff=0;
- gmx_pme_t *pmedata=NULL;
- gmx_vsite_t *vsite=NULL;
- gmx_constr_t constr;
- int i,m,nChargePerturbed=-1,status,nalloc;
- char *gro;
- gmx_wallcycle_t wcycle;
- gmx_bool bReadRNG,bReadEkin;
- int list;
- gmx_runtime_t runtime;
- int rc;
- gmx_large_int_t reset_counters;
- gmx_edsam_t ed=NULL;
- t_commrec *cr_old=cr;
- int nthreads=1,nthreads_requested=1;
-
-
- char *ins;
- int rm_bonded_at,fr_id,fr_i=0,tmp_id,warn=0;
- int ng,j,max_lip_rm,ins_grp_id,ins_nat,mem_nat,ntype,lip_rm,tpr_version;
- real xy_step=0,z_step=0;
- real prot_area;
- rvec *r_ins=NULL,fac;
- t_block *ins_at,*rest_at;
- pos_ins_t *pos_ins;
- mem_t *mem_p;
- rm_t *rm_p;
- gmx_groups_t *groups;
- gmx_bool bExcl=FALSE;
- t_atoms atoms;
- t_pbc *pbc;
- char **piecename=NULL;
-
- /* CAUTION: threads may be started later on in this function, so
- cr doesn't reflect the final parallel state right now */
- snew(inputrec,1);
- snew(mtop,1);
-
- if (bVerbose && SIMMASTER(cr))
- {
- fprintf(stderr,"Getting Loaded...\n");
- }
-
- if (Flags & MD_APPENDFILES)
- {
- fplog = NULL;
- }
-
- snew(state,1);
- if (MASTER(cr))
- {
- /* Read (nearly) all data required for the simulation */
- read_tpx_state(ftp2fn(efTPX,nfile,fnm),inputrec,state,NULL,mtop);
-
- /* NOW the threads will be started: */
-#ifdef GMX_THREADS
-#endif
- }
- /* END OF CAUTION: cr is now reliable */
-
- if (PAR(cr))
- {
- /* now broadcast everything to the non-master nodes/threads: */
- init_parallel(fplog, cr, inputrec, mtop);
- }
- /* now make sure the state is initialized and propagated */
- set_state_entries(state,inputrec,cr->nnodes);
-
- if (can_use_allvsall(inputrec,mtop,TRUE,cr,fplog))
- {
- /* All-vs-all loops do not work with domain decomposition */
- Flags |= MD_PARTDEC;
- }
-
- if (!EEL_PME(inputrec->coulombtype) || (Flags & MD_PARTDEC))
- {
- cr->npmenodes = 0;
- }
-
- snew(ins_at,1);
- snew(pos_ins,1);
- if(MASTER(cr))
- {
- tpr_version = get_tpr_version(ftp2fn(efTPX,nfile,fnm));
- if (tpr_version<58)
- gmx_fatal(FARGS,"Version of *.tpr file to old (%d). Rerun grompp with gromacs VERSION 4.0.3 or newer.\n",tpr_version);
-
- if( inputrec->eI != eiMD )
- gmx_input("Change integrator to md in mdp file.");
-
- if(PAR(cr))
- gmx_input("Sorry, parallel g_membed is not yet fully functrional.");
-
- groups=&(mtop->groups);
-
- atoms=gmx_mtop_global_atoms(mtop);
- snew(mem_p,1);
- fprintf(stderr,"\nSelect a group to embed in the membrane:\n");
- get_index(&atoms,ftp2fn_null(efNDX,nfile,fnm),1,&(ins_at->nr),&(ins_at->index),&ins);
- ins_grp_id = search_string(ins,groups->ngrpname,(groups->grpname));
- fprintf(stderr,"\nSelect a group to embed %s into (e.g. the membrane):\n",ins);
- get_index(&atoms,ftp2fn_null(efNDX,nfile,fnm),1,&(mem_p->mem_at.nr),&(mem_p->mem_at.index),&(mem_p->name));
-
- pos_ins->pieces=pieces;
- snew(pos_ins->nidx,pieces);
- snew(pos_ins->subindex,pieces);
- snew(piecename,pieces);
- if (pieces>1)
- {
- fprintf(stderr,"\nSelect pieces to embed:\n");
- get_index(&atoms,ftp2fn_null(efNDX,nfile,fnm),pieces,pos_ins->nidx,pos_ins->subindex,piecename);
- }
- else
- {
- /*use whole embedded group*/
- snew(pos_ins->nidx,1);
- snew(pos_ins->subindex,1);
- pos_ins->nidx[0]=ins_at->nr;
- pos_ins->subindex[0]=ins_at->index;
- }
-
- if(probe_rad<0.2199999)
- {
- warn++;
- fprintf(stderr,"\nWarning %d:\nA probe radius (-rad) smaller than 0.2 can result in overlap between waters "
- "and the group to embed, which will result in Lincs errors etc.\nIf you are sure, you can increase maxwarn.\n\n",warn);
- }
-
- if(xy_fac<0.09999999)
- {
- warn++;
- fprintf(stderr,"\nWarning %d:\nThe initial size of %s is probably too smal.\n"
- "If you are sure, you can increase maxwarn.\n\n",warn,ins);
- }
-
- if(it_xy<1000)
- {
- warn++;
- fprintf(stderr,"\nWarning %d;\nThe number of steps used to grow the xy-coordinates of %s (%d) is probably too small.\n"
- "Increase -nxy or, if you are sure, you can increase maxwarn.\n\n",warn,ins,it_xy);
- }
-
- if( (it_z<100) && ( z_fac<0.99999999 || z_fac>1.0000001) )
- {
- warn++;
- fprintf(stderr,"\nWarning %d;\nThe number of steps used to grow the z-coordinate of %s (%d) is probably too small.\n"
- "Increase -nz or, if you are sure, you can increase maxwarn.\n\n",warn,ins,it_z);
- }
-
- if(it_xy+it_z>inputrec->nsteps)
- {
- warn++;
- fprintf(stderr,"\nWarning %d:\nThe number of growth steps (-nxy + -nz) is larger than the number of steps in the tpr.\n"
- "If you are sure, you can increase maxwarn.\n\n",warn);
- }
-
- fr_id=-1;
- if( inputrec->opts.ngfrz==1)
- gmx_fatal(FARGS,"You did not specify \"%s\" as a freezegroup.",ins);
- for(i=0;i<inputrec->opts.ngfrz;i++)
- {
- tmp_id = mtop->groups.grps[egcFREEZE].nm_ind[i];
- if(ins_grp_id==tmp_id)
- {
- fr_id=tmp_id;
- fr_i=i;
- }
- }
- if (fr_id == -1 )
- gmx_fatal(FARGS,"\"%s\" not as freezegroup defined in the mdp-file.",ins);
-
- for(i=0;i<DIM;i++)
- if( inputrec->opts.nFreeze[fr_i][i] != 1)
- gmx_fatal(FARGS,"freeze dimensions for %s are not Y Y Y\n",ins);
-
- ng = groups->grps[egcENER].nr;
- if (ng == 1)
- gmx_input("No energy groups defined. This is necessary for energy exclusion in the freeze group");
-
- for(i=0;i<ng;i++)
- {
- for(j=0;j<ng;j++)
- {
- if (inputrec->opts.egp_flags[ng*i+j] == EGP_EXCL)
- {
- bExcl = TRUE;
- if ( (groups->grps[egcENER].nm_ind[i] != ins_grp_id) || (groups->grps[egcENER].nm_ind[j] != ins_grp_id) )
- gmx_fatal(FARGS,"Energy exclusions \"%s\" and \"%s\" do not match the group to embed \"%s\"",
- *groups->grpname[groups->grps[egcENER].nm_ind[i]],
- *groups->grpname[groups->grps[egcENER].nm_ind[j]],ins);
- }
- }
- }
- if (!bExcl)
- gmx_input("No energy exclusion groups defined. This is necessary for energy exclusion in the freeze group");
-
- /* Set all atoms in box*/
- /*set_inbox(state->natoms,state->x);*/
-
- /* Guess the area the protein will occupy in the membrane plane Calculate area per lipid*/
- snew(rest_at,1);
- ins_nat = init_ins_at(ins_at,rest_at,state,pos_ins,groups,ins_grp_id,xy_max);
- /* Check moleculetypes in insertion group */
- check_types(ins_at,rest_at,mtop);
-
- mem_nat = init_mem_at(mem_p,mtop,state->x,state->box,pos_ins);
-
- prot_area = est_prot_area(pos_ins,state->x,ins_at,mem_p);
- if ( (prot_area>7.5) && ( (state->box[XX][XX]*state->box[YY][YY]-state->box[XX][YY]*state->box[YY][XX])<50) )
- {
- warn++;
- fprintf(stderr,"\nWarning %d:\nThe xy-area is very small compared to the area of the protein.\n"
- "This might cause pressure problems during the growth phase. Just try with\n"
- "current setup (-maxwarn + 1), but if pressure problems occur, lower the\n"
- "compressibility in the mdp-file or use no pressure coupling at all.\n\n",warn);
- }
- if(warn>maxwarn)
- gmx_fatal(FARGS,"Too many warnings.\n");
-
- printf("The estimated area of the protein in the membrane is %.3f nm^2\n",prot_area);
- printf("\nThere are %d lipids in the membrane part that overlaps the protein.\nThe area per lipid is %.4f nm^2.\n",mem_p->nmol,mem_p->lip_area);
-
- /* Maximum number of lipids to be removed*/
- max_lip_rm=(int)(2*prot_area/mem_p->lip_area);
- printf("Maximum number of lipids that will be removed is %d.\n",max_lip_rm);
-
- printf("\nWill resize the protein by a factor of %.3f in the xy plane and %.3f in the z direction.\n"
- "This resizing will be done with respect to the geometrical center of all protein atoms\n"
- "that span the membrane region, i.e. z between %.3f and %.3f\n\n",xy_fac,z_fac,mem_p->zmin,mem_p->zmax);
-
- /* resize the protein by xy and by z if necessary*/
- snew(r_ins,ins_at->nr);
- init_resize(ins_at,r_ins,pos_ins,mem_p,state->x,bALLOW_ASYMMETRY);
- fac[0]=fac[1]=xy_fac;
- fac[2]=z_fac;
-
- xy_step =(xy_max-xy_fac)/(double)(it_xy);
- z_step =(z_max-z_fac)/(double)(it_z-1);
-
- resize(ins_at,r_ins,state->x,pos_ins,fac);
-
- /* remove overlapping lipids and water from the membrane box*/
- /*mark molecules to be removed*/
- snew(pbc,1);
- set_pbc(pbc,inputrec->ePBC,state->box);
-
- snew(rm_p,1);
- lip_rm = gen_rm_list(rm_p,ins_at,rest_at,pbc,mtop,state->x, r_ins, mem_p,pos_ins,probe_rad,low_up_rm,bALLOW_ASYMMETRY);
- lip_rm -= low_up_rm;
-
- if(fplog)
- for(i=0;i<rm_p->nr;i++)
- fprintf(fplog,"rm mol %d\n",rm_p->mol[i]);
-
- for(i=0;i<mtop->nmolblock;i++)
- {
- ntype=0;
- for(j=0;j<rm_p->nr;j++)
- if(rm_p->block[j]==i)
- ntype++;
- printf("Will remove %d %s molecules\n",ntype,*(mtop->moltype[mtop->molblock[i].type].name));
- }
-
- if(lip_rm>max_lip_rm)
- {
- warn++;
- fprintf(stderr,"\nWarning %d:\nTrying to remove a larger lipid area than the estimated protein area\n"
- "Try making the -xyinit resize factor smaller. If you are sure about this increase maxwarn.\n\n",warn);
- }
-
- /*remove all lipids and waters overlapping and update all important structures*/
- rm_group(inputrec,groups,mtop,rm_p,state,ins_at,pos_ins);
-
- rm_bonded_at = rm_bonded(ins_at,mtop);
- if (rm_bonded_at != ins_at->nr)
- {
- fprintf(stderr,"Warning: The number of atoms for which the bonded interactions are removed is %d, "
- "while %d atoms are embedded. Make sure that the atoms to be embedded are not in the same"
- "molecule type as atoms that are not to be embedded.\n",rm_bonded_at,ins_at->nr);
- }
-
- if(warn>maxwarn)
- gmx_fatal(FARGS,"Too many warnings.\nIf you are sure these warnings are harmless, you can increase -maxwarn");
-
- if (MASTER(cr))
- {
- if (ftp2bSet(efTOP,nfile,fnm))
- top_update(opt2fn("-p",nfile,fnm),ins,rm_p,mtop);
- }
-
- sfree(pbc);
- sfree(rest_at);
- }
-
-#ifdef GMX_FAHCORE
- fcRegisterSteps(inputrec->nsteps,inputrec->init_step);
-#endif
-
- /* NMR restraints must be initialized before load_checkpoint,
- * since with time averaging the history is added to t_state.
- * For proper consistency check we therefore need to extend
- * t_state here.
- * So the PME-only nodes (if present) will also initialize
- * the distance restraints.
- */
- snew(fcd,1);
-
- /* This needs to be called before read_checkpoint to extend the state */
- init_disres(fplog,mtop,inputrec,cr,Flags & MD_PARTDEC,fcd,state);
-
- if (gmx_mtop_ftype_count(mtop,F_ORIRES) > 0)
- {
- if (PAR(cr) && !(Flags & MD_PARTDEC))
- {
- gmx_fatal(FARGS,"Orientation restraints do not work (yet) with domain decomposition, use particle decomposition (mdrun option -pd)");
- }
- /* Orientation restraints */
- if (MASTER(cr))
- {
- init_orires(fplog,mtop,state->x,inputrec,cr->ms,&(fcd->orires),
- state);
- }
- }
-
- if (DEFORM(*inputrec))
- {
- /* Store the deform reference box before reading the checkpoint */
- if (SIMMASTER(cr))
- {
- copy_mat(state->box,box);
- }
- if (PAR(cr))
- {
- gmx_bcast(sizeof(box),box,cr);
- }
- /* Because we do not have the update struct available yet
- * in which the reference values should be stored,
- * we store them temporarily in static variables.
- * This should be thread safe, since they are only written once
- * and with identical values.
- */
-/* deform_init_init_step_tpx = inputrec->init_step;*/
-/* copy_mat(box,deform_init_box_tpx);*/
- }
-
- if (opt2bSet("-cpi",nfile,fnm))
- {
- /* Check if checkpoint file exists before doing continuation.
- * This way we can use identical input options for the first and subsequent runs...
- */
- if( gmx_fexist_master(opt2fn_master("-cpi",nfile,fnm,cr),cr) )
- {
- load_checkpoint(opt2fn_master("-cpi",nfile,fnm,cr),&fplog,
- cr,Flags & MD_PARTDEC,ddxyz,
- inputrec,state,&bReadRNG,&bReadEkin,
- (Flags & MD_APPENDFILES));
-
- if (bReadRNG)
- {
- Flags |= MD_READ_RNG;
- }
- if (bReadEkin)
- {
- Flags |= MD_READ_EKIN;
- }
- }
- }
-
- if ((MASTER(cr) || (Flags & MD_SEPPOT)) && (Flags & MD_APPENDFILES))
- {
- gmx_log_open(ftp2fn(efLOG,nfile,fnm),cr,!(Flags & MD_SEPPOT),
- Flags,&fplog);
- }
-
- if (SIMMASTER(cr))
- {
- copy_mat(state->box,box);
- }
-
- if (PAR(cr))
- {
- gmx_bcast(sizeof(box),box,cr);
- }
-
- if (bVerbose && SIMMASTER(cr))
- {
- fprintf(stderr,"Loaded with Money\n\n");
- }
-
- if (PAR(cr) && !((Flags & MD_PARTDEC) || EI_TPI(inputrec->eI)))
- {
- cr->dd = init_domain_decomposition(fplog,cr,Flags,ddxyz,rdd,rconstr,
- dddlb_opt,dlb_scale,
- ddcsx,ddcsy,ddcsz,
- mtop,inputrec,
- box,state->x,
- &ddbox,&npme_major,&npme_minor);
-
- make_dd_communicators(fplog,cr,dd_node_order);
-
- /* Set overallocation to avoid frequent reallocation of arrays */
- set_over_alloc_dd(TRUE);
- }
- else
- {
- /* PME, if used, is done on all nodes with 1D decomposition */
- cr->npmenodes = 0;
- cr->duty = (DUTY_PP | DUTY_PME);
- npme_major = cr->nnodes;
- npme_minor = 1;
-
- if (inputrec->ePBC == epbcSCREW)
- {
- gmx_fatal(FARGS,
- "pbc=%s is only implemented with domain decomposition",
- epbc_names[inputrec->ePBC]);
- }
- }
-
- if (PAR(cr))
- {
- /* After possible communicator splitting in make_dd_communicators.
- * we can set up the intra/inter node communication.
- */
- gmx_setup_nodecomm(fplog,cr);
- }
-
- wcycle = wallcycle_init(fplog,resetstep,cr);
- if (PAR(cr))
- {
- /* Master synchronizes its value of reset_counters with all nodes
- * including PME only nodes */
- reset_counters = wcycle_get_reset_counters(wcycle);
- gmx_bcast_sim(sizeof(reset_counters),&reset_counters,cr);
- wcycle_set_reset_counters(wcycle, reset_counters);
- }
-
-
- snew(nrnb,1);
- if (cr->duty & DUTY_PP)
- {
- /* For domain decomposition we allocate dynamically
- * in dd_partition_system.
- */
- if (DOMAINDECOMP(cr))
- {
- bcast_state_setup(cr,state);
- }
- else
- {
- if (PAR(cr))
- {
- if (!MASTER(cr))
- {
- snew(state,1);
- }
- bcast_state(cr,state,TRUE);
- }
- }
-
- /* Dihedral Restraints */
- if (gmx_mtop_ftype_count(mtop,F_DIHRES) > 0)
- {
- init_dihres(fplog,mtop,inputrec,fcd);
- }
-
- /* Initiate forcerecord */
- fr = mk_forcerec();
- init_forcerec(fplog,oenv,fr,fcd,inputrec,mtop,cr,box,FALSE,
- opt2fn("-table",nfile,fnm),
- opt2fn("-tablep",nfile,fnm),
- opt2fn("-tableb",nfile,fnm),FALSE,pforce);
-
- /* version for PCA_NOT_READ_NODE (see md.c) */
- /*init_forcerec(fplog,fr,fcd,inputrec,mtop,cr,box,FALSE,
- "nofile","nofile","nofile",FALSE,pforce);
- */
- fr->bSepDVDL = ((Flags & MD_SEPPOT) == MD_SEPPOT);
-
- /* Initialize QM-MM */
- if(fr->bQMMM)
- {
- init_QMMMrec(cr,box,mtop,inputrec,fr);
- }
-
- /* Initialize the mdatoms structure.
- * mdatoms is not filled with atom data,
- * as this can not be done now with domain decomposition.
- */
- mdatoms = init_mdatoms(fplog,mtop,inputrec->efep!=efepNO);
-
- /* Initialize the virtual site communication */
- vsite = init_vsite(mtop,cr);
-
- calc_shifts(box,fr->shift_vec);
-
- /* With periodic molecules the charge groups should be whole at start up
- * and the virtual sites should not be far from their proper positions.
- */
- if (!inputrec->bContinuation && MASTER(cr) &&
- !(inputrec->ePBC != epbcNONE && inputrec->bPeriodicMols))
- {
- /* Make molecules whole at start of run */
- if (fr->ePBC != epbcNONE)
- {
- do_pbc_first_mtop(fplog,inputrec->ePBC,box,mtop,state->x);
- }
- if (vsite)
- {
- /* Correct initial vsite positions are required
- * for the initial distribution in the domain decomposition
- * and for the initial shell prediction.
- */
- construct_vsites_mtop(fplog,vsite,mtop,state->x);
- }
- }
-
- /* Initiate PPPM if necessary */
- if (fr->eeltype == eelPPPM)
- {
- if (mdatoms->nChargePerturbed)
- {
- gmx_fatal(FARGS,"Free energy with %s is not implemented",
- eel_names[fr->eeltype]);
- }
- status = gmx_pppm_init(fplog,cr,oenv,FALSE,TRUE,box,
- getenv("GMXGHAT"),inputrec, (Flags & MD_REPRODUCIBLE));
- if (status != 0)
- {
- gmx_fatal(FARGS,"Error %d initializing PPPM",status);
- }
- }
-
- if (EEL_PME(fr->eeltype))
- {
- ewaldcoeff = fr->ewaldcoeff;
- pmedata = &fr->pmedata;
- }
- else
- {
- pmedata = NULL;
- }
- }
- else
- {
- /* This is a PME only node */
-
- /* We don't need the state */
- done_state(state);
-
- ewaldcoeff = calc_ewaldcoeff(inputrec->rcoulomb, inputrec->ewald_rtol);
- snew(pmedata,1);
- }
-
- /* Initiate PME if necessary,
- * either on all nodes or on dedicated PME nodes only. */
- if (EEL_PME(inputrec->coulombtype))
- {
- if (mdatoms)
- {
- nChargePerturbed = mdatoms->nChargePerturbed;
- }
- if (cr->npmenodes > 0)
- {
- /* The PME only nodes need to know nChargePerturbed */
- gmx_bcast_sim(sizeof(nChargePerturbed),&nChargePerturbed,cr);
- }
- if (cr->duty & DUTY_PME)
- {
- status = gmx_pme_init(pmedata,cr,npme_major,npme_minor,inputrec,
- mtop ? mtop->natoms : 0,nChargePerturbed,
- (Flags & MD_REPRODUCIBLE));
- if (status != 0)
- {
- gmx_fatal(FARGS,"Error %d initializing PME",status);
- }
- }
- }
-
-
-/* if (integrator[inputrec->eI].func == do_md
-#ifdef GMX_OPENMM
- ||
- integrator[inputrec->eI].func == do_md_openmm
-#endif
- )
- {*/
- /* Turn on signal handling on all nodes */
- /*
- * (A user signal from the PME nodes (if any)
- * is communicated to the PP nodes.
- */
- signal_handler_install();
-/* }*/
-
- if (cr->duty & DUTY_PP)
- {
- if (inputrec->ePull != epullNO)
- {
- /* Initialize pull code */
- init_pull(fplog,inputrec,nfile,fnm,mtop,cr,oenv,
- EI_DYNAMICS(inputrec->eI) && MASTER(cr),Flags);
- }
-
- constr = init_constraints(fplog,mtop,inputrec,ed,state,cr);
-
- if (DOMAINDECOMP(cr))
- {
- dd_init_bondeds(fplog,cr->dd,mtop,vsite,constr,inputrec,
- Flags & MD_DDBONDCHECK,fr->cginfo_mb);
-
- set_dd_parameters(fplog,cr->dd,dlb_scale,inputrec,fr,&ddbox);
-
- setup_dd_grid(fplog,cr->dd);
- }
-
- /* Now do whatever the user wants us to do (how flexible...) */
- do_md_membed(fplog,cr,nfile,fnm,
- oenv,bVerbose,bCompact,
- nstglobalcomm,
- vsite,constr,
- nstepout,inputrec,mtop,
- fcd,state,
- mdatoms,nrnb,wcycle,ed,fr,
- repl_ex_nst,repl_ex_seed,
- cpt_period,max_hours,
- deviceOptions,
- Flags,
- &runtime,
- fac, r_ins, pos_ins, ins_at,
- xy_step, z_step, it_xy, it_z);
-
- if (inputrec->ePull != epullNO)
- {
- finish_pull(fplog,inputrec->pull);
- }
- }
- else
- {
- /* do PME only */
- gmx_pmeonly(*pmedata,cr,nrnb,wcycle,ewaldcoeff,FALSE,inputrec);
- }
-
- if (EI_DYNAMICS(inputrec->eI) || EI_TPI(inputrec->eI))
- {
- /* Some timing stats */
- if (MASTER(cr))
- {
- if (runtime.proc == 0)
- {
- runtime.proc = runtime.real;
- }
- }
- else
- {
- runtime.real = 0;
- }
- }
-
- wallcycle_stop(wcycle,ewcRUN);
-
- /* Finish up, write some stuff
- * if rerunMD, don't write last frame again
- */
- finish_run(fplog,cr,ftp2fn(efSTO,nfile,fnm),
- inputrec,nrnb,wcycle,&runtime,
- EI_DYNAMICS(inputrec->eI) && !MULTISIM(cr));
-
- /* Does what it says */
- print_date_and_time(fplog,cr->nodeid,"Finished mdrun",&runtime);
-
- /* Close logfile already here if we were appending to it */
- if (MASTER(cr) && (Flags & MD_APPENDFILES))
- {
- gmx_log_close(fplog);
- }
-
- if (pieces>1)
- {
- sfree(piecename);
- }
-
- rc=(int)gmx_get_stop_condition();
-
- return rc;
-}
-
-
int gmx_membed(int argc,char *argv[])
{
const char *desc[] = {
int maxwarn=0;
int pieces=1;
gmx_bool bALLOW_ASYMMETRY=FALSE;
+ gmx_bool bStart=FALSE;
int nstepout=100;
gmx_bool bVerbose=FALSE;
char *mdrun_path=NULL;
"Number of lipids that will additionally be removed from the lower (negative number) or upper (positive number) membrane leaflet." },
{ "-maxwarn", FALSE, etINT, {&maxwarn},
"Maximum number of warning allowed" },
+ { "-start", FALSE, etBOOL, {&bStart},
+ "Call mdrun with membed options" },
{ "-stepout", FALSE, etINT, {&nstepout},
"HIDDENFrequency of writing the remaining runtime" },
{ "-v", FALSE, etBOOL,{&bVerbose},
}
printf("%s\n",buf);
- system(buf);
+ if (bStart)
+ {
+ system(buf);
+ } else {
+ printf("You can membed your protein now by:\n%s\n",buf);
+ }
fprintf(stderr,"Please cite:\nWolf et al, J Comp Chem 31 (2010) 2169-2174.\n");
} t_inputinfo;
-static void sep_line(FILE *fp)
-{
- fprintf(fp, "\n------------------------------------------------------------\n");
-}
-
-
-
-static gmx_bool is_equal(real a, real b)
-{
- real diff, eps=1.0e-6;
-
-
- diff = a - b;
-
- if (diff < 0.0) diff = -diff;
-
- if (diff < eps)
- return TRUE;
- else
- return FALSE;
-}
-
-
/* Returns TRUE when atom is charged */
static gmx_bool is_charge(real charge)
{
real q[], /* array of charges */
int nr, /* number of charges = size of the charge array */
FILE *fp_out,
+ gmx_bool bVerbose,
+ unsigned int seed, /* The seed for the random number generator */
+ int *nsamples, /* Return the number of samples used if Monte Carlo
+ * algorithm is used for self energy error estimate */
t_commrec *cr)
{
real e_rec=0; /* reciprocal error estimate */
real tmp=0; /* variables to compute different factors from vectors */
real tmp1=0;
real tmp2=0;
- real xtmp=0;
- real ytmp=0;
- real ztmp=0;
- double ewald_error;
+ gmx_bool bFraction;
/* Random number generator */
-
gmx_rng_t rng=NULL;
- /*rng=gmx_rng_init(gmx_rng_make_seed()); */
+ int *numbers=NULL;
/* Index variables for parallel work distribution */
int startglobal,stopglobal;
int startlocal, stoplocal;
int x_per_core;
- int nrsamples;
- real xtot;
+ int xtot;
-/* #define TAKETIME */
#ifdef TAKETIME
double t0=0.0;
double t1=0.0;
- double t2=0.0;
#endif
- rng=gmx_rng_init(cr->nodeid);
+ rng=gmx_rng_init(seed);
clear_rvec(gridpx);
clear_rvec(gridpxy);
xtot = stopglobal*2+1;
if (PAR(cr))
{
- x_per_core = ceil(xtot / cr->nnodes);
+ x_per_core = ceil((real)xtot / (real)cr->nnodes);
startlocal = startglobal + x_per_core*cr->nodeid;
stoplocal = startlocal + x_per_core -1;
if (stoplocal > stopglobal)
#endif
*/
+#ifdef GMX_MPI
#ifdef TAKETIME
if (MASTER(cr))
t0 = MPI_Wtime();
+#endif
#endif
if (MASTER(cr)){
}
-/*
-#ifdef GMX_MPI
- MPI_Barrier(MPI_COMM_WORLD);
-#endif
-*/
-
if (MASTER(cr))
fprintf(stderr, "\n");
- if (info->fracself>0)
+
+ /* Use just a fraction of all charges to estimate the self energy error term? */
+ bFraction = (info->fracself > 0.0) && (info->fracself < 1.0);
+
+ if (bFraction)
{
- nrsamples=ceil(info->fracself*nr);
+ /* Here xtot is the number of samples taken for the Monte Carlo calculation
+ * of the average of term IV of equation 35 in Wang2010. Round up to a
+ * number of samples that is divisible by the number of nodes */
+ x_per_core = ceil(info->fracself * nr / (real)cr->nnodes);
+ xtot = x_per_core * cr->nnodes;
}
else
{
- nrsamples=nr;
+ /* In this case we use all nr particle positions */
+ xtot = nr;
+ x_per_core = ceil( (real)xtot / (real)cr->nnodes );
}
-
-
- xtot=nrsamples;
-
- startglobal=0;
- stopglobal=nr;
+ startlocal = x_per_core * cr->nodeid;
+ stoplocal = min(startlocal + x_per_core, xtot); /* min needed if xtot == nr */
- if(PAR(cr))
+ if (bFraction)
{
- x_per_core=ceil(xtot/cr->nnodes);
- startlocal=startglobal+x_per_core*cr->nodeid;
- stoplocal=startglobal+x_per_core*(cr->nodeid+1);
- if (stoplocal>stopglobal)
- stoplocal=stopglobal;
- }
- else
- {
- startlocal=startglobal;
- stoplocal=stopglobal;
- x_per_core=xtot;
- }
+ /* Make shure we get identical results in serial and parallel. Therefore,
+ * take the sample indices from a single, global random number array that
+ * is constructed on the master node and that only depends on the seed */
+ snew(numbers, xtot);
+ if (MASTER(cr))
+ {
+ for (i=0; i<xtot; i++)
+ {
+ numbers[i] = floor(gmx_rng_uniform_real(rng) * nr );
+ }
+ }
+ /* Broadcast the random number array to the other nodes */
+ if (PAR(cr))
+ {
+ nblock_bc(cr,xtot,numbers);
+ }
+ if (bVerbose && MASTER(cr))
+ {
+ fprintf(stdout, "Using %d sample%s to approximate the self interaction error term",
+ xtot, xtot==1?"":"s");
+ if (PAR(cr))
+ fprintf(stdout, " (%d sample%s per node)", x_per_core, x_per_core==1?"":"s");
+ fprintf(stdout, ".\n");
+ }
+ }
+ /* Return the number of positions used for the Monte Carlo algorithm */
+ *nsamples = xtot;
for(i=startlocal;i<stoplocal;i++)
{
e_rec3y=0;
e_rec3z=0;
- if (info->fracself<0) {
- ci=i;
- }else {
- ci=floor(gmx_rng_uniform_real(rng) * nr );
- if (ci==nr)
- {
- ci=nr-1;
- }
+ if (bFraction)
+ {
+ /* Randomly pick a charge */
+ ci = numbers[i];
+ }
+ else
+ {
+ /* Use all charges */
+ ci = i;
}
/* for(nx=startlocal; nx<=stoplocal; nx++)*/
svmul(e_rec3z,info->recipbox[ZZ],tmpvec);
rvec_inc(tmpvec2,tmpvec);
- e_rec3 += q[ci]*q[ci]*q[ci]*q[ci]*norm2(tmpvec2) / ( nrsamples * M_PI * info->volume * M_PI * info->volume);
+ e_rec3 += q[ci]*q[ci]*q[ci]*q[ci]*norm2(tmpvec2) / ( xtot * M_PI * info->volume * M_PI * info->volume);
if (MASTER(cr)){
fprintf(stderr, "\rCalculating reciprocal error part 2 ... %3.0f%%",
100.0*(i+1)/stoplocal);
}
-
}
if (MASTER(cr))
cr->nodeid, startlocal, stoplocal, e_rec3);
}
#endif
-
-
-/*
-#ifdef GMX_MPI
- MPI_Barrier(MPI_COMM_WORLD);
-#endif
- */
-
-#ifdef TAKETIME
- if (MASTER(cr))
- {
- t2= MPI_Wtime() - t0;
- fprintf(fp_out, "barrier : %lf s\n", t2-t1);
- }
-#endif
if (PAR(cr))
{
gmx_sum(1,&e_rec3,cr);
}
-#ifdef TAKETIME
- if (MASTER(cr))
- fprintf(fp_out, "final reduce : %lf s\n", MPI_Wtime() - t0-t2);
-#endif
/* e_rec1*=8.0 * q2_all / info->volume / info->volume / nr ;
e_rec2*= q2_all / M_PI / M_PI / info->volume / info->volume / nr ;
e_rec3/= M_PI * M_PI * info->volume * info->volume * nr ;
* b) a total charge of zero.
*/
static void estimate_PME_error(t_inputinfo *info, t_state *state,
- gmx_mtop_t *mtop, FILE *fp_out, t_commrec *cr)
+ gmx_mtop_t *mtop, FILE *fp_out, gmx_bool bVerbose, unsigned int seed,
+ t_commrec *cr)
{
rvec *x=NULL; /* The coordinates */
real *q=NULL; /* The charges */
- real q2all=0.0;
- real q2allnr=0.0;
real edir=0.0; /* real space error */
real erec=0.0; /* reciprocal space error */
real derr=0.0; /* difference of real and reciprocal space error */
real beta=0.0; /* splitting parameter beta */
real beta0=0.0; /* splitting parameter beta */
int ncharges; /* The number of atoms with charges */
+ int nsamples; /* The number of samples used for the calculation of the
+ * self-energy error term */
int i=0;
if (MASTER(cr))
info->e_dir[0] = estimate_direct(info);
/* Calculate reciprocal space error */
- info->e_rec[0] = estimate_reciprocal(info, x, q, ncharges, fp_out, cr);
+ info->e_rec[0] = estimate_reciprocal(info, x, q, ncharges, fp_out, bVerbose,
+ seed, &nsamples, cr);
if (PAR(cr))
bcast_info(info, cr);
{
fprintf(fp_out, "Direct space error est. : %10.3e kJ/(mol*nm)\n", info->e_dir[0]);
fprintf(fp_out, "Reciprocal sp. err. est.: %10.3e kJ/(mol*nm)\n", info->e_rec[0]);
+ fprintf(fp_out, "Self-energy error term was estimated using %d samples\n", nsamples);
fflush(fp_out);
fprintf(stderr, "Direct space error est. : %10.3e kJ/(mol*nm)\n", info->e_dir[0]);
fprintf(stderr, "Reciprocal sp. err. est.: %10.3e kJ/(mol*nm)\n", info->e_rec[0]);
else
info->ewald_beta[0]-=0.1;
info->e_dir[0] = estimate_direct(info);
- info->e_rec[0] = estimate_reciprocal(info, x, q, ncharges, fp_out, cr);
+ info->e_rec[0] = estimate_reciprocal(info, x, q, ncharges, fp_out, bVerbose,
+ seed, &nsamples, cr);
if (PAR(cr))
bcast_info(info, cr);
derr0=derr;
info->e_dir[0] = estimate_direct(info);
- info->e_rec[0] = estimate_reciprocal(info, x, q, ncharges, fp_out, cr);
+ info->e_rec[0] = estimate_reciprocal(info, x, q, ncharges, fp_out, bVerbose,
+ seed, &nsamples, cr);
if (PAR(cr))
bcast_info(info, cr);
}
-#define BENCHSTEPS (1000)
int gmx_pme_error(int argc,char *argv[])
{
const char *desc[] = {
"g_pme_error estimates the error of the electrostatic forces",
- "if using the SPME algorithm. The flag [TT]-tune[tt] will determine",
+ "if using the sPME algorithm. The flag [TT]-tune[tt] will determine",
"the splitting parameter such that the error is equally",
"distributed over the real and reciprocal space part.",
- "As a part of the error stems from self interaction of the particles "
- "and is computationally very demanding a good a approximation is possible",
- "if just a fraction of the particles is used to calculate the average",
- "of this error by using the flag [TT]-self[tt].[PAR]",
+ "The part of the error that stems from self interaction of the particles "
+ "is computationally demanding. However, a good a approximation is to",
+ "just use a fraction of the particles for this term which can be",
+ "indicated by the flag [TT]-self[tt].[PAR]",
};
- int repeats=2;
- real fs=0.0; /* 0 indicates: not set by the user */
-
+ real fs=0.0; /* 0 indicates: not set by the user */
real user_beta=-1.0;
- real fracself=-1.0;
-
-
- t_perf **perfdata;
+ real fracself=1.0;
t_inputinfo info;
t_state state; /* The state from the tpr input file */
gmx_mtop_t mtop; /* The topology from the tpr input file */
t_commrec *cr;
unsigned long PCA_Flags;
gmx_bool bTUNE=FALSE;
+ gmx_bool bVerbose=FALSE;
+ int seed=0;
static t_filenm fnm[] = {
- /* g_tune_pme */
{ efTPX, "-s", NULL, ffREAD },
{ efOUT, "-o", "error", ffWRITE },
{ efTPX, "-so", "tuned", ffOPTWR }
};
-
output_env_t oenv=NULL;
t_pargs pa[] = {
- /***********************/
- /* g_tune_pme options: */
- /***********************/
{ "-beta", FALSE, etREAL, {&user_beta},
"If positive, overwrite ewald_beta from tpr file with this value" },
{ "-tune", FALSE, etBOOL, {&bTUNE},
- "If flag is set the splitting parameter will be tuned to distribute the error equally in real and rec. space" },
+ "Tune the splitting parameter such that the error is equally distributed between real and reciprocal space" },
{ "-self", FALSE, etREAL, {&fracself},
- "If positive, determine selfinteraction error just over this fraction (default=1.0)" }
+ "If between 0.0 and 1.0, determine self interaction error from just this fraction of the charged particles" },
+ { "-seed", FALSE, etINT, {&seed},
+ "Random number seed used for Monte Carlo algorithm when -self is set to a value between 0.0 and 1.0" },
+ { "-v", FALSE, etBOOL, {&bVerbose},
+ "Be loud and noisy" }
};
cr = init_par(&argc,&argv);
+#ifdef GMX_MPI
+ MPI_Barrier(MPI_COMM_WORLD);
+#endif
+
if (MASTER(cr))
CopyRight(stderr,argv[0]);
if (PAR(cr))
bcast_info(&info, cr);
- /* Get an error estimate of the input tpr file */
- estimate_PME_error(&info, &state, &mtop, fp, cr);
+ /* Get an error estimate of the input tpr file and do some tuning if requested */
+ estimate_PME_error(&info, &state, &mtop, fp, bVerbose, seed, cr);
if (MASTER(cr))
{
- ir->ewald_rtol=info.ewald_rtol[0];
- write_tpx_state(opt2fn("-so",NFILE,fnm),ir,&state,&mtop);
+ /* Write out optimized tpr file if requested */
+ if ( opt2bSet("-so",NFILE,fnm) || bTUNE )
+ {
+ ir->ewald_rtol=info.ewald_rtol[0];
+ write_tpx_state(opt2fn("-so",NFILE,fnm),ir,&state,&mtop);
+ }
please_cite(fp,"Wang2010");
fclose(fp);
}
onedim = -1;
}
}
- scale = 1.0/nfr_x;
- for(i=0; i<isize; i++)
- {
- svmul(scale,x[index[i]],x[index[i]]);
- }
scale = 1.0/nfr_v;
for(i=0; i<isize; i++)
{
fp=xvgropen(xname,title,"Atom","",oenv);
for(i=0; i<isize; i++)
{
- fprintf(fp,"%-5d %10.3f %10.3f %10.3f\n",i,
+ fprintf(fp,"%-5d %10.3f %10.3f %10.3f\n",1+i,
sum[index[i]][XX],sum[index[i]][YY],sum[index[i]][ZZ]);
}
ffclose(fp);
}
printf("Maximum %s is %g on atom %d %s, res. %s %d\n",
- title,sqrt(max)/nfr_v,maxi+1,*(atoms->atomname[maxi]),
+ title,sqrt(max),maxi+1,*(atoms->atomname[maxi]),
*(atoms->resinfo[atoms->atom[maxi].resind].name),
atoms->resinfo[atoms->atom[maxi].resind].nr);
"This implies [TT]-com[tt].[PAR]",
"Options [TT]-cv[tt] and [TT]-cf[tt] write the average velocities",
"and average forces as temperature factors to a pdb file with",
- "the average coordinates. The temperature factors are scaled such",
- "that the maximum is 10. The scaling can be changed with the option",
- "[TT]-scale[tt]. To get the velocities or forces of one",
+ "the average coordinates or the coordinates at [TT]-ctime[tt].",
+ "The temperature factors are scaled such that the maximum is 10.",
+ "The scaling can be changed with the option [TT]-scale[tt].",
+ "To get the velocities or forces of one",
"frame set both [TT]-b[tt] and [TT]-e[tt] to the time of",
"desired frame. When averaging over frames you might need to use",
"the [TT]-nojump[tt] option to obtain the correct average coordinates.",
static gmx_bool bMol=FALSE,bCom=FALSE,bPBC=TRUE,bNoJump=FALSE;
static gmx_bool bX=TRUE,bY=TRUE,bZ=TRUE,bNorm=FALSE,bFP=FALSE;
static int ngroups=1;
- static real scale=0,binwidth=1;
+ static real ctime=-1,scale=0,binwidth=1;
t_pargs pa[] = {
{ "-com", FALSE, etBOOL, {&bCom},
"Plot data for the com of each group" },
"Full precision output" },
{ "-bin", FALSE, etREAL, {&binwidth},
"Binwidth for velocity histogram (nm/ps)" },
+ { "-ctime", FALSE, etREAL, {&ctime},
+ "Use frame at this time for x in -cv and -cf instead of the average x" },
{ "-scale", FALSE, etREAL, {&scale},
"Scale factor for pdb output, 0 is autoscale" }
};
t_trxframe fr,frout;
int flags,nvhisto=0,*vhisto=NULL;
rvec *xtop,*xp=NULL;
- rvec *sumxv=NULL,*sumv=NULL,*sumxf=NULL,*sumf=NULL;
+ rvec *sumx=NULL,*sumv=NULL,*sumf=NULL;
matrix topbox;
t_trxstatus *status;
t_trxstatus *status_out=NULL;
read_first_frame(oenv,&status,ftp2fn(efTRX,NFILE,fnm),&fr,flags);
+ if (bCV || bCF)
+ {
+ snew(sumx,fr.natoms);
+ }
if (bCV)
{
- snew(sumxv,fr.natoms);
snew(sumv,fr.natoms);
}
if (bCF)
{
- snew(sumxf,fr.natoms);
snew(sumf,fr.natoms);
}
nr_xfr = 0;
}
fprintf(outekr,"\n");
}
- if (bCV)
+ if ((bCV || bCF) && fr.bX &&
+ (ctime < 0 || (fr.time >= ctime*0.999999 &&
+ fr.time <= ctime*1.000001)))
{
- if (fr.bX)
- {
- for(i=0; i<fr.natoms; i++)
- {
- rvec_inc(sumxv[i],fr.x[i]);
- }
- nr_xfr++;
- }
- if (fr.bV)
+ for(i=0; i<fr.natoms; i++)
{
- for(i=0; i<fr.natoms; i++)
- rvec_inc(sumv[i],fr.v[i]);
- nr_vfr++;
+ rvec_inc(sumx[i],fr.x[i]);
}
+ nr_xfr++;
}
- if (bCF)
+ if (bCV && fr.bV)
{
- if (fr.bX)
+ for(i=0; i<fr.natoms; i++)
{
- for(i=0; i<fr.natoms; i++)
- {
- rvec_inc(sumxf[i],fr.x[i]);
- }
- nr_xfr++;
+ rvec_inc(sumv[i],fr.v[i]);
}
- if (fr.bF)
+ nr_vfr++;
+ }
+ if (bCF && fr.bF)
+ {
+ for(i=0; i<fr.natoms; i++)
{
- for(i=0; i<fr.natoms; i++)
- {
- rvec_inc(sumf[i],fr.f[i]);
- }
- nr_ffr++;
+ rvec_inc(sumf[i],fr.f[i]);
}
+ nr_ffr++;
}
} while(read_next_frame(oenv,status,&fr));
- gmx_rmpbc_done(gpbc);
+ if (gpbc != NULL)
+ {
+ gmx_rmpbc_done(gpbc);
+ }
/* clean up a bit */
close_trj(status);
print_histo(opt2fn("-vd",NFILE,fnm),nvhisto,vhisto,binwidth,oenv);
}
- if ((bCV || bCF) && (nr_vfr>1 || nr_ffr>1) && !bNoJump)
+ if (bCV || bCF)
{
- fprintf(stderr,"WARNING: More than one frame was used for option -cv or -cf\n"
- "If atoms jump across the box you should use the -nojump option\n");
+ if (nr_xfr > 1)
+ {
+ if (ePBC != epbcNONE && !bNoJump)
+ {
+ fprintf(stderr,"\nWARNING: More than one frame was used for option -cv or -cf\n"
+ "If atoms jump across the box you should use the -nojump or -ctime option\n\n");
+ }
+ for(i=0; i<isize[0]; i++)
+ {
+ svmul(1.0/nr_xfr,sumx[index[0][i]],sumx[index[0][i]]);
+ }
+ }
+ else if (nr_xfr == 0)
+ {
+ fprintf(stderr,"\nWARNING: No coordinate frames found for option -cv or -cf\n\n");
+ }
}
-
if (bCV)
{
write_pdb_bfac(opt2fn("-cv",NFILE,fnm),
opt2fn("-av",NFILE,fnm),"average velocity",&(top.atoms),
- ePBC,topbox,isize[0],index[0],nr_xfr,sumxv,
+ ePBC,topbox,isize[0],index[0],nr_xfr,sumx,
nr_vfr,sumv,bDim,scale,oenv);
}
if (bCF)
{
write_pdb_bfac(opt2fn("-cf",NFILE,fnm),
opt2fn("-af",NFILE,fnm),"average force",&(top.atoms),
- ePBC,topbox,isize[0],index[0],nr_xfr,sumxf,
+ ePBC,topbox,isize[0],index[0],nr_xfr,sumx,
nr_ffr,sumf,bDim,scale,oenv);
}
#include <config.h>
#endif
+
+#include <time.h>
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+
+
#include "statutil.h"
#include "typedefs.h"
#include "smalloc.h"