Implemented several new input variables.
Started work on Andersen temperature coupling, and a framework for
Generalized-Born type potentials.
Added function types for fourier dihedrals, Amber/OPLS impropers and
dihedral restraints (not yet working).
])
+dnl @synopsis ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+dnl
+dnl This macro figures out how to build C programs using POSIX
+dnl threads. It sets the PTHREAD_LIBS output variable to the threads
+dnl library and linker flags, and the PTHREAD_CFLAGS output variable
+dnl to any special C compiler flags that are needed. (The user can also
+dnl force certain compiler flags/libs to be tested by setting these
+dnl environment variables.)
+dnl
+dnl Also sets PTHREAD_CC to any special C compiler that is needed for
+dnl multi-threaded programs (defaults to the value of CC otherwise).
+dnl (This is necessary on AIX to use the special cc_r compiler alias.)
+dnl
+dnl If you are only building threads programs, you may wish to
+dnl use these variables in your default LIBS, CFLAGS, and CC:
+dnl
+dnl LIBS="$PTHREAD_LIBS $LIBS"
+dnl CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+dnl CC="$PTHREAD_CC"
+dnl
+dnl In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute
+dnl constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE
+dnl to that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+dnl
+dnl ACTION-IF-FOUND is a list of shell commands to run if a threads
+dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands
+dnl to run it if it is not found. If ACTION-IF-FOUND is not specified,
+dnl the default action will define HAVE_PTHREAD.
+dnl
+dnl Please let the authors know if this macro fails on any platform,
+dnl or if you have any other suggestions or comments. This macro was
+dnl based on work by SGJ on autoconf scripts for FFTW (www.fftw.org)
+dnl (with help from M. Frigo), as well as ac_pthread and hb_pthread
+dnl macros posted by AFC to the autoconf macro repository. We are also
+dnl grateful for the helpful feedback of numerous users.
+dnl
+dnl @version $Id$
+dnl @author Steven G. Johnson <stevenj@alum.mit.edu> and Alejandro Forero Cuervo <bachue@bachue.com>
+
+AC_DEFUN([ACX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+acx_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+ AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes)
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test x"$acx_pthread_ok" = xno; then
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+ fi
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try. Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all.
+
+acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt"
+
+# The ordering *is* (sometimes) important. Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+# other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+# doesn't hurt to check since this sometimes defines pthreads too;
+# also defines -D_REENTRANT)
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+
+case "${host_cpu}-${host_os}" in
+ *solaris*)
+
+ # On Solaris (at least, for some versions), libc contains stubbed
+ # (non-functional) versions of the pthreads routines, so link-based
+ # tests will erroneously succeed. (We need to link with -pthread or
+ # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather
+ # a function called by this macro, so we could check for that, but
+ # who knows whether they'll stub that too in a future libc.) So,
+ # we'll just look for -pthreads and -lpthread first:
+
+ acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags"
+ ;;
+esac
+
+if test x"$acx_pthread_ok" = xno; then
+for flag in $acx_pthread_flags; do
+
+ case $flag in
+ none)
+ AC_MSG_CHECKING([whether pthreads work without any flags])
+ ;;
+
+ -*)
+ AC_MSG_CHECKING([whether pthreads work with $flag])
+ PTHREAD_CFLAGS="$flag"
+ ;;
+
+ *)
+ AC_MSG_CHECKING([for the pthreads library -l$flag])
+ PTHREAD_LIBS="-l$flag"
+ ;;
+ esac
+
+ save_LIBS="$LIBS"
+ save_CFLAGS="$CFLAGS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Check for various functions. We must include pthread.h,
+ # since some functions may be macros. (On the Sequent, we
+ # need a special flag -Kthread to make this header compile.)
+ # We check for pthread_join because it is in -lpthread on IRIX
+ # while pthread_create is in libc. We check for pthread_attr_init
+ # due to DEC craziness with -lpthreads. We check for
+ # pthread_cleanup_push because it is one of the few pthread
+ # functions on Solaris that doesn't have a non-functional libc stub.
+ # We try pthread_create on general principles.
+ AC_TRY_LINK([#include <pthread.h>],
+ [pthread_t th; pthread_join(th, 0);
+ pthread_attr_init(0); pthread_cleanup_push(0, 0);
+ pthread_create(0,0,0,0); pthread_cleanup_pop(0); ],
+ [acx_pthread_ok=yes])
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ AC_MSG_RESULT($acx_pthread_ok)
+ if test "x$acx_pthread_ok" = xyes; then
+ break;
+ fi
+
+ PTHREAD_LIBS=""
+ PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$acx_pthread_ok" = xyes; then
+ save_LIBS="$LIBS"
+ LIBS="$PTHREAD_LIBS $LIBS"
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+ # Detect AIX lossage: threads are created detached by default
+ # and the JOINABLE attribute has a nonstandard name (UNDETACHED).
+ AC_MSG_CHECKING([for joinable pthread attribute])
+ AC_TRY_LINK([#include <pthread.h>],
+ [int attr=PTHREAD_CREATE_JOINABLE;],
+ ok=PTHREAD_CREATE_JOINABLE, ok=unknown)
+ if test x"$ok" = xunknown; then
+ AC_TRY_LINK([#include <pthread.h>],
+ [int attr=PTHREAD_CREATE_UNDETACHED;],
+ ok=PTHREAD_CREATE_UNDETACHED, ok=unknown)
+ fi
+ if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then
+ AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok,
+ [Define to the necessary symbol if this constant
+ uses a non-standard name on your system.])
+ fi
+ AC_MSG_RESULT(${ok})
+ if test x"$ok" = xunknown; then
+ AC_MSG_WARN([we do not know how to create joinable pthreads])
+ fi
+
+ AC_MSG_CHECKING([if more special flags are required for pthreads])
+ flag=no
+ case "${host_cpu}-${host_os}" in
+ *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";;
+ *solaris* | alpha*-osf*) flag="-D_REENTRANT";;
+ esac
+ AC_MSG_RESULT(${flag})
+ if test "x$flag" != xno; then
+ PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+ fi
+
+ LIBS="$save_LIBS"
+ CFLAGS="$save_CFLAGS"
+
+ # More AIX lossage: must compile with cc_r
+ AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC})
+else
+ PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$acx_pthread_ok" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+ :
+else
+ acx_pthread_ok=no
+ $2
+fi
+AC_LANG_RESTORE
+])dnl ACX_PTHREAD
+
+
#
# Below, we include our patched version of libtool.m4, from
#######################################################################
AC_PREREQ(2.50)
-AC_INIT(GROMACS, 3.1.99_20020920, gmx-users@gromacs.org)
+AC_INIT(GROMACS, 3.1.99_20021031, gmx-users@gromacs.org)
AC_CONFIG_SRCDIR(src/gmxlib/3dview.c)
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST
-AM_INIT_AUTOMAKE(gromacs, 3.1.99_20020920)
+AM_INIT_AUTOMAKE(gromacs, 3.1.99_20021031)
AC_PREFIX_DEFAULT(/usr/local/gromacs)
AM_CONFIG_HEADER(src/config.h)
dnl This is the version info according to the libtool versioning system.
AC_ARG_ENABLE(mpi,
[ --enable-mpi compile for parallel runs using MPI],,enable_mpi=no)
+### Threads
+AC_ARG_ENABLE(threads,
+ [ --disable-threads don't try to use multithreading],,enable_threads=yes)
+
### MPI environment
AC_ARG_ENABLE(mpi-environment,
fi
AC_SUBST(CC_FOR_BUILD)
-if test "$enable_fortran" = "yes"; then
+if test "$enable_fortran" = "yes"; then
AC_PROG_F77( $f77_names )
if test -z "$F77"; then
AC_MSG_ERROR([No fortran compiler found])
AC_DEFINE(USE_MPI,,[Make a parallel version of GROMACS using MPI])
fi
+if test "$enable_threads" = "yes"; then
+ AC_MSG_CHECKING([for pthreads])
+ AC_MSG_RESULT([yes])
+# ACX_PTHREAD([],AC_MSG_ERROR([Cannot compile with pthreads; use --disable-threads])
+fi
+
if test "$enable_fortran" = "yes"; then
AC_F77_LIBRARY_LDFLAGS
AC_F77_WRAPPERS
#ifndef _3dview_h
#define _3dview_h
-static char *SRCID_3dview_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
typedef real mat4[4][4];
typedef int iv2[2];
-
+
typedef struct {
matrix box;
vec4 eye,origin; /* The eye and origin position */
mat4 proj; /* Projection matrix */
mat4 Rot; /* Total rotation matrix */
real sc_x,sc_y; /* Scaling for aspect ratio */
+ mat4 RotP[DIM]; /* state for 3d rotations */
+ mat4 RotM[DIM];
} t_3dview;
extern void print_m4(FILE *fp,char *s,mat4 A);
* FALSE otherwise.
*/
+extern void init_rotate_3d(t_3dview *view);
+/* Initiates the state of 3d rotation matrices in the structure */
+
extern void rotate_3d(t_3dview *view,int axis,bool bPositive);
/* Rotate the eye around the center of the box, around axis */
include_HEADERS = \
3dview.h do_md.h invblock.h nrjac.h \
- rwtop.h tpxio.h assert.h \
+ rwtop.h tpxio.h assert.h dihre.h \
nrnb.h sheader.h transfer.h \
- atomprop.h dummies.h list.h ns.h \
+ atomprop.h dummies.h ns.h \
shift.h trnio.h axp_asm.h ebin.h \
macros.h nsb.h shift_util.h txtdump.h \
- binio.h edsam.h magic.h nsgrid.h \
+ edsam.h magic.h nsgrid.h \
typedefs.h block_tx.h enxio.h \
main.h pbc.h smalloc.h update.h \
bondf.h ewald.h maths.h pdbio.h \
- sortwater.h utils.h buffer.h ewald_util.h \
+ sortwater.h utils.h ewald_util.h \
matio.h pdebug.h split.h vcm.h \
calcgrid.h fatal.h mdatoms.h physics.h \
vec.h calch.h ffscanf.h mdebin.h \
pme.h statusio.h viewit.h calcmu.h \
fftgrid.h mdrun.h pppm.h statutil.h \
- vveclib.h callf77.h fftw_wrapper.h memdump.h \
+ callf77.h fftw_wrapper.h \
princ.h wgms.h gmx_system_xdr.h \
- filenm.h memtab.h pull.h strdb.h \
- wman.h comlib.h force.h memtest.h \
+ filenm.h pull.h strdb.h \
+ wman.h force.h \
string2.h writeps.h gmxcomplex.h \
futil.h metacode.h random.h struc2.h \
- x86_3dnow.h comtest.h gbutil.h \
- rbin.h superb.h detectcpu.h tgroup.h \
- general.h mshift.h rdgroup.h symtab.h \
- x86_sse.h confio.h gmxfio.h mvdata.h \
- rdklib.h sync.h xdrf.h constr.h \
- grompp.h names.h readcomp.h synclib.h \
+ x86_3dnow.h gbutil.h \
+ rbin.h detectcpu.h tgroup.h \
+ mshift.h rdgroup.h symtab.h \
+ x86_sse.h confio.h gmxfio.h \
+ xdrf.h constr.h \
+ grompp.h names.h readcomp.h \
xtcio.h copyrite.h gstat.h network.h \
- readinp.h sysstuff.h xvgr.h delay.h \
- index.h nhash.h renum.h systest.h \
+ readinp.h sysstuff.h xvgr.h \
+ index.h mvdata.h \
disre.h orires.h x86_sse2.h \
init.h nr.h reorder.h \
tags.h do_fit.h nrama.h \
#ifndef _assert_h
#define _assert_h
-static char *SRCID_assert_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) assert.h 1.12 11/23/92"
-#endif /* HAVE_IDENT */
-
#include <ctype.h>
#include "sysstuff.h"
* And Hey:
* Grunge ROck MAChoS
*/
-static char *SRCID_atomprop_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _axp_asm_h
#define _axp_asm_h
-static char *SRCID_axp_asm_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
--- /dev/null
+/*
+ * $Id$
+ *
+ * This source code is part of
+ *
+ * G R O M A C S
+ *
+ * GROningen MAchine for Chemical Simulations
+ *
+ * VERSION 3.1
+ * Copyright (c) 1991-2001, University of Groningen, The Netherlands
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * If you want to redistribute modifications, please consider that
+ * scientific software is very special. Version control is crucial -
+ * bugs must be traceable. We will be happy to consider code for
+ * inclusion in the official distribution, but derived work must not
+ * be called official GROMACS. Details are found in the README & COPYING
+ * files - if they are missing, get the official version at www.gromacs.org.
+ *
+ * To help us fund GROMACS development, we humbly ask that you cite
+ * the papers on the package - you can find them in the top README file.
+ *
+ * For more info, check our website at http://www.gromacs.org
+ *
+ * And Hey:
+ * Grunge ROck MAChoS
+ */
+
+#ifndef _binio_h
+#define _binio_h
+
+static char *SRCID_binio_h = "$Id$";
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_IDENT
+#ident "@(#) binio.h 1.5 11/23/92"
+#endif /* HAVE_IDENT */
+
+#include <stdio.h>
+#include "sysstuff.h"
+#include "fatal.h"
+
+/*
+ * Module to binary write and read.
+ *
+ * @
+ * @@@ @@ @
+ * @ @
+ * @ @ @ @@@ @@ @@@ @@ @@ @@@ @@ @@ @@ @@
+ * @ @ @ @ @ @@ @ @@ @ @ @@ @ @ @@
+ * @ @ @ @ @ @ @ @ @ @ @ @ @
+ * @@ @@ @@@@@ @ @ @ @ @ @ @ @
+ * @ @ @ @ @ @ @ @ @ @ @ @
+ * @ @ @ @@ @ @ @ @ @ @ @ @@
+ * @ @ @@@ @@ @@@@ @@@ @@@ @@@@@ @@@ @@@ @@ @
+ * @
+ * @
+ * @@@
+ *
+ * Use this module only to write and read simple types or array(s)
+ * of simple types. STRUCTURES ARE DEFINITELY NOT ALLOWED.
+ */
+
+#define nblockwrite(fp,nelem,data) \
+ _blockwrite(fp,nelem,sizeof(*data),(data),#data,__FILE__,__LINE__)
+#define blockwrite(fp,data) \
+ _blockwrite(fp,1,sizeof(data),&(data),#data,__FILE__,__LINE__)
+#define cblockwrite(fp,ptr,nchars) \
+ _blockwrite(fp,1,(nchars),(ptr),#ptr,__FILE__,__LINE__)
+#define nblockread(fp,nelem,data) \
+ _blockread(fp,nelem,sizeof(*data),(data),#data,__FILE__,__LINE__)
+#define blockread(fp,data) \
+ _blockread(fp,1,sizeof(data),&(data),#data,__FILE__,__LINE__)
+#define cblockread(fp,ptr,nchars) \
+ _blockread(fp,1,(nchars),(ptr),#ptr,__FILE__,__LINE__)
+
+
+extern void _blockwrite(FILE *fp,int nelem,int size,void *data,
+ char *what,char *file,int line);
+
+extern void _blockread(FILE *fp,int nelem,int size,void *data,
+ char *what,char *file,int line);
+
+#endif /* _binio_h */
* And Hey:
* Grunge ROck MAChoS
*/
-static char *SRCID_block_tx_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _bondf_h
#define _bondf_h
-static char *SRCID_bondf_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) bondf.h 1.28 2/19/97"
-#endif /* HAVE_IDENT */
#ifdef CPLUSPLUS
extern "C" {
* And Hey:
* Grunge ROck MAChoS
*/
-static char *SRCID_calcgrid_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _calch_h
#define _calch_h
-static char *SRCID_calch_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) calch.h 1.8 2/2/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
extern void calc_h_pos(int nht, rvec xa[], rvec xh[]);
#ifndef _calcmu_h
#define _calcmu_h
-static char *SRCID_calcmu_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _callf77_h
#define _callf77_h
-static char *SRCID_callf77_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _confio_h
#define _confio_h
-static char *SRCID_confio_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) confio.h 1.16 11/23/92"
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
/* For reading coordinate files it is assumed that enough memory
* And Hey:
* Grunge ROck MAChoS
*/
-static char *SRCID_constr_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include<config.h>
#endif
#ifndef _copyrite_h
#define _copyrite_h
-static char *SRCID_copyrite_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) copyright.h 1.10 11/23/92"
-#endif /* HAVE_IDENT */
-
#ifdef CPLUSPLUS
extern "C" {
#endif
#include <stdio.h>
/* Has to be a function, so we can get version number from autoconf */
-char *GromacsVersion(void);
+const char *GromacsVersion(void);
-static char *CopyrightText[] = {
- "Copyright (c) 1991-2002, University of Groningen, The Netherlands"
+static const char *CopyrightText[] = {
+ "Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.",
+ "Copyright (c) 1991-2002, University of Groningen, The Netherlands",
+ "Check out http://www.gromacs.org for more information.\n"
};
-static char *GPLText[] = {
+static const char *GPLText[] = {
"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",
extern void pr_difftime(FILE *out,double dt);
void CopyRight(FILE *out,char *szProgram);
+
+/* For both bromacs() and cool_quote() you have to provide a pointer to
+ * a string of reasonable length (say 256) and the string length. This
+ * is necessary to make the routines threadsafe and avoid allocating
+ * a new string each time. The retstring pointer will be the return value.
+ */
+extern char *bromacs(char *retstring, int retsize);
-extern char *bromacs(void);
-
-extern char *cool_quote(void);
+/* For cool_quote, the number of the quote used will be returned in cqnum
+ * if it is non-NULL
+ */
+extern char *cool_quote(char *retstring, int retsize, int *cqnum);
extern int be_cool(void);
/* Return TRUE when the user is COOL, FALSE otherwise */
#ifndef _detectcpu_h
#define _detectcpu_h
-static char *SRCID_detectcpu_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#define IA64_CPU (1 << 7)
#define PPC_CPU (1 << 8)
#define PPC_ALTIVEC_SUPPORT (1 << 9)
+#define AMD_CPU (1 << 10)
+#define INTEL_CPU (1 << 11)
/* Values that are return by cpuid instructions on x86 */
#define VENDOR_AMD 0x68747541
#ifndef _disre_h
#define _disre_h
-static char *SRCID_disre_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) disre.h 1.13 2/2/97"
-#endif /* HAVE_IDENT */
-
#ifdef CPLUSPLUS
extern "C" {
#endif
#ifndef _do_fit_h
#define _do_fit_h
-static char *SRCID_do_fit_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) do_fit.h 1.8 2/2/97"
-#endif /* HAVE_IDENT */
+
extern real calc_similar_ind(bool bRho,int nind,atom_id *index,real mass[],
rvec x[],rvec xp[]);
/* Returns RMSD or Rho (depending on bRho) over all atoms in index */
#ifndef _do_md_h
#define _do_md_h
-static char *SRCID_do_md_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) do_md.h 1.16 2/2/97"
-#endif /* HAVE_IDENT */
#include <stdio.h>
#include "typedefs.h"
#include "network.h"
#ifndef _dummies_h
#define _dummies_h
-static char *SRCID_dummies_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _ebin_h
#define _ebin_h
-static char *SRCID_ebin_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) ebin.h 1.10 5/2/97"
-#endif /* HAVE_IDENT */
+
#include "sysstuff.h"
#include "typedefs.h"
#ifndef _edsam_h
#define _edsam_h
-static char *SRCID_edsam_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _enxio_h
#define _enxio_h
-static char *SRCID_enxio_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) enerio.h 1.13 2/2/97"
-#endif /* HAVE_IDENT */
#ifdef CPLUSPLUS
external "C" {
#ifndef _ewald_h
#define _ewald_h
-static char *SRCID_ewald_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _ewald_util_h
#define _ewald_util_h
-static char *SRCID_ewald_util_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _fatal_h
#define _fatal_h
-static char *SRCID_fatal_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) fatal.h 1.9 11/23/92"
-#endif /* HAVE_IDENT */
-
#ifdef CPLUSPLUS
extern "C" {
#endif
* And Hey:
* Grunge ROck MAChoS
*/
-static char *SRCID_ffscanf_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _fftgrid_h
#define _fftgrid_h
-static char *SRCID_fftgrid_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _fftw_wrapper_h
#define _fftw_wrapper_h
-static char *SRCID_fftw_wrapper_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _filenm_h
#define _filenm_h
-static char *SRCID_filenm_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) filenm.h 1.14 2/2/97"
-#endif /* HAVE_IDENT */
#ifdef CPLUSPLUS
extern "C" {
#endif
#include "futil.h"
-
-void set_default_file_name(char *name);
+
+void set_default_file_name(const char *name);
/* Set the default file name for all file types to name */
-extern char *ftp2ext(int ftp);
+extern const char *ftp2ext(int ftp);
/* Return extension for filetype */
-extern char *ftp2desc(int ftp);
+extern const char *ftp2desc(int ftp);
/* Return description for file type */
-extern char *ftp2defnm(int ftp);
+extern const char *ftp2defnm(int ftp);
/* Return default file name for file type */
-extern char *ftp2ftype(int ftp);
+extern const char *ftp2ftype(int ftp);
/* Return Binary or ASCII depending on file type */
extern void pr_def(FILE *fp,int ftp);
#ifndef _force_h
#define _force_h
-static char *SRCID_force_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) force.h 1.53 5/15/97"
-#endif /* HAVE_IDENT */
+
#include "typedefs.h"
#include "pbc.h"
#include "nsb.h"
#ifndef _futil_h
#define _futil_h
-static char *SRCID_futil_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) futil.h 1.1 11/23/92"
-#endif /* HAVE_IDENT */
#include <stdio.h>
#include "typedefs.h"
extern void no_buffers(void);
/* Turn off buffering of files (which is default) for debugging purposes */
-extern bool fexist(char *fname);
+extern bool fexist(const char *fname);
/* Return TRUE when fname exists, FALSE otherwise */
extern bool eof(FILE *fp);
extern bool is_pipe(FILE *fp);
/* Check whether the file (opened by ffopen) is a pipe */
-extern char *backup_fn(char *file);
+extern char *backup_fn(const char *file);
/* Return a backup name for file (name with # before and after) */
/* Make a backup of file if necessary.
Return false if there was a problem.
*/
-extern bool make_backup(char * file);
+extern bool make_backup(const char * file);
-extern FILE *ffopen(char *file,char *mode);
+extern FILE *ffopen(const char *file,char *mode);
/* Return a valid file pointer when succesfull, exits otherwise
* If the file is in compressed format, open a pipe which uncompresses
* the file! Therefore, files must be closed with ffclose (see below)
* And Hey:
* Grunge ROck MAChoS
*/
-static char *SRCID_gbutil_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _complex_h
#define _complex_h
-static char *SRCID_complex_h = "$Id$";
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _gmxfio_h
#define _gmxfio_h
-static char *SRCID_gmxfio_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#ifndef _grompp_h
#define _grompp_h
-static char *SRCID_grompp_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-
-#ifdef HAVE_IDENT
-#ident "@(#) grompp.h 1.37 2/2/97"
-#endif /* HAVE_IDENT */
-
#include <stdio.h>
#include "typedefs.h"
#include "macros.h"
t_block cgs; /* Charge groups */
t_block mols; /* Molecules */
t_params plist[F_NRE]; /* Parameters in old style */
+
} t_molinfo;
typedef struct {
char ***atomname; /* Names of the atomtypes */
t_param *nb; /* Nonbonded force default params */
int *bondatomtype; /* The bond_atomtype for each atomtype */
+ real *radius; /* Radius for GBSA stuff */
+ real *vol; /* Effective volume for GBSA */
+ real *surftens; /* Surface tension with water, for GBSA */
} t_atomtype;
typedef struct {
d_angle_restraints_z,
d_distance_restraints,
d_orientation_restraints,
+ d_dihedral_restraints,
d_maxdir,
d_invalid,
d_none
"angle_restraints_z",
"distance_restraints",
"orientation_restraints",
+ "dihedral_restraints",
"invalid"
};
extern void convert_harmonics(int nrmols,t_molinfo mols[],t_atomtype *atype);
#endif /* _grompp_h */
+
+
+
+
+
+
+
+
#ifndef _gstat_h
#define _gstat_h
-static char *SRCID_gstat_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_index_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
extern void write_index(char *outf, t_block *b,char **gnames);
/* Writes index blocks to outf (writes an indexfile) */
-void add_grp(t_block *b,char ***gnames,int nra,atom_id a[],char *name);
+void add_grp(t_block *b,char ***gnames,int nra,atom_id a[],const char *name);
/* Ads group a with name name to block b and namelist gnames */
extern void analyse(t_atoms *atoms,t_block *gb,char ***gn,
#ifndef _init_h
#define _init_h
-static char *SRCID_init_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) init.h 1.13 11/23/92"
-#endif /* HAVE_IDENT */
-
#include <stdio.h>
#include "typedefs.h"
#include "mvdata.h"
#ifndef _invblock_h
#define _invblock_h
-static char *SRCID_invblock_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) invblock.h 1.8 2/2/97"
-#endif /* HAVE_IDENT */
#include <typedefs.h>
extern atom_id *make_invblock(t_block *block,int nr);
#ifndef _macros_h
#define _macros_h
-static char *SRCID_macros_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) macros.h 1.8 11/23/92"
-#endif /* HAVE_IDENT */
-
#ifdef CPLUSPLUS
extern "C" {
#endif
/* This macro calculates the size of a array */
#define asize(a) (sizeof(a)/sizeof((a)[0]))
-extern real ZERO;
-extern real THIRD;
-extern real HALF;
-extern real ONE;
-extern real TWO;
-extern real THREE;
-extern real SIX;
-extern real TEN;
-extern real TWELVE;
+extern const real ZERO;
+extern const real THIRD;
+extern const real HALF;
+extern const real ONE;
+extern const real TWO;
+extern const real THREE;
+extern const real SIX;
+extern const real TEN;
+extern const real TWELVE;
#ifdef CPLUSPLUS
}
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_magic_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _main_h
#define _main_h
-static char *SRCID_main_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) main.h 1.3 11/23/92"
-#endif /* HAVE_IDENT */
#include <stdio.h>
#include "network.h"
extern FILE *stdlog;
extern int gmx_parallel; /* 1 when running in parallel */
-extern char *par_fn(char *base,int ftp,t_commrec *cr);
+extern char *par_fn(char *base,int ftp,t_commrec *cr, char buf[], int bufsize);
/* Add processor id in the filename right before the extension */
extern void open_log(char *fn,t_commrec *cr);
#ifndef _maths_h
#define _maths_h
-static char *SRCID_maths_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) maths.h 1.11 11/24/92"
-#endif /* HAVE_IDENT */
-
#include <math.h>
#include "typedefs.h"
#ifndef _matio_h
#define _matio_h
-static char *SRCID_matio_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) matio.h 1.11 5/20/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
extern bool matelmt_cmp(t_xpmelmt e1, t_xpmelmt e2);
#ifndef _mdatoms_h
#define _mdatoms_h
-static char *SRCID_mdatoms_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _mdebin_h
#define _mdebin_h
-static char *SRCID_mdebin_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) mdebin.h 1.12 2/2/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
#include "sysstuff.h"
#include "ebin.h"
t_groups *grps,
rvec mu_tot, bool bNoseHoover);
-extern void print_ebin_header(FILE *log,int steps,real time,
- real lamb,real SAfactor);
+extern void print_ebin_header(FILE *log,int steps,real time,real lamb);
-extern void print_ebin(int fp_ene,bool bEne,bool bDR,bool bOR,
+extern void print_ebin(int fp_ene,bool bEne,bool bDR,bool bOR,bool bDihR,
FILE *log,int steps,real time,
int mode,bool bCompact,
- t_mdebin *md,t_fcdata *fcd,t_atoms *atoms);
+ t_mdebin *md,t_fcdata *fcd,t_atoms *atoms, t_grpopts *opts);
#endif /* _mdebin_h */
#ifndef _mdrun_h
#define _mdrun_h
-static char *SRCID_mdrun_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) do_md.h 1.12 03 Mar 1996"
-#endif /* HAVE_IDENT */
#include <stdio.h>
#include "typedefs.h"
#include "network.h"
extern void close_xtc_traj(void);
/* ROUTINES from sim_util.c */
-extern void init_mdatoms(t_mdatoms *md,real lambda,bool bFirst);
+extern void update_mdatoms(t_mdatoms *md,real lambda, bool bFirst);
/* Compute fields from mdatoms struct (invmass etc.) which may change
* due to lambda dependent FEP calculations.
* If bFirst all values are set, this is necessary once in the
* first step.
+ * You only have to call this routine again if lambda changes.
*/
extern void print_time(FILE *out,time_t start,int step,t_inputrec *ir);
/* Driver routine, that calls the different methods */
extern void init_md(t_commrec *cr,t_inputrec *ir,tensor box,real *t,real *t0,
- real *lambda,real *lam0,real *SAfactor,
+ real *lambda,real *lam0,
t_nrnb *mynrnb,bool *bTYZ,t_topology *top,
int nfile,t_filenm fnm[],char **traj,
char **xtc_traj,int *fp_ene,
FILE **fp_dgdl,t_mdebin **mdebin,t_groups *grps,
tensor force_vir,tensor pme_vir,
tensor shake_vir,t_mdatoms *mdatoms,rvec mu_tot,
- bool *bNEMD,t_vcm **vcm,t_nsborder *nsb);
+ bool *bNEMD,bool *bSimAnn,t_vcm **vcm,t_nsborder *nsb);
/* Routine in sim_util.c */
#endif /* _mdrun_h */
#ifndef _metacode_h
#define _metacode_h
-static char *SRCID_metacode_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _mshift_h
#define _mshift_h
-static char *SRCID_mshift_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) mshift.h 1.11 2/2/97"
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
+
extern t_graph *mk_graph(t_idef *idef,int natoms,bool bShakeOnly,bool bSettle);
/* Build a graph from an idef description. The graph can be used
* to generate mol-shift indices.
#ifndef _mvdata_h
#define _mvdata_h
-static char *SRCID_mvdata_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) mvdata.h 1.6 11/23/92"
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
#include "nsb.h"
#ifndef _names_h
#define _names_h
-static char *SRCID_names_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) names.h 1.23 5/20/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
* extra argument (the +1)
* these should correspond to names.c and include/types/enums.h
*/
-extern char *eblock_names[ebNR+1];
-extern char *epbc_names[epbcNR+1];
-extern char *etcoupl_names[etcNR+1];
-extern char *epcoupl_names[epcNR+1];
-extern char *epcoupltype_names[epctNR+1];
-extern char *ens_names[ensNR+1];
-extern char *ei_names[eiNR+1];
-extern char *yesno_names[BOOL_NR+1];
-extern char *bool_names[BOOL_NR+1];
-extern char *eel_names[eelNR+1];
-extern char *eewg_names[eewgNR+1];
-extern char *evdw_names[evdwNR+1];
-extern char *eshake_names[estNR+1];
-extern char *ptype_str[eptNR+1];
-extern char *egrp_nm[egNR+1];
-extern char *edisre_names[edrNR+1];
-extern char *edisreweighting_names[edrwNR+1];
-extern char *enbf_names[eNBF_NR+1];
-extern char *ecomb_names[eCOMB_NR+1];
-extern char *gtypes[egcNR+1];
-extern char *efep_names[efepNR+1];
-extern char *esolv_names[esolNR+1];
-extern char *edispc_names[edispcNR+1];
-extern char *ecm_names[ecmNR+1];
+extern const char *eblock_names[ebNR+1];
+extern const char *epbc_names[epbcNR+1];
+extern const char *etcoupl_names[etcNR+1];
+extern const char *epcoupl_names[epcNR+1];
+extern const char *epcoupltype_names[epctNR+1];
+extern const char *ens_names[ensNR+1];
+extern const char *ei_names[eiNR+1];
+extern const char *yesno_names[BOOL_NR+1];
+extern const char *bool_names[BOOL_NR+1];
+extern const char *eel_names[eelNR+1];
+extern const char *eewg_names[eewgNR+1];
+extern const char *evdw_names[evdwNR+1];
+extern const char *eshake_names[estNR+1];
+extern const char *ptype_str[eptNR+1];
+extern const char *egrp_nm[egNR+1];
+extern const char *edisre_names[edrNR+1];
+extern const char *edisreweighting_names[edrwNR+1];
+extern const char *enbf_names[eNBF_NR+1];
+extern const char *ecomb_names[eCOMB_NR+1];
+extern const char *gtypes[egcNR+1];
+extern const char *efep_names[efepNR+1];
+extern const char *esolv_names[esolNR+1];
+extern const char *edispc_names[edispcNR+1];
+extern const char *ecm_names[ecmNR+1];
+extern const char *eann_names[eannNR+1];
+extern const char *egb_names[egbNR+1];
+extern const char *eis_names[eisNR+1];
#define UNDEFINED "UNDEFINED"
#define ENUM_NAME(e,max,names) ((((e)<0)||((e)>=(max)))?UNDEFINED:(names)[e])
#define ESOLVTYPE(e) ENUM_NAME(e,esolNR,esolv_names)
#define EDISPCORR(e) ENUM_NAME(e,edispcNR,edispc_names)
#define ECOM(e) ENUM_NAME(e,ecmNR,ecm_names)
+#define EANNEAL(e) ENUM_NAME(e,eannNR,eann_names)
+#define EGBALGORITHM(e) ENUM_NAME(e,egbNR,egb_names)
+#define EIMPLICITSOL(e) ENUM_NAME(e,eisNR,eis_names)
#endif /* _names_h */
#ifndef _network_h
#define _network_h
-static char *SRCID_network_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) gmx_comm.h 1.9 11/23/92"
-#endif /* HAVE_IDENT */
/*
* This module defines the interface of the actual communication routines.
#ifndef _nhash_h
#define _nhash_h
-static char *SRCID_nhash_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) nhash.h 1.3 11/23/92"
-#endif /* HAVE_IDENT */
-
#define MAX_LJQQ 997
typedef struct {
#ifndef _nr_h
#define _nr_h
-static char *SRCID_nr_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _nrama_h
#define _nrama_h
-static char *SRCID_nrama_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) nrama.h 1.9 2/2/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
#include "statutil.h"
#include "mshift.h"
t_idef *idef;
} t_xrama;
-extern void init_rama(char *infile,char *topfile,t_xrama *xr);
+extern t_topology *init_rama(char *infile,char *topfile,t_xrama *xr);
extern bool new_data(t_xrama *xr);
#ifndef _nrjac_h
#define _nrjac_h
-static char *SRCID_nrjac_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _nrnb_h
#define _nrnb_h
-static char *SRCID_nrnb_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) nrnb.h 1.9 2/2/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
extern void init_nrnb(t_nrnb *nrnb);
#ifndef _ns_h
#define _ns_h
-static char *SRCID_ns_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) ns.h 1.50 2/2/97"
-#endif /* HAVE_IDENT */
-
#include <stdio.h>
#include "sysstuff.h"
#include "typedefs.h"
#ifndef _nsb_h
#define _nsb_h
-static char *SRCID_nsb_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _nsgrid_h
#define _nsgrid_h
-static char *SRCID_nsgrid_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) nsgrid.h 1.7 11/23/92"
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
extern void init_grid(FILE *log,t_grid *grid,
#ifndef _orires_h
#define _orires_h
-static char *SRCID_orires_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) disre.h 1.13 2/2/97"
-#endif /* HAVE_IDENT */
-
#ifdef CPLUSPLUS
extern "C" {
#endif
#ifndef _pbc_h
#define _pbc_h
-static char *SRCID_pbc_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) pbc.h 1.17 2/2/97"
-#endif /* HAVE_IDENT */
#include "sysstuff.h"
#include "typedefs.h"
#ifndef _pdbio_h
#define _pdbio_h
-static char *SRCID_pdbio_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) pdbio.h 1.12 7/28/97"
-#endif /* HAVE_IDENT */
#include "sysstuff.h"
#include "typedefs.h"
#include "symtab.h"
#ifndef _pdebug_h
#define _pdebug_h
-static char *SRCID_pdebug_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) pdebug.h 1.7 2/2/97"
-#endif /* HAVE_IDENT */
-#ifdef HAVE_IDENT
-#endif /* HAVE_IDENT */
extern void p_debug(char *s,char *file,int line);
#ifdef DEBUG
#ifndef _physics_h
#define _physics_h
-static char *SRCID_physics_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) physics.h 1.6 11/23/92"
-#endif /* HAVE_IDENT */
-
/*
* Physical constants to be used in Gromacs.
* No constants (apart from 0, 1 or 2) should
#ifndef _pme_h
#define _pme_h
-
-static char *SRCID_pme_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _ppc_altivec_h
#define _ppc_altivec_h
-static char *SRCID_ppc_altivec_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _pppm_h
#define _pppm_h
-static char *SRCID_pppm_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _princ_h
#define _princ_h
-static char *SRCID_princ_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _pull_h
#define _pull_h
-static char *SRCID_pull_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _random_h
#define _random_h
-static char *SRCID_random_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) random.h 1.5 12/16/92"
-#endif /* HAVE_IDENT */
-
#include <typedefs.h>
-extern real gauss(real am, real sd, int *ig);
-/* Generate a gaussian number with:
- * am = center of the distribution
- * sd = standard deviation
- * ig = the random number seed.
+
+typedef struct t_gaussdata *t_Gaussdata;
+/* Abstract data type for the internal state of
+ * a gaussian random number generator
+ */
+
+t_Gaussdata init_gauss(int seed);
+/* Initialize (and warm up) a gaussian random number generator
+ * by copying the seed. The routine returns a handle to the
+ * new generator.
+ */
+
+real
+gauss(t_Gaussdata data);
+/* Return a new gaussian random number with expectation value
+ * 0.0 and standard deviation 1.0. This routine is NOT thread-safe
+ * for performance reasons - you will either have to do the locking
+ * yourself, or better: initialize one generator per thread.
*/
+void
+finish_gauss(t_Gaussdata data);
+/* Release all the resources used for the generator */
+
+
+
+
extern int make_seed(void);
/* Make a random seed: (time+getpid) % 1000000 */
-extern real rando(int *ig);
-/* Generate a random number 0 <= r < 1. ig is the (address of) the
- * seed variable.
+extern real rando(int *seed);
+/* Generate a random number 0 <= r < 1. seed is the (address of) the
+ * random seed variable.
*/
extern void grp_maxwell(t_block *grp,real tempi[],int nrdf[],int seed,
#ifndef _rbin_h
#define _rbin_h
-static char *SRCID_rbin_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) rbin.h 1.8 2/2/97"
-#endif /* HAVE_IDENT */
#include "sysstuff.h"
#include "typedefs.h"
#include "network.h"
#ifndef _rdgroup_h
#define _rdgroup_h
-static char *SRCID_rdgroup_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) rdgroup.h 1.15 2/2/97"
-#endif /* HAVE_IDENT */
#include <typedefs.h>
#ifdef CPLUSPLUS
#ifndef _readcomp_h
#define _readcomp_h
-static char *SRCID_readcomp_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) readcomp.h 1.12 25 Jan 1993"
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
/*
#ifndef _readinp_h
#define _readinp_h
-static char *SRCID_readinp_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
extern void write_inpfile(char *fn,int ninp,t_inpfile inp[]);
-extern int get_eint(int *ninp,t_inpfile **inp,char *name,int def);
+extern int get_eint(int *ninp,t_inpfile **inp,const char *name,int def);
-extern real get_ereal(int *ninp,t_inpfile **inp,char *name,real def);
+extern real get_ereal(int *ninp,t_inpfile **inp,const char *name,real def);
-extern char *get_estr(int *ninp,t_inpfile **inp,char *name,char *def);
+extern char *get_estr(int *ninp,t_inpfile **inp,const char *name,char *def);
-extern int get_eeenum(int *ninp,t_inpfile **inp,char *name,char **defs,
+extern int get_eeenum(int *ninp,t_inpfile **inp,const char *name,const char **defs,
int *nerror,bool bPrintError);
/* defs must be NULL terminated,
* Add errors to nerror
* When bPrintError=TRUE and invalid enum: print "ERROR: ..."
*/
-extern int get_eenum(int *ninp,t_inpfile **inp,char *name,char **defs);
+extern int get_eenum(int *ninp,t_inpfile **inp,const char *name,const char **defs);
/* defs must be NULL terminated */
/* Here are some macros to extract data from the inp structures.
extern bool is_hidden(t_pargs *pa);
/* Return TRUE when the option is a secret one */
-extern char *pa_val(t_pargs *pa);
-/* Return a pointer to a static buffer containing the value of pa */
+extern char *pa_val(t_pargs *pa,char *buf, int sz);
+/* Return the value of pa in the provided buffer buf, of size sz.
+ * The return value is also a pointer to buf.
+ */
extern int opt2parg_int(char *option,int nparg,t_pargs pa[]);
#ifndef _renum_h
#define _renum_h
-static char *SRCID_renum_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) renum.h 1.6 11/23/92"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
#ifndef _reorder_h
#define _reorder_h
-static char *SRCID_reorder_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) reorder.h 1.4 11/23/92"
-#endif /* HAVE_IDENT */
extern void reorder(t_topology *topin,t_topology topout[],
int nnodes,int load[],int tload[]);
#ifndef _rmpbc_h
#define _rmpbc_h
-static char *SRCID_rmpbc_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) rmpbc.h 1.6 2/2/97"
-#endif /* HAVE_IDENT */
+
#include "typedefs.h"
extern void rm_pbc(t_idef *idef,int natoms,matrix box,rvec x[],rvec x_s[]);
+++ /dev/null
-/*
- * $Id$
- *
- * This source code is part of
- *
- * G R O M A C S
- *
- * GROningen MAchine for Chemical Simulations
- *
- * VERSION 3.1
- * Copyright (c) 1991-2001, University of Groningen, The Netherlands
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * If you want to redistribute modifications, please consider that
- * scientific software is very special. Version control is crucial -
- * bugs must be traceable. We will be happy to consider code for
- * inclusion in the official distribution, but derived work must not
- * be called official GROMACS. Details are found in the README & COPYING
- * files - if they are missing, get the official version at www.gromacs.org.
- *
- * To help us fund GROMACS development, we humbly ask that you cite
- * the papers on the package - you can find them in the top README file.
- *
- * For more info, check our website at http://www.gromacs.org
- *
- * And Hey:
- * Getting the Right Output Means no Artefacts in Calculating Stuff
- */
-
-#ifndef _rwtop_h
-#define _rwtop_h
-
-static char *SRCID_rwtop_h = "$Id$";
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_IDENT
-#ident "@(#) rwtop.h 1.5 12/16/92"
-#endif /* HAVE_IDENT */
-
-#include <stdio.h>
-#include "typedefs.h"
-
-/*
- * This module handles topolgy manipulation, including (binary) writing
- * to and reading from a file, freeing the allocated space and textual
- * representation of the complete topology structure.
- */
-
-extern long wr_top(FILE *fp,t_topology *top);
-/*
- * Writes the topology to the file, specified by fp. The function
- * returns the number of bytes written. The topology is not modified!
- */
-
-extern long rd_top(FILE *fp,t_topology *top);
-/*
- * Reads the topology from the file, specified by fp. This will
- * include allocating the needed space. The function returns the
- * number of bytes read.
- */
-
-extern void rm_top(t_topology *top);
-/*
- * Frees the space allocated by the topology. This is only
- * guaranteed to work when the same allocation strategy is used as
- * in rd_top().
- */
-
-extern void pr_energies(FILE *fp,int indent,char *title,t_energy *e,int n);
-/*
- * This routine prints out a (human) readable representation of
- * an array of energy structs to the file fp. Ident specifies the
- * number of spaces the text should be indented. Title is used to
- * print a header text.
- */
-
-extern void pr_inputrec(FILE *fp,int indent,char *title,t_inputrec *ir);
-/*
- * This routine prints out a (human) readable representation of
- * an input record to the file fp. Ident specifies the number of spaces
- * the text should be indented. Title is used to print a header text.
- */
-
-#endif /* _rwtop_h */
#ifndef _sheader_h
#define _sheader_h
-static char *SRCID_sheader_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) sheader.h 1.4 11/23/92"
-#endif /* HAVE_IDENT */
-
#include <stdio.h>
#include "typedefs.h"
#include "tpxio.h"
#ifndef _shift_h
#define _shift_h
-static char *SRCID_shift_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) shift.h 1.6 2/2/97"
-#endif /* HAVE_IDENT */
-#ifdef HAVE_IDENT
-#endif /* HAVE_IDENT */
-
extern real *mk_shift_tab(int n,real r1,real rc,real dr,real *sfac);
/* Return a table of length n, containing the parabolic
* shift function from HJC Berendsen
#ifndef _shift_util_h
#define _shift_util_h
-static char *SRCID_shift_util_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _smalloc_h
#define _smalloc_h
-static char *SRCID_smalloc_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) smalloc.h 1.14 11/23/92"
-#endif /* HAVE_IDENT */
-
/*
* Memory allocation routines in gromacs:
*
* If ptr equals NULL, malloc is called in stead of realloc, in this way
* it is possible to combine first and later allocations.
*
- * extern void save_free(char *name,char *file,int line,void *ptr);
+ * extern void save_free(char *name,char *file,int line,const void *ptr);
* Like free, uses name, file and line to generate an error message when
* the free failed.
*
unsigned nelem,unsigned elsize);
void *save_realloc(char *name,char *file,int line,
void *ptr,unsigned size);
-void save_free(char *name,char *file,int line,void *ptr);
+void save_free(char *name,char *file,int line,const void *ptr);
unsigned maxavail(void);
unsigned memavail(void);
#ifndef _sortwater_h
#define _sortwater_h
-static char *SRCID_sortwater_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _split_h
#define _split_h
-static char *SRCID_split_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) split.h 1.20 12/16/92"
-#endif /* HAVE_IDENT */
-
/*
* Determine on which node a particle should reside and on which
* node is also should be available. The distribution algorithm
#ifndef _statusio_h
#define _statusio_h
-static char *SRCID_statusio_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) statusio.h 1.46 2/2/97"
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
#include "sheader.h"
#ifndef _statutil_h
#define _statutil_h
-static char *SRCID_statutil_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _strdb_h
#define _strdb_h
-static char *SRCID_strdb_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) strdb.h 1.9 2/2/97"
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
extern bool get_a_line(FILE *fp,char line[],int n);
#ifndef _string2_h
#define _string2_h
-static char *SRCID_string2_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) string2.h 1.13 11/23/92"
-#endif /* HAVE_IDENT */
-
/*
*
* string2.h
#define strdup gmx_strdup
#endif
-extern char *wrap_lines(char *buf,int line_width, int indent);
+extern char *wrap_lines(const char *buf,int line_width, int indent);
/* wraps lines at 'linewidth', indenting all following
* lines by 'indent' spaces. A temp buffer is allocated and returned,
* which can be disposed of if no longer needed.
#ifndef _struc2_h
#define _struc2_h
-static char *SRCID_struc2_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) struc2.h 1.2 15 Sep 1993"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
typedef struct {
#ifndef _superb_h
#define _superb_h
-static char *SRCID_superb_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) superb.h 1.7 2/2/97"
-#endif /* HAVE_IDENT */
#include <sysstuff.h>
#include <typedefs.h>
#ifndef _symtab_h
#define _symtab_h
-static char *SRCID_symtab_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) symtab.h 1.6 12/16/92"
-#endif /* HAVE_IDENT */
#include <stdio.h>
#include "typedefs.h"
/* Frees the space allocated by the symbol table, including all
* entries in it */
-extern char **put_symtab(t_symtab *symtab,char *name);
+extern char **put_symtab(t_symtab *symtab,const char *name);
/* Enters a string into the symbol table symtab, if it was not
* available, a reference to a copy is returned else a reference
* to the earlier entered value is returned. Strings are trimmed
#ifndef _sysstuff_h
#define _sysstuff_h
-static char *SRCID_sysstuff_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) sysstuff.h 1.22 12/16/92"
-#endif /* HAVE_IDENT */
-
#ifdef CPLUSPLUS
extern "C" {
#endif
#ifndef _tags_h
#define _tags_h
-static char *SRCID_tags_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) tags.h 1.3 11/23/92"
-#endif /* HAVE_IDENT */
-
#define SYSCALL_TAG 0x11 /* Tag for server system calls */
#define SEMGET_TAG 0x10 /* Server subcommand i860_semget() */
#define SEMCTL_TAG 0x11 /* Server subcommand i860_semctl() */
#ifndef _tgroup_h
#define _tgroup_h
-static char *SRCID_tgroup_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) tgroup.h 1.12 2/2/97"
-#endif /* HAVE_IDENT */
-#ifdef HAVE_IDENT
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
#include "network.h"
#ifndef _tpxio_h
#define _tpxio_h
-static char *SRCID_tpxio_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
extern void close_tpx(int fp);
/* Close the file corresponding to fp */
-extern void read_tpxheader(char *fn,t_tpxheader *tpx);
-/* Read the header from a tpx file and then close it again */
+extern void read_tpxheader(char *fn,t_tpxheader *tpx, bool TopOnlyOK, int *version, int *generation);
+/* Read the header from a tpx file and then close it again.
+ * By setting TopOnlyOK to true, it is possible to read future
+ * versions too (we skip the changed inputrec), provided we havent
+ * changed the topology description. If it is possible to read
+ * the inputrec it will still be done even if TopOnlyOK is TRUE.
+ *
+ * The version and generation if the topology (see top of tpxio.c)
+ * are returned in the two last arguments.
+ */
extern void write_tpx(char *fn,int step,real t,real lambda,
t_inputrec *ir,rvec *box,int natoms,
#ifndef _transfer_h
#define _transfer_h
-static char *SRCID_transfer_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) transfer.h 1.6 11/23/92"
-#endif /* HAVE_IDENT */
extern void linkio_write(int linkno,int nbytes);
extern void linkio_read(int linkno,int nbytes);
#ifndef _trnio_h
#define _trnio_h
-static char *SRCID_trnio_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _txtdump_h
#define _txtdump_h
-static char *SRCID_txtdump_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) txtdump.h 1.20 12/16/92"
-#endif /* HAVE_IDENT */
#include <stdio.h>
#include "typedefs.h"
/* Return pointer to a buffer which holds the atomname in the
* form resname resnr atomname. Pointer can be freed afterwards.
*/
-extern void pr_shownumbers(bool bShow);
extern int available(FILE *fp,void *p,char *title);
extern int pr_indent(FILE *fp,int n);
extern int pr_title(FILE *fp,int indent,char *title);
extern int pr_title_n(FILE *fp,int indent,char *title,int n);
extern int pr_title_nxn(FILE *fp,int indent,char *title,int n1,int n2);
-extern void pr_ivec(FILE *fp,int indent,char *title,int vec[],int n);
-extern void pr_ivecs(FILE *fp,int indent,char *title,ivec vec[],int n);
-extern void pr_rvec(FILE *fp,int indent,char *title,real vec[],int n);
+extern void pr_ivec(FILE *fp,int indent,char *title,int vec[],int n, bool bShowNumbers);
+extern void pr_ivecs(FILE *fp,int indent,char *title,ivec vec[],int n, bool bShowNumbers);
+extern void pr_rvec(FILE *fp,int indent,char *title,real vec[],int n, bool bShowNumbers);
extern void pr_rvecs(FILE *fp,int indent,char *title,rvec vec[],int n);
extern void pr_rvecs_len(FILE *fp,int indent,char *title,rvec vec[],int n);
-extern void pr_block(FILE *fp,int indent,char *title,t_block *block);
+extern void pr_block(FILE *fp,int indent,char *title,t_block *block, bool bShowNumbers);
extern void pr_iparams(FILE *fp,t_functype ftype,t_iparams *iparams);
-extern void pr_idef(FILE *fp,int indent,char *title,t_idef *idef);
+extern void pr_idef(FILE *fp,int indent,char *title,t_idef *idef, bool bShowNumbers);
extern void pr_inputrec(FILE *fp,int indent,char *title,t_inputrec *ir);
-extern void pr_top(FILE *fp,int indent,char *title,t_topology *top);
+extern void pr_top(FILE *fp,int indent,char *title,t_topology *top, bool bShowNumbers);
/*
* This routine prints out a (human) readable representation of
* the topology to the file fp. Ident specifies the number of
* header text.
*/
extern void pr_header(FILE *fp,int indent,char *title,t_tpxheader *sh);
- /*
+ /*
* This routine prints out a (human) readable representation of
* a header to the file fp. Ident specifies the number of spaces
* the text should be indented. Title is used to print a header text.
*/
-
#endif /* _txtdump_h */
#ifndef _typedefs_h
#define _typedefs_h
-static char *SRCID_typedefs_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* use: (*(atomtypeB[i])) */
int nres; /* Nr of residue names */
char ***resname; /* Array of pointers to residue names */
- /* use: (*(resname[i])) */
- int ngrpname; /* Number of groupnames */
+ /* use: (*(resname[i])) */
+ int ngrpname; /* Number of groupnames */
char ***grpname; /* Names of the groups */
- t_block excl; /* Exclusions */
+ t_block excl; /* Exclusions */
t_grps grps[egcNR]; /* Groups of things */
t_pdbinfo *pdbinfo; /* PDB Information, such as aniso. Bfac */
} t_atoms;
+typedef struct {
+ int nr; /* number of atomtypes */
+ real *radius; /* GBSA radius for each atomtype */
+ real *vol; /* GBSA efective volume for each atomtype */
+ real *surftens; /* implicit solvent surftens for each atomtype */
+} t_atomtypes;
+
+
#define PERTURBED(a) (((a).mB != (a).m) || ((a).qB != (a).q) || ((a).typeB != (a).type))
};
enum {
- etcNO, etcBERENDSEN, etcNOSEHOOVER, etcYES, etcNR
+ etcNO, etcBERENDSEN, etcNOSEHOOVER, etcYES, etcANDERSEN, etcANDERSENINTERVAL, etcNR
}; /* yes is an alias for berendsen */
enum {
enum {
eelCUT, eelRF, eelGRF, eelPME, eelEWALD, eelPPPM,
- eelPOISSON, eelSWITCH, eelSHIFT, eelUSER, eelNR
+ eelPOISSON, eelSWITCH, eelSHIFT, eelUSER, eelGB, eelNR
};
/* Ewald geometry */
ecmLINEAR, ecmANGULAR, ecmNO, ecmNR
};
+/* New version of simulated annealing */
+enum {
+ eannNO, eannSINGLE, eannPERIODIC, eannNR
+};
+
+/* Algorithms for calculating GB radii */
+enum {
+ egbSTILL, egbKARPLUS, egbNR
+};
+
+/* Implicit solvent algorithms */
+enum {
+ eisNO, eisLCPO, eisNR
+};
+
real ***TMP; /* An array of temporary 5x5 matrices (nex); */
} t_oriresdata;
+/* Dihedral restraining stuff */
+typedef struct {
+ real dihre_fc; /* Force constant for dihres,
+ * which is multiplied by a (possibly)
+ * different factor for each restraint */
+ real dihre_tau; /* Time constant for dihres */
+
+ real ETerm; /* multiplication factor for time averaging */
+ real ETerm1; /* 1 - ETerm1 */
+ real exp_min_t_tau; /* Factor for slowly switching on the force */
+ int nr; /* The number of dihedral restraints */
+ int ndih; /* The number of dihedral restraint pairs */
+ real *diht; /* The calculated instantaneous dihedrals (npr) */
+ real *dihav; /* The calculated time averaged dihedrals (npr) */
+ real RMSviol; /* The root-mean-square of violations (degrees) */
+} t_dihresdata;
+
/*
* Data struct used in the force calculation routines
* for storing information which is needed in following steps
typedef struct {
t_disresdata disres;
t_oriresdata orires;
+ t_dihresdata dihres;
} t_fcdata;
/* xmdrun flexible constraints */
real fc_stepsize;
+
+ /* Generalized born stuff */
+ /* VdW radius for each atomtype (dim is thus ntype) */
+ real *atype_radius;
+ /* Effective radius (derived from effective volume) for each type */
+ real *atype_vol;
+ /* Implicit solvent - surface tension for each atomtype */
+ real *atype_surftens;
+
} t_forcerec;
#define C6(nbfp,ntp,ai,aj) (nbfp)[2*((ntp)*(ai)+(aj))]
#include "fatal.h"
+typedef enum { egcolWhite, egcolGrey, egcolBlack, egcolNR } egCol;
+
typedef struct {
int maxedge; /* Max number of edges per atom */
int nnodes; /* The number of nodes */
int *nedge; /* For each node the number of edges */
atom_id **edge; /* For each node, the actual edges (bidirect.) */
ivec *ishift; /* Shift for each particle */
+ int negc;
+ egCol *egc; /* color of each node */
} t_graph;
#define MAXATOMLIST 5
#define MAXFORCEPARAM 12
#define NR_RBDIHS 6
+#define NR_FOURDIHS 4
typedef atom_id t_iatom;
F_ANGLES,
F_G96ANGLES,
F_PDIHS,
- F_RBDIHS,
+ F_RBDIHS,
+ F_FOURDIHS,
F_IDIHS,
+ F_PIDIHS,
F_LJ14,
F_COUL14,
F_LJ,
F_ORIRESDEV,
F_ANGRES,
F_ANGRESZ,
+ F_DIHRES,
+ F_DIHRESVIOL,
F_SHAKE,
F_SHAKENC,
F_SETTLE,
* The harmonic type is used for all harmonic potentials:
* bonds, angles and improper dihedrals
*/
- struct {real a,b,c; } bham;
- struct {real rA,krA,rB,krB; } harmonic;
- /* No free energy support for cubic bonds */
- struct {real b0,kb,kcub; } cubic;
+ struct {real a,b,c; } bham;
+ struct {real rA,krA,rB,krB; } harmonic;
+ /* No free energy supported for cubic bonds */
+ struct {real b0,kb,kcub; } cubic;
/* No free energy supported for WPOL */
- struct {real kx,ky,kz,rOH,rHH,rOD; } wpol;
- struct {real c6,c12; } lj;
- struct {real c6A,c12A,c6B,c12B; } lj14;
+ struct {real kx,ky,kz,rOH,rHH,rOD; } wpol;
+ struct {real c6,c12; } lj;
+ struct {real c6A,c12A,c6B,c12B; } lj14;
/* Proper dihedrals can not have different multiplicity when
* doing free energy calculations, because the potential would not
* be periodic anymore.
*/
- struct {real phiA,cpA;int mult;real phiB,cpB; } pdihs;
- struct {real dA,dB; } shake;
- /* Settle can not be used for Free energy calculations.
- * Use shake (or lincs) instead.
- * The rest of the things cannot (yet) be used in FEP studies either.
+ struct {real phiA,cpA;int mult;real phiB,cpB; } pdihs;
+ struct {real dA,dB; } shake;
+ /* Settle can not be used for Free energy calculations of water bond geometry.
+ * Use shake (or lincs) instead if you have to change the water bonds.
*/
- struct {real doh,dhh; } settle;
- struct {real b0,cb,beta; } morse;
- struct {real pos0[DIM],fc[DIM]; } posres;
- struct {real rbcA[NR_RBDIHS], rbcB[NR_RBDIHS];} rbdihs;
- struct {real a,b,c,d,e,f; } dummy;
- struct {real low,up1,up2,kfac;int type,label; } disres;
- struct {int ex,power,label; real c,obs,kfac; } orires;
- struct {real buf[MAXFORCEPARAM]; } generic; /* Conversion */
+ struct {real doh,dhh; } settle;
+ /* No free energy supported for morse bonds */
+ struct {real b0,cb,beta; } morse;
+ struct {real pos0[DIM],fc[DIM]; } posres;
+ struct {real rbcA[NR_RBDIHS], rbcB[NR_RBDIHS]; } rbdihs;
+ struct {real a,b,c,d,e,f; } dummy;
+ struct {real low,up1,up2,kfac;int type,label; } disres;
+ struct {real phi,dphi,kfac;int label,power; } dihres;
+ struct {int ex,power,label; real c,obs,kfac; } orires;
+ struct {real buf[MAXFORCEPARAM]; } generic; /* Conversion */
} t_iparams;
typedef int t_functype;
#define IS_CHEMBOND(ftype) (interaction_function[(ftype)].nratoms==2 && interaction_function[(ftype)].flags & IF_CHEMBOND)
/* IS_CHEMBOND tells if function type ftype represents a chemical bond */
-extern t_interaction_function interaction_function[F_NRE];
+extern const t_interaction_function interaction_function[F_NRE];
/* initialised interaction functions descriptor */
#endif
} t_cosines;
typedef struct {
- int ngtc; /* # T-Coupl groups */
- int ngacc; /* # Accelerate groups */
- int ngfrz; /* # Freeze groups */
- int ngener; /* # Ener groups */
- real *nrdf; /* Nr of degrees of freedom in a group */
- real *ref_t; /* Coupling temperature per group */
- real *tau_t; /* Tau coupling time */
- rvec *acc; /* Acceleration per group */
- ivec *nFreeze; /* Freeze the group in each direction ? */
- bool *eg_excl; /* Exclusions of energy group pairs */
+ int ngtc; /* # T-Coupl groups */
+ int ngacc; /* # Accelerate groups */
+ int ngfrz; /* # Freeze groups */
+ int ngener; /* # Ener groups */
+ real *nrdf; /* Nr of degrees of freedom in a group */
+ real *ref_t; /* Coupling temperature per group */
+ int *annealing; /* No/simple/periodic SA for each group */
+ int *anneal_npoints; /* Number of annealing time points per grp*/
+ real **anneal_time; /* For ea. group: Time points */
+ real **anneal_temp; /* For ea. grp: Temperature at these times*/
+ /* Final temp after all intervals is ref_t*/
+ real *tau_t; /* Tau coupling time */
+ rvec *acc; /* Acceleration per group */
+ ivec *nFreeze; /* Freeze the group in each direction ? */
+ bool *eg_excl; /* Exclusions of energy group pairs */
} t_grpopts;
+
typedef struct {
int eI; /* Integration method */
int nsteps; /* number of steps to be taken */
+ int init_step; /* start at a stepcount >0 (used w. tpbconv) */
int ns_type; /* which ns method should we use? */
int nstlist; /* number of steps before pairlist is generated */
int ndelta; /* number of cells per rlong */
int decomp_dir; /* Direction of decomposition (may not be opt.) */
int nstcomm; /* number of steps after which center of mass */
/* motion is removed */
+ int nstcheckpoint; /* checkpointing frequency */
int nstlog; /* number of steps after which print to logfile */
int nstxout; /* number of steps after which X is output */
int nstvout; /* id. for V */
real tau_p; /* pressure coupling time (ps) */
tensor ref_p; /* reference pressure (kJ/(mol nm^3)) */
tensor compress; /* compressability ((mol nm^3)/kJ) */
- bool bSimAnn; /* simulated annealing (SA) */
- real zero_temp_time; /* time at which temp becomes zero in sim. ann. */
+ int andersen_seed; /* Random seed for Andersen thermostat. */
real rlist; /* short range pairlist cut-off (nm) */
int coulombtype; /* Type of electrostatics treatment */
real rcoulomb_switch; /* Coulomb switch range start (nm) */
real rcoulomb; /* Coulomb cutoff (nm) */
+ real epsilon_r; /* relative dielectric constant */
+ int gb_algorithm; /* Algorithm to use for calculation Born radii */
+ int nstgbradii; /* Frequency of updating Generalized Born radii */
+ real rgbradii; /* Cutoff for GB radii calculation */
+ real gb_saltconc; /* Salt concentration (M) for GBSA models */
int vdwtype; /* Type of Van der Waals treatment */
real rvdw_switch; /* Van der Waals switch range start (nm) */
real rvdw; /* Van der Waals cutoff (nm) */
- real epsilon_r; /* relative dielectric constant */
+ int implicit_solvent;/* No (=explicit water), or GBSA solvent models */
int eDispCorr; /* Perform Long range dispersion corrections */
real shake_tol; /* tolerance for shake */
real fudgeQQ; /* Id. for 1-4 coulomb interactions */
real orires_fc; /* force constant for orientational restraints */
real orires_tau; /* time constant for memory function in orires */
int nstorireout; /* frequency of writing tr(SD) to enx */
+ int dihre_fc; /* force constant for dihedral restraints */
+ int nstdihreout; /* frequency of writing dihedrals to enx */
+ real dihre_tau; /* time constant for memory function in dihres */
real em_stepsize; /* The stepsize for updating */
real em_tol; /* The tolerance */
int niter; /* Number of iterations for convergence of */
int eConstrAlg; /* Type of constraint algorithm */
int nProjOrder; /* Order of the LINCS Projection Algorithm */
real LincsWarnAngle; /* If bond rotates more than %g degrees, warn */
+ int nLincsIter; /* Number of iterations in the final Lincs step */
bool bShakeSOR; /* Use successive overrelaxation for shake */
real bd_temp; /* Temperature for Brownian Dynamics (BD) */
real bd_fric; /* Friction coefficient for BD (amu / ps) */
eNR_SHIFTX, eNR_CGCM, eNR_FSUM,
eNR_BONDS, eNR_G96BONDS, eNR_ANGLES,
eNR_G96ANGLES, eNR_PROPER, eNR_IMPROPER,
- eNR_RB, eNR_DISRES, eNR_ORIRES,
+ eNR_RB, eNR_FOURDIH, eNR_DISRES,
+ eNR_ORIRES, eNR_DIHRES,
eNR_POSRES, eNR_ANGRES, eNR_ANGRESZ,
eNR_MORSE, eNR_CUBICBONDS,
eNR_WPOL, eNR_VIRIAL,
#endif
typedef struct {
- char **name; /* Name of the topology */
+ char **name; /* Name of the topology */
t_idef idef; /* The interaction function definition */
- t_atoms atoms; /* The atoms */
- t_block blocks[ebNR]; /* The blocks */
+ t_atoms atoms; /* The atoms */
+ t_atomtypes atomtypes; /* Atomtype properties */
+ t_block blocks[ebNR]; /* The blocks */
t_symtab symtab; /* The symbol table */
} t_topology;
#ifndef _update_h
#define _update_h
-static char *SRCID_update_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) update.h 1.33 24 Jun 1996"
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
#include "mshift.h"
#include "tgroup.h"
real lambda, /* FEP scaling parameter */
real *dvdlambda, /* FEP stuff */
t_parm *parm, /* input record and box stuff */
- real SAfactor, /* simulated annealing factor */
t_mdatoms *md,
rvec x[], /* coordinates of home particles */
t_graph *graph,
*/
extern real run_aver(real old,real cur,int step,int nmem);
-extern void berendsen_tcoupl(t_grpopts *opts,t_groups *grps,
- real dt,real SAfactor);
-extern void nosehoover_tcoupl(t_grpopts *opts,t_groups *grps,
- real dt,real SAfactor);
+extern void berendsen_tcoupl(t_grpopts *opts,t_groups *grps,real dt);
+extern void nosehoover_tcoupl(t_grpopts *opts,t_groups *grps,real dt);
/* Compute temperature scaling. For Nose-Hoover it is done in update. */
+/* Set reference temp for simulated annealing at time t*/
+extern void update_annealing_target_temp(t_grpopts *opts,real t);
+
extern real calc_temp(real ekin,real nrdf);
/* Calculate the temperature */
#ifndef _utils_h
#define _utils_h
-static char *SRCID_utils_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) utils.h 1.11 2/2/97"
-#endif /* HAVE_IDENT */
-
#include <stdio.h>
#include "typedefs.h"
#ifndef _vcm_h
#define _vcm_h
-static char *SRCID_vcm_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) vcm.h 1.9 9/29/97"
-#endif /* HAVE_IDENT */
#include "sysstuff.h"
#include "typedefs.h"
#ifndef _vec_h
#define _vec_h
-static char *SRCID_vec_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#define gmx_inline inline
/* Perform out[i]=1.0/sqrt(in[i]) for n elements */
-
extern void vecrecip(real in[],real out[],int n);
-/* Perform out[i]=1.0/(in[i]) for n elements
- * Note that this function can be much faster than writing
- * the loop yourself, even if the recip(x) is slow on your machine.
- * Not only do we get better cache usage in vecrecip, but it
- * might be possible to use optimized vector libraries.
+/* Perform out[i]=1.0/(in[i]) for n elements */
+
+/* Note: If you need a fast version of vecinvsqrt
+ * and/or vecrecip, call detectcpu() and run the SSE/3DNow/SSE2/Altivec
+ * versions if your hardware supports it.
+ *
+ * To use those routines, your memory HAS TO BE CACHE-ALIGNED.
+ * Start by allocating 31 bytes more than you need, put
+ * this in a temp variable (e.g. _buf, so you can free it later), and
+ * create your aligned array buf with
+ *
+ * buf=(real *) ( ( (unsigned long int)_buf + 31 ) & (~0x1f) );
*/
-
-
static inline void rvec_add(const rvec a,const rvec b,rvec c)
{
real x,y,z;
#ifndef _viewit_h
#define _viewit_h
-static char *SRCID_viewit_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "$Id$"
-#endif /* HAVE_IDENT */
-
#ifdef CPLUSPLUS
extern "C" {
#endif
#ifndef _wgms_h
#define _wgms_h
-
-static char *SRCID_wgms_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _wman_h
#define _wman_h
-static char *SRCID_wman_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) wman.h 1.11 10/2/97"
-#endif /* HAVE_IDENT */
-
#include "readinp.h"
extern void write_java(FILE *out,char *program,
int nbug,char **bugs,
bool bHidden);
-extern char *fileopt(unsigned long flag);
+extern char *fileopt(unsigned long flag,char buf[],int maxsize);
/* Return a string describing the file type in flag.
* flag should the flag field of a filenm struct.
+ * You have to provide a buffer and buffer length in which
+ * the result will be written. The returned pointer is just
+ * a pointer to this buffer.
*/
-extern char *check_tty(char *s);
-extern char *check_tex(char *s);
-extern char *check_html(char *s,char *program);
-/* Check LaTeX or HTML strings for codes, and remove them
- * the program variable may be NULL
- */
+extern const char *check_tex(const char *s);
+
+extern const char *check_tty(const char *s);
#endif /* _wman_h */
#ifndef _writeps_h
#define _writeps_h
-static char *SRCID_writeps_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) writeps.h 1.10 8/25/97"
-#endif /* HAVE_IDENT */
#include <stdio.h>
#include "typedefs.h"
efontCOUR, efontCOURITALIC, efontCOURBOLD, efontCOURBOLDITALIC,
efontNR };
-extern char *fontnm[efontNR];
-extern FILE *ps_open(char *fn,real x1,real y1,real x2,real y2);
+typedef struct t_int_psdata *t_psdata;
+/* Only use t_psdata - it is a pointer to an abstract datatype
+ * that maintains the state of the postscript currently written.
+ */
+
+extern const char *fontnm[efontNR];
+
+extern t_psdata ps_open(char *fn,real x1,real y1,real x2,real y2);
-extern void ps_linewidth(FILE *ps,int lw);
-extern void ps_color(FILE *ps,real r,real g,real b);
-extern void ps_rgb(FILE *ps,t_rgb *rgb);
+extern void ps_linewidth(t_psdata ps,int lw);
+extern void ps_color(t_psdata ps,real r,real g,real b);
+extern void ps_rgb(t_psdata ps,t_rgb *rgb);
-extern void ps_rgb_box(FILE *ps,t_rgb *rgb);
-extern void ps_rgb_nbox(FILE *ps,t_rgb *rgb,real n);
-extern void ps_init_rgb_box(FILE *ps,real xbox, real ybox);
-extern void ps_init_rgb_nbox(FILE *ps,real xbox, real ybox);
+extern void ps_rgb_box(t_psdata ps,t_rgb *rgb);
+extern void ps_rgb_nbox(t_psdata ps,t_rgb *rgb,real n);
+extern void ps_init_rgb_box(t_psdata ps,real xbox, real ybox);
+extern void ps_init_rgb_nbox(t_psdata ps,real xbox, real ybox);
-extern void ps_lineto(FILE *ps,real x,real y);
-extern void ps_linerel(FILE *ps,real dx,real dy);
+extern void ps_lineto(t_psdata ps,real x,real y);
+extern void ps_linerel(t_psdata ps,real dx,real dy);
-extern void ps_moveto(FILE *ps,real x,real y);
-extern void ps_moverel(FILE *ps,real dx,real dy);
+extern void ps_moveto(t_psdata ps,real x,real y);
+extern void ps_moverel(t_psdata ps,real dx,real dy);
-extern void ps_line(FILE *ps,real x1,real y1,real x2,real y2);
+extern void ps_line(t_psdata ps,real x1,real y1,real x2,real y2);
-extern void ps_box(FILE *ps,real x1,real y1,real x2,real y2);
-extern void ps_fillbox(FILE *ps,real x1,real y1,real x2,real y2);
+extern void ps_box(t_psdata ps,real x1,real y1,real x2,real y2);
+extern void ps_fillbox(t_psdata ps,real x1,real y1,real x2,real y2);
-extern void ps_arc(FILE *ps,real x1,real y1,real rad,real a0,real a1);
-extern void ps_fillarc(FILE *ps,real x1,real y1,real rad,real a0,real a1);
-extern void ps_arcslice(FILE *ps,real xc,real yc,
+extern void ps_arc(t_psdata ps,real x1,real y1,real rad,real a0,real a1);
+extern void ps_fillarc(t_psdata ps,real x1,real y1,real rad,real a0,real a1);
+extern void ps_arcslice(t_psdata ps,real xc,real yc,
real rad1,real rad2,real a0,real a1);
-extern void ps_fillarcslice(FILE *ps,real xc,real yc,
+extern void ps_fillarcslice(t_psdata ps,real xc,real yc,
real rad1,real rad2,real a0,real a1);
-extern void ps_circle(FILE *ps,real x1,real y1,real rad);
+extern void ps_circle(t_psdata ps,real x1,real y1,real rad);
-extern void ps_font(FILE *ps,int font,real size);
-extern void ps_strfont(FILE *ps,char *font,real size);
+extern void ps_font(t_psdata ps,int font,real size);
+extern void ps_strfont(t_psdata ps,char *font,real size);
-extern void ps_text(FILE *ps,real x1,real y1,char *str);
-extern void ps_ctext(FILE *ps,real x1,real y1,char *str,int expos);
+extern void ps_text(t_psdata ps,real x1,real y1,char *str);
+extern void ps_ctext(t_psdata ps,real x1,real y1,char *str,int expos);
-extern void ps_close(FILE *ps);
+extern void ps_close(t_psdata ps);
-extern void ps_rotate(FILE *ps,bool bPlus);
+extern void ps_rotate(t_psdata ps,bool bPlus);
/* Rotate over 90 (bPlus) or -90 (!bPlus) degrees */
-extern void ps_translate(FILE *ps,real x,real y);
+extern void ps_translate(t_psdata ps,real x,real y);
-extern void ps_setorigin(FILE *ps);
-extern void ps_unsetorigin(FILE *ps);
+extern void ps_setorigin(t_psdata ps);
+extern void ps_unsetorigin(t_psdata ps);
extern void viewps(char *fn);
-extern void ps_comment(FILE *ps,char *s);
+extern void ps_comment(t_psdata ps,char *s);
#endif /* _writeps_h */
#ifndef _x86_3dnow_h
#define _x86_3dnow_h
-static char *SRCID_x86_3dnow_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _x86_sse_h
#define _x86_sse_h
-static char *SRCID_x86_sse_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _x86_sse2_h
#define _x86_sse2_h
-static char *SRCID_x86_sse2_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _xdrf_h
#define _xdrf_h
-static char *SRCID_xdrf_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _xtcio_h
#define _xtcio_h
-static char *SRCID_xtcio_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _xvgr_h
#define _xvgr_h
-static char *SRCID_xvgr_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-#ifdef HAVE_IDENT
-#ident "@(#) xvgr.h 1.8 7/28/97"
-#endif /* HAVE_IDENT */
-
#ifdef CPLUSPLUS
extern "C" {
#endif
* XVGR ROUTINES
***************************************************/
-extern FILE *xvgropen(char *fn,char *title,char *xaxis,char *yaxis);
+extern FILE *xvgropen(const char *fn,const char *title,const char *xaxis,const char *yaxis);
/* Open a file, and write a title, and axis-labels in Xvgr format */
extern void xvgr_view(FILE *out,real xmin,real ymin,real xmax,real ymax);
sed 's,@CC\@,$(CC),' | \
sed 's,@host\@,@host@,' >$@
-install-data-hook:
-if DOUBLE
- (cd $(DESTDIR)$(templatedir) && ! (test -e Makefile) && $(LN_S) Makefile.@host@_double Makefile ; exit 0)
-else
- (cd $(DESTDIR)$(templatedir) && ! (test -e Makefile) && $(LN_S) Makefile.@host@ Makefile ; exit 0)
-endif
CLEANFILES = Makefile.@host@ Makefile.@host@_double *~ \\\#*
writing your own analysis software.
A Makefile.arch is created for each architecture you install
-(the first one is linked to Makefile) with the correct paths
-and libraries. If there is more than one, copy the one
-that corresponds best to your computer.
+with the correct paths and libraries. You will have to link
+(or copy) the correct makefile to "Makefile" or use the -f
+option to gmake in order to select a makefile.
----------------------------------------------------------
OM 15.99940 0.000 A 0.22617E-02 0.74158E-06
OA 15.99940 0.000 A 0.22617E-02 0.15062E-05
#ifdef HEAVY_H
- OW 9.95140 0.000 A 0.26171E-02 0.26331E-05
+ OW 9.95140 0.000 A 0.26171E-02 0.26331E-05 1 2 3
#else
- OW 15.99940 0.000 A 0.26171E-02 0.26331E-05
+ OW 15.99940 0.000 A 0.26171E-02 0.26331E-05 1 2 3
#endif
N 14.00670 0.000 A 0.24362E-02 0.16924E-05
NT 14.00670 0.000 A 0.24362E-02 0.16924E-05
H 1.00800 0.000 A 0.00000E+00 0.00000E+00
HO 1.00800 0.000 A 0.00000E+00 0.00000E+00
#ifdef HEAVY_H
- HW 4.03200 0.000 A 0.00000E+00 0.00000E+00
+ HW 4.03200 0.000 A 0.00000E+00 0.00000E+00 4 5 6
#else
- HW 1.00800 0.000 A 0.00000E+00 0.00000E+00
+ HW 1.00800 0.000 A 0.00000E+00 0.00000E+00 4 5 6
#endif
HS 1.00800 0.000 A 0.00000E+00 0.00000E+00
S 32.06000 0.000 A 0.99844E-02 0.13078E-04
CH3 C
C O
[ impropers ]
- O C +N CH3 improper_O_C_X_Y
+ C CH3 +N O improper_O_C_X_Y
[ ALA ]
[ atoms ]
-#ifndef _FF_GROMOS96
+#ifdef _FF_OPLSAA
-[ atomtypes ]
-; type mass charge ptype c6 c12
- OMET 15.999 -0.69 A 2.6169e-3 2.5231e-6
- OW 15.999 -0.82 A 2.6170e-3 2.6330e-6
- CMET 15.035 0.29 A 8.8758e-3 17.8426e-6
- H 1.008 0.4 A 0.0 0.0
- HW 1.008 0.41 A 0.0 0.0
-#endif
[ moleculetype ]
; name nrexcl
-Methanol 2
+Ethanol 3
[ atoms ]
-; nr type resnr residu atom cgnr charge mass
-#ifdef _FF_GROMOS96
-1 CMET 1 MeOH Me1 1 0.176 15.035
-2 OMET 1 MeOH O2 1 -0.574 15.999
-3 H 1 MeOH H3 1 0.398 1.008
-#else
-1 CMET 1 MeOH Me1 1 0.29 15.035
-2 OMET 1 MeOH O2 1 -0.69 15.999
-3 H 1 MeOH H3 1 0.40 1.008
-#endif
+; nr type resnr residu atom cgnr charge mass
+ 1 opls_135 1 EtOH CB 1 -0.18 12.011
+ 2 opls_140 1 EtOH HB1 1 0.06 1.008
+ 3 opls_140 1 EtOH HB2 1 0.06 1.008
+ 4 opls_140 1 EtOH HB3 1 0.06 1.008
+ 5 opls_157 1 EtOH CA 2 0.145 12.011
+ 6 opls_140 1 EtOH HA1 2 0.06 1.008
+ 7 opls_140 1 EtOH HA2 2 0.06 1.008
+ 8 opls_154 1 EtOH OH 2 -0.683 15.994
+ 9 opls_155 1 EtOH HO 2 0.418 1.008
+
[ bonds ]
-; ai aj funct c0 c1
-1 2 1 0.13600 376560.
-2 3 1 0.10000 313800.
+; ai aj funct
+ 1 2 1
+ 1 3 1
+ 1 4 1
+ 1 5 1
+ 5 6 1
+ 5 7 1
+ 5 8 1
+ 8 9 1
+
[ angles ]
; ai aj ak funct c0 c1
- 1 2 3 1 108.53 397.5
+ 2 1 3 1
+ 2 1 4 1
+ 2 1 5 1
+ 3 1 4 1
+ 3 1 5 1
+ 4 1 5 1
+ 1 5 6 1
+ 1 5 7 1
+ 1 5 8 1
+ 6 5 7 1
+ 6 5 8 1
+ 7 5 8 1
+ 5 8 9 1
+
+
+[ dihedrals ]
+; ai aj ak al func
+ 2 1 5 6 3
+ 2 1 5 7 3
+ 2 1 5 8 3
+ 3 1 5 6 3
+ 3 1 5 7 3
+ 3 1 5 8 3
+ 4 1 5 6 3
+ 4 1 5 7 3
+ 4 1 5 8 3
+ 1 5 8 9 3
+ 6 5 8 9 3
+ 7 5 8 9 3
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_addquote_c = "$Id$";
+
#include <ctype.h>
+#include <string.h>
#include "strdb.h"
#include "copyrite.h"
#include "smalloc.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_anaf_c = "$Id$";
+
#include <stdio.h>
#include <string.h>
#include <math.h>
static void list_trn(char *fn)
{
static real mass[5] = { 15.9994, 1.008, 1.008, 0.0, 0.0 };
- int i,j,m,fpread,fpwrite,nframe;
+ int i,j=0,m,fpread,fpwrite,nframe;
rvec *x,*v,*f,fmol[2],xcm[2],torque[j],dx;
real mmm,len;
matrix box;
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_calcfdev_c = "$Id$";
+
#include "typedefs.h"
#include "main.h"
#include "vec.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_copyrgt_c = "$Id$";
+
#include "stdio.h"
#include "stdlib.h"
#include "macros.h"
#define NH2 asize(head2)
#define MAXS 10240
-void head(FILE *out, char *fn_, bool bH, bool bSRCID,
+void head(FILE *out, char *fn_, bool bH,
char *cstart, char *ccont, char *cend)
{
int i;
fprintf(out,"#define _%s\n",fn_);
fprintf(out,"\n");
}
- if (bSRCID)
- fprintf(out,"static char *SRCID_%s = \"$""Id""$\";\n",fn_);
- /* NOTE: the "" are to mislead CVS so it will not replace by version info */
- /*fprintf(out,"\n");*/
}
void cr_c(char *fn)
FILE *in,*out;
char ofn[1024],line[MAXS+1],cwd[1024];
char *p,*fn_;
- bool bH,bSRCID;
+ bool bH;
sprintf(ofn,"%s.bak",fn);
(strstr(line,"#define") != NULL) )
bH=TRUE;
} while ( ( (strstr(line,fn_) != NULL) ||
- (strstr(line,"static char *SRCID") != NULL) ||
(strlen(line)==0) ) && (!feof(in) ) );
getcwd(cwd,STRLEN);
- bSRCID = TRUE;
- /* Do not put source id's in include/types since some filenames are
- * be equal to those in include */
- if ((strlen(cwd)>strlen("types")) &&
- (!strcmp(cwd+strlen(cwd)-strlen("types"),"types")))
- bSRCID = FALSE;
- head(out,fn_,bH,bSRCID,"/*"," *"," */");
+ head(out,fn_,bH,"/*"," *"," */");
do {
fprintf(out,"%s\n",line);
} while (!feof(in) && fgets2(line,MAXS,in));
/* FILE *in,*out;
char ofn[1024],line[MAXS+1],line2[MAXS+1],cwd[1024];
char *p,*fn_,*ptr;
- bool bH,bSRCID;
+ bool bH;
sprintf(ofn,"%s.bak",fn);
- fprintf(stderr,"Processing %s (backed up to %s)\n",
- fn,ofn);
+ fprintf(stderr,"Processing %s (backed up to %s)\n",fn,ofn);
if (rename(fn,ofn) != 0) {
perror(ofn);
out=ffopen(fn,"w");
*/
/* Skip over empty lines in the beginning only */
- /*
- do {
- if (fgets2(line,MAXS,in))
- rtrim(line);
- } while ((strlen(line) == 0) && (!feof(in)));
- */
- /* Now we are at end of file, or we have a non-empty string */
- /*
- if (strlen(line) != 0) {
- strcpy(line2,line);
- trim(line2);
- while ((line2[0] == ';') && (!feof(in))) {
- fgets2(line,MAXS,in);
- strcpy(line2,line);
- trim(line2);
- }
- */
- /*
- fn_=strdup(fn);
- p=strchr(fn_,'.');
- if (p)
- p[0]='_';
- bH=FALSE;
- do {
- fgets2(line,MAXS,in);
- if ( (strstr(line,fn_) != NULL) &&
- (strstr(line,"#define") != NULL) )
- bH=TRUE;
- } while ( ( (strstr(line,fn_) != NULL) ||
- (strstr(line,"static char *SRCID") != NULL) ||
- (strlen(line)==0) ) && (!feof(in) ) );
- getcwd(cwd,STRLEN);
- bSRCID = TRUE;
- */
- /* Do not put source id's in include/types since some filenames are
- * be equal to those in include */
- /*if ((strlen(cwd)>strlen("types")) &&
- (strcmp(cwd+strlen(cwd)-strlen("types"),"types") == NULL))
- */
- /*
- bSRCID = FALSE;
- head(out,fn_,bH,bSRCID,";",";",";");
- do {
- fprintf(out,"%s\n",line);
- } while (!feof(in) && fgets2(line,MAXS,in));
- }
- fclose(in);
- fclose(out);
- */
+
}
void cr_tex(char *fn)
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_do_shift_c = "$Id$";
+
#include <stdlib.h>
#include "errno.h"
#include "sysstuff.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_dsspcore_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-/* ------------------------------------------------------------------ */
-/*
-
-DSSP version October 1988.
-This copy for Rudi Drunen at Univ_Groningen
-who have agreed to the following software license agreement:
-
-
-An academic license for the DSSP program
-((c) W. Kabsch, C. Sander and MPI-MF, 1983, 1985, 1988)
-is granted to in exchange for the following commitments:
-
-I hereby certify that
-
- (1) I am an academic user at an academic research institution. In
- using the software, I will respect the interests of the authors
- and their institutions.
-
- (2) I will not use the software in commercial activities without
- a written commercial license agreement; commercial activities
- include, in particular, work under contract from a commercial
- company.
-
- (3) I will not redistribute the software to others outside of my
- immediate research group. I will suggest to other interested
- research groups to contact the authors directly.
-
- (4) I will not alter or suppress the run-time copyright message.
-
- (5) I will acknowledge the program authors on any publication of
- scientific results based in part on use of the program and
- cite the article in which the program was described.
-
- (6) I will report evidence of program bugs to the authors.
-
- (7) I will send the source code of any bug corrections and program
- extensions, major or minor, to the original authors, for free
- academic use. If I have made major extensions which are incor-
- porated by the authors, I reserve the right to be appropriately
- included in any future commercial license agreement.
-
- (8) I will not extract part of the software, e.g. modules or sub-
- routines, for use in other contexts without permission by the
- authors.
-
- (9) I will not use the program in the context of classified research.
-*/
-/* PREVIOUS RELEASE: VERSION OCTOBER 1985 */
-/* PREVIOUS RELEASE: VERSION JUNE 1983 */
-/* LANGUAGE: STANDARD PASCAL WITH 128 CHARACTER ASCII SET */
-/* AUTHORS AND COPYRIGHT (1983,1985,1988):
- Wolfgang Kabsch and Chris Sander, Max Planck Institut
- fuer Medizinische Forschung, Jahnstr. 29, 6900 Heidelberg, Germany
- Telephone: +49-6221-486 276 Telex: 461505 mpimf d
- Bitnet: KABSCH@EMBL
- Current address for Chris Sander:
- Biocomputing, EMBL, 6900 Heidelberg, Germany
- Telephone: +49-6221-387 361 Telex: 461613 embl d
- Telefax: +49-6221-387 306
- Bitnet: SANDER@EMBL
- Do report errors if you find any.
- Reference: Kabsch,W. and Sander,C. (1983) Biopolymers 22, 2577-2637*/
-/*--------------------------------------------------------------------*/
-/* DEFINES SECONDARY STRUCTURE AND SOLVENT EXPOSURE OF PROTEINS FROM
- ATOMIC COORDINATES AS GIVEN BY THE BROOKHAVEN PROTEIN DATA BANK. */
-/*--------------------------------------------------------------------*/
-/* This program including sample input and output files for dataset 1PPT
- is available from the authors in exchange for an academic or
- commercial license agreement. The program is no longer available
- from the Brookhaven Protein Data Bank */
-/*--------------------------------------------------------------------*/
-/* CORRECTION AND MODIFICATION LOG SINCE JUNE 1983 */
-/* (1) MODIFICATIONS THAT AFFECT OUTPUT ON FILE TAPEOUT FOR AT LEAST ONE
- OF THE 62 PROTEIN DATA SETS IN THE 1983 BIOPOLYMERS PAPER:
- - SIDECHAIN ATOMS MORE THAN MAXDIST ANGSTROM DISTANT FROM ATOM CA ARE
- DECLARED ILLEGAL AND IGNORED. OUTPUT CHANGE: ACCESSIBILITY VALUES
- FOR ASN 76 OF 1SBT (ILLEGAL ATOM OD1) AND PRO 49 OF 156B (ILLEGAL
- ATOM UNK).
- - ANY RESIDUE WITH INCOMPLETE BACKBONE IS IGNORED. OUTPUT CHANGE:
- CHAIN BREAK BETWEEN RESIDUE SER 11 AND ILE 16 IN 2GCH
- (DUE TO INCOMPLETE COORDINATES FOR SER 11) IS NOW CORRECT.
- (2) MODIFICATIONS THAT DO NOT AFFECT OUTPUT ON FILE TAPEOUT FOR ANY
- OF THE 62 PROTEIN DATA SETS IN THE 1983 BIOPOLYMERS PAPER:
- - SPELLING OF FLAGCHIRALITY AND TESTSSBOND CORRECTED.
- - WARNING MESSAGE FOR RESIDUES WITH NON-STANDARD NUMBER OF
- SIDECHAIN ATOMS HAS BEEN ADDED. FOR EXAMPLE, THIS ALERTS THE USER
- TO BAD DATA FOR RESIDUES 8,12,21,24 AND 44 OF DATA SET 2RXN.
- - WARNING MESSAGE FOR RESIDUES IGNORED DUE TO NON-STANDARD RESIDUE
- NAME SUCH AS 'ACE' AND 'FOR' HAS BEEN ADDED.
- - WARNING MESSAGE FOR ALTERNATE ATOM LOCATION IDENTIFIER HAS BEEN
- ADDED. FOR EXAMPLE, THE USER IS NOW WARNED THAT ATOM CH2 IN ANY
- TRP OF DATA SET 1APP IS IGNORED DUE TO BAD ALTERNATE LOCATION
- IDENTIFIER '2'.
- WE THANK STEVEN SHERIFF, FRANCOIS COLONNA AND JOHN MOULT FOR
- REPORTING PROBLEMS AND STEVEN SHERIF, JANET THORNTON AND
- WILLIE TAYLOR FOR RESULTS OF TEST RUNS ON VAX COMPUTERS.
-
- Changes after 1985:
-
- - program speeded up by a factor of two or three by avoiding use
- of square root.
- - hydrogen atoms in data set ignored on input (H of NH of backbone
- is built as before)
- - 18-AUG-1988: CADIST=9.0, replacing CADIST=8.0. Has affected output
- for 63/300 proteins in a minor way. Thanks to Jean Richelle (Bruxelles)
- for pointing out this bug.
-
- Output changes due to change in parameter CADIST (8 to 9 Angstrom) :
- additional backbone-backbone Hbonds found with slight
- adjustments in secondary structure summary. In about 300 protein
- data sets from the Fall 1988 PDB release, 63 additional
- Hbonds were found, i.e. 0.2 Hbonds per protein (29 of type
- i,i+5; 16 of type i,i+4; 6 of type i,i+3; 10 in antiparallel beta
- bridges and 2 in a parallel beta bridge). These additional
- Hbonds affected the secondary structure summary of 26 of these
- protein data sets in a minor way, typically joining a 4-turn to
- an alpha-helix, changing a geometrical turn to a hydrogen-
- bonded turn or adding an extra residue pair to a beta ladder.
- The changes are (using _ for blank):
-
- [protein id, old secstruc summary > corrected summary]
-
- 1FC2_E > EE and _T > ET
- 1GP1GGG > HHH
- 1HBSS > T
- 1HDSS > T and GGGGGG > TTHHHH
- 1HFM__ > TT
- 1HKGSSS > TTT
- 1IG2S_ > TT
- 1LDX GGG > HTT
- 1MEV__ > TT and _BS > TBS and SSS > TTS
- 1PFCSSS > TTS
- 1PP2_E > EE and _S > ES
- 1RN3E_SS_E > EEEEEE and _E > EE (>3-res beta bulge)
- 1RNSsame as 1RN3
- 2ATCHH > TT
- 2CABB_ > EE
- 2CPPSS > TT and GGGGGG > HHHHTT
- 2LYZT > H
- 2MDHSSS > TTT
- 3CPA TTT > HHH
- 4CATTTT > HHH
- 4SBVS > T
- 5API_ > B
- 5CPATTT > HHH
- 7LYZS > H
- 8CAT_ > B and _ > B
- 8LYZT > H
-
- Note that this bugfix results in a small variation in the total
- number of Hbonds, compared to the variation which would
- result, say, from changing the (somewhat arbitrary) cutoff of
- -0.5 kcal/mol for the Hbond electrostatic potential energy. We
- cannot here solve the fundamental difficulty of arbitrary
- cutoffs involved in extracting binary classifications (an Hbond
- exists, yes/no) from real numbers (coordinates, energies).
- However, for most purposes the secondary structure summary agrees
- will with anyone's intuitive definition, especially for well-refined and
- high resolution structures. For a more clearcut assignment of protein
- substructure, we recommend using the detailed H-bond and other assignments
- in the columns following the summary column, i.e. columns 19-38 (xxx):
-
- ....;....1....;....2....;....3....;....4....;....5....;....6....;....7..
- xxxxxxxxxxxxxxxxxxxx
- .-- 3-turns/helix
- |.-- 4-turns/helix
- ||.-- 5-turns/helix
- |||.-- geometrical bend
- ||||.-- chirality
- |||||.-- beta bridge label
- ||||||.-- beta bridge label
- ||||||| .-- beta bridge partner resnum
- ||||||| | .-- beta bridge partner resnum
- ||||||| | |.-- beta sheet label
- ||||||| | || .-- solvent accessibility
- ||||||| | || |
- 35 47 I E + 0 0 2
- 36 48 R E > S- K 0 39C 97
- 37 49 Q T 3 S+ 0 0 86 (example from 1EST)
- 38 50 N T 3 S+ 0 0 34
- 39 51 W E < -KL 36 98C 6
- */
-/*--------------------------------------------------------------------*/
-/* GENERAL PROGRAM INSTALLATION GUIDE. */
-/* (1) THE PROGRAM REQUIRES THE FULL STANDARD ASCII 128 CHARACTER SET,
- IN PARTICULAR LOWER CASE LETTERS 'abcdefg....'.
- (2) STANDARD PASCAL MAY NOT RECOGNIZE REAL NUMBERS SUCH AS .1, +.1,
- -.1 ON INPUT. CHANGE TO 0.1,+0.1,-0.1.
- (3) THE NON-STANDARD PROCEDURE 'DATE' RETURNS THE CURRENT DAY, MONTH,
- AND YEAR. IF THE PROCEDURE IS NOT CALLED (LINE COMMENTED OUT)
- THE PSYCHEDELIC DATE DEC 24, 2001 IS RETURNED. YOU MAY REPLACE
- 'DATE' BY THE CORRESPONDING PROCEDURE FROM YOUR PASCAL
- IMPLEMENTATION. THE EXAMPLE GIVEN WORKS IN DEC VAX VMS 5.0.
- (4) DUE TO INCOMPATIBLE ASCII CODES, SQUARE BRACKETS '[' AND ']'
- MAY APPEAR AS '!','?' ETC. USE YOUR EDITOR TO CONVERT THESE. */
-/* INSTALLATION GUIDE FOR VAX/VMS USERS. */
-/* (1) THE /OPTIMIZE OPTION OF THE PASCAL COMPILER PRODUCED
- INCORRECT CODE ON THE VAX 8600 AT EMBL RUNNING UNDER VMS V4.2.
- LATER VERSIONS OF VMS (E.G. VMS 5.0) PRODUCED CORRECT CODE.
- IF IN DOUBT, COMPILE USING PASCAL /NOOPTIMIZE.
- (2) COPY BROOKHAVEN DATA BANK COORDINATE INPUT TO A FILE NAMED
- TAPEIN.DAT . OUTPUT WILL BE IN A FILE NAMED TAPEOUT.DAT */
-/* IMPLEMENTATION ON OTHER COMPUTERS */
-/* (1) NORD-500. EXECUTION TIME COMPARABLE TO VAX 780.
- (2) SUN-3. EXECUTION TIME COMPARABLE TO VAX 780.
- Compile using: pc -L
- in ORDER to map upper case letters in keywords
- and identifiers to lower case.
- (3) ATARI 520 ST. RUNS FACTOR 60 SLOWER THAN NORD-500 DUE TO
- SOFTWARE-EMULATED FLOATING POINT OPERATIONS ON MC68000. */
-/*--------------------------------------------------------------------*/
-/* INPUT/OUTPUT FILES. */
-/* INPUT: DEFAULT INPUT UNIT, E.G. YOUR TERMINAL
- OUTPUT: DEFAULT OUTPUT UNIT, E.G. YOUR TERMINAL,
- USED FOR RUN-TIME MESSAGES. WARNINGS AND ERRORS LOOK
- LIKE THIS: !!! TEXT !!!
- TAPEIN: FILE WITH PROTEIN DATA BANK COORDINATES, E.G. PDB3PTI.COO
- TAPEOUT: DSSP OUTPUT OF LINE LENGTH 128, E.G. PAPER PRINTER */
-/*--------------------------------------------------------------------*/
-/* DESCRIPTION OF OUTPUT ON FILE TAPEOUT:
- LINE LENGTH OF OUTPUT IS 128 CHARCTERS.
- FOR DEFINITONS, SEE ABOVE BIOPOLYMERS ARTICLE.
- IN ADDITION NOTE:
- HISTOGRAMS - E.G. 2 UNDER COLUMN '8' IN LINE 'RESIDUES PER ALPHA
- HELIX' MEANS: THERE ARE 2 ALPHA HELICES OF LENGTH 8
- RESIDUES IN THIS DATA SET.
- # RESIDUE AA STRUCTURE BP1 BP2 ACC ..ETC..FOR EACH RESIDUE I:
- # RESIDUE - TWO COLUMNS OF RESIDUE NUMBERS. FIRST COLUMN IS DSSP'S
- SEQUENTIAL RESIDUE NUMBER, STARTING AT THE FIRST
- RESIDUE ACTUALLY IN THE DATA SET AND INCLUDING CHAIN BREAKS;
- THIS NUMBER IS USED TO REFER TO RESIDUES THROUGHOUT. SECOND
- COLUMN GIVES CRYSTALLOGRAPHERS' 'RESIDUE SEQUENCE
- NUMBER','INSERTION CODE' AND 'CHAIN IDENTIFIER' (SEE PROTEIN
- DATA BANK FILE RECORD FORMAT MANUAL), GIVEN FOR REFERENCE
- ONLY AND NOT USED FURTHER..
- AA - ONE LETTER AMINO ACID CODE, LOWER CASE FOR SS-BRIDGE CYS.
- STRUCTURE - SEE BIOPOLYMERS
- BP1 BP2 - RESIDUE NUMBER OF FIRST AND SECOND BRIDGE PARTNER
- FOLLOWED BY ONE LETTER SHEET LABEL
- ACC - NUMBER OF WATER MOLECULES IN CONTACT WITH THIS RESIDUE *10.
- OR RESIDUE WATER EXPOSED SURFACE IN ANGSTROM**2.
- N-H-->O ETC. - HYDROGEN BONDS. E.G. -3,-1.4 MEANS: IF THIS RESIDUE
- IS RESIDUE I THEN N-H OF I IS H-BONDED TO C=O OF I-3
- WITH AN ELECTROSTATIC H-BOND ENERGY OF -1.4 KCAL/MOL.
- TCO - COSINE OF ANGLE BETWEEN C=O OF RESIDUE I AND C=O OF
- RESIDUE I-1. FOR ALPHA-HELICES, TCO IS NEAR +1, FOR
- BETA-SHEETS TCO IS NEAR -1. NOT USED FOR STRUCTURE
- DEFINITION.
- KAPPA - VIRTUAL BOND ANGLE (BEND ANGLE) DEFINED BY THE THREE
- C-ALPHA ATOMS OF RESIDUES I-2,I,I+2. USED TO DEFINE
- BEND (STRUCTURE CODE 'S').
- ALPHA - VIRTUAL TORSION ANGLE (DIHEDRAL ANGLE) DEFINED BY THE FOUR
- C-ALPHA ATOMS OF RESIDUES I-1,I,I+1,I+2. USED TO DEFINE
- CHIRALITY (STRUCTURE CODE '+' OR '-').
- PHI PSI - IUPAC PEPTIDE BACKBONE TORSION ANGLES
- X-CA Y-CA Z-CA - ECHO OF C-ALPHA ATOM COORDINATES */
-/*--------------------------------------------------------------------*/
-/* WORDS OF CAUTION */
-/* THE VALUES FOR SOLVENT EXPOSURE MAY NOT MEAN WHAT YOU THINK!
- (A) EFFECTS LEADING TO LARGER THAN EXPECTED VALUES:
- SOLVENT EXPOSURE CALCULATION IGNORES UNUSUAL RESIDUES, LIKE ACE,
- OR RESIDUES WITH INCOMPLETE BACKBONE, LIKE ALA 1 OF DATA SET 1CPA.
- IT ALSO IGNORES HETATOMS, LIKE A HEME OR METAL LIGANDS.
- ALSO, SIDE CHAINS MAY BE INCOMPLETE (AN ERROR MESSAGE IS WRITTEN).
- (B) EFFECTS LEADING TO SMALLER THAN EXPECTED VALUES:
- IF YOU APPLY THIS PROGRAM TO PROTEIN DATA BANK DATA SETS
- CONTAINING OLIGOMERS, SOLVENT EXPOSURE IS FOR THE ENTIRE ASSEMBLY,
- NOT FOR THE MONOMER. ALSO, ATOM OXT OF C-TERMINAL RESIDUES IS
- TREATED LIKE A SIDE CHAIN ATOM IF IT IS LISTED AS PART OF THE LAST
- RESIDUE. ALSO, PEPTIDE SUBSTRATES, WHEN LISTED AS ATOMS RATHER THAN
- HETATOMS, ARE TREATED AS PART OF THE PROTEIN, E.G. RESIDUES 499 S
- AND 500 S IN 1CPA. */
-/* UNKNOWN OR UNUSUAL RESIDUES ARE NAMED X ON OUTPUT AND THEY ARE
- NOT CHECKED FOR STANDARD NUMBER OF SIDECHAIN ATOMS. */
-/* ALL EXPLICIT WATER MOLECULES, LIKE OTHER HETATOMS, ARE IGNORED. */
-/* END OF INTRODUCTORY COMMENTS */
-/**********************************************************************/
-
-
/************************************************************
* *
* p2c.h *
exit(EXIT_FAILURE);
fprintf(stderr, "%s\n", _ShowEscape(buf, P_escapecode, P_ioresult, ""));
exit(EXIT_FAILURE);
+ return 0;
}
int _EscIO(code)
backbone *WITH;
WITH = &chain[i];
- return (WITH->acceptor[0].residue == j && WITH->acceptor[0].energy < HBHIGH ||
- WITH->acceptor[1].residue == j && WITH->acceptor[1].energy < HBHIGH);
+ return ((WITH->acceptor[0].residue == j && WITH->acceptor[0].energy < HBHIGH) ||
+ (WITH->acceptor[1].residue == j && WITH->acceptor[1].energy < HBHIGH));
} /* Testbond */
switch (WITH->btyp) {
case parallel:
- bulge = (jb1 - WITH->je < 6 && ib1 - WITH->ie < 3 ||
- jb1 - WITH->je < 3) & Nochainbreak(WITH->je, jb1);
+ bulge = ((jb1 - WITH->je < 6 && ib1 - WITH->ie < 3) ||
+ (jb1 - WITH->je < 3) & Nochainbreak(WITH->je, jb1));
break;
case antiparallel:
- bulge = (WITH->jb - je1 < 6 && ib1 - WITH->ie < 3 ||
- WITH->jb - je1 < 3) & Nochainbreak(je1, WITH->jb);
+ bulge = ((WITH->jb - je1 < 6 && ib1 - WITH->ie < 3) ||
+ (WITH->jb - je1 < 3) & Nochainbreak(je1, WITH->jb));
+ break;
+ default:
+ printf("Uh-oh.. this shouln't happen..\n");
+ exit(0);
break;
}
}
ie2 = bridgetable[l2 - 1].ie;
jb2 = bridgetable[l2 - 1].jb;
je2 = bridgetable[l2 - 1].je;
- return (ie1 >= ib2 && ib1 <= ie2 || ie1 >= jb2 && ib1 <= je2 ||
- je1 >= ib2 && jb1 <= ie2 || je1 >= jb2 && jb1 <= je2);
+ return ((ie1 >= ib2 && ib1 <= ie2) || (ie1 >= jb2 && ib1 <= je2) ||
+ (je1 >= ib2 && jb1 <= ie2) || (je1 >= jb2 && jb1 <= je2));
} /* Link */
/***/
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_ehanal_c = "$Id$";
+
#include <stdlib.h>
#include <math.h>
#include <string.h>
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_ehdata_c = "$Id$";
+
#include <stdlib.h>
#include <math.h>
#include "typedefs.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_ehdata_h = "$Id$";
+
extern real get_omega(real ekin,int *seed,FILE *fp,char *fn);
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_ehole_c = "$Id$";
+
#include <stdlib.h>
#include <math.h>
#include <string.h>
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_g_anavel_c = "$Id$";
+
#include "sysstuff.h"
#include "smalloc.h"
#include "macros.h"
FILE *fp;
int *npts,nmax;
int status;
- int i,j,idum,step,nframe=0,natoms,index;
- real t,temp,rdum,hboxx,hboxy,scale,xnorm;
+ int i,j,idum,step,nframe=0,index;
+ real temp,rdum,hboxx,hboxy,scale,xnorm=0;
real **profile=NULL;
real *t_x=NULL,*t_y,hi=0;
- rvec *x,*v;
t_topology *top;
int d,m,n;
matrix box;
atom_id *sysindex;
bool bHaveV,bReadV;
t_rgb rgblo = { 0, 0, 1 },rgbhi = { 1, 0, 0 };
-
+ int flags = TRX_READ_X | TRX_READ_V;
+ t_trxframe fr;
+
CopyRight(stderr,argv[0]);
parse_common_args(&argc,argv,PCA_CAN_TIME | PCA_BE_NICE ,NFILE,fnm,
asize(pa),pa,asize(desc),desc,0,NULL);
top = read_top(ftp2fn(efTPX,NFILE,fnm));
-
- natoms = read_first_x_v(&status,ftp2fn(efTRN,NFILE,fnm),&t,&x,&v,box);
-
+
+ read_first_frame(&status,ftp2fn(efTRX,NFILE,fnm),&fr,flags);
+
if (xmax > 0) {
scale = 5;
nmax = xmax*scale;
srenew(profile,++nframe);
snew(profile[nframe-1],nmax+1);
srenew(t_x,nframe);
- t_x[nframe-1] = t*1000;
+ t_x[nframe-1] = fr.time*1000;
hboxx = box[XX][XX]/2;
hboxy = box[YY][YY]/2;
- for(i=0; (i<natoms); i++) {
+ for(i=0; (i<fr.natoms); i++) {
/* determine position dependent on mode */
switch (mode) {
case 0:
- xnorm = sqrt(sqr(x[i][XX]-hboxx) + sqr(x[i][YY]-hboxy));
+ xnorm = sqrt(sqr(fr.x[i][XX]-hboxx) + sqr(fr.x[i][YY]-hboxy));
break;
default:
fatal_error(0,"Unknown mode %d",mode);
}
index = xnorm*scale;
if (index <= nmax) {
- temp = top->atoms.atom[i].m*iprod(v[i],v[i])/(2*BOLTZ);
+ temp = top->atoms.atom[i].m*iprod(fr.v[i],fr.v[i])/(2*BOLTZ);
if (temp > hi)
hi = temp;
npts[index]++;
profile[nframe-1][i] /= npts[i];
npts[i] = 0;
}
- } while (read_next_x_v(status,&t,natoms,x,v,box));
- close_trn(status);
+ } while (read_next_frame(status,&fr));
+ close_trx(status);
fp = ftp2FILE(efXPM,NFILE,fnm,"w");
write_xpm(fp,"Temp. profile","T (a.u.)",
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_glasmd_c = "$Id$";
+
#include <stdio.h>
#include <string.h>
#include <time.h>
construct_dummies(log,x,&mynrnb,parm->ir.delta_t,v,&top->idef);
/* Set values for invmass etc. */
- init_mdatoms(mdatoms,lambda,FALSE);
+ if (parm->ir.bPert)
+ init_mdatoms(mdatoms,lambda,FALSE);
/*init_forcerec(log,fr,&(parm->ir),&(top->blocks[ebMOLS]),cr,
&(top->blocks[ebCGS]),&(top->idef),mdatoms,parm->box,FALSE);
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_hexamer_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include <ctype.h>
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_hrefify_c = "$Id$";
+
#include <math.h>
-#include <string.h>
+#include <string.h>
+#include <ctype.h>
#include "smalloc.h"
#include "typedefs.h"
#include "macros.h"
#include "statutil.h"
#include "copyrite.h"
#include "pdbio.h"
+#include "strdb.h"
bool isword(char c)
{
char *strstr_href(char *line,bool *bInHREF,int *i_dat,int n_dat,char **dat)
{
- char *start,*found,*href;
+ char *start,*found,*href=NULL;
bool bIn;
int i;
i=0;
while((i<n_dat) && !found) {
found=strncasestr(start,dat[i]);
- if (found)
+ if (found) {
if (href && (found>href))
found=NULL;
- else
+ else {
if (((found!=start) && isword(found[-1])) ||
isword(found[strlen(dat[i])]))
found=NULL;
else
*i_dat=i;
- i++;
+ }
+ i++;
+ }
}
}
} while (strlen(start) && !found && href);
static char *in=NULL,*out=NULL,*excl=NULL,*link_text=NULL;
static bool peratom=FALSE;
t_pargs pa[] = {
- { "-f", FALSE, etSTR, &in, "HTML input" },
- { "-o", FALSE, etSTR, &out, "HTML output" },
- { "-e", FALSE, etSTR, &excl, "Exclude a string from HREF's, "
+ { "-f", FALSE, etSTR, { &in } , "HTML input" },
+ { "-o", FALSE, etSTR, { &out } , "HTML output" },
+ { "-e", FALSE, etSTR, { &excl } , "Exclude a string from HREF's, "
"when this option is not set, the filename without path and extension "
"will be excluded from HREF's"},
- { "-t", FALSE, etSTR, &link_text, "Insert a string in front of the "
+ { "-t", FALSE, etSTR, { &link_text } , "Insert a string in front of the "
"href file name, useful for scripts" }
};
strcpy(word,ref);
word[ptr-ref+strlen(str[i_str])]='\0';
strcpy(end,ptr+strlen(str[i_str]));
- sprintf(line,"%s<a href=\"%s%s.html\">%s</a>%s\0",
+ sprintf(line,"%s<a href=\"%s%s.html\">%s</a>%s",
start,link_text,str[i_str],word,end);
fprintf(stderr,"line %d: %s\n",l+1,str[i_str]);
n_repl++;
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_mk6_n_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_mkice_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "typedefs.h"
#define NFILE asize(fnm)
FILE *fp;
- char *fn;
+ char *fn,quote[256];
int i,j,k,n,nmax,m,natom,natmol;
t_atoms *pdba;
t_atoms atoms;
nx,ny,nz,odist,hdist);
fprintf(fp,"REMARK Density of this crystal is %g (g/l)\n",
density(pdba,boxje));
- write_pdbfile(fp,bromacs(),pdba,xx,boxje,' ',-1);
+ write_pdbfile(fp,bromacs(quote,255),pdba,xx,boxje,' ',-1);
fclose(fp);
}
else {
- write_sto_conf(fn,bromacs(),pdba,xx,NULL,boxje);
+ write_sto_conf(fn,bromacs(quote,255),pdba,xx,NULL,boxje);
}
if (ftp2bSet(efTRN,NFILE,fnm))
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_mkyaw_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include <ctype.h>
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_my_dssp_c = "$Id$";
+
#define MY_DSSP
#include "../tools/do_dssp.c"
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_options_c = "$Id$";
+
#include "typedefs.h"
#include "macros.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_optwat_c = "$Id$";
+
+#include <string.h>
#include "typedefs.h"
#include "smalloc.h"
#include "vec.h"
char **nms=NULL;
int nre,step,ndr,i;
real t;
- t_energy *ener;
+ t_enxframe fr;
fp_ene = open_enx(enx,"r");
do_enxnms(fp_ene,&nre,&nms);
- snew(ener,nre);
/* Read until the last frame */
- while (do_enx(fp_ene,&t,&step,&nre,ener,&ndr,NULL));
+ while (do_enx(fp_ene,&fr));
close_enx(fp_ene);
- *epot = ener[eindex].e;
+ *epot = fr.ener[eindex].e;
for(i=pindex; (i<pindex+9); i++)
- P[i-pindex] = ener[i].e;
+ P[i-pindex] = fr.ener[i].e;
sfree(ener);
}
asize(desc),desc,0,NULL);
/* Read initial topology and coordaintes etc. */
- read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&sh);
+ read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&sh,TRUE,NULL,NULL);
snew(xx,sh.natoms);
snew(vv,sh.natoms);
read_tpx(ftp2fn(efTPX,NFILE,fnm),&step,&t,&lambda,&ir,box,&natoms,
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_prfn_c = "$Id$";
+
#include "filenm.h"
#include "futil.h"
#include "wman.h"
}
-void main()
+int main()
{
FILE *out;
out=ffopen("files.html","w");
pr_htmldefs(out);
fclose(out);
+
+ return 0;
}
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_sigeps_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "typedefs.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_test_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "typedefs.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_3dview_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "smalloc.h"
return TRUE;
}
-void rotate_3d(t_3dview *view,int axis,bool bPositive)
+void init_rotate_3d(t_3dview *view)
{
- static bool bFirst=TRUE;
- static mat4 RotP[DIM];
- static mat4 RotM[DIM];
- int i,j;
- mat4 m4;
-
- if (bFirst) {
- real rot=DEG2RAD*15;
-
- for(i=0; (i<DIM); i++) {
- rotate(i, rot ,RotP[i]);
- rotate(i,(real)(-rot),RotM[i]);
+ real rot=DEG2RAD*15;
+ int i;
+
+ for(i=0; (i<DIM); i++) {
+ rotate(i, rot ,view->RotP[i]);
+ rotate(i,(real)(-rot),view->RotM[i]);
#ifdef DEBUG
- print_m4(debug,"RotP",RotP[i]);
- print_m4(debug,"RotM",RotM[i]);
+ print_m4(debug,"RotP",view->RotP[i]);
+ print_m4(debug,"RotM",view->RotM[i]);
#endif
- }
}
+}
+
+
+void rotate_3d(t_3dview *view,int axis,bool bPositive)
+{
+ int i,j;
+ mat4 m4;
- /*
- if (bPositive)
- m4_op(RotP[axis],view->eye,v4);
- else
- m4_op(RotM[axis],view->eye,v4);
- for(i=0; (i<DIM); i++)
- view->eye[i]=v4[i];
- */
if (bPositive)
- mult_matrix(m4,view->Rot,RotP[axis]);
+ mult_matrix(m4,view->Rot,view->RotP[axis]);
else
- mult_matrix(m4,view->Rot,RotM[axis]);
+ mult_matrix(m4,view->Rot,view->RotM[axis]);
for(i=0; (i<N); i++)
for(j=0; (j<N); j++)
view->Rot[i][j]=m4[i][j];
/* Initiate the matrix */
unity_m4(view->Rot);
calculate_view(view);
+
+ init_rotate_3d(view);
}
t_3dview *init_view(matrix box)
libgmx@LIBSUFFIX@_la_SOURCES = \
3dview.c atomprop.c block_tx.c bondfree.c \
- buffer.c calcgrid.c calch.c inner.h \
+ calcgrid.c calch.c inner.h \
confio.c copyrite.c disre.c do_fit.c \
enxio.c ewald_util.c fatal.c ffscanf.c \
filenm.c futil.c gbutil.c fnbf.c \
gmxfio.c ifunc.c index.c cinvsqrtdata.c \
invblock.c macros.c orires.c gmx_system_xdr.c \
- main.c maths.c matio.c memdump.c \
+ main.c maths.c matio.c \
mshift.c mvdata.c mvxvf.c names.c \
network.c nrama.c nrjac.c nrnb.c \
pargs.c pbc.c pdbio.c princ.c \
trnio.c trxio.c txtdump.c typedefs.c \
viewit.c wgms.c wman.c writeps.c \
xdrd.c xtcio.c xvgr.c replace.h \
- detectcpu.c libxdrf.c vec.c xmlio.c
+ detectcpu.c libxdrf.c vec.c xmlio.c \
+ dihres.c
EXTRA_libgmx@LIBSUFFIX@_la_SOURCES = \
x86_sse.s x86_sse2.s x86_3dnow.s inner_altivec.c \
/*
* $Id$
*
- * This source code is part of
+ * This source code ispart of
*
* G R O M A C S
*
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_atomprop_c = "$Id$";
+
#include <ctype.h>
#include "sysstuff.h"
#include "smalloc.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_block_tx_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include "network.h"
#include "block_tx.h"
#include "fatal.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_bondfree_c = "$Id$";
+
#include <math.h>
#include "assert.h"
#include "physics.h"
#include "vec.h"
-#include "vveclib.h"
#include "maths.h"
#include "txtdump.h"
#include "bondf.h"
return vtot;
}
+
+
real idihs(int nbonds,
t_iatom forceatoms[],t_iparams forceparams[],
rvec x[],rvec f[],t_forcerec *fr,t_graph *g,
t_fcdata *fcd)
{
int i,type,ai,aj,ak,al;
- real phi,cos_phi,ddphi,sign,vid,vtot;
+ real phi,phi0,cos_phi,ddphi,sign,vtot;
rvec r_ij,r_kj,r_kl,m,n;
-
+ real L1,kk,dp,dp2,kA,kB,pA,pB,dvdl;
+
+ L1 = 1.0-lambda;
+ dvdl = 0;
+
vtot = 0.0;
for(i=0; (i<nbonds); ) {
type = forceatoms[i++];
phi=dih_angle(box,x[ai],x[aj],x[ak],x[al],r_ij,r_kj,r_kl,m,n,
&cos_phi,&sign); /* 84 */
- *dvdlambda += harmonic(forceparams[type].harmonic.krA,
- forceparams[type].harmonic.krB,
- forceparams[type].harmonic.rA*DEG2RAD,
- forceparams[type].harmonic.rB*DEG2RAD,
- phi,lambda,&vid,&ddphi); /* 21 */
+ /* phi can jump if phi0 is close to Pi/-Pi, which will cause huge
+ * force changes if we just apply a normal harmonic.
+ * Instead, we first calculate phi-phi0 and take it modulo (-Pi,Pi).
+ * This means we will never have the periodicity problem, unless
+ * the dihedral is Pi away from phiO, which is very unlikely due to
+ * the potential.
+ */
+ kA = forceparams[type].harmonic.krA;
+ kB = forceparams[type].harmonic.krB;
+ pA = forceparams[type].harmonic.rA;
+ pB = forceparams[type].harmonic.rB;
+
+ phi0 = L1*kA+lambda*kB;
+ kk = (L1*pA+lambda*pB)*DEG2RAD;
+
+ /* dp = (phi-phi0), modulo (-pi,pi) */
+ dp = phi-phi0;
+ /* dp cannot be outside (-2*pi,2*pi) */
+ if(dp>=M_PI)
+ dp -= 2*M_PI;
+ else if(dp<-M_PI)
+ dp += 2*M_PI;
+
+ dp2 = dp*dp;
+
+ vtot += 0.5*kk*dp2;
+ ddphi = -kk*dp;
+
+ dvdl += 0.5*(kB-kA)*dp2 + (pA-pB)*kk*dp;
- vtot += vid;
do_dih_fup(ai,aj,ak,al,(real)(-ddphi),r_ij,r_kj,r_kl,m,n,
f,fr,g,x); /* 112 */
/* 217 TOTAL */
ai,aj,ak,al,cos_phi,phi);
#endif
}
+
+ *dvdlambda += dvdl;
return vtot;
}
+
real posres(int nbonds,
t_iatom forceatoms[],t_iparams forceparams[],
rvec x[],rvec f[],t_forcerec *fr,t_graph *g,
lambda,dvdlambda,TRUE);
}
+
real unimplemented(int nbonds,
t_iatom forceatoms[],t_iparams forceparams[],
rvec x[],rvec f[],t_forcerec *fr,t_graph *g,
t_mdatoms *md,int ngrp,real egnb[],real egcoul[],
t_fcdata *fcd)
{
- static const real c0=0.0,c1=1.0,c2=2.0,c3=3.0,c4=4.0,c5=5.0;
+ const real c0=0.0,c1=1.0,c2=2.0,c3=3.0,c4=4.0,c5=5.0;
int type,ai,aj,ak,al,i,j;
rvec r_ij,r_kj,r_kl,m,n;
real parmA[NR_RBDIHS];
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_calcgrid_c = "$Id$";
#include "typedefs.h"
#include "smalloc.h"
#include "fatal.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_calch_c = "$Id$";
#include "macros.h"
#include "calch.h"
#include "maths.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_cinvsqrtdata_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* just put something here to avoid empty file warnings */
-int cinvsqrtdata_stub;
+const int cinvsqrtdata_stub;
#ifdef SOFTWARE_INVSQRT
const unsigned int cinvsqrtexptab[256] = {
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_confio_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
char resnm[6],nm[6],format[100];
int ai,i,resnr,l,vpr;
- fprintf (out,"%s\n",(title && title[0])?title:bromacs());
+ fprintf (out,"%s\n",(title && title[0])?title:bromacs(format,99));
fprintf (out,"%5d\n",nx);
/* build format string for printing,
something like "%8.3f" for x and "%8.4f" for v */
void get_stx_coordnum(char *infile,int *natoms)
{
FILE *in;
- int ftp;
+ int ftp,tpxver,tpxgen;
t_trxframe fr;
ftp=fn2ftp(infile);
case efTPR: {
t_tpxheader tpx;
- read_tpxheader(infile,&tpx);
+ read_tpxheader(infile,&tpx,TRUE,&tpxver,&tpxgen);
*natoms = tpx.natoms;
break;
}
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_copyrite_c = "$Id$";
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef USE_THREADS
+#include <pthread.h>
+#endif
+/* This file is completely threadsafe - keep it that way! */
+
#include <string.h>
#include <ctype.h>
#include "sysstuff.h"
fprintf(out,"\n");
}
+
bool be_cool(void)
{
- static int cool=-1;
+ int cool=-1;
char *envptr;
-
+
+ /* Yes, it is bad to check the environment variable every call,
+ * but we dont call this routine often, and it avoids using
+ * a mutex for locking the variable...
+ */
if (cool == -1) {
envptr=getenv("IAMCOOL");
else
cool=1;
}
+
return cool;
}
void f(char *a){int i;for(i=0;i<(int)strlen(a);i++)a[i]=~a[i]; }
-static void sp_print(FILE *out,char *s)
+static void sp_print(FILE *out,const char *s)
{
int slen;
fprintf(out,"%s\n",s);
}
-static void ster_print(FILE *out,char *s)
+static void ster_print(FILE *out,const char *s)
{
int slen;
char buf[128];
fprintf(out,"%s\n",buf);
}
-static int nran=0;
-static char *pukeit(char *db,char *defstring)
+static char *pukeit(char *db,char *defstring, char *retstring, int retsize, int *cqnum)
{
- static char hulp[STRLEN];
FILE *fp;
char **help;
int i,nhlp;
int seed;
-
+
if (!be_cool())
return defstring;
else if ((fp = low_libopen(db,FALSE)) != NULL) {
nhlp=fget_lines(fp,&help);
fclose(fp);
seed=time(NULL);
- nran=nhlp*rando(&seed);
- if (strlen(help[nran]) >= STRLEN)
- help[nran][STRLEN-1] = '\0';
- strcpy(hulp,help[nran]);
- f(hulp);
+ *cqnum=nhlp*rando(&seed);
+ if (strlen(help[*cqnum]) >= STRLEN)
+ help[*cqnum][STRLEN-1] = '\0';
+ strncpy(retstring,help[*cqnum],retsize);
+ f(retstring);
for(i=0; (i<nhlp); i++)
sfree(help[i]);
sfree(help);
-
- return hulp;
+ return retstring;
}
else
return defstring;
}
-char *bromacs(void)
+
+char *bromacs(char *retstring, int retsize)
{
+ int dum;
+
return pukeit("bromacs.dat",
- "Groningen Machine for Chemical Simulation");
+ "Groningen Machine for Chemical Simulation",
+ retstring,retsize,&dum);
}
-char *cool_quote(void)
+
+char *cool_quote(char *retstring, int retsize, int *cqnum)
{
- static char buf[1024];
+ char tmpstr[1024];
char *s,*ptr;
+ int tmpcq,*p;
+
+ if(cqnum!=NULL)
+ p=cqnum;
+ else
+ p=&tmpcq;
/* protect audience from explicit lyrics */
- s = pukeit("gurgle.dat","Thanx for Using GROMACS - Have a Nice Day");
+ pukeit("gurgle.dat","Thanx for Using GROMACS - Have a Nice Day",
+ tmpstr,1024,p);
- if (be_cool() && ((ptr=strchr(s,'_')) != NULL)) {
+ if (be_cool() && ((ptr=strchr(tmpstr,'_')) != NULL)) {
*ptr='\0';
ptr++;
- sprintf(buf,"\"%s\" %s",s,ptr);
+ sprintf(retstring,"\"%s\" %s",tmpstr,ptr);
}
else {
- strcpy(buf,s);
+ strncpy(retstring,tmpstr,1023);
}
- return buf;
+ return retstring;
}
void CopyRight(FILE *out,char *szProgram)
#define NCR (int)asize(CopyrightText)
#define NGPL (int)asize(GPLText)
- char buf[256];
+ char buf[256],tmpstr[1024];
+
char *ptr;
int i;
ster_print(out,"G R O M A C S");
fprintf(out,"\n");
- ptr=bromacs();
+ ptr=bromacs(tmpstr,1023);
sp_print(out,ptr);
fprintf(out,"\n");
fprintf(out,"\n");
fprintf(out,"\n");
+
sp_print(out,"PLEASE NOTE: THIS IS A BETA VERSION\n");
fprintf(out,"\n");
void thanx(FILE *fp)
{
+ char tmpbuf[1024];
char *cq,*c;
+ int cqnum;
/* protect the audience from suggestive discussions */
- cq=cool_quote();
+ cq=cool_quote(tmpbuf,1023,&cqnum);
if (be_cool()) {
snew(c,strlen(cq)+20);
- sprintf(c,"gcq#%d: %s\n",nran,cq);
+
+ sprintf(c,"gcq#%d: %s\n",cqnum,cq);
+
fprintf(fp,"\n%s\n",c);
sfree(c);
}
fflush(fp);
}
-char *GromacsVersion()
+/* This routine only returns a static (constant) string, so we use a
+ * mutex to initialize it. Since the string is only written to the
+ * first time, there is no risk with multiple calls overwriting the
+ * output for each other.
+ */
+const char *GromacsVersion()
{
- static bool bFirst=TRUE;
- static char ver_string[100];
- /* The version number is defined by the autoconf scripts */
- if(bFirst) {
- sprintf(ver_string,"VERSION %s",VERSION);
- bFirst=FALSE;
- }
+ /* Concatenate the version info during preprocessing */
+ static const char ver_string[]="VERSION " VERSION;
return ver_string;
}
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_crecipdata_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* just put something here to avoid empty file warnings */
-int crecipdata_stub;
+const int crecipdata_stub;
#ifdef SOFTWARE_RECIP
const unsigned int crecipexptab[256] = {
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_debugb_h = "$Id$";
+
#ifndef DEBUG
#define DEBUG_BOND(log,x,ai,aj,dx,dr2,dr,bondparams,delta_r,vbond,fbond,fij)
#define DEBUG_ANGLE_UPD(log,f_i,f_j,f_k)
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_detectcpu_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+
+/* This file is completely threadsafe - keep it that way! */
+
+#ifdef USE_THREADS
+#include <pthread.h>
+#endif
+
#include <stdlib.h>
#include <stdio.h>
#include <detectcpu.h>
+/* This file uses some global variables to catch illegal instruction
+ * signals from the operating system. To make it thread-safe, we use
+ * a global mutex which is locked immediately when the detect_cpu()
+ * routine is called (if we use threads). Do NOT call any of the
+ * lower-level CPU detection routines directly, since these do not
+ * lock the mutex.
+ */
+
#if (defined USE_X86_SSE_AND_3DNOW || defined USE_X86_SSE2 || defined USE_PPC_ALTIVEC)
/* We use some special posix-style long jumps in
* be clobbered by the longjmp. We get rid of this
* warning by making them global...
*/
-static int cpuSSE,cpuSSE2,cpu3DNow,doSSE,doSSE2,do3DNow,cpuflags;
-static int cpuAltivec;
+
+#ifdef USE_THREADS
+static pthread_mutex_t detectcpu_mutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
static jmp_buf mainloop;
static int success=1;
* to perform the extensive tests like for x86 to recommend
* users to upgrade. Just check if an instruction works!
*/
- cpuflags=cpuAltivec=0;
+ int cpuAltivec=0;
+ int cpuflags=0;
/* if we got here, its ppc! */
cpuflags |= PPC_CPU;
static int detect_sse2(FILE *log)
{
unsigned long eax,ebx,ecx,edx;
+ int cpuflags=0;
- cpuSSE2=doSSE2=cpuflags=0;
-
- if(log)
- fprintf(log,"\nTesting x86 processor CPUID...\n");
/* start by trying to issue the cpuid instruction */
success=1;
signal(SIGILL,sigill_handler);
/* for SSE support, bit 25 of edx should be set */
x86_cpuid(1,&eax,&ebx,&ecx,&edx);
if(edx & FLAGS_SUPPORT_SSE2) {
- cpuSSE2=1;
cpuflags |= CPU_SSE2_SUPPORT;/* CPU ok, but OS might not be */
/* try it */
success=1;
setjmp(mainloop); /* return to this point if we get SIGILL */
if(success) {
checksse2();
- doSSE2=1;
cpuflags |= X86_SSE2_SUPPORT;
}
}
{
unsigned long eax,ebx,ecx,edx;
- cpuSSE=doSSE=cpuflags=0;
+ int cpuflags=0;
- if(log)
- fprintf(log,"\nTesting x86 processor CPUID...\n");
/* start by trying to issue the cpuid instruction */
success=1;
signal(SIGILL,sigill_handler);
/* for SSE support, bit 25 of edx should be set */
x86_cpuid(1,&eax,&ebx,&ecx,&edx);
if(edx & FLAGS_SUPPORT_SSE) {
- cpuSSE=1;
cpuflags |= CPU_SSE_SUPPORT;/* CPU ok, but OS might not be */
/* try it */
success=1;
setjmp(mainloop); /* return to this point if we get SIGILL */
if(success) {
checksse();
- doSSE=1;
cpuflags |= X86_SSE_SUPPORT;
}
}
{
unsigned long eax,ebx,ecx,edx;
- cpu3DNow=do3DNow=cpuflags=0;
+ int cpuflags=0;
- if(log)
- fprintf(log,"\nTesting x86 processor CPUID...\n");
/* start by trying to issue the cpuid instruction */
success=1;
signal(SIGILL,sigill_handler);
if(eax>=0x80000001) {
x86_cpuid(0x80000001,&eax,&ebx,&ecx,&edx);
if(edx & FLAGS_SUPPORT_EXT_3DNOW) {
- cpu3DNow=1;
/* try it */
success=1;
setjmp(mainloop); /* return to this point if we get SIGILL */
if(success) {
check3dnow();
- do3DNow=1;
cpuflags |= X86_3DNOW_SUPPORT;
}
}
#if (defined USE_X86_SSE_AND_3DNOW || defined USE_X86_SSE2)
static int detect_x86(FILE *log)
{
- cpuflags=0;
+ unsigned long eax,ebx,ecx,edx;
+
+ int cpuflags=0;
+
+ /* First we check if this is an Intel or AMD cpu */
+ if(log)
+ fprintf(log,"\nTesting x86 processor CPUID...\n");
+ /* start by trying to issue the cpuid instruction */
+ success=1;
+ signal(SIGILL,sigill_handler);
+ setjmp(mainloop); /* return to this point if we get SIGILL */
+
+ if(success)
+ x86_cpuid(0,&eax,&ebx,&ecx,&edx);
+ else if(log)
+ fprintf(log,"This CPU doesn't support CPUID.\n");
+
+ if(eax>0) {
+ cpuflags |= X86_CPU;
+ } else {
+ if(log)
+ fprintf(log,"Didn't recognize this as an x86-type CPU.\n");
+ return cpuflags;
+ }
+
+ if(ebx==VENDOR_INTEL) {
+ if(log)
+ fprintf(log,"CPU manufactured by Intel.\n");
+ cpuflags |= INTEL_CPU;
+ }
+ else if(ebx==VENDOR_AMD) {
+ if(log)
+ fprintf(log,"CPU manufactured by AMD.\n");
+ cpuflags |= AMD_CPU;
+ }
+
#ifdef USE_X86_SSE2
/* For double precision we need SSE2 */
cpuflags=detect_sse2(log);
}
#endif
-int detect_cpu(FILE *log)
+
+int
+detect_cpu(FILE *log)
{
int cpuflags=0;
+ /* Use a global lock for all CPU detection */
+#ifdef USE_THREADS
+ pthread_mutex_lock(&detectcpu_mutex);
+#endif
+
#ifdef USE_PPC_ALTIVEC
cpuflags=detect_altivec(log);
#elif (defined USE_X86_SSE_AND_3DNOW || defined USE_X86_SSE2)
fprintf(log,"Not checking cpu support for SSE/SSE2/3DNow/Altivec\n");
cpuflags=UNKNOWN_CPU;
#endif
+
+ /* release lock */
+#ifdef USE_THREADS
+ pthread_mutex_unlock(&detectcpu_mutex);
+#endif
+
if (getenv("NOASSEMBLYLOOPS") != NULL) {
cpuflags &= (~X86_SSE_SUPPORT) & (~X86_SSE2_SUPPORT) & (~X86_3DNOW_SUPPORT) & (~PPC_ALTIVEC_SUPPORT);
"Found environment variable NOASSEMBLYLOOPS.\n"
"Disabling all SSE/SSE2/3DNow/Altivec support.\n");
}
+
return cpuflags;
}
#endif /* detectcpu */
+
+
+
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_disre_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <math.h>
#include "typedefs.h"
#include "sysstuff.h"
t_mdatoms *md,int ngrp,real egnb[],real egcoul[],
t_fcdata *fcd)
{
- static real sixth=1.0/6.0;
- static real seven_three=7.0/3.0;
+ const real sixth=1.0/6.0;
+ const real seven_three=7.0/3.0;
atom_id ai,aj;
int fa,res,npairs,p,pair,ki,kj,m;
#ifndef _dlb_h
#define _dlb_h
-static char *SRCID_dlb_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) dlb.h 1.3 31 Jan 1995"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
extern void count_nb(t_commrec *cr,t_nsborder *nsb,t_block *cgs,int nns,
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_do_fit_c = "$Id$";
+
#include "maths.h"
#include "sysstuff.h"
#include "typedefs.h"
void calc_fit_R(int natoms,real *w_rls,rvec *xp,rvec *x,matrix R)
{
int c,r,n,j,m,i,irot;
- static double **omega=NULL,**om=NULL;
+ double **omega,**om;
double d[2*DIM],xnr,xpc;
matrix vh,vk,u;
real mn;
int index;
real max_d;
- if (omega == NULL) {
- snew(omega,2*DIM);
- snew(om,2*DIM);
- for(i=0; i<2*DIM; i++) {
- snew(omega[i],2*DIM);
- snew(om[i],2*DIM);
- }
+ snew(omega,2*DIM);
+ snew(om,2*DIM);
+ for(i=0; i<2*DIM; i++) {
+ snew(omega[i],2*DIM);
+ snew(om[i],2*DIM);
}
-
+
for(i=0; i<2*DIM; i++) {
d[i]=0;
for(j=0; j<2*DIM; j++) {
R[r][c] = vk[0][r]*vh[0][c] +
vk[1][r]*vh[1][c] +
vk[2][r]*vh[2][c];
+
+ for(i=0; i<2*DIM; i++) {
+ sfree(omega[i]);
+ sfree(om[i]);
+ }
+ sfree(omega);
+ sfree(om);
}
void do_fit(int natoms,real *w_rls,rvec *xp,rvec *x)
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_enxio_c = "$Id$";
+
#include "futil.h"
#include "string2.h"
#include "fatal.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_ewald_util_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "assert.h"
matrix box,rvec mu_tot,real qsum, int ewald_geometry,
real epsilon_surface,matrix lr_vir)
{
- static bool bFirst=TRUE;
- static real Vself;
-
+ real Vself;
int i,i1,i2,j,k,m,iv,jv;
atom_id *AA;
double q2sum; /* Necessary for precision */
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_f77_wrappers_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_fatal_c = "$Id$";
+
#include <sysstuff.h>
#include <ctype.h>
#include <errno.h>
#include "string2.h"
#include "smalloc.h"
+
static bool bDebug = FALSE;
static char *fatal_tmp_file = NULL;
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_ffscanf_c = "$Id$";
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/* This file is completely threadsafe - keep it that way! */
+
+
#include <stdarg.h>
#include <ctype.h>
#include "typedefs.h"
* And Hey:
* S C A M O R G
*/
-static char *SRCID_filenm_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
/* To support multiple file types with one general (eg TRX) we have
* these arrays.
*/
-static int trxs[]={
+static const int trxs[]={
#ifdef USE_XDR
efXTC, efTRR,
#endif
efTRJ, efGRO, efG96, efPDB, efG87 };
#define NTRXS asize(trxs)
-static int trns[]={
+static const int trns[]={
#ifdef USE_XDR
efTRR,
#endif
efTRJ };
#define NTRNS asize(trns)
-static int stos[]={ efGRO, efG96, efPDB, efBRK,
+static const int stos[]={ efGRO, efG96, efPDB, efBRK,
#ifdef HAVE_XML
efXML,
#endif
efENT};
#define NSTOS asize(stos)
-static int stxs[]={ efGRO, efG96, efPDB, efBRK, efENT,
+static const int stxs[]={ efGRO, efG96, efPDB, efBRK, efENT,
#ifdef USE_XDR
efTPR,
#endif
};
#define NSTXS asize(stxs)
-static int enxs[]={
+static const int enxs[]={
#ifdef USE_XDR
efEDR,
#endif
efENE };
#define NENXS asize(enxs)
-static int tpxs[]={
+static const int tpxs[]={
#ifdef USE_XDR
efTPR,
#endif
};
#define NTPXS asize(tpxs)
-static int tpss[]={
+static const int tpss[]={
#ifdef USE_XDR
efTPR,
#endif
char *ext;
char *defnm;
char *defopt;
- char *descr;
+ const char *descr;
int ntps;
- int *tps;
+ const int *tps;
} t_deffile;
+
/* this array should correspond to the enum in include/types/filenm.h */
static t_deffile deffile[efNR] = {
static char *default_file_name=NULL;
#define NZEXT 2
-char *z_ext[NZEXT] = { ".gz", ".Z" };
+const char *z_ext[NZEXT] = { ".gz", ".Z" };
-void set_default_file_name(char *name)
+void set_default_file_name(const char *name)
{
int i;
deffile[i].defnm = default_file_name;
}
-char *ftp2ext(int ftp)
+const char *ftp2ext(int ftp)
{
if ((0 <= ftp) && (ftp < efNR))
return deffile[ftp].ext+1;
return "unknown";
}
-char *ftp2desc(int ftp)
+const char *ftp2desc(int ftp)
{
if ((0 <= ftp) && (ftp < efNR))
return deffile[ftp].descr;
return "unknown filetype";
}
-char *ftp2ftype(int ftp)
+const char *ftp2ftype(int ftp)
{
if ((ftp >= 0) && (ftp < efNR)) {
switch (deffile[ftp].ftype) {
return "unknown";
}
-char *ftp2defnm(int ftp)
+const char *ftp2defnm(int ftp)
{
static char buf[256];
void pr_def(FILE *fp,int ftp)
{
t_deffile *df;
- char *s=NULL,*ext,*desc,*flst;
+ char *s=NULL,*flst;
+ const char *ext,*desc;
df=&(deffile[ftp]);
/* find default file extension and \tt-ify description */
for(i=0; (i<nf); i++) {
for(f=0; f<tfn[i].nf; f++) {
sprintf(buf, "%4s %14s %-12s", f==0?tfn[i].opt:"", tfn[i].fns[f],
- f==0?fileopt(tfn[i].flag):"");
+ f==0?fileopt(tfn[i].flag,buf,255):"");
if ( f < tfn[i].nf-1 )
fprintf(fp, "%s\n", buf);
}
int i,type;
bool bValidExt;
int nopts;
- int *ftps;
+ const int *ftps;
nopts = deffile[fnm->ftp].ntps;
ftps = deffile[fnm->ftp].tps;
return NULL;
}
-static void add_filters(char *filter,int *n,int nf,int ftp[])
+static void add_filters(char *filter,int *n,int nf,const int ftp[])
{
char buf[8];
int i;
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_fnbf_c = "$Id$";
+
#ifdef USE_THREADS
#include <pthread.h> /* must come first! */
if (nbfp14 == NULL) {
nbfp14 = mk_14parm(fr->ntype,nbonds,iatoms,iparams,md->typeA);
if (debug)
- pr_rvec(debug,0,"nbfp14",nbfp14,sqr(fr->ntype));
+ pr_rvec(debug,0,"nbfp14",nbfp14,sqr(fr->ntype),TRUE);
}
shift14 = CENTRAL;
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_four1_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <math.h>
#include "typedefs.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_fourn_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
#include <math.h>
#include "typedefs.h"
#include "nr.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_ftocstr_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
int ftocstr(char *ds, int dl, char *ss, int sl)
/* dst, src ptrs */
/* dst max len */
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_futil_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
return fp;
}
-bool fexist(char *fname)
+bool fexist(const char *fname)
{
FILE *test;
}
}
-char *backup_fn(char *file)
+char *backup_fn(const char *file)
{
/* Use a reasonably low value for countmax; we might
* generate 4-5 files in each round, and we dont
return buf;
}
-bool make_backup(char * name)
+bool make_backup(const char * name)
{
char * backup;
return TRUE;
}
-FILE *ffopen(char *file,char *mode)
+FILE *ffopen(const char *file,char *mode)
{
FILE *ff=NULL;
char buf[256],*bf,*bufsize=0,*ptr;
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_gbutil_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include <math.h>
#include "macros.h"
#include "vec.h"
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_gmxfio_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
} t_fileio;
/* These simple lists define the I/O type for these files */
-static int ftpXDR[] = { efTPR, efTRR, efEDR, efXTC };
-static int ftpASC[] = { efTPA, efGRO, efPDB };
-static int ftpBIN[] = { efTPB, efTRJ, efMTX, efENE };
+static const int ftpXDR[] = { efTPR, efTRR, efEDR, efXTC };
+static const int ftpASC[] = { efTPA, efGRO, efPDB };
+static const int ftpBIN[] = { efTPB, efTRJ, efMTX, efENE };
#ifdef HAVE_XML
-static int ftpXML[] = { efXML };
+static const int ftpXML[] = { efXML };
#endif
-bool in_ftpset(int ftp,int nset,int set[])
+bool in_ftpset(int ftp,int nset,const int set[])
{
int i;
bool bResult;
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_ifunc_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include "typedefs.h"
#include "bondf.h"
#include "disre.h"
+#include "dihre.h"
#include "orires.h"
#define def_bonded(str,lstr,nra,nrpa,nrpb,ind,func)\
{str,lstr, 0, 0, 0,IF_NULL, -1,unimplemented}
/* this MUST correspond to the enum in include/types/idef.h */
-t_interaction_function interaction_function[F_NRE]=
+const t_interaction_function interaction_function[F_NRE]=
{
- def_bond ("BONDS", "Bond", 2, 2, 2, eNR_BONDS, bonds ),
- def_bond ("G96BONDS", "G96Bond", 2, 2, 2, eNR_BONDS, g96bonds ),
- def_bond ("MORSE", "Morse", 2, 3, 0, eNR_MORSE, morsebonds),
+ def_bond ("BONDS", "Bond", 2, 2, 2, eNR_BONDS, bonds ),
+ def_bond ("G96BONDS", "G96Bond", 2, 2, 2, eNR_BONDS, g96bonds ),
+ def_bond ("MORSE", "Morse", 2, 3, 0, eNR_MORSE, morsebonds ),
def_bond ("CUBICBONDS","Cubic Bonds", 2, 3, 0, eNR_CUBICBONDS, cubicbonds),
- def_bondnb ("CONNBONDS","Connect Bonds", 2, 0, 0, 0, unimplemented),
- def_bondedg("HARMONIC", "Harmonic Pot.", 2, 2, 2, eNR_BONDS, bonds ),
- def_angle ("ANGLES", "Angle", 3, 2, 2, eNR_ANGLES, angles ),
- def_angle ("G96ANGLES","G96Angle", 3, 2, 2, eNR_ANGLES, g96angles),
- def_bonded ("PDIHS", "Proper Dih.", 4, 3, 3, eNR_PROPER, pdihs ),
- def_bonded ("RBDIHS", "Ryckaert-Bell.", 4, 6, 6, eNR_RB, rbdihs ),
- def_bonded ("IDIHS", "Improper Dih.", 4, 2, 2, eNR_IMPROPER,idihs ),
- def_bonded ("LJ14", "LJ-14", 2, 2, 2, eNR_INL1100, do_14 ),
- def_nofc ("COUL14", "Coulomb-14" ),
- def_nb ("LJ", "LJ (SR)", 2, 2 ),
- def_nb ("BHAM", "BuckingHam", 2, 3 ),
- def_nofc ("LJLR", "LJ (LR)" ),
- def_nofc ("DISPCORR", "Disper. corr." ),
- def_nofc ("SR", "Coulomb (SR)" ),
- def_nofc ("LR", "Coulomb (LR)" ),
- def_bonded ("WATERPOL", "Water Pol.", 1, 6, 0, eNR_WPOL, water_pol),
- def_bonded ("POSRES", "Position Rest.", 1, 3, 0, eNR_POSRES, posres ),
- def_bondedg("DISRES", "Dis. Rest.", 2, 6, 0, eNR_DISRES, ta_disres),
- def_nofc ("DRVIOL", "D. R. Viol. (nm)" ),
- def_bondedg("ORIRES", "Orient. Rest.", 2, 6, 0, eNR_ORIRES, orires ),
- def_nofc ("ORDEV", "Ori. R. RMSD" ),
- def_bondedg("ANGRES", "Angle Rest.", 4, 3, 3, eNR_ANGRES, angres ),
- def_bondedg("ANGRESZ", "Angle Rest. Z", 2, 3, 3, eNR_ANGRESZ,angresz ),
- def_shkcb ("CONSTR", "Constraint", 2, 1, 1 ),
- def_shk ("CONSTRNC", "Constr. No Conn.",2, 1, 1 ),
- def_shkcb ("SETTLE", "Settle", 1, 2, 0 ),
- def_dummy ("DUMMY2", "Dummy2", 3, 1 ),
- def_dummy ("DUMMY3", "Dummy3", 4, 2 ),
- def_dummy ("DUMMY3FD", "Dummy3fd", 4, 2 ),
- def_dummy ("DUMMY3FAD","Dummy3fad", 4, 2 ),
- def_dummy ("DUMMY3OUT","Dummy3out", 4, 3 ),
- def_dummy ("DUMMY4FD", "Dummy4fd", 5, 3 ),
+ def_bondnb ("CONNBONDS","Connect Bonds", 2, 0, 0, 0, unimplemented ),
+ def_bondedg("HARMONIC", "Harmonic Pot.", 2, 2, 2, eNR_BONDS, bonds ),
+ def_angle ("ANGLES", "Angle", 3, 2, 2, eNR_ANGLES, angles ),
+ def_angle ("G96ANGLES","G96Angle", 3, 2, 2, eNR_ANGLES, g96angles ),
+ def_bonded ("PDIHS", "Proper Dih.", 4, 3, 3, eNR_PROPER, pdihs ),
+ def_bonded ("RBDIHS", "Ryckaert-Bell.", 4, 6, 6, eNR_RB, rbdihs ),
+ def_bonded ("FOURDIHS", "Fourier Dih.", 4, 4, 4, eNR_FOURDIH, rbdihs ),
+ def_bonded ("IDIHS", "Improper Dih.", 4, 2, 2, eNR_IMPROPER,idihs ),
+ def_bonded ("PIDIHS", "Improper Dih.", 4, 3, 3, eNR_PROPER, pdihs ),
+ def_bonded ("LJ14", "LJ-14", 2, 2, 2, eNR_INL1100, do_14 ),
+ def_nofc ("COUL14", "Coulomb-14" ),
+ def_nb ("LJ", "LJ (SR)", 2, 2 ),
+ def_nb ("BHAM", "BuckingHam", 2, 3 ),
+ def_nofc ("LJLR", "LJ (LR)" ),
+ def_nofc ("DISPCORR", "Disper. corr." ),
+ def_nofc ("SR", "Coulomb (SR)" ),
+ def_nofc ("LR", "Coulomb (LR)" ),
+ def_bonded ("WATERPOL", "Water Pol.", 1, 6, 0, eNR_WPOL, water_pol ),
+ def_bonded ("POSRES", "Position Rest.", 1, 3, 0, eNR_POSRES, posres ),
+ def_bondedg("DISRES", "Dis. Rest.", 2, 6, 0, eNR_DISRES, ta_disres ),
+ def_nofc ("DRVIOL", "D. R. Viol. (nm)" ),
+ def_bondedg("ORIRES", "Orient. Rest.", 2, 6, 0, eNR_ORIRES, orires ),
+ def_nofc ("ORDEV", "Ori. R. RMSD" ),
+ def_bondedg("ANGRES", "Angle Rest.", 4, 3, 3, eNR_ANGRES, angres ),
+ def_bondedg("ANGRESZ", "Angle Rest. Z", 2, 3, 3, eNR_ANGRESZ,angresz ),
+ def_bondedg("DIHRES", "Dih. Rest.", 4, 5, 0, eNR_DIHRES, ta_dihres ),
+ def_nofc ("DIHVIOL", "Dih. Rest. viol." ),
+ def_shkcb ("CONSTR", "Constraint", 2, 1, 1 ),
+ def_shk ("CONSTRNC", "Constr. No Conn.",2, 1, 1 ),
+ def_shkcb ("SETTLE", "Settle", 1, 2, 0 ),
+ def_dummy ("DUMMY2", "Dummy2", 3, 1 ),
+ def_dummy ("DUMMY3", "Dummy3", 4, 2 ),
+ def_dummy ("DUMMY3FD", "Dummy3fd", 4, 2 ),
+ def_dummy ("DUMMY3FAD","Dummy3fad", 4, 2 ),
+ def_dummy ("DUMMY3OUT","Dummy3out", 4, 3 ),
+ def_dummy ("DUMMY4FD", "Dummy4fd", 5, 3 ),
def_nofc ("EQM", "Quantum En." ),
def_nofc ("EPOT", "Potential" ),
def_nofc ("EKIN", "Kinetic En." ),
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_index_c = "$Id$";
+
#include <ctype.h>
#include <string.h>
#include "sysstuff.h"
#include "smalloc.h"
typedef enum { etOther, etProt, etDNA, erestNR } eRestp;
-static char *ResTP[erestNR] = { "OTHER", "PROTEIN", "DNA" };
+static const char *ResTP[erestNR] = { "OTHER", "PROTEIN", "DNA" };
-static char *Sugars[] = { "A", "T", "G", "C", "U" };
+static const char *Sugars[] = { "A", "T", "G", "C", "U" };
#define NDNA asize(Sugars)
static bool yn(bool bASK)
fclose(out);
}
-void add_grp(t_block *b,char ***gnames,int nra,atom_id a[],char *name)
+void add_grp(t_block *b,char ***gnames,int nra,atom_id a[],const char *name)
{
int i;
t_block *gb,char ***gn,bool bASK,bool bVerb)
{
/* atomnames to be used in constructing index groups: */
- static char *pnoh[] = { "H" };
- static char *pnodum[] = { "MN1", "MN2", "MCB1", "MCB2", "MCG1", "MCG2",
+ const char *pnoh[] = { "H" };
+ const char *pnodum[] = { "MN1", "MN2", "MCB1", "MCB2", "MCG1", "MCG2",
"MCD1", "MCD2", "MCE1", "MCE2", "MNZ1", "MNZ2" };
- static char *calpha[] = { "CA" };
- static char *bb[] = { "N","CA","C" };
- static char *mc[] = { "N","CA","C","O","O1","O2","OXT" };
- static char *mcb[] = { "N","CA","CB","C","O","O1","O2","OT","OXT" };
- static char *mch[] = { "N","CA","C","O","O1","O2","OT","OXT",
+ const char *calpha[] = { "CA" };
+ const char *bb[] = { "N","CA","C" };
+ const char *mc[] = { "N","CA","C","O","O1","O2","OXT" };
+ const char *mcb[] = { "N","CA","CB","C","O","O1","O2","OT","OXT" };
+ const char *mch[] = { "N","CA","C","O","O1","O2","OT","OXT",
"H1","H2","H3","H" };
/* array of arrays of atomnames: */
- static char **chains[] = { NULL,pnoh,calpha,bb,mc,mcb,mch,mch,mch,pnodum };
+ const char **chains[] = { NULL,pnoh,calpha,bb,mc,mcb,mch,mch,mch,pnodum };
#define NCH asize(chains)
/* array of sizes of arrays of atomnames: */
- static int sizes[NCH] = {
+ const int sizes[NCH] = {
0, asize(pnoh), asize(calpha), asize(bb),
asize(mc), asize(mcb), asize(mch), asize(mch), asize(mch), asize(pnodum)
};
/* descriptive names of index groups */
- static char *ch_name[NCH] = {
+ const char *ch_name[NCH] = {
"Protein", "Protein-H", "C-alpha", "Backbone",
"MainChain", "MainChain+Cb", "MainChain+H", "SideChain", "SideChain-H",
"Prot-Masses"
};
/* construct index group containing (TRUE) or excluding (FALSE)
given atom names */
- static bool complement[NCH] = {
+ const bool complement[NCH] = {
TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE
};
- static int wholename[NCH] = { -1, 0,-1,-1,-1,-1,-1,-1, 11,-1 };
+ const int wholename[NCH] = { -1, 0,-1,-1,-1,-1,-1,-1, 11,-1 };
/* the index in wholename gives the first item in the arrays of
* atomtypes that should be tested with 'strncasecmp' in stead of
* strcasecmp, or -1 if all items should be tested with strcasecmp
*/
/* only add index group if it differs from the specified one,
specify -1 to always add group */
- static int compareto[NCH] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0 };
+ const int compareto[NCH] = { -1,-1,-1,-1,-1,-1,-1,-1,-1, 0 };
int i,n,j;
atom_id *aid;
bool is_protein(char *resnm)
{
- static bool bRead=FALSE;
- static int naa;
- static char **aas;
+ int naa;
+ char **aas;
int i;
- if (!bRead) {
- naa = get_strings("aminoacids.dat",&aas);
- bRead=TRUE;
- }
+ naa = get_strings("aminoacids.dat",&aas);
for(i=0; (i<naa); i++)
if (strcasecmp(aas[i],resnm) == 0)
#ifndef _inner_h
#define _inner_h
-static char *SRCID_inner_h = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_inner_altivec_c = "$Id$";
+
#include <ppc_altivec.h>
#include<stdio.h>
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_invblock_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "typedefs.h"
#include "smalloc.h"
#include "invblock.h"
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_libxdrf_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "xdrf.h"
#include <callf77.h>
-#define MAXID 20
+
+
+#define MAXID 256
static FILE *xdrfiles[MAXID];
static XDR *xdridptr[MAXID];
static char xdrmodes[MAXID];
static unsigned int cnt;
+
#ifdef USE_FORTRAN
typedef void (* F77_FUNC(xdrfproc,XDRFPROC))(int *, void *, int *);
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_macros_c = "$Id$";
+
#include "macros.h"
-real ZERO = 0.0;
-real THIRD = (1.0/3.0);
-real HALF = 0.5;
-real ONE = 1.0;
-real TWO = 2.0;
-real THREE = 3.0;
-real SIX = 6.0;
-real TEN = 10.0;
-real TWELVE = 12.0;
+const real ZERO = 0.0;
+const real THIRD = (1.0/3.0);
+const real HALF = 0.5;
+const real ONE = 1.0;
+const real TWO = 2.0;
+const real THREE = 3.0;
+const real SIX = 6.0;
+const real TEN = 10.0;
+const real TWELVE = 12.0;
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_main_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUFSIZE 1024
+
+#ifdef USE_THREADS
+/* These are a couple of Global mutex variables that
+ * we use when writing to log files, so we avoid different
+ * threads printing to the same file at once. (It wont crash,
+ * but the print statements would be completely mixed up)
+ */
+pthread_mutex_t gmx_logfile_mtx = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutex_t gmx_stdout_mtx = PTHREAD_MUTEX_INITIALIZER;
+
+#endif
+
FILE *stdlog=NULL;
int gmx_parallel=0;
return 1;
}
-char *par_fn(char *base,int ftp,t_commrec *cr)
+char *par_fn(char *base,int ftp,t_commrec *cr, char buf[], int bufsize)
{
- static char buf[256];
+ int n;
+ if(bufsize<(strlen(base)+4))
+ fatal_error(0,"Character buffer too small!\n");
+
/* Copy to buf, and strip extension */
strcpy(buf,base);
- buf[strlen(base)-4] = '\0';
+ buf[strlen(buf)-4] = '\0';
/* Add node info */
if (PAR(cr))
void open_log(char *lognm,t_commrec *cr)
{
int len,testlen,pid;
- char *buf,*host;
+ char buf[256],*host;
debug_gmx();
debug_gmx();
/* Since log always ends with '.log' let's use this info */
- buf = par_fn(lognm,efLOG,cr);
+ par_fn(lognm,efLOG,cr,buf,255);
stdlog = ffopen(buf,"w");
/* Get some machine parameters */
{
t_commrec *mcr;
int i,ftp;
- char *buf;
+ char buf[256];
snew(mcr,1);
/* Because of possible multiple extensions per type we must look
* at the actual file name
*/
+<<<<<<< main.c
+ ftp = fn2ftp(fnm[i].fn);
+ if (ftp != efLOG) {
+#ifdef DEBUGPAR
+ fprintf(stderr,"Old file name: %s",fnm[i].fn);
+#endif
+ par_fn(fnm[i].fn,ftp,mcr,buf,255);
+ sfree(fnm[i].fn);
+ fnm[i].fn = strdup(buf);
+#ifdef DEBUGPAR
+ fprintf(stderr,", new: %s\n",fnm[i].fn);
+#endif
+=======
ftp = fn2ftp(fnm[i].fns[0]);
if (ftp != efLOG && ftp!= efTPX && ftp != efTPR && ftp != efTPS && ftp!=efTPA && ftp!=efTPB) {
/* fprintf(stderr,"Old file name: %s",fnm[i].fns[0]); */
sfree(fnm[i].fns[0]);
fnm[i].fns[0] = strdup(buf);
/* fprintf(stderr,", new: %s\n",fnm[i].fns[0]); */
+>>>>>>> 1.30
}
}
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_maths_c = "$Id$";
+
#include <math.h>
#include <limits.h>
#include "maths.h"
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_matio_c = "$Id$";
+
#include <ctype.h>
#include "sysstuff.h"
#include "futil.h"
#define round(a) (int)(a+0.5)
-static char mapper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+{}|;:',<.>/?";
+static const char mapper[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+{}|;:',<.>/?";
#define NMAP strlen(mapper)
#define MAX_XPM_LINELENGTH 4096
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_metacode_c = "$Id$";
+
#include <stdlib.h>
#include <string.h>
#include <metacode.h>
#include <stdarg.h>
#include <ctype.h>
+/* This file is NOT threadsafe, but it is only used to create
+ * the innerloops during the build process, so it will never be
+ * executed by multiple threads.
+ */
+
#define MAXCODESIZE 1000000
#define MAXDECL 1000
#define F77IND 6
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_mgmx_c = "$Id$";
+
#include <string.h>
#include <ctype.h>
{
int i;
XmString xmstr;
- char *ptr,*cptr,*nlptr;
-
+ char *cptr,*nlptr;
+ const char *ptr;
+
if (ndesc <= 0)
return empty_str;
else {
char **wname;
int i,j,ftp,narg,dx,www[NWC];
Widget topw;
- char *fn,dbuf[256];
+ char *fn,dbuf[256],buf[255];
wc[nwcTEXT] = xmTextFieldWidgetClass;
wc[nwcFDLG] = xmPushButtonWidgetClass;
for(i=0; (i<nfile); i++) {
ftp = fnm[i].ftp;
dx = (i % 2)*50;
- sprintf(dbuf,"%s [%s]",ftp2desc(ftp),fileopt(fnm[i].flag));
+ sprintf(dbuf,"%s [%s]",ftp2desc(ftp),fileopt(fnm[i].flag,buf,255));
if ((fn = strrchr(fnm[i].fns[0],'/')) == NULL)
fn = fnm[i].fns[0];
else
{
#define DELTA 256
int i,slen,width=80;
- char *ptr,*nptr;
-
+ char *nptr;
+ const char *ptr;
+
ptr = check_tty(str);
if (indent > 0) {
slen=strlen(ptr);
"In the fifth pane you find the usual buttons, [BB]OK[bb], [BB]Cancel[bb],",
"[BB]Help[bb], and [BB]About[bb] which presumably don't need any explanation.[PAR]",
"The GUI was written by David van der Spoel (comments to spoel@xray.bmc.uu.se)[PAR]",
- "And hey:[BR]",
- NULL
+ "And hey:[BR]"
};
#define NABOUT asize(about)
"It took about 1500 lines of pretty ugly C code to get this dialog box working"
};
- about[NABOUT-1] = cool_quote();
-
+ char tmpstr[256];
+ int dum;
+
return low_mk_help(base,
"ABOUT THE GROMACS MOTIF USER INTERFACE",asize(about),about,
"PROBLEMS IN THE GUI",asize(mbugs),mbugs,
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mgmxtest_c = "$Id$";
+
#include "copyrite.h"
#include "statutil.h"
#include "macros.h"
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_minvert_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "minvert.h"
#include "nr.h"
#include "smalloc.h"
void invert_mat(int n,real **A,real **Ainv)
{
- static real *col=NULL;
- static int *indx=NULL;
- static int N=0;
+ real *col=NULL;
+ int *indx=NULL;
real d;
int i,j;
- if (n > N) {
- srenew(col,n+1);
- srenew(indx,n+1);
- N=n;
- }
- ludcmp(A,N,indx,&d);
+ snew(col,n+1);
+ snew(indx,n+1);
+
+ ludcmp(A,n,indx,&d);
/* A is an LU-decomposed matrix, now back substitute to get Ainv */
for(j=1; (j<=n); j++) {
for(i=1; (i<=n); i++)
Ainv[i][j]=col[i];
}
+ sfree(col);
+ sfree(indx);
}
#ifndef _minvert_h
#define _minvert_h
-static char *SRCID_minvert_h = "$Id$";
+
#include "typedefs.h"
/* A bunch of routines that works on matrices that run from 1 thru n
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mkinl_c = "$Id$";
+
+/* This file is NOT threadsafe, but it is only used to create
+ * the innerloops during the build process, so it will never be
+ * executed by multiple threads.
+ */
+
#include <string.h>
#include "mkinl.h"
#include <types/simple.h>
#ifndef _mkinl_h
#define _mkinl_h
-static char *SRCID_mkinl_h = "$Id$";
+/* This file is NOT threadsafe, but it is only used to create
+ * the innerloops during the build process, so it will never be
+ * executed by multiple threads.
+ */
+
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mkinl_calcdist_c = "$Id$";
+
+/* This file is NOT threadsafe, but it is only used to create
+ * the innerloops during the build process, so it will never be
+ * executed by multiple threads.
+ */
+
#include "mkinl.h"
#include <string.h>
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mkinl_declarations_c = "$Id$";
+
+/* This file is NOT threadsafe, but it is only used to create
+ * the innerloops during the build process, so it will never be
+ * executed by multiple threads.
+ */
+
#include "mkinl.h"
#include <string.h>
#include <mkinl_fortrandata.h>
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mkinl_fortrandata_h = "$Id$";
-static char finvsqrtdata[]={
+
+/* This file is completely threadsafe - keep it that way! */
+
+static const char finvsqrtdata[]={
" DATA (finvsqrtexptab(I), I= 1, 64) /\n"
" $ X'5f000000', X'5e800000', X'5e800000', X'5e000000',\n"
" $ X'5e000000', X'5d800000', X'5d800000', X'5d000000',\n"
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mkinl_innerloop_c = "$Id$";
+
+/* This file is NOT threadsafe, but it is only used to create
+ * the innerloops during the build process, so it will never be
+ * executed by multiple threads.
+ */
+
#include "mkinl.h"
void unpack_inner_data(bool calcdist,bool calcforce)
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mkinl_interactions_c = "$Id$";
+
+/* This file is NOT threadsafe, but it is only used to create
+ * the innerloops during the build process, so it will never be
+ * executed by multiple threads.
+ */
+
#include "mkinl.h"
#include <string.h>
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mkinl_invsqrt_c = "$Id$";
+
+/* This file is NOT threadsafe, but it is only used to create
+ * the innerloops during the build process, so it will never be
+ * executed by multiple threads.
+ */
+
#include "mkinl.h"
#include <string.h>
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mkinl_outerloop_c = "$Id$";
+
+/* This file is NOT threadsafe, but it is only used to create
+ * the innerloops during the build process, so it will never be
+ * executed by multiple threads.
+ */
+
#include <string.h>
#include "mkinl.h"
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mkinl_recip_c = "$Id$";
+
#include "mkinl.h"
#include <string.h>
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mshift_c = "$Id$";
+
#include <string.h>
#include "assert.h"
#include "smalloc.h"
*
************************************************************/
-typedef enum { egcolWhite, egcolGrey, egcolBlack, egcolNR } egCol;
-
static void add_gbond(t_graph *g,t_iatom ia[],int np)
{
int j,k,l;
#ifdef DEBUG
p_graph(stdlog,"graph",g);
#endif
+
+ g->negc = 0;
+ g->egc = NULL;
+
return g;
}
/* This is malloced in a NASTY way, see above */
sfree(g->edge[0]);
sfree(g->edge);
+ sfree(g->egc);
}
}
int nW,nG,nB; /* Number of Grey, Black, White */
int fW,fG; /* First of each category */
int nerror=0;
- static int negc=0;
- static egCol *egc=NULL; /* The colour of each node */
/* This puts everything in the central box, that is does not move it
* at all. If we return without doing this for a system without bonds
return;
nnodes=g->nnodes;
- if (nnodes > negc) {
- negc = nnodes;
- srenew(egc,negc);
+ if (nnodes > g->negc) {
+ g->negc = nnodes;
+ srenew(g->egc,g->negc);
}
- memset(egc,0,(size_t)(nnodes*sizeof(egc[0])));
+ memset(g->egc,0,(size_t)(nnodes*sizeof(g->egc[0])));
nW=g->nbound;
nG=0;
* number than before, because no nodes are made white
* in the loop
*/
- if ((fW=first_colour(fW,egcolWhite,g,egc)) == -1)
+ if ((fW=first_colour(fW,egcolWhite,g,g->egc)) == -1)
fatal_error(0,"No WHITE nodes found while nW=%d\n",nW);
/* Make the first white node grey */
- egc[fW]=egcolGrey;
+ g->egc[fW]=egcolGrey;
nG++;
nW--;
nW,nG,nB,nW+nG+nB);
#endif
while (nG > 0) {
- if ((fG=first_colour(fG,egcolGrey,g,egc)) == -1)
+ if ((fG=first_colour(fG,egcolGrey,g,g->egc)) == -1)
fatal_error(0,"No GREY nodes found while nG=%d\n",nG);
/* Make the first grey node black */
- egc[fG]=egcolBlack;
+ g->egc[fG]=egcolBlack;
nB++;
nG--;
/* Make all the neighbours of this black node grey
* and set their periodicity
*/
- ng=mk_grey(log,nnodes,egc,g,&fG,box,x,&nerror);
+ ng=mk_grey(log,nnodes,g->egc,g,&fG,box,x,&nerror);
/* ng is the number of white nodes made grey */
nG+=ng;
nW-=ng;
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mvdata_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include <sysstuff.h>
#include <string.h>
#include "typedefs.h"
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_mvxvf_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include <sysstuff.h>
#include <string.h>
#include "typedefs.h"
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_names_c = "$Id$";
+
#include "typedefs.h"
#include "names.h"
/* note: these arrays should correspond to enums in include/types/enums.h */
-char *eblock_names[ebNR+1]=
+const char *eblock_names[ebNR+1]=
{
"CGS","MOLS","SBLOCKS",NULL
};
-char *epbc_names[epbcNR+1]=
+const char *epbc_names[epbcNR+1]=
{
"xyz", "no", NULL
};
-char *ens_names[ensNR+1]=
+const char *ens_names[ensNR+1]=
{
"Grid","Simple", NULL
};
-char *ei_names[eiNR+1]=
+const char *ei_names[eiNR+1]=
{
"md", "steep", "cg", "bd", "sd", "nm", NULL
};
-char *bool_names[BOOL_NR+1]=
+const char *bool_names[BOOL_NR+1]=
{
"FALSE","TRUE", NULL
};
-char *yesno_names[BOOL_NR+1]=
+const char *yesno_names[BOOL_NR+1]=
{
"no","yes", NULL
};
-char *ptype_str[eptNR+1] = {
+const char *ptype_str[eptNR+1] = {
"Atom", "Nucleus", "Shell", "Bond", "Dummy", NULL
};
-char *eel_names[eelNR+1] = {
+const char *eel_names[eelNR+1] = {
"Cut-off", "Reaction-Field", "Generalized-Reaction-Field",
- "PME", "Ewald", "PPPM", "Poisson", "Switch", "Shift", "User", NULL
+ "PME", "Ewald", "PPPM", "Poisson", "Switch", "Shift", "User",
+ "Generalized-Born", NULL
};
-char *eewg_names[eewgNR+1] = {
+const char *eewg_names[eewgNR+1] = {
"3d", "3dc", NULL
};
-char *evdw_names[evdwNR+1] = {
+const char *evdw_names[evdwNR+1] = {
"Cut-off", "Switch", "Shift", "User", NULL
};
-char *eshake_names[estNR+1] = {
+const char *eshake_names[estNR+1] = {
"Lincs", "Shake", NULL
};
-char *egrp_nm[egNR+1] = {
+const char *egrp_nm[egNR+1] = {
"Coul-SR","LJ","Buck", "Coul-LR", "LJ-LR", "Coul-14", "LJ-14", NULL
};
-char *etcoupl_names[etcNR+1] = {
- "No", "Berendsen", "Nose-Hoover", "yes", NULL
+const char *etcoupl_names[etcNR+1] = {
+ "No", "Berendsen", "Nose-Hoover", "yes", "Andersen", "Andersen-interval", NULL
}; /* yes is alias for berendsen */
-char *epcoupl_names[epcNR+1] = {
+const char *epcoupl_names[epcNR+1] = {
"No", "Berendsen", "Parrinello-Rahman", "Isotropic", NULL
}; /* isotropic is alias for berendsen */
-char *epcoupltype_names[epctNR+1] = {
+const char *epcoupltype_names[epctNR+1] = {
"Isotropic", "Semiisotropic", "Anisotropic", "Surface-Tension", NULL
};
-char *edisre_names[edrNR+1] = {
+const char *edisre_names[edrNR+1] = {
"No", "Simple", "Ensemble", NULL
};
-char *edisreweighting_names[edrwNR+1] = {
+const char *edisreweighting_names[edrwNR+1] = {
"Conservative", "Equal", NULL
};
-char *enbf_names[eNBF_NR+1] = {
+const char *enbf_names[eNBF_NR+1] = {
"", "LJ", "Buckingham", NULL
};
-char *ecomb_names[eCOMB_NR+1] = {
+const char *ecomb_names[eCOMB_NR+1] = {
"", "Arithmetic", "Geometric", "ArithSigEps", NULL
};
-char *gtypes[egcNR+1] = {
+const char *gtypes[egcNR+1] = {
"T-Coupling", "Energy Mon.", "Acceleration", "Freeze",
"User1", "User2", "VCM", "XTC", "Or. Res. Fit", NULL
};
-char *efep_names[efepNR+1] = {
+const char *efep_names[efepNR+1] = {
"no", "yes", NULL
};
-char *esolv_names[esolNR+1] = {
+const char *esolv_names[esolNR+1] = {
"General", "MNO Solvent", "Water", "Water-Water", NULL
};
-char *edispc_names[edispcNR+1] = {
+const char *edispc_names[edispcNR+1] = {
"No", "EnerPres", "Ener", NULL
};
-char *ecm_names[ecmNR+1] = {
+const char *ecm_names[ecmNR+1] = {
"Linear", "Angular", "None", NULL
};
-
+
+const char *eann_names[eannNR+1] = {
+ "No", "Single", "Periodic", NULL
+};
+
+const char *egb_names[egbNR+1] = {
+ "Still", "Karplus", NULL
+};
+
+const char *eis_names[eisNR+1] = {
+ "No", "LCPO", NULL
+};
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_network_c = "$Id$";
+
#include <string.h>
#include "fatal.h"
#include "main.h"
#endif
#ifdef USE_MPI
-static int mpi_num_nodes=0;
-static int mpi_my_rank=-1;
-static char mpi_hostname[MPI_MAX_PROCESSOR_NAME];
static MPI_Request mpi_req_tx=MPI_REQUEST_NULL,mpi_req_rx;
#else
char buf[256];
int resultlen; /* actual length of node name */
int i,flag;
+ int mpi_num_nodes;
+ int mpi_my_rank;
+ char mpi_hostname[MPI_MAX_PROCESSOR_NAME];
/* Call the MPI routines */
(void) MPI_Init(argc,&argv);
#ifndef USE_MPI
return 1;
#else
- return mpi_num_nodes;
+ int i;
+ return MPI_Comm_size(MPI_COMM_WORLD, &i);
+ return i;
#endif
}
#ifndef USE_MPI
return 0;
#else
- return mpi_my_rank;
+ int i;
+ return MPI_Comm_rank(MPI_COMM_WORLD, &i);
+ return i;
#endif
}
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_nrama_c = "$Id$";
+
#include <math.h>
#include "assert.h"
#include "sysstuff.h"
#include "nrama.h"
#include "rmpbc.h"
-static char *pp_pat[] = { "C", "N", "CA", "C", "N" };
+static const char *pp_pat[] = { "C", "N", "CA", "C", "N" };
#define NPP (sizeof(pp_pat)/sizeof(pp_pat[0]))
static int d_comp(const void *a,const void *b)
return TRUE;
}
-static int find_atom(char *find,char ***names,int start,int nr)
+static int find_atom(const char *find,char ***names,int start,int nr)
{
int i;
atoms->atom[ff[1]].resnr+1);
xr->pp[xr->npp].label=strdup(buf);
xr->npp++;
-}
+}
static void get_dih(t_xrama *xr,t_atoms *atoms)
{
xr->dih[i].ai[1],xr->dih[i].ai[2]);
}
-void init_rama(char *infile,char *topfile,t_xrama *xr)
+
+
+t_topology *init_rama(char *infile,char *topfile,t_xrama *xr)
{
- static t_topology *top;
+ t_topology *top;
real t;
top=read_top(topfile);
min_max(xr);
calc_dihs(xr);
+
+ return top;
}
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_nrjac_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "gstat.h"
#include "smalloc.h"
-/* These routines were taken from NUMERICAL RECIPES */
#define ROTATE(a,i,j,k,l) g=a[i][j];h=a[k][l];a[i][j]=g-s*(h+g*tau);\
a[k][l]=h+s*(g-h*tau);
-static void nrerror(char *error_text)
-{
- fatal_error(0,"Numerical Recipes: %s\n",error_text);
-}
-
void jacobi(double **a,int n,double d[],double **v,int *nrot)
{
int j,i;
z[ip] = 0.0;
}
}
- nrerror("Too many iterations in routine JACOBI");
+ fatal_error(0,"Error: Too many iterations in routine JACOBI\n");
}
int m_inv_gen(real **m,int n,real **minv)
* And Hey:
* Gyas ROwers Mature At Cryogenic Speed
*/
-static char *SRCID_nrnb_c = "$Id$";
+
#include <string.h>
#include "sysstuff.h"
#include "fatal.h"
-#include "vveclib.h"
#include "names.h"
#include "macros.h"
#include "nrnb.h"
} t_nrnb_data;
-static t_nrnb_data nbdata[eNRNB] = {
+static const t_nrnb_data nbdata[eNRNB] = {
{ "LJ", 31 }, /* inl0100 */
{ "LJ(S)", 31 }, /* inl0110 */
{ "Buckingham", 36 }, /* inl0200 */
{ "Propers", 229 },
{ "Impropers", 208 },
{ "RB-Dihedrals", 247 },
+ { "Four. Dihedrals", 247 },
{ "Dist. Restr.", 200 },
{ "Orient. Restr.", 200 },
+ { "Dihedral Restr.", 200 },
{ "Pos. Restr.", 50 },
{ "Angle Restr.", 191 },
{ "Angle Restr. Z", 164 },
return nbdata[enr].name;
}
-static int force_index[]={
+static const int force_index[]={
eNR_BONDS, eNR_ANGLES, eNR_PROPER, eNR_IMPROPER,
eNR_RB, eNR_DISRES, eNR_ORIRES, eNR_POSRES,
eNR_NS, eNR_INL_IATOM
};
#define NFORCE_INDEX asize(force_index)
-static int shake_index[]={
+static const int shake_index[]={
eNR_SHAKE, eNR_SHAKE_RIJ, eNR_SETTLE, eNR_UPDATE, eNR_PCOUPL,
eNR_SHAKE_VIR, eNR_SHAKE_V, eNR_PSHAKEINITLD, eNR_PSHAKEINITMD, eNR_PSHAKE
};
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_orires_c = "$Id$";
+
#include "typedefs.h"
#include "smalloc.h"
#include "vec.h"
rvec *xref,*xtmp,com,r_unrot,r;
t_oriresdata *od;
bool bTAV;
- static real two_thr=2.0/3.0;
+ const real two_thr=2.0/3.0;
od = &(fcd->orires);
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_pargs_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <stdio.h>
#include <string.h>
#include <ctype.h>
return NULL;
}
-char *pa_val(t_pargs *pa)
+char *pa_val(t_pargs *pa, char buf[], int sz)
{
- static char buf[256];
buf[0]='\0';
+
+ if(sz<255)
+ fatal_error(0,"Buffer must be at least 255 chars\n");
+
switch(pa->type) {
case etINT:
sprintf(buf,"%d",*(pa->u.i));
break;
case etSTR:
if (*(pa->u.c)) {
- if (strlen(*(pa->u.c)) >= 256)
+ if (strlen(*(pa->u.c)) >= sz)
fatal_error(0,"Argument too long: \"%d\"\n",*(pa->u.c));
else
strcpy(buf,*(pa->u.c));
void print_pargs(FILE *fp, int npargs,t_pargs pa[])
{
bool bShowHidden;
- char buf[32],buf2[256];
+ char buf[32],buf2[256],tmp[256];
char *wdesc;
int i;
if (strlen(buf)>((OPTLEN+TYPELEN)-max(strlen(argtp[pa[i].type]),4))) {
fprintf(fp,"%12s\n",buf);
sprintf(buf2,"%12s %6s %6s %s\n",
- "",argtp[pa[i].type],pa_val(&(pa[i])),check_tty(pa[i].desc));
+ "",argtp[pa[i].type],pa_val(&(pa[i]),tmp,255),check_tty(pa[i].desc));
} else if (strlen(buf)>OPTLEN) {
/* so type can be 4 or 5 char's (max(...,4)), this fits in the %5s */
sprintf(buf2,"%-14s%5s %6s %s\n",
- buf,argtp[pa[i].type],pa_val(&(pa[i])),check_tty(pa[i].desc));
+ buf,argtp[pa[i].type],pa_val(&(pa[i]),tmp,255),check_tty(pa[i].desc));
} else
sprintf(buf2,"%12s %6s %6s %s\n",
- buf,argtp[pa[i].type],pa_val(&(pa[i])),check_tty(pa[i].desc));
+ buf,argtp[pa[i].type],pa_val(&(pa[i]),tmp,255),check_tty(pa[i].desc));
wdesc=wrap_lines(buf2,80,28);
fprintf(fp,wdesc);
sfree(wdesc);
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_pbc_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "typedefs.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_pdbio_c = "$Id$";
+
#include "sysstuff.h"
#include "string2.h"
#include "vec.h"
#include "physics.h"
#include "pbc.h"
-static char *pdbtp[epdbNR]={
+static const char *pdbtp[epdbNR]={
"ATOM ","HETATM", "ANISOU", "CRYST1",
"COMPND", "MODEL", "ENDMDL", "TER", "HEADER", "TITLE", "REMARK"
};
t_atoms *atoms,rvec x[],matrix box,char chain,
int model_nr, atom_id nindex, atom_id index[])
{
- char resnm[6],nm[6],ch,pdbform[128];
+ char resnm[6],nm[6],ch,pdbform[128],pukestring[100];
atom_id i,ii;
int resnr,type;
real occup,bfac;
real alpha,beta,gamma;
bool bOccup;
- fprintf(out,"HEADER %s\n",(title && title[0])?title:bromacs());
+ fprintf(out,"HEADER %s\n",(title && title[0])?title:bromacs(pukestring,99));
if (bWideFormat) {
fprintf(out,"REMARK This file does not adhere to the PDB standard\n");
fprintf(out,"REMARK As a result of, some programs may not like it\n");
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_princ_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "typedefs.h"
#include "vec.h"
#include "smalloc.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_rando_c = "$Id$";
+
#include <time.h>
#include "sysstuff.h"
#include "typedefs.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_random_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "smalloc.h"
#include "vec.h"
#include "random.h"
-real gauss (real am, real sd, int *ig)
- /* we use the boxmuller method to calculate the gaussian. */
- /* this method calculates two gaussians at a time, one of */
- /* which is stored in glgset until the next call to gauss. */
- /* see: numerical recipes p.716 */
+#define GAUSS_NXP 16
+/* The size of the data area is 2^GAUSS_NXP */
+
+struct t_gaussdata {
+ real *x; /* Pointer to the work area */
+ int seed; /* The random seed */
+ int uselast; /* Is there a saved number we can use? */
+ real last; /* The possibly saved number */
+};
+
+
+/* Initialize (and warm up) a gaussian random number generator
+ * by copying the seed. The routine returns a handle to the
+ * new generator.
+ */
+t_Gaussdata
+init_gauss(int seed)
{
- /* use our own gaussian, or modified boxmuller's ? */
-#define STRAND
-
-#ifdef STRAND
- real a;
- int i;
-#else
- static bool gliset=FALSE;
- static real glgset;
- real fac,r,v1,v2;
-#endif
- real gval;
-
-#ifdef STRAND
- a = 0;
- for (i=0; (i<12); i++)
- a = a + rando (ig);
- gval = (a-6.0)*sd+am;
-#else
- if (!gliset) {
+ int size = (1 << GAUSS_NXP);
+ int nwarmup = GAUSS_NXP*(size-1);
+ int k;
+ real tmp;
+ t_Gaussdata gaussdata;
+ gaussdata=(t_Gaussdata)malloc(sizeof(struct t_gaussdata));
+ gaussdata->x=(real *)malloc(size*sizeof(real));
+ gaussdata->seed = seed;
+ gaussdata->last = 0;
+ gaussdata->uselast = 0;
+
+ for(k=0;k<size;k++)
+ gaussdata->x[k]=1;
+
+ for(k=0;k<nwarmup;k++)
+ tmp=gauss(gaussdata);
+
+ return gaussdata;
+}
+
+
+
+/* Return a new gaussian random number with expectation value
+ * 0.0 and standard deviation 1.0. This routine is NOT thread-safe
+ * for performance reasons - you will either have to do the locking
+ * yourself, or better: initialize one generator per thread.
+ */
+real
+gauss(t_Gaussdata gaussdata)
+{
+ int i,n1=0,n2;
+ int intt;
+ int mo;
+ int j1;
+ int isgn;
+ int ne = 31-GAUSS_NXP;
+
+ if(gaussdata->uselast) {
+ gaussdata->uselast=0;
+ return gaussdata->last;
+ } else {
do {
- v1 = 2.0*rando(ig)-1.0;
- v2 = 2.0*rando(ig)-1.0;
- r = v1*v1 + v2*v2;
- } while (r >= 1.0);
- fac = sqrt (-2*log(r)/r);
- glgset = v1*fac;
- gval = v2*fac;
+ for (i=0;i<2;i++) {
+ intt=(gaussdata->seed)/127773;
+ mo=(gaussdata->seed)-intt*127773;
+ j1=2836*intt;
+ (gaussdata->seed)=16807*mo-j1;
+ if(gaussdata->seed<0)
+ gaussdata->seed+=2147483647;
+ if(i==0)
+ n1 = gaussdata->seed >> ne;
+ }
+ n2 = gaussdata->seed >> ne;
+ } while (n1==n2);
+
+ isgn=2*(gaussdata->seed & 1)-1;
+
+ gaussdata->x[n1]=isgn*(0.7071067811865475*(gaussdata->x[n1]+gaussdata->x[n2]));
+ gaussdata->x[n2]=-gaussdata->x[n1]+isgn*1.414213562373095*gaussdata->x[n2];
+ gaussdata->last = gaussdata->x[n2];
+ gaussdata->uselast = 1;
+ return gaussdata->x[n1];
}
- else
- gval = glgset; /* use the spare gaussian */
- gliset=!gliset; /* set the spare indicator */
-#endif
+}
- return gval;
+
+
+/* Release all the resources used for the generator */
+void
+finish_gauss(t_Gaussdata data)
+{
+ free(data->x);
+ free(data);
+ data=NULL;
+
+ return;
}
-void low_mspeed(real tempi,int nrdf,int seed,int nat,atom_id a[],
- t_atoms *atoms,rvec v[])
+
+
+void low_mspeed(real tempi,int nrdf,int nat,atom_id a[],
+ t_atoms *atoms,rvec v[], t_Gaussdata gaussdata)
{
- int i,j,m,ig;
+ int i,j,m;
real boltz,sd;
real ekin,temp,mass,scal;
- ig=seed;
boltz=BOLTZ*tempi;
ekin=0.0;
for (i=0; (i<nat); i++) {
if (mass > 0) {
sd=sqrt(boltz/mass);
for (m=0; (m<DIM); m++) {
- v[j][m]=gauss(0.0,sd,&ig);
+ v[j][m]=sd*gauss(gaussdata);
ekin+=0.5*mass*v[j][m]*v[j][m];
}
}
t_atoms *atoms,rvec v[])
{
int i,s,n;
+ t_Gaussdata gaussdata;
+ bool bFirst=TRUE;
+
+ if(bFirst) {
+ bFirst=FALSE;
+ gaussdata = init_gauss(seed);
+ }
for(i=0; (i<grp->nr); i++) {
s=grp->index[i];
n=grp->index[i+1]-s;
- low_mspeed(tempi[i],nrdf[i],seed,n,&(grp->a[s]),atoms,v);
+ low_mspeed(tempi[i],nrdf[i],n,&(grp->a[s]),atoms,v,gaussdata);
}
}
+
void maxwell_speed(real tempi,int nrdf,int seed,t_atoms *atoms, rvec v[])
{
atom_id *dummy;
int i;
+ t_Gaussdata gaussdata;
+ bool bFirst=TRUE;
if (seed == -1) {
seed = make_seed();
fprintf(stderr,"Using random seed %d for generating velocities\n",seed);
}
+
+ if(bFirst) {
+ bFirst=FALSE;
+ gaussdata = init_gauss(seed);
+ }
+
snew(dummy,atoms->nr);
for(i=0; (i<atoms->nr); i++)
dummy[i]=i;
- low_mspeed(tempi,nrdf,seed,atoms->nr,dummy,atoms,v);
+ low_mspeed(tempi,nrdf,atoms->nr,dummy,atoms,v,gaussdata);
sfree(dummy);
}
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_rbin_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "typedefs.h"
#include "main.h"
#include "network.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_rdgroup_c = "$Id$";
+
#include "sysstuff.h"
#include "smalloc.h"
#include "typedefs.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_readinp_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include "typedefs.h"
out=ffopen(fn,"w");
nice_header(out,fn);
for(i=0; (i<ninp); i++) {
- if (inp[i].bSet)
- fprintf(out,"%-24s = %s\n",inp[i].name,inp[i].value ? inp[i].value : "");
- else {
+ if (inp[i].bSet) {
+ if(inp[i].name[0]==';' || (strlen(inp[i].name)>2 && inp[i].name[1]==';'))
+ fprintf(out,"%-24s\n",inp[i].name);
+ else
+ fprintf(out,"%-24s = %s\n",inp[i].name,inp[i].value ? inp[i].value : "");
+ } else {
sprintf(warn_buf,"Unknown left-hand %s in parameter file\n",
inp[i].name);
warning(NULL);
fclose(out);
}
-static int get_einp(int *ninp,t_inpfile **inp,char *name)
+static int get_einp(int *ninp,t_inpfile **inp,const char *name)
{
int i;
return i;
}
-int get_eint(int *ninp,t_inpfile **inp,char *name,int def)
+int get_eint(int *ninp,t_inpfile **inp,const char *name,int def)
{
char buf[32];
int ii;
return atoi((*inp)[ii].value);
}
-real get_ereal(int *ninp,t_inpfile **inp,char *name,real def)
+real get_ereal(int *ninp,t_inpfile **inp,const char *name,real def)
{
char buf[32];
int ii;
return atof((*inp)[ii].value);
}
-char *get_estr(int *ninp,t_inpfile **inp,char *name,char *def)
+char *get_estr(int *ninp,t_inpfile **inp,const char *name,char *def)
{
char buf[32];
int ii;
return (*inp)[ii].value;
}
-int get_eeenum(int *ninp,t_inpfile **inp,char *name,char **defs,
+int get_eeenum(int *ninp,t_inpfile **inp,const char *name,const char **defs,
int *nerror,bool bPrintError)
{
int ii,i,j;
return i;
}
-int get_eenum(int *ninp,t_inpfile **inp,char *name,char **defs)
+int get_eenum(int *ninp,t_inpfile **inp,const char *name,const char **defs)
{
int dum=0;
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_repfirst_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include "string2.h"
#include "typedefs.h"
#include "smalloc.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_replace_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <ctype.h>
#include "string2.h"
#include "smalloc.h"
#include "macros.h"
#include "replace.h"
-char *replace(char *string,char *search,char *replace)
+char *replace(const char *string,const char *search,const char *replace)
{
char *buf=NULL,*ptr=NULL,*bufptr=NULL;
int blen,stringlen,slen,rlen;
return buf;
}
-char *replaceww(char *string,char *search,char *replace)
+char *replaceww(char *string,const char *search,const char *replace)
{
char *buf=NULL,*ptr=NULL,*bufptr=NULL;
int buflen,stringlen,searchlen,replacelen;
#ifndef _replace_h
#define _replace_h
-static char *SRCID_replace_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) replace.h 1.16 10/14/97"
-#endif /* HAVE_IDENT */
-extern char *replace(char *string,char *search,char *replace);
+extern char *replace(const char *string,const char *search,const char *replace);
/* Replace all occurences of
* string 'search' in string 'string' by 'replace'
*/
-extern char *replaceww(char *string,char *search,char *replace);
+extern char *replaceww(char *string,const char *search,const char *replace);
/* Replace all occurences of string 'search' delimited by non-alphanum
* characters (i.e. whole words) in string 'string' by 'replace'
*/
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_rmpbc_c = "$Id$";
+
#include "sysstuff.h"
#include "typedefs.h"
#include "smalloc.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_sheader_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <string.h>
#include "sheader.h"
#include "txtdump.h"
#include "tpxio.h"
-static char *version="@(#) sheader.c 1.5 12/16/92";
+
void pr_header(FILE *fp,int indent,char *title,t_tpxheader *sh)
{
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_shift_util_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "typedefs.h"
void plot_phi(char *fn,rvec box,int natoms,rvec x[],real phi[])
{
- FILE *eps;
+ t_psdata eps;
real phi_max,rr,gg,bb,fac,dx,x0,y0;
real offset;
int i;
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_smalloc_c = "$Id$";
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/* This file is completely threadsafe - keep it that way! */
+#ifdef USE_THREADS
+#include <pthread.h>
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
bytes=size*nelem;
if (!bMal)
bytes=-bytes;
+
+#ifdef USE_THREADS
+ pthread_mutex_lock(&gmx_logfile_mtx);
+#endif
+
+ /* This static variable is protected by the mutex too... */
btot+=bytes;
bytes/=1024;
fprintf(stdlog,"%30s:%6d kb (%7d kb) [%s, line %d, nelem %d, size %d]\n",
what ? what : NN,bytes,btot/1024,
file ? file : NN,line,nelem,size);
+#ifdef USE_THREADS
+ pthread_mutex_unlock(&gmx_logfile_mtx);
+#endif
}
#endif
return p;
}
-void save_free(char *name,char *file,int line,void *ptr)
+void save_free(char *name,char *file,int line,const void *ptr)
{
#ifdef DEBUG
log_action(0,name,file,line,0,0,ptr);
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_sortwater_c = "$Id$";
+
#include "typedefs.h"
#include "random.h"
#include "smalloc.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_stat_c = "$Id$";
+
#include <string.h>
#include <stdio.h>
#include "typedefs.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_statutil_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_strdb_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include "string2.h"
bool get_a_line(FILE *fp,char line[],int n)
{
- static char *line0=NULL;
- static int nalloc=0;
+ char *line0;
char *dum;
- if (n>nalloc) {
- nalloc=n;
- srenew(line0,nalloc+1);
- }
+ snew(line0,n+1);
+
do {
if (!fgets(line0,n+1,fp)) {
return FALSE;
dum=strchr(line0,';');
if (dum)
dum[0]='\0';
- strcpy(line,line0);
+ strncpy(line,line0,n);
dum=line0;
ltrim(dum);
} while (dum[0] == '\0');
-
+
+ sfree(line0);
return TRUE;
}
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_string2_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
return dest;
}
-char *wrap_lines(char *buf,int line_width, int indent)
+char *wrap_lines(const char *buf,int line_width, int indent)
{
char *b2;
int i,i0,i2,j,b2len,lspace=0,l2space=0;
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_symtab_c = "$Id$";
+
#include <stdio.h>
#include <string.h>
#include "sysstuff.h"
#define BUFSIZE 1024
#define TABLESIZE 5
-static char *trim_string(char *s)
+static char *trim_string(char *s,char *out, int maxlen)
/*
* Returns a pointer to a static area which contains a copy
* of s without leading or trailing spaces. Strings are
* truncated to BUFSIZE positions.
*/
{
- static char buf[BUFSIZE];
int len,i;
+
+ if(strlen(s)>maxlen-1)
+ fatal_error(0,"Character buffer size too small\n");
for (; (*s)&&((*s)==' '); s++);
for (len=strlen(s); (len>0); len--) if (s[len-1]!=' ') break;
if (len>=BUFSIZE) len=BUFSIZE-1;
- for (i=0; i<len; i++) buf[i]=*(s++);
- buf[i]=0;
- return buf;
+ for (i=0; i<len; i++) out[i]=*(s++);
+ out[i]=0;
+ return out;
}
int lookup_symtab(t_symtab *symtab,char **name)
return &(symbuf->buf[0]);
}
-char **put_symtab(t_symtab *symtab,char *name)
+char **put_symtab(t_symtab *symtab,const char *name)
{
- return enter_buf(symtab,trim_string(name));
+ char buf[256];
+
+ return enter_buf(symtab,trim_string(name,buf,255));
}
void open_symtab(t_symtab *symtab)
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_testfft_c = "$Id$";
+
#include <math.h>
#include <stdio.h>
#include "typedefs.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_testlr_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "typedefs.h"
/* Read topology and coordinates */
- read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&stath);
+ read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&stath,FALSE);
snew(x,stath.natoms);
snew(f_sr,stath.natoms);
snew(f_excl,stath.natoms);
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_testtab_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include <stdio.h>
#include "typedefs.h"
#include "force.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_testxml_c = "$Id$";
+
#include "macros.h"
#include "smalloc.h"
#include "xmlio.h"
else {
t_tpxheader tpx;
- read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&tpx);
+ read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&tpx,FALSE);
snew(x,tpx.natoms);
snew(v,tpx.natoms);
f = NULL;
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_threadsync_c = "$Id$";
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/* This file is completely threadsafe - keep it that way! */
+#ifdef USE_THREADS
+#include <pthread.h>
+#endif
+
+
/* Since most fortran compilers dont support threads started
* in a calling c program we call these wrapper syncronization
* routines from the fortran innerloops
int *ii1, pthread_mutex_t *mtx)
{
int t0,t1;
+#ifdef USE_THREADS
pthread_mutex_lock(mtx);
+#endif
t0=*count;
t1=t0+(*nri-t0)/nthreads+1;
*count=t1;
+#ifdef USE_THREADS
pthread_mutex_unlock(mtx);
+#endif
*ii0=t0;
*ii1=t1;
}
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_tpxio_c = "$Id$";
-
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/* This file is completely threadsafe - keep it that way! */
+#ifdef USE_THREADS
+#include <pthread.h>
+#endif
+
#include <ctype.h>
#include "sysstuff.h"
#include "smalloc.h"
#endif
/* This number should be increased whenever the file format changes! */
-static int tpx_version = 25;
-/* This number should be the most recent incompatible version */
-static int tpx_incompatible_version = 9;
-/* This is the version of the file we are reading */
-static int file_version = 0;
+static const int tpx_version = 26;
+
+/* This number should only be increased when you edit the TOPOLOGY section
+ * of the tpx format. This way we can maintain forward compatibility too
+ * for all analysis tools and/or external programs that only need to
+ * know the atom/residue names, charges, and bond connectivity.
+ *
+ * It first appeared in tpx version 26, when I also moved the inputrecord
+ * to the end of the tpx file, so we can just skip it if we only
+ * want the topology.
+ */
+static const int tpx_generation = 1;
+
+/* This number should be the most recent backwards incompatible version
+ * I.e., if this number is 9, we cannot read tpx version 9 with this code.
+ */
+static const int tpx_incompatible_version = 9;
+
+
/* Struct used to maintain tpx compatibility when function types are added */
typedef struct {
* 1. ascending file version number
* 2. ascending function type number
*/
-t_ftupd ftupd[] = {
- { 20, F_CUBICBONDS },
- { 20, F_CONNBONDS },
- { 20, F_HARMONIC },
- { 20, F_EQM, },
- { 22, F_DISRESVIOL },
- { 22, F_ORIRES },
- { 22, F_ORIRESDEV }
+static const t_ftupd ftupd[] = {
+ { 20, F_CUBICBONDS },
+ { 20, F_CONNBONDS },
+ { 20, F_HARMONIC },
+ { 20, F_EQM, },
+ { 22, F_DISRESVIOL },
+ { 22, F_ORIRES },
+ { 22, F_ORIRESDEV },
+ { 26, F_FOURDIHS },
+ { 26, F_PIDIHS },
+ { 26, F_DIHRES },
+ { 26, F_DIHRESVIOL }
};
#define NFTUPD asize(ftupd)
* Now the higer level routines that do io of the structures and arrays
*
**************************************************************/
-static void do_inputrec(t_inputrec *ir,bool bRead)
+static void do_inputrec(t_inputrec *ir,bool bRead, int file_version)
{
- int i,j,*tmp,idum=0;
+ int i,j,k,*tmp,idum=0;
bool bDum=TRUE;
real rdum;
rvec vdum;
-
+ bool bSimAnn;
+ real zerotemptime,finish_t,init_temp,finish_temp;
+
if (file_version != tpx_version) {
/* Give a warning about features that are not accessible */
fprintf(stderr,"Note: tpx file_version %d, software version %d\n",
/* Basic inputrec stuff */
do_int(ir->eI);
do_int(ir->nsteps);
+ if(file_version > 25)
+ do_int(ir->init_step);
+ else
+ ir->init_step=0;
+
do_int(ir->ePBC);
if (file_version <= 15 && ir->ePBC == 2)
ir->ePBC = epbcNONE;
do_int(ir->bDomDecomp);
do_int(ir->decomp_dir);
do_int(ir->nstcomm);
+
+ if(file_version > 25)
+ do_int(ir->nstcheckpoint);
+ else
+ ir->nstcheckpoint=0;
+
do_int(ir->nstcgsteep);
do_int(ir->nstlog);
do_int(ir->nstxout);
do_real(ir->rvdw);
do_int(ir->eDispCorr);
do_real(ir->epsilon_r);
+
+ if(file_version > 25) {
+ do_int(ir->gb_algorithm);
+ do_int(ir->nstgbradii);
+ do_real(ir->rgbradii);
+ do_real(ir->gb_saltconc);
+ do_int(ir->implicit_solvent);
+ } else {
+ ir->gb_algorithm=egbSTILL;
+ ir->nstgbradii=0;
+ ir->rgbradii=0;
+ ir->gb_saltconc=0;
+ ir->implicit_solvent=eisNO;
+ }
+
do_int(ir->nkx);
do_int(ir->nky);
do_int(ir->nkz);
do_rvec(ir->compress[YY]);
do_rvec(ir->compress[ZZ]);
}
- do_int(ir->bSimAnn);
- do_real(ir->zero_temp_time);
+ if(file_version > 25)
+ do_int(ir->andersen_seed);
+ else
+ ir->andersen_seed=0;
+
+ if(file_version < 26) {
+ do_int(bSimAnn);
+ do_real(zerotemptime);
+ }
+
do_real(ir->epsilon_r);
+
do_real(ir->shake_tol);
do_real(ir->fudgeQQ);
do_int(ir->efep);
ir->orires_tau = 0;
ir->nstorireout = 0;
}
+ if(file_version >=26) {
+ do_real(ir->dihre_fc);
+ do_real(ir->dihre_tau);
+ do_int(ir->nstdihreout);
+ } else {
+ ir->dihre_fc=0;
+ ir->dihre_tau=0;
+ ir->nstdihreout=0;
+ }
+
do_real(ir->em_stepsize);
do_real(ir->em_tol);
if (file_version >= 22)
do_real(ir->LincsWarnAngle);
if (file_version <= 14)
do_int(idum);
+ if (file_version >=26)
+ do_int(ir->nLincsIter);
do_real(ir->bd_temp);
do_real(ir->bd_fric);
do_int(ir->ld_seed);
do_int(ir->opts.ngtc);
do_int(ir->opts.ngacc);
do_int(ir->opts.ngfrz);
- do_int(ir->opts.ngener);
+ do_int(ir->opts.ngener);
+
if (bRead) {
snew(ir->opts.nrdf, ir->opts.ngtc);
snew(ir->opts.ref_t, ir->opts.ngtc);
+ snew(ir->opts.annealing, ir->opts.ngtc);
+ snew(ir->opts.anneal_npoints, ir->opts.ngtc);
+ snew(ir->opts.anneal_time, ir->opts.ngtc);
+ snew(ir->opts.anneal_temp, ir->opts.ngtc);
snew(ir->opts.tau_t, ir->opts.ngtc);
snew(ir->opts.nFreeze,ir->opts.ngfrz);
snew(ir->opts.acc, ir->opts.ngacc);
if (file_version >= 12)
ndo_int(ir->opts.eg_excl,ir->opts.ngener*ir->opts.ngener,bDum);
+ if(bRead && file_version < 26) {
+ for(i=0;i<ir->opts.ngtc;i++) {
+ if(bSimAnn) {
+ ir->opts.annealing[i] = eannSINGLE;
+ ir->opts.anneal_npoints[i] = 2;
+ snew(ir->opts.anneal_time[i],2);
+ snew(ir->opts.anneal_temp[i],2);
+ /* calculate the starting/ending temperatures from reft, zerotemptime, and nsteps */
+ finish_t = ir->init_t + ir->nsteps * ir->delta_t;
+ init_temp = ir->opts.ref_t[i]*(1-ir->init_t/zerotemptime);
+ finish_temp = ir->opts.ref_t[i]*(1-finish_t/zerotemptime);
+ ir->opts.anneal_time[i][0] = ir->init_t;
+ ir->opts.anneal_time[i][1] = finish_t;
+ ir->opts.anneal_temp[i][0] = init_temp;
+ ir->opts.anneal_temp[i][1] = finish_temp;
+ } else {
+ ir->opts.annealing[i] = eannNO;
+ ir->opts.anneal_npoints[i] = 0;
+ }
+ }
+ } else {
+ /* file version 26 or later */
+ /* First read the lists with annealing and npoints for each group */
+ ndo_int(ir->opts.annealing,ir->opts.ngtc,bDum);
+ ndo_int(ir->opts.anneal_npoints,ir->opts.ngtc,bDum);
+ for(j=0;j<(ir->opts.ngtc);j++) {
+ k=ir->opts.anneal_npoints[j];
+ if(bRead) {
+ snew(ir->opts.anneal_time[j],k);
+ snew(ir->opts.anneal_temp[j],k);
+ }
+ ndo_real(ir->opts.anneal_time[j],k,bDum);
+ ndo_real(ir->opts.anneal_temp[j],k,bDum);
+ }
+ }
/* Cosine stuff for electric fields */
for(j=0; (j<DIM); j++) {
do_int (ir->ex[j].n);
{
int i;
bool bDum;
+ real VA[4],VB[4];
if (!bRead)
set_comment(interaction_function[ftype].name);
do_real(iparams->lj14.c12B);
break;
case F_PDIHS:
+ case F_PIDIHS:
do_real(iparams->pdihs.phiA);
do_real(iparams->pdihs.cpA);
do_real(iparams->pdihs.phiB);
do_real(iparams->orires.obs);
do_real(iparams->orires.kfac);
break;
+ case F_DIHRES:
+ do_int (iparams->dihres.power);
+ do_int (iparams->dihres.label);
+ do_real(iparams->dihres.phi);
+ do_real(iparams->dihres.dphi);
+ do_real(iparams->dihres.kfac);
+ break;
case F_POSRES:
do_rvec(iparams->posres.pos0);
do_rvec(iparams->posres.fc);
if(file_version>=25)
ndo_real(iparams->rbdihs.rbcB,NR_RBDIHS,bDum);
break;
+ case F_FOURDIHS:
+ /* Fourier dihedrals are internally represented
+ * as Ryckaert-Bellemans since those are faster to compute.
+ */
+ ndo_real(VA,NR_RBDIHS,bDum);
+ ndo_real(VB,NR_RBDIHS,bDum);
+ break;
case F_SHAKE:
case F_SHAKENC:
do_real(iparams->shake.dA);
unset_comment();
}
-static void do_idef(t_idef *idef,bool bRead)
+static void do_idef(t_idef *idef,bool bRead, int file_version)
{
int i,j,k;
bool bDum=TRUE,bClear;
ndo_int(block->a,block->nra,bDum);
}
-static void do_atom(t_atom *atom,int ngrp,bool bRead)
+static void do_atom(t_atom *atom,int ngrp,bool bRead, int file_version)
{
do_real (atom->m);
do_real (atom->q);
do_nuchar(atom->grpnr,ngrp);
}
-static void do_grps(int ngrp,t_grps grps[],bool bRead)
+static void do_grps(int ngrp,t_grps grps[],bool bRead, int file_version)
{
int i,j;
bool bDum=TRUE;
do_symstr(&(nm[j]),bRead,symtab);
}
-static void do_atoms(t_atoms *atoms,bool bRead,t_symtab *symtab)
+static void do_atoms(t_atoms *atoms,bool bRead,t_symtab *symtab, int file_version)
{
int i;
atoms->pdbinfo = NULL;
}
for(i=0; (i<atoms->nr); i++)
- do_atom(&atoms->atom[i],egcNR,bRead);
+ do_atom(&atoms->atom[i],egcNR,bRead, file_version);
do_strstr(atoms->nr,atoms->atomname,bRead,symtab);
if (bRead && (file_version <= 20)) {
for(i=0; i<atoms->nr; i++) {
do_strstr(atoms->nres,atoms->resname,bRead,symtab);
do_strstr(atoms->ngrpname,atoms->grpname,bRead,symtab);
- do_grps(egcNR,atoms->grps,bRead);
+ do_grps(egcNR,atoms->grps,bRead,file_version);
do_block(&(atoms->excl),bRead);
}
+static void do_atomtypes(t_atomtypes *atomtypes,bool bRead,t_symtab *symtab, int file_version)
+{
+ int i,j;
+ bool bDum = TRUE;
+
+ if (file_version > 25) {
+ do_int(atomtypes->nr);
+ j=atomtypes->nr;
+ if(bRead) {
+ snew(atomtypes->radius,j);
+ snew(atomtypes->vol,j);
+ snew(atomtypes->surftens,j);
+ }
+ ndo_real(atomtypes->radius,j,bDum);
+ ndo_real(atomtypes->vol,j,bDum);
+ ndo_real(atomtypes->surftens,j,bDum);
+ } else {
+ /* File versions prior to 26 cannot do GBSA, so they dont use this structure */
+ atomtypes->nr = 0;
+ atomtypes->radius = NULL;
+ atomtypes->vol = NULL;
+ atomtypes->surftens = NULL;
+ }
+}
+
static void do_symtab(t_symtab *symtab,bool bRead)
{
int i,nr;
atoms->atom[a].chain=' ';
}
-static void do_top(t_topology *top,bool bRead)
+static void do_top(t_topology *top,bool bRead, int file_version)
{
int i;
do_symtab(&(top->symtab),bRead);
do_symstr(&(top->name),bRead,&(top->symtab));
- do_atoms (&(top->atoms),bRead,&(top->symtab));
- do_idef (&(top->idef),bRead);
+ do_atoms (&(top->atoms),bRead,&(top->symtab), file_version);
+ do_atomtypes (&(top->atomtypes),bRead,&(top->symtab), file_version);
+ do_idef (&(top->idef),bRead,file_version);
for(i=0; (i<ebNR); i++)
do_block(&(top->blocks[i]),bRead);
if (bRead) {
}
}
-static void do_tpxheader(int fp,bool bRead,t_tpxheader *tpx)
+/* If TopOnlyOK is TRUE then we can read even future versions
+ * of tpx files, provided the file_generation hasn't changed.
+ * If it is FALSE, we need the inputrecord too, and bail out
+ * if the file is newer than the program.
+ *
+ * The version and generation if the topology (see top of this file)
+ * are returned in the two last arguments.
+ *
+ * If possible, we will read the inputrec even when TopOnlyOK is TRUE.
+ */
+static void do_tpxheader(int fp,bool bRead,t_tpxheader *tpx, bool TopOnlyOK, int *file_version, int *file_generation)
{
char buf[STRLEN];
bool bDouble;
int precision;
-
+ int fver,fgen;
fio_select(fp);
fio_setdebug(fp,bDebugMode());
bDouble = (precision == sizeof(double));
fio_setprecision(fp,bDouble);
do_int(precision);
- file_version = tpx_version;
+ fver = tpx_version;
}
/* Check versions! */
- do_int(file_version);
- if ((file_version <= tpx_incompatible_version) ||
- (file_version > tpx_version))
+ do_int(fver);
+
+ if(fver>=26)
+ do_int(fgen);
+ else
+ fgen=0;
+
+ if(file_version!=NULL)
+ *file_version = fver;
+ if(file_version!=NULL)
+ *file_generation = fgen;
+
+
+ if ((fver <= tpx_incompatible_version) ||
+ ((fver > tpx_version) && !TopOnlyOK) ||
+ (fgen > tpx_generation))
fatal_error(0,"reading tpx file (%s) version %d with version %d program",
- fio_getname(fp),file_version,tpx_version);
-
+ fio_getname(fp),fver,tpx_version);
+
do_section(eitemHEADER,bRead);
do_int (tpx->natoms);
do_int (tpx->step);
do_int (tpx->bV);
do_int (tpx->bF);
do_int (tpx->bBox);
+
+ if((fgen > tpx_generation)) {
+ /* This can only happen if TopOnlyOK=TRUE */
+ tpx->bIr=FALSE;
+ }
}
static void do_tpx(int fp,bool bRead,int *step,real *t,real *lambda,
t_tpxheader tpx;
t_inputrec dum_ir;
t_topology dum_top;
-
+ bool TopOnlyOK;
+ int file_version,file_generation;
+
if (!bRead) {
tpx.natoms = *natoms;
tpx.step = *step;
tpx.bBox = (box != NULL);
}
- do_tpxheader(fp,bRead,&tpx);
+ TopOnlyOK = (ir==NULL);
+ do_tpxheader(fp,bRead,&tpx,TopOnlyOK,&file_version,&file_generation);
+
if (bRead) {
*natoms = tpx.natoms;
*step = tpx.step;
*t = tpx.t;
*lambda = tpx.lambda;
}
-
+
#define do_test(b,p) if (bRead && (p!=NULL) && !b) fatal_error(0,"No %s in %s",#p,fio_getname(fp))
-
+
do_test(tpx.bBox,box);
do_section(eitemBOX,bRead);
if (tpx.bBox) ndo_rvec(box,DIM);
- do_test(tpx.bIr,ir);
- do_section(eitemIR,bRead);
- if (tpx.bIr) {
- if (ir)
- do_inputrec(ir,bRead);
- else {
- init_inputrec(&dum_ir);
- do_inputrec (&dum_ir,bRead);
- done_inputrec(&dum_ir);
+ /* Prior to tpx version 26, the inputrec was here.
+ * I moved it to enable partial forward-compatibility
+ * for analysis/viewer programs.
+ */
+ if(file_version<26) {
+ do_test(tpx.bIr,ir);
+ do_section(eitemIR,bRead);
+ if (tpx.bIr) {
+ if (ir)
+ do_inputrec(ir,bRead,file_version);
+ else {
+ init_inputrec(&dum_ir);
+ do_inputrec (&dum_ir,bRead,file_version);
+ done_inputrec(&dum_ir);
+ }
}
}
+
do_test(tpx.bTop,top);
do_section(eitemTOP,bRead);
if (tpx.bTop) {
if (top)
- do_top(top,bRead);
+ do_top(top,bRead, file_version);
else {
- do_top(&dum_top,bRead);
+ do_top(&dum_top,bRead,file_version);
done_top(&dum_top);
}
}
do_test(tpx.bF,f);
do_section(eitemF,bRead);
if (tpx.bF) ndo_rvec(f,*natoms);
+
+ /* Starting with tpx version 26, we have the inputrec
+ * at the end of the file, so we can ignore it
+ * if the file is never than the software (but still the
+ * same generation - see comments at the top of this file.
+ *
+ *
+ */
+ if((file_version>=26) && (file_generation<=tpx_generation)) {
+ do_test(tpx.bIr,ir);
+ do_section(eitemIR,bRead);
+ if (tpx.bIr && ir)
+ do_inputrec(ir,bRead,file_version);
+ }
}
/************************************************************
fio_close(fp);
}
-void read_tpxheader(char *fn,t_tpxheader *tpx)
+void read_tpxheader(char *fn,t_tpxheader *tpx, bool TopOnlyOK,int *file_version, int *file_generation)
{
int fp;
else {
#endif
fp = open_tpx(fn,"r");
- do_tpxheader(fp,TRUE,tpx);
+ do_tpxheader(fp,TRUE,tpx,TopOnlyOK,file_version,file_generation);
close_tpx(fp);
#ifdef HAVE_XML
}
{
t_tpxheader header;
real t,lambda;
- int natoms,step,i;
+ int natoms,step,i,version,generation;
bool bTop,bXNULL;
-
+
bTop=fn2bTPX(infile);
if (bTop) {
- read_tpxheader(infile,&header);
+ read_tpxheader(infile,&header,TRUE,&version,&generation);
if (x)
snew(*x,header.natoms);
if (v)
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_trnio_c = "$Id$";
+
#include <string.h>
#include "sysstuff.h"
static bool do_trnheader(int fp,bool bRead,t_trnheader *sh, bool *bOK)
{
- static int magic=GROMACS_MAGIC;
- static char *version = "GMX_trn_file";
+ const int magic=GROMACS_MAGIC;
+ const char *version = "GMX_trn_file";
static bool bFirst=TRUE;
char buf[256];
bool bDouble;
if (!*bOK) return *bOK;
bDouble = (nFloatSize(sh) == sizeof(double));
fio_setprecision(fp,bDouble);
+
if (bRead && bFirst) {
fprintf(stderr,"(%s precision)\n",bDouble ? "double" : "single");
bFirst = FALSE;
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_trxio_c = "$Id$";
+
#include <ctype.h>
#include "sysstuff.h"
#include "string2.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_tstsqrtc_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "vec.h"
int main(int argc,char *argv[])
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_txtdump_c = "$Id$";
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+/* This file is completely threadsafe - please keep it that way! */
+#ifdef USE_THREADS
+#include <pthread.h>
+#endif
+
#include <stdio.h>
#include "smalloc.h"
#include "typedefs.h"
#include "string2.h"
#include "vec.h"
-static bool bShowNumbers=TRUE;
-
-void pr_shownumbers(bool bShow)
-{
- bShowNumbers=bShow;
-}
int available(FILE *fp,void *p,char *title)
{
return (indent+INDENT);
}
-void pr_ivec(FILE *fp,int indent,char *title,int vec[],int n)
+void pr_ivec(FILE *fp,int indent,char *title,int vec[],int n, bool bShowNumbers)
{
int i;
}
}
-void pr_ivecs(FILE *fp,int indent,char *title,ivec vec[],int n)
+void pr_ivecs(FILE *fp,int indent,char *title,ivec vec[],int n, bool bShowNumbers)
{
int i,j;
}
}
-void pr_rvec(FILE *fp,int indent,char *title,real vec[],int n)
+void pr_rvec(FILE *fp,int indent,char *title,real vec[],int n, bool bShowNumbers)
{
int i;
void pr_grp_opts(FILE *out,int indent,char *title,t_grpopts *opts)
{
- int i,m;
+ int i,m,j;
fprintf(out,"%s:\n",title);
fprintf(out," %10g",opts->tau_t[i]);
fprintf(out,"\n");
+ /* Pretty-print the imulated annealing info */
+ fprintf(out,"anneal:\t\t");
+ for(i=0; (i<opts->ngtc); i++)
+ fprintf(out," %10s",EANNEAL(opts->annealing[i]));
+ fprintf(out,"\n");
+
+ fprintf(out,"ann_npoints:\t");
+ for(i=0; (i<opts->ngtc); i++)
+ fprintf(out," %10d",opts->anneal_npoints[i]);
+ fprintf(out,"\n");
+
+ for(i=0; (i<opts->ngtc); i++) {
+ if(opts->anneal_npoints[i]>0) {
+ fprintf(out,"ann. times [%d]:\t",i);
+ for(j=0; (j<opts->anneal_npoints[i]); j++)
+ fprintf(out," %10.1f",opts->anneal_time[i][j]);
+ fprintf(out,"\n");
+ fprintf(out,"ann. temps [%d]:\t",i);
+ for(j=0; (j<opts->anneal_npoints[i]); j++)
+ fprintf(out," %10.1f",opts->anneal_temp[i][j]);
+ fprintf(out,"\n");
+ }
+ }
+
pr_indent(out,indent);
fprintf(out,"acc:\t");
for(i=0; (i<opts->ngacc); i++)
fprintf(out," %10s",opts->nFreeze[i][m] ? "Y" : "N");
fprintf(out,"\n");
+
for(i=0; (i<opts->ngener); i++) {
pr_indent(out,indent);
fprintf(out,"energygrp_excl[%3d]:",i);
fprintf(fp,"%-20s = %g\n",title,r);
}
-static void pr_str(FILE *fp,int indent,char *title,char *s)
+static void pr_str(FILE *fp,int indent,char *title,const char *s)
{
pr_indent(fp,indent);
fprintf(fp,"%-20s = %s\n",title,s);
#define PR(t,s) pr_real(fp,indent,t,s)
PS("integrator",EI(ir->eI));
PI("nsteps",ir->nsteps);
+ PI("init_step",ir->init_step);
PS("ns_type",ENS(ir->ns_type));
PI("nstlist",ir->nstlist);
PI("ndelta",ir->ndelta);
PS("bDomDecomp",BOOL(ir->bDomDecomp));
PI("decomp_dir",ir->decomp_dir);
PI("nstcomm",ir->nstcomm);
+ PI("nstcheckpoint",ir->nstcheckpoint);
PI("nstlog",ir->nstlog);
PI("nstxout",ir->nstxout);
PI("nstvout",ir->nstvout);
PR("tau_p",ir->tau_p);
pr_rvecs(fp,indent,"ref_p",ir->ref_p,DIM);
pr_rvecs(fp,indent,"compress",ir->compress,DIM);
- PS("bSimAnn",BOOL(ir->bSimAnn));
- PR("zero_temp_time",ir->zero_temp_time);
+ PI("andersen_seed",ir->andersen_seed);
PR("rlist",ir->rlist);
PS("coulombtype",EELTYPE(ir->coulombtype));
PR("rcoulomb_switch",ir->rcoulomb_switch);
PR("epsilon_r",ir->epsilon_r);
else
PS("epsilon_r",infbuf);
+ PS("gb_algorithm",EGBALGORITHM(ir->gb_algorithm));
+ PI("nstgbradii",ir->nstgbradii);
+ PR("rgbradii",ir->rgbradii);
+ PR("gb_saltconc",ir->gb_saltconc);
+ PS("implicit_solvent",EIMPLICITSOL(ir->implicit_solvent));
PS("DispCorr",EDISPCORR(ir->eDispCorr));
PR("fudgeQQ",ir->fudgeQQ);
PS("free_energy",EFEPTYPE(ir->efep));
PR("sc_alpha",ir->sc_alpha);
PR("sc_sigma",ir->sc_sigma);
PR("delta_lambda",ir->delta_lambda);
+
PS("disre_weighting",EDISREWEIGHTING(ir->eDisreWeighting));
PS("disre_mixed",BOOL(ir->bDisreMixed));
PR("dr_fc",ir->dr_fc);
PR("orires_fc",ir->orires_fc);
PR("orires_tau",ir->orires_tau);
PR("nstorireout",ir->nstorireout);
+
+ PR("dihre-fc",ir->dihre_fc);
+ PR("dihre-tau",ir->dihre_tau);
+ PR("nstdihreout",ir->nstdihreout);
+
PR("em_stepsize",ir->em_stepsize);
PR("em_tol",ir->em_tol);
PI("niter",ir->niter);
PR("shake_tol",ir->shake_tol);
PI("lincs_order",ir->nProjOrder);
PR("lincs_warnangle",ir->LincsWarnAngle);
+ PI("lincs_iter",ir->nLincsIter);
PR("bd_temp",ir->bd_temp);
PR("bd_fric",ir->bd_fric);
PI("ld_seed",ir->ld_seed);
void pr_iparams(FILE *fp,t_functype ftype,t_iparams *iparams)
{
int i;
-
+ real VA[4],VB[4],*rbcA,*rbcB;
+
switch (ftype) {
case F_ANGLES:
case F_G96ANGLES:
iparams->orires.ex,iparams->orires.label,iparams->orires.power,
iparams->orires.c,iparams->orires.obs,iparams->orires.kfac);
break;
+ case F_DIHRES:
+ fprintf(fp,"label=%d, power=%4d phi=%15.8e, dphi=%15.8e, kfac=%15.8e)\n",
+ iparams->dihres.label,iparams->dihres.power,
+ iparams->dihres.phi,iparams->dihres.dphi,iparams->dihres.kfac);
+ break;
case F_POSRES:
fprintf(fp,"pos0=(%15.8e,%15.8e,%15.8e), fc=(%15.8e,%15.8e,%15.8e)\n",
iparams->posres.pos0[XX],iparams->posres.pos0[YY],
fprintf(fp,"%srbcB[%d]=%15.8e",i==0?"":", ",i,iparams->rbdihs.rbcB[i]);
fprintf(fp,"\n");
break;
+ case F_FOURDIHS:
+ /* Use the OPLS -> Ryckaert-Bellemans formula backwards to get the
+ * OPLS potential constants back.
+ */
+ rbcA = iparams->rbdihs.rbcA;
+ rbcB = iparams->rbdihs.rbcB;
+
+ VA[3] = -0.25*rbcA[4];
+ VA[2] = -0.5*rbcA[3];
+ VA[1] = 4.0*VA[3]-rbcA[2];
+ VA[0] = 3.0*VA[2]-2.0*rbcA[1];
+
+ VB[3] = -0.25*rbcB[4];
+ VB[2] = -0.5*rbcB[3];
+ VB[1] = 4.0*VB[3]-rbcB[2];
+ VB[0] = 3.0*VB[2]-2.0*rbcB[1];
+
+ for (i=0; i<NR_FOURDIHS; i++)
+ fprintf(fp,"%sFourA[%d]=%15.8e",i==0?"":", ",i,VA[i]);
+ fprintf(fp,"\n");
+ for (i=0; i<NR_FOURDIHS; i++)
+ fprintf(fp,"%sFourB[%d]=%15.8e",i==0?"":", ",i,VB[i]);
+ fprintf(fp,"\n");
+ break;
+
case F_SHAKE:
case F_SHAKENC:
fprintf(fp,"dA=%15.8e, dB=%15.8e\n",iparams->shake.dA,iparams->shake.dB);
}
static void pr_ilist(FILE *fp,int indent,char *title,
- t_idef *idef,t_ilist *ilist)
+ t_idef *idef,t_ilist *ilist, bool bShowNumbers)
{
int i,j,k,type,ftype;
t_iatom *iatoms;
}
}
-void pr_idef(FILE *fp,int indent,char *title,t_idef *idef)
+void pr_idef(FILE *fp,int indent,char *title,t_idef *idef, bool bShowNumbers)
{
int i,j;
}
for(j=0; (j<F_NRE); j++)
pr_ilist(fp,indent,interaction_function[j].longname,
- idef,&idef->il[j]);
+ idef,&idef->il[j],bShowNumbers);
}
}
return indent;
}
-static void low_pr_block(FILE *fp,int indent,char *title,t_block *block)
+static void low_pr_block(FILE *fp,int indent,char *title,t_block *block, bool bShowNumbers)
{
int i;
}
}
-void pr_block(FILE *fp,int indent,char *title,t_block *block)
+void pr_block(FILE *fp,int indent,char *title,t_block *block, bool bShowNumbers)
{
int i,j,ok,size,start,end;
{
(void) pr_indent(fp,indent);
(void) fprintf(fp,"tables inconsistent, dumping complete tables:\n");
- low_pr_block(fp,indent,title,block);
+ low_pr_block(fp,indent,title,block,bShowNumbers);
}
}
}
static void pr_blocks(FILE *fp,int indent,char *title,
- t_block block[],int n,char *block_names[])
+ t_block block[],int n,const char *block_names[], bool bShowNumbers)
{
int i;
char s[STRLEN];
sprintf(s,"%s[%d]",title,i);
else
sprintf(s,"%s[%s]",title,block_names[i]);
- pr_block(fp,indent,s,&(block[i]));
+ pr_block(fp,indent,s,&(block[i]),bShowNumbers);
}
}
}
}
static void pr_grps(FILE *fp,int indent,char *title,t_grps grps[],int ngrp,
- char **grpname[])
+ char **grpname[], bool bShowNumbers)
{
int i,j;
}
}
-static void pr_strings(FILE *fp,int indent,char *title,char ***nm,int n)
+static void pr_strings(FILE *fp,int indent,char *title,char ***nm,int n, bool bShowNumbers)
{
int i;
}
static void pr_strings2(FILE *fp,int indent,char *title,
- char ***nm,char ***nmB,int n)
+ char ***nm,char ***nmB,int n, bool bShowNumbers)
{
int i;
}
}
-static void pr_atoms(FILE *fp,int indent,char *title,t_atoms *atoms)
+static void pr_atoms(FILE *fp,int indent,char *title,t_atoms *atoms, bool bShownumbers)
{
if (available(fp,atoms,title))
{
indent=pr_title(fp,indent,title);
pr_atom(fp,indent,"atom",atoms->atom,atoms->nr);
- pr_grps(fp,indent,"grp",atoms->grps,egcNR,atoms->grpname);
- pr_strings(fp,indent,"atom",atoms->atomname,atoms->nr);
- pr_strings2(fp,indent,"type",atoms->atomtype,atoms->atomtypeB,atoms->nr);
- pr_strings(fp,indent,"residue",atoms->resname,atoms->nres);
- pr_strings(fp,indent,"grpname",atoms->grpname,atoms->ngrpname);
- pr_block(fp,indent,"excl",&atoms->excl);
+ pr_grps(fp,indent,"grp",atoms->grps,egcNR,atoms->grpname,bShownumbers);
+ pr_strings(fp,indent,"atom",atoms->atomname,atoms->nr,bShownumbers);
+ pr_strings2(fp,indent,"type",atoms->atomtype,atoms->atomtypeB,atoms->nr,bShownumbers);
+ pr_strings(fp,indent,"residue",atoms->resname,atoms->nres,bShownumbers);
+ pr_strings(fp,indent,"grpname",atoms->grpname,atoms->ngrpname,bShownumbers);
+ pr_block(fp,indent,"excl",&atoms->excl,bShownumbers);
}
}
-void pr_top(FILE *fp,int indent,char *title,t_topology *top)
+static void pr_atomtypes(FILE *fp,int indent,char *title,t_atomtypes *atomtypes, bool bShowNumbers)
+{
+ int i;
+ if (available(fp,atomtypes,title)) {
+ indent=pr_title(fp,indent,title);
+ for(i=0;i<atomtypes->nr;i++) {
+ pr_indent(fp,indent);
+ fprintf(fp,"atomtype[%3d]={radius=%12.5e, volume=%12.5e, surftens=%12.5e)}\n",
+ bShowNumbers?i:-1,atomtypes->radius[i],atomtypes->vol[i],atomtypes->surftens[i]);
+ }
+ }
+}
+
+void pr_top(FILE *fp,int indent,char *title,t_topology *top, bool bShowNumbers)
{
if (available(fp,top,title)) {
indent=pr_title(fp,indent,title);
(void) pr_indent(fp,indent);
(void) fprintf(fp,"name=\"%s\"\n",*(top->name));
- pr_atoms(fp,indent,"atoms",&(top->atoms));
- pr_blocks(fp,indent,"blocks",top->blocks,ebNR,eblock_names);
- pr_idef(fp,indent,"idef",&top->idef);
+ pr_atoms(fp,indent,"atoms",&(top->atoms),bShowNumbers);
+ pr_atomtypes(fp,indent,"atomtypes",&(top->atomtypes),bShowNumbers);
+ pr_blocks(fp,indent,"blocks",top->blocks,ebNR,eblock_names, bShowNumbers);
+ pr_idef(fp,indent,"idef",&top->idef,bShowNumbers);
}
}
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_typedefs_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
#include "smalloc.h"
#include "assert.h"
#include "symtab.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_vec_c = "$Id$";
+
#include <typedefs.h>
#include <vec.h>
#include <detectcpu.h>
* Assembly routines are used for Alpha processors, AMD processors
* with 3DNow. On IBM we use the MASS libraries if they are present.
*
- * WE ALSO HAVE AN ASSEMBLY LOOP FOR PENTIUM PROCESSORS, BUT IT CAN
- * ONLY BE USED IF YOUR INPUT AND OUTPUT ARRAYS ARE ALIGNED TO
- * THE CACHE LINE!
- * This is not complicated to do, but you must do it when you allocate
- * your memory. Start by allocating 31 bytes more than you need, put
- * this in a temp variable (e.g. _buf, so you can free it later), and
- * create your aligned array buf with
- *
- * buf=(real *) ( ( (unsigned long int)_buf + 31 ) & (~0x1f) );
- *
- * And, of course, simliar for your output buffer.
- * If you have an SSE-enabled CPU (pentium III and later) and OS
- * (Linux 2.4 and later) you will now be able to perform 1/sqrt(x)
- * in 3-4 clocks/element for long lists!
+ * We cannot call the SSE/3DNow/SSE2/Altivec from this general loop,
+ * since the CPU detection is costly and we dont want to maintain
+ * a separate variable for the cpu detected. Call detectcpu()
+ * yourself, and use the SSE/3DNow/SSE2/Altivec versions directly
+ * if the flags match.
*/
void vecinvsqrt(real in[],real out[],int n)
sqrtiv_(in,out,&n);
# else /* SINGLE */
ssqrtiv_(in,out,&n);
-# endif
+# endif /* SINGLE/DOUBLE */
#elif defined HAVE_LIBMASSV_ANY
/* On IBM we should definitely use vectorized MASS if present. */
# ifdef DOUBLE
vrsqrt(out,in,&n);
# else /* SINGLE */
vsrsqrt(out,in,&n);
-# endif
-#else /* not alpha, and not IBM with MASS */
- /* Software routines and calls to x86 assembly. */
-#ifdef SOFTWARE_INVSQRT
+# endif /* SINGLE/DOUBLE */
+#elif defined SOFTWARE_INVSQRT /* gromacs software 1/sqrt*/
const real half=0.5;
const real three=3.0;
t_convert result,bit_pattern;
real x;
#ifdef DOUBLE
real y;
-#endif
-#endif /* VARIABLES FOR SOFTWARE_INVSQRT */
- int i;
-
-#if (defined USE_X86_SSE_AND_3DNOW && !defined DOUBLE)
- static bool bFirst=TRUE;
- static int cpu_capabilities;
-
- if(bFirst) {
- cpu_capabilities=detect_cpu(NULL);
- bFirst=FALSE;
- }
-
- if((cpu_capabilities & X86_SSE_SUPPORT) && !((unsigned long int)in & 0x1f) && !((unsigned long int)out & 0x1f)) /* SSE data must be cache aligned */
- vecinvsqrt_sse(in,out,n);
- else if(cpu_capabilities & X86_3DNOW_SUPPORT)
- vecinvsqrt_3dnow(in,out,n);
- else
-#endif /* no x86 optimizations */
-#if (defined USE_X86_SSE2 && defined DOUBLE)
- static bool bFirst=TRUE;
- static int cpu_capabilities;
-
- if(bFirst) {
- cpu_capabilities=detect_cpu(NULL);
- bFirst=FALSE;
- }
-
- if((cpu_capabilities & X86_SSE2_SUPPORT) && !((unsigned long int)in & 0x1f) && !((unsigned long int)out & 0x1f)) /* SSE2 data must be cache aligned */
- vecinvsqrt_sse2(in,out,n);
- else
-#endif /* no sse2 optimizations */
-#ifdef SOFTWARE_INVSQRT
- for(i=0;i<n;i++) {
- x=in[i];
- bit_pattern.fval=x;
- exp = EXP_ADDR(bit_pattern.bval);
- fract = FRACT_ADDR(bit_pattern.bval);
- result.bval=cinvsqrtexptab[exp] | cinvsqrtfracttab[fract];
- lu = result.fval;
-
-#ifdef DOUBLE
- y=(half*lu*(three-((x*lu)*lu)));
- out[i]=(half*y*(three-((x*y)*y)));
-#else
- out[i]=(half*lu*(three-((x*lu)*lu)));
-#endif
- }
-#else /* no gmx invsqrt */
+#endif /* DOUBLE */
+#else /* NO INVSQRT */
+ int i;
for(i=0;i<n;i++)
out[i]=1.0f/sqrt(in[i]);
#endif /* SOFTWARE_INVSQRT */
-#endif
}
int i;
-#if (defined USE_X86_SSE_AND_3DNOW && !defined DOUBLE)
- static bool bFirst=TRUE;
- static int cpu_capabilities;
-
- if(bFirst) {
- cpu_capabilities=detect_cpu(NULL);
- bFirst=FALSE;
- }
- if((cpu_capabilities & X86_SSE_SUPPORT) && !((unsigned long int)in & 0x1f) && !((unsigned long int)out & 0x1f)) /* SSE data must be cache aligned */
- vecrecip_sse(in,out,n);
- else if(cpu_capabilities & X86_3DNOW_SUPPORT)
- vecrecip_3dnow(in,out,n);
- else
-#endif /* no x86 optimizations */
-#if (defined USE_X86_SSE2 && defined DOUBLE)
- static bool bFirst=TRUE;
- static int cpu_capabilities;
-
- if(bFirst) {
- cpu_capabilities=detect_cpu(NULL);
- bFirst=FALSE;
- }
- if((cpu_capabilities & X86_SSE2_SUPPORT) && !((unsigned long int)in & 0x1f) && !((unsigned long int)out & 0x1f)) /* SSE2 data must be cache aligned */
- vecrecip_sse2(in,out,n);
- else
-#endif /* no sse2 optimizations */
for(i=0;i<n;i++)
out[i]=1.0f/(in[i]);
#endif
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_viewit_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include <string.h>
#include "statutil.h"
#include "viewit.h"
#include "filenm.h"
#include "macros.h"
-static int can_view_ftp[] = { 0,
+static const int can_view_ftp[] = { 0,
efEPS, efXPM, efXVG, efPDB };
#define NVIEW asize(can_view_ftp)
-static char* view_program[] = { NULL,
- "ghostview", "xv", NULL, "xterm -e rasmol" };
+static const char* view_program[] = { NULL,
+ "ghostview", "display", NULL, "xterm -e rasmol" };
int can_view(int ftp)
{
void do_view(char *fn, char *opts)
{
#define N_EXT 3
- char buf[STRLEN], env[20], ext[N_EXT], *cmd;
+ char buf[STRLEN], env[20], ext[N_EXT];
+ const char *cmd;
int ftp, n;
if (bDoView() && fn) {
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_wgms_c = "$Id$";
+
#include <stdio.h>
#include "gstat.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_widget_c = "$Id$";
+
#include "widget.h"
#include "smalloc.h"
#include "fatal.h"
w[win].other = www;
}
-XmString char2xms(char *ptr)
+XmString char2xms(const char *ptr)
{
return XmStringCreate(ptr,XmSTRING_DEFAULT_CHARSET);
}
#ifndef _widget_h
#define _widget_h
-static char *SRCID_widget_h = "$Id$";
+
#include "typedefs.h"
#include <Xm/Xm.h>
extern void set_widget_other(windex win,Widget www);
extern void mk_desc_callbacks(void);
-extern XmString char2xms(char *ptr);
+extern XmString char2xms(const char *ptr);
extern char *xms2char(XmString xms);
#endif
* And Hey:
* Great Red Owns Many ACres of Sand
*/
-static char *SRCID_wman_c = "$Id$";
#include "string2.h"
#include "smalloc.h"
#include "sysstuff.h"
char *search,*replace;
} t_sandr;
-t_sandr sandrTeX[] = {
+const t_sandr sandrTeX[] = {
{ "[TT]", "{\\tt " },
{ "[tt]", "}" },
{ "[BB]", "{\\bf " },
};
#define NSRTEX asize(sandrTeX)
-t_sandr sandrTty[] = {
+const t_sandr sandrTty[] = {
{ "[TT]", "" },
{ "[tt]", "" },
{ "[BB]", "" },
};
#define NSRTTY asize(sandrTty)
-t_sandr sandrNROFF[] = {
+const t_sandr sandrNROFF[] = {
{ "[TT]", "\n.B " },
{ "[tt]", "\n" },
{ "[BB]", "\n.B " },
};
#define NSRNROFF asize(sandrNROFF)
-t_sandr sandrHTML[] = {
+const t_sandr sandrHTML[] = {
{ "<", "<" },
{ ">", ">" },
{ "[TT]", "<tt>" },
};
#define NSRHTML asize(sandrHTML)
-static char *mydate(void)
+static char *mydate(char buf[], int maxsize)
{
- static char *mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ const char *mon[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
- static char *day[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
+ const char *day[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
time_t now;
- static char tbuf[128];
struct tm *tm;
(void) time(&now);
tm = localtime(&now);
- sprintf(tbuf,"%s %d %s %d",day[tm->tm_wday],tm->tm_mday,
+ /* subtract one from maxsize, so we have room for \0. */
+ snprintf(buf,maxsize-1,"%s %d %s %d",day[tm->tm_wday],tm->tm_mday,
mon[tm->tm_mon],tm->tm_year+1900);
- return tbuf;
+ return buf;
}
-static char *repall(char *s,int nsr,t_sandr sa[])
+static const char *repall(const char *s,int nsr,const t_sandr sa[])
{
int i;
- char *buf,*buf2;
+ const char *buf;
+ char *buf2;
- buf=s;
+ buf=s;
for(i=0; (i<nsr); i++) {
buf2=replace(buf,sa[i].search,sa[i].replace);
if (i && buf)
}
return buf;
-}
+}
-static char *repallww(char *s,int nsr,t_sandr sa[])
+static char *repallww(char *s,int nsr,const t_sandr sa[])
{
int i;
char *buf,*buf2;
- buf=s;
+ buf=s;
for(i=0; (i<nsr); i++) {
buf2=replaceww(buf,sa[i].search,sa[i].replace);
if (i && buf)
return buf;
}
-char *check_tex(char *s)
+const char *check_tex(const char *s)
{
return repall(s,NSRTEX,sandrTeX);
}
-char *check_nroff(char *s)
+static const char *check_nroff(const char *s)
{
return repall(s,NSRNROFF,sandrNROFF);
}
-static char *html_xref(char *s,char *program)
+/* Data structure for saved HTML links */
+typedef struct {
+ int nsr;
+ t_sandr *sr;
+} t_linkdata;
+
+static t_linkdata *init_linkdata()
+{
+ t_linkdata *p;
+ snew(p,1);
+ p->sr=NULL;
+ p->nsr=0;
+
+ return p;
+}
+
+static void finish_linkdata(t_linkdata *p)
+{
+ int i;
+
+ sfree(p->sr);
+ for(i=0;i<p->nsr;i++) {
+ sfree(p->sr[i].search);
+ sfree(p->sr[i].replace);
+ }
+ sfree(p);
+}
+
+
+static char *html_xref(char *s,char *program, t_linkdata *links)
{
- static int nstr;
- static char **str;
- static t_sandr *sr=NULL;
- char buf[256];
- int i,j;
+ char buf[256],**filestr;
+ int i,j,n;
- if (sr == NULL) {
- nstr=get_file("links.dat",&str);
- snew(sr,nstr);
- for(i=j=0; (i<nstr); i++) {
- if (!program || (strcasecmp(program,str[i]) != 0)) {
- sr[j].search=str[i];
- sprintf(buf,"<a href=\"%s.html\">%s</a>",str[i],str[i]);
- sr[j].replace=strdup(buf);
+ if (links->sr == NULL) {
+ n=get_file("links.dat",&(filestr));
+ links->nsr=n;
+ snew(links->sr,n);
+ for(i=0,j=0; (i<n); i++) {
+ if (!program || (strcasecmp(program,filestr[i]) != 0)) {
+ links->sr[j].search=strdup(filestr[i]);
+ sprintf(buf,"<a href=\"%s.html\">%s</a>",filestr[i],filestr[i]);
+ links->sr[j].replace=strdup(buf);
j++;
}
}
- nstr=j;
+ links->nsr=j;
+ for(i=0;i<n;i++)
+ sfree(filestr[i]);
+ sfree(filestr);
}
- return repallww(s,nstr,sr);
+ return repallww(s,links->nsr,links->sr);
}
#define FLAG_SET(flag, mask) ((flag & mask) == mask)
-char *fileopt(unsigned long flag)
+char *fileopt(unsigned long flag,char buf[],int maxsize)
{
- static char buf[32];
+ char tmp[256];
if (FLAG_SET(flag, ffRW))
- strcpy(buf,"In/Out");
+ sprintf(tmp,"In/Out");
else if (FLAG_SET(flag, ffREAD))
- strcpy(buf,"Input");
+ sprintf(tmp,"Input");
else if (FLAG_SET(flag, ffWRITE))
- strcpy(buf,"Output");
+ sprintf(tmp,"Output");
else
- strcpy(buf,"Dunno");
+ sprintf(tmp,"Dunno");
+
if (FLAG_SET(flag, ffOPT)) {
- strcat(buf,", Opt");
+ strcat(tmp,", Opt");
if (FLAG_SET(flag, ffSET))
- strcat(buf,"!");
+ strcat(tmp,"!");
else
- strcat(buf,".");
+ strcat(tmp,".");
}
if (FLAG_SET(flag, ffLIB))
- strcat(buf,", Lib.");
+ strcat(tmp,", Lib.");
if (FLAG_SET(flag, ffMULT))
- strcat(buf,", Mult.");
+ strcat(tmp,", Mult.");
+
+ snprintf(buf,maxsize-1,tmp);
+
return buf;
}
int nbug,char **bugs)
{
int i;
+ char tmp[256];
fprintf(out,"\\section{\\normindex{%s}}\n\n",check_tex(program));
fprintf(out,"\\>{\\tt %s} \\'\\> {\\tt %s} \\' %s \\> "
"\\parbox[t]{0.55\\linewidth}{%s} \\\\\n",
check_tex(fnm[i].opt),check_tex(fnm[i].fns[0]),
- check_tex(fileopt(fnm[i].flag)),
+ check_tex(fileopt(fnm[i].flag,tmp,255)),
check_tex(ftp2desc(fnm[i].ftp)));
fprintf(out,"\\end{tabbing}\\vspace{-4ex}\n");
}
fprintf(out,"{\\tt ~~~~~~~~~~} \\= vector \\= "
"{\\tt ~~~~~~~} \\= \\nopagebreak\\kill\n");
for(i=0; (i<npargs); i++) {
- if (strlen(check_tex(pa_val(&(pa[i])))) <= 8)
+ if (strlen(check_tex(pa_val(&(pa[i]),tmp,255))) <= 8)
fprintf(out,"\\> {\\tt %s} \\'\\> %s \\'\\> {\\tt %s} \\' "
"\\parbox[t]{0.68\\linewidth}{%s}\\\\\n",
check_tex(pa[i].option),argtp[pa[i].type],
- check_tex(pa_val(&(pa[i]))),
+ check_tex(pa_val(&(pa[i]),tmp,255)),
check_tex(pa[i].desc));
else
fprintf(out,"\\> {\\tt %s} \\'\\> %s \\'\\>\\\\\n"
"\\> \\'\\> \\'\\> {\\tt %s} \\' "
"\\parbox[t]{0.7\\linewidth}{%s}\\\\\n",
check_tex(pa[i].option),argtp[pa[i].type],
- check_tex(pa_val(&(pa[i]))),
+ check_tex(pa_val(&(pa[i]),tmp,255)),
check_tex(pa[i].desc));
}
fprintf(out,"\\end{tabbing}\\vspace{-4ex}\n");
{
int i;
+ char tmp[256];
+
- fprintf(out,".TH %s 1 \"%s\"\n",program,mydate());
+ fprintf(out,".TH %s 1 \"%s\"\n",program,mydate(tmp,255));
fprintf(out,".SH NAME\n");
fprintf(out,"%s\n",program);
fprintf(out,".B %s\n",GromacsVersion());
fprintf(out,".SH FILES\n");
for(i=0; (i<nfile); i++)
fprintf(out,".BI \"%s\" \" %s\" \n.B %s\n %s \n\n",
- fnm[i].opt,fnm[i].fns[0],fileopt(fnm[i].flag),
+ fnm[i].opt,fnm[i].fns[0],fileopt(fnm[i].flag,tmp,255),
check_nroff(ftp2desc(fnm[i].ftp)));
}
if (pa[i].type == etBOOL)
fprintf(out,".BI \"-[no]%s\" \"%s\"\n %s\n\n",
check_nroff(pa[i].option+1),
- pa_val(&(pa[i])),check_nroff(pa[i].desc));
+ pa_val(&(pa[i]),tmp,255),check_nroff(pa[i].desc));
else
fprintf(out,".BI \"%s\" \" %s\" \" %s\" \n %s\n\n",
check_nroff(pa[i].option),argtp[pa[i].type],
- pa_val(&(pa[i])),check_nroff(pa[i].desc));
+ pa_val(&(pa[i]),tmp,255),check_nroff(pa[i].desc));
}
}
}
-char *check_tty(char *s)
+const char *check_tty(const char *s)
{
return repall(s,NSRTTY,sandrTty);
}
void print_tty_formatted(FILE *out, int nldesc, char **desc)
{
- char *buf,*temp;
+ char *buf;
+ const char *temp;
int i,j;
/* Just to be sure */
int nbug,char **bugs,bool bHeader)
{
int i;
+ char buf[256];
char *tmp;
if (bHeader) {
fprintf(out,"%s\n\n",check_tty(program));
- fprintf(out,"%s\n%s\n",GromacsVersion(),mydate());
+ fprintf(out,"%s\n%s\n",GromacsVersion(),mydate(buf,255));
}
if (nldesc > 0) {
fprintf(out,"DESCRIPTION:\n\n");
}
}
-char *check_html(char *s,char *program)
+static const char *check_html(const char *s,char *program, t_linkdata *links)
{
- char *buf;
+ const char *buf;
buf=repall(s,NSRHTML,sandrHTML);
- buf=html_xref(buf,program);
+ buf=html_xref(buf,program,links);
return buf;
}
int nbug,char **bugs)
{
int i;
- char link[10];
+ char link[10],tmp[255];
+ t_linkdata *links;
-#define NSR(s) check_html(s,program)
+ links=init_linkdata();
+
+#define NSR(s) check_html(s,program,links)
fprintf(out,"<HTML>\n<HEAD>\n<TITLE>%s</TITLE>\n",program);
fprintf(out,"<LINK rel=stylesheet href=\"style.css\" type=\"text/css\">\n");
"<br><h2>%s</h2>",program);
fprintf(out,"<font size=-1><A HREF=\"../online.html\">Main Table of Contents</A></font><br>");
fprintf(out,"<br></td>\n</TABLE></TD><TD WIDTH=\"*\" ALIGN=RIGHT VALIGN=BOTTOM><p><B>%s<br>\n",GromacsVersion());
- fprintf(out,"%s</B></td></tr></TABLE>\n<HR>\n",mydate());
+ fprintf(out,"%s</B></td></tr></TABLE>\n<HR>\n",mydate(tmp,255));
if (nldesc > 0) {
fprintf(out,"<H3>Description</H3>\n<p>\n");
"<TD> %s </TD>"
"<TD> %s </TD>"
"</TR>\n",
- fnm[i].opt,link,fnm[i].fns[0],fileopt(fnm[i].flag),
+ fnm[i].opt,link,fnm[i].fns[0],fileopt(fnm[i].flag,tmp,255),
NSR(ftp2desc(fnm[i].ftp)));
}
fprintf(out,"</TABLE>\n");
"<TD> %s </TD>"
"</TD>\n",
(pa[i].type == etBOOL)?"-[no]":"-",pa[i].option+1,
- argtp[pa[i].type],pa_val(&(pa[i])),NSR(pa[i].desc));
+ argtp[pa[i].type],pa_val(&(pa[i]),tmp,255),NSR(pa[i].desc));
fprintf(out,"</TABLE>\n");
}
if (nbug > 0) {
"gromacs@gromacs.org</a></font><br>\n");
fprintf(out,"</div>\n");
fprintf(out,"</BODY>\n");
+
+ finish_linkdata(links);
}
static void pr_opts(FILE *fp,
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_writeps_c = "$Id$";
+
#include <stdio.h>
#include "futil.h"
#include "fatal.h"
#include "writeps.h"
#include "smalloc.h"
-static int maxrgb=0;
-static int nrgb=0;
-static t_rgb *rgb=NULL;
+const char *fontnm[efontNR] = {
+ "Times-Roman","Times-Italic", "Times-Bold", "Times-BoldItalic",
+ "Helvetica", "Helvetica-Oblique","Helvetica-Bold","Helvetica-BoldOblique",
+ "Courier", "Courier-Oblique", "Courier-Bold", "Courier-BoldOblique"
+};
+
+
+/* Internal psdata structure (abstract datatype)
+ * to maintain the current state of the ps engine.
+ */
+struct t_int_psdata {
+ FILE *fp;
+ int maxrgb;
+ int nrgb;
+ t_rgb *rgb;
+ real gen_ybox;
+ int ostack;
+};
-FILE *ps_open(char *fn,real x1,real y1,real x2,real y2)
+
+t_psdata ps_open(char *fn,real x1,real y1,real x2,real y2)
{
- FILE *ps;
+ t_psdata ps;
+
+ snew(ps,1);
+
+ ps->fp=ffopen(fn,"w");
+ fprintf(ps->fp,"%%!PS-Adobe-2.0 EPSF-1.2\n");
+ fprintf(ps->fp,"%%%%Creator: GROMACS\n");
+ fprintf(ps->fp,"%%%%Title: %s\n",fn);
+ fprintf(ps->fp,"%%%%BoundingBox: %g %g %g %g\n",x1,y1,x2,y2);
+ fprintf(ps->fp,"%%%%EndComments\n");
+ fprintf(ps->fp,"/m {moveto} bind def\n");
+ fprintf(ps->fp,"/l {lineto} bind def\n");
+ fprintf(ps->fp,"/rm {rmoveto} bind def\n");
+ fprintf(ps->fp,"/r {rlineto} bind def\n");
+ fprintf(ps->fp,"/f {fill} bind def\n");
+ fprintf(ps->fp,"/s {stroke} bind def\n");
+
+ ps->nrgb=0;
+ ps->maxrgb=0;
+ ps->rgb=NULL;
+ ps->gen_ybox=0;
+ ps->ostack=0;
- ps=ffopen(fn,"w");
- fprintf(ps,"%%!PS-Adobe-2.0 EPSF-1.2\n");
- fprintf(ps,"%%%%Creator: GROMACS\n");
- fprintf(ps,"%%%%Title: %s\n",fn);
- fprintf(ps,"%%%%BoundingBox: %g %g %g %g\n",x1,y1,x2,y2);
- fprintf(ps,"%%%%EndComments\n");
- fprintf(ps,"/m {moveto} bind def\n");
- fprintf(ps,"/l {lineto} bind def\n");
- fprintf(ps,"/rm {rmoveto} bind def\n");
- fprintf(ps,"/r {rlineto} bind def\n");
- fprintf(ps,"/f {fill} bind def\n");
- fprintf(ps,"/s {stroke} bind def\n");
-
- if (nrgb > 0) {
- fprintf(stderr,"Warning: resetting color table in %s when opening %s\n",
- __FILE__,fn);
- nrgb=0;
- }
-
return ps;
}
-void ps_linewidth(FILE *ps, int lw)
+void ps_linewidth(t_psdata ps, int lw)
{
- fprintf(ps,"%d setlinewidth\n",lw);
+ fprintf(ps->fp,"%d setlinewidth\n",lw);
}
-static void ps_defcolor(FILE *ps,real r,real g,real b,char *cname)
+static void ps_defcolor(t_psdata ps,real r,real g,real b,char *cname)
{
- fprintf(ps,"/%s {%g %g %g setrgbcolor} bind def\n",cname,r,g,b);
+ fprintf(ps->fp,"/%s {%g %g %g setrgbcolor} bind def\n",cname,r,g,b);
}
-static void ps_selcolor(FILE *ps,char *cname)
+static void ps_selcolor(t_psdata ps,char *cname)
{
- fprintf(ps,"%s\n",cname);
+ fprintf(ps->fp,"%s\n",cname);
}
-static char *i2a(int i)
-{
- static char buf[12];
-
- sprintf(buf,"C%d",i);
-
- return buf;
-}
-
-static int search_col(FILE *ps,real r,real g,real b)
+static int search_col(t_psdata ps,real r,real g,real b)
{
int i;
+ char buf[12];
- for(i=0; (i<nrgb); i++)
- if ((rgb[i].r == r) && (rgb[i].g == g) && (rgb[i].b == b))
+ for(i=0; (i<ps->nrgb); i++)
+ if ((ps->rgb[i].r == r) && (ps->rgb[i].g == g) && (ps->rgb[i].b == b))
return i;
- if (nrgb >= maxrgb) {
- maxrgb+=100;
- srenew(rgb,maxrgb);
+ if (ps->nrgb >= ps->maxrgb) {
+ ps->maxrgb+=100;
+ srenew(ps->rgb,ps->maxrgb);
}
- ps_defcolor(ps,r,g,b,i2a(nrgb));
- fprintf(ps,"/B%d {%s b} bind def\n",nrgb,i2a(nrgb));
- rgb[i].r=r;
- rgb[i].g=g;
- rgb[i].b=b;
- nrgb++;
+ snprintf(buf,11,"C%d",ps->nrgb);
+ ps_defcolor(ps,r,g,b,buf);
+ fprintf(ps->fp,"/B%d {%s b} bind def\n",ps->nrgb,buf);
+ ps->rgb[i].r=r;
+ ps->rgb[i].g=g;
+ ps->rgb[i].b=b;
+ ps->nrgb++;
- return nrgb-1;
+ return (ps->nrgb-1);
}
-void ps_color(FILE *ps,real r,real g,real b)
+void ps_color(t_psdata ps,real r,real g,real b)
{
- ps_selcolor(ps,i2a(search_col(ps,r,g,b)));
+ char buf[12];
+ int i;
+
+ i=search_col(ps,r,g,b);
+
+ snprintf(buf,11,"C%d",i);
+ ps_selcolor(ps,buf);
}
-void ps_rgb(FILE *ps,t_rgb *rgb)
+void ps_rgb(t_psdata ps,t_rgb *rgb)
{
ps_color(ps,rgb->r,rgb->g,rgb->b);
}
-static real gen_ybox=0;
-void ps_init_rgb_nbox(FILE *ps,real xbox, real ybox)
+void ps_init_rgb_nbox(t_psdata ps,real xbox, real ybox)
{
- gen_ybox=ybox;
- fprintf(ps,"/by {def currentpoint "
+ ps->gen_ybox=ybox;
+ fprintf(ps->fp,"/by {def currentpoint "
"%g y r %g %g r %g y neg r %g %g r f y add moveto} bind def\n",
0.0,xbox,0.0,0.0,-xbox,0.0);
/* macro bn is used in ps_rgb_nbox to draw rectangular boxes */
}
-void ps_rgb_nbox(FILE *ps,t_rgb *rgb,real n)
+void ps_rgb_nbox(t_psdata ps,t_rgb *rgb,real n)
{
int i;
if ( n>2 ) {
ps_rgb(ps,rgb);
- fprintf(ps,"/y %g by\n",n*gen_ybox);
+ fprintf(ps->fp,"/y %g by\n",n*ps->gen_ybox);
/* macro by is defined in ps_init_rgb_nbox */
} else
for (i=0; (i<n); i++)
}
-void ps_init_rgb_box(FILE *ps,real xbox, real ybox)
+void ps_init_rgb_box(t_psdata ps,real xbox, real ybox)
{
- fprintf(ps,"/b {currentpoint "
+ fprintf(ps->fp,"/b {currentpoint "
"%g %g r %g %g r %g %g r %g %g r f %g add moveto} bind def\n",
0.0,ybox,xbox,0.0,0.0,-ybox,-xbox,0.0,ybox);
/* macro b is used in search_col to define macro B */
}
-void ps_rgb_box(FILE *ps,t_rgb *rgb)
+void ps_rgb_box(t_psdata ps,t_rgb *rgb)
{
- fprintf(ps,"B%d\n",search_col(ps,rgb->r,rgb->g,rgb->b));
+ fprintf(ps->fp,"B%d\n",search_col(ps,rgb->r,rgb->g,rgb->b));
/* macro B is defined in search_col from macro b */
}
-void ps_lineto(FILE *ps,real x,real y)
+void ps_lineto(t_psdata ps,real x,real y)
{
- fprintf(ps,"%g %g l\n",x,y);
+ fprintf(ps->fp,"%g %g l\n",x,y);
}
-void ps_linerel(FILE *ps,real dx,real dy)
+void ps_linerel(t_psdata ps,real dx,real dy)
{
- fprintf(ps,"%g %g r\n",dx,dy);
+ fprintf(ps->fp,"%g %g r\n",dx,dy);
}
-void ps_moveto(FILE *ps,real x,real y)
+void ps_moveto(t_psdata ps,real x,real y)
{
- fprintf(ps,"%g %g m\n",x,y);
+ fprintf(ps->fp,"%g %g m\n",x,y);
}
-void ps_moverel(FILE *ps,real dx,real dy)
+void ps_moverel(t_psdata ps,real dx,real dy)
{
- fprintf(ps,"%g %g rm\n",dx,dy);
+ fprintf(ps->fp,"%g %g rm\n",dx,dy);
}
-void ps_line(FILE *ps,real x1,real y1,real x2,real y2)
+void ps_line(t_psdata ps,real x1,real y1,real x2,real y2)
{
ps_moveto(ps,x1,y1);
ps_lineto(ps,x2,y2);
- fprintf(ps,"s\n");
+ fprintf(ps->fp,"s\n");
}
-static void do_box(FILE *ps,real x1,real y1,real x2,real y2)
+static void do_box(t_psdata ps,real x1,real y1,real x2,real y2)
{
ps_moveto(ps,x1,y1);
ps_linerel(ps,0,(real)(y2-y1));
ps_linerel(ps,(real)(x1-x2),0);
}
-void ps_box(FILE *ps,real x1,real y1,real x2,real y2)
+void ps_box(t_psdata ps,real x1,real y1,real x2,real y2)
{
do_box(ps,x1,y1,x2,y2);
- fprintf(ps,"s\n");
+ fprintf(ps->fp,"s\n");
}
-void ps_fillbox(FILE *ps,real x1,real y1,real x2,real y2)
+void ps_fillbox(t_psdata ps,real x1,real y1,real x2,real y2)
{
do_box(ps,x1,y1,x2,y2);
- fprintf(ps,"f\n");
+ fprintf(ps->fp,"f\n");
}
-void ps_arc(FILE *ps,real x1,real y1,real rad,real a0,real a1)
+void ps_arc(t_psdata ps,real x1,real y1,real rad,real a0,real a1)
{
- fprintf(ps,"%g %g %g %g %g arc s\n",x1,y1,rad,a0,a1);
+ fprintf(ps->fp,"%g %g %g %g %g arc s\n",x1,y1,rad,a0,a1);
}
-void ps_fillarc(FILE *ps,real x1,real y1,real rad,real a0,real a1)
+void ps_fillarc(t_psdata ps,real x1,real y1,real rad,real a0,real a1)
{
- fprintf(ps,"%g %g %g %g %g arc f\n",x1,y1,rad,a0,a1);
+ fprintf(ps->fp,"%g %g %g %g %g arc f\n",x1,y1,rad,a0,a1);
}
-void ps_arcslice(FILE *ps,real xc,real yc,
+void ps_arcslice(t_psdata ps,real xc,real yc,
real rad1,real rad2,real a0,real a1)
{
- fprintf(ps,"newpath %g %g %g %g %g arc %g %g %g %g %g arcn closepath s\n",
+ fprintf(ps->fp,"newpath %g %g %g %g %g arc %g %g %g %g %g arcn closepath s\n",
xc,yc,rad1,a0,a1,xc,yc,rad2,a1,a0);
}
-void ps_fillarcslice(FILE *ps,real xc,real yc,
+void ps_fillarcslice(t_psdata ps,real xc,real yc,
real rad1,real rad2,real a0,real a1)
{
- fprintf(ps,"newpath %g %g %g %g %g arc %g %g %g %g %g arcn closepath f\n",
+ fprintf(ps->fp,"newpath %g %g %g %g %g arc %g %g %g %g %g arcn closepath f\n",
xc,yc,rad1,a0,a1,xc,yc,rad2,a1,a0);
}
-void ps_circle(FILE *ps,real x1,real y1,real rad)
+void ps_circle(t_psdata ps,real x1,real y1,real rad)
{
ps_arc(ps,x1,y1,rad,0,360);
}
-char *fontnm[efontNR] = {
- "Times-Roman","Times-Italic", "Times-Bold", "Times-BoldItalic",
- "Helvetica", "Helvetica-Oblique","Helvetica-Bold","Helvetica-BoldOblique",
- "Courier", "Courier-Oblique", "Courier-Bold", "Courier-BoldOblique"
-};
-
-void ps_font(FILE *ps,int font,real size)
+void ps_font(t_psdata ps,int font,real size)
{
if ((font < 0) || (font > efontNR)) {
fprintf(stderr,"Invalid Font: %d, using %s\n",font,fontnm[0]);
font=0;
}
- fprintf(ps,"/%s findfont\n",fontnm[font]);
- fprintf(ps,"%g scalefont setfont\n",size);
+ fprintf(ps->fp,"/%s findfont\n",fontnm[font]);
+ fprintf(ps->fp,"%g scalefont setfont\n",size);
}
-void ps_strfont(FILE *ps,char *font,real size)
+void ps_strfont(t_psdata ps,char *font,real size)
{
- fprintf(ps,"/%s findfont\n",font);
- fprintf(ps,"%g scalefont setfont\n",size);
+ fprintf(ps->fp,"/%s findfont\n",font);
+ fprintf(ps->fp,"%g scalefont setfont\n",size);
}
-void ps_text(FILE *ps,real x1,real y1,char *str)
+void ps_text(t_psdata ps,real x1,real y1,char *str)
{
ps_moveto(ps,x1,y1);
- fprintf(ps,"(%s) show\n",str);
+ fprintf(ps->fp,"(%s) show\n",str);
}
-void ps_rotate(FILE *ps,bool bPlus)
+void ps_rotate(t_psdata ps,bool bPlus)
{
if (bPlus)
- fprintf(ps,"612.5 0 translate 90 rotate\n");
+ fprintf(ps->fp,"612.5 0 translate 90 rotate\n");
else
- fprintf(ps,"-90 rotate -612.5 0 translate\n");
+ fprintf(ps->fp,"-90 rotate -612.5 0 translate\n");
}
-void ps_ctext(FILE *ps,real x1,real y1,char *str,int expos)
+void ps_ctext(t_psdata ps,real x1,real y1,char *str,int expos)
{
if (expos == eXLeft) {
ps_text(ps,x1,y1,str);
return;
}
ps_moveto(ps,x1,y1);
- fprintf(ps,"(%s) stringwidth\n",str);
+ fprintf(ps->fp,"(%s) stringwidth\n",str);
switch (expos) {
case eXLeft:
- fprintf(ps,"exch 0 exch pop exch\n");
+ fprintf(ps->fp,"exch 0 exch pop exch\n");
break;
case eXCenter:
- fprintf(ps,"exch 2 div neg exch\n");
+ fprintf(ps->fp,"exch 2 div neg exch\n");
break;
case eXRight:
- fprintf(ps,"exch neg exch\n");
+ fprintf(ps->fp,"exch neg exch\n");
break;
default:
fatal_error(0,"invalid position index (expos=%d)",expos);
}
- fprintf(ps,"rmoveto (%s) show\n",str);
+ fprintf(ps->fp,"rmoveto (%s) show\n",str);
}
-void ps_translate(FILE *ps,real x,real y)
+void ps_translate(t_psdata ps,real x,real y)
{
- fprintf(ps,"%g %g translate\n",x,y);
+ fprintf(ps->fp,"%g %g translate\n",x,y);
}
-static int ostack=0;
-
-void ps_setorigin(FILE *ps)
+void ps_setorigin(t_psdata ps)
{
- fprintf(ps,"currentpoint dup 3 -1 roll dup 4 1 roll exch translate\n");
- ostack++;
+ fprintf(ps->fp,"currentpoint dup 3 -1 roll dup 4 1 roll exch translate\n");
+ ps->ostack++;
}
-void ps_unsetorigin(FILE *ps)
+void ps_unsetorigin(t_psdata ps)
{
- if (ostack <= 0)
+ if (ps->ostack <= 0)
fatal_error(0,"No origin on stack!\n");
- fprintf(ps,"neg exch neg exch translate\n");
- ostack--;
+ fprintf(ps->fp,"neg exch neg exch translate\n");
+ ps->ostack--;
}
-void ps_close(FILE *ps)
+void ps_close(t_psdata ps)
{
- fprintf(ps,"%%showpage\n");
- fprintf(ps,"%%%%EOF\n");
- fclose(ps);
+ fprintf(ps->fp,"%%showpage\n");
+ fprintf(ps->fp,"%%%%EOF\n");
+ fclose(ps->fp);
+ sfree(ps->rgb);
+ sfree(ps);
}
-void ps_comment(FILE *ps,char *s)
+void ps_comment(t_psdata ps,char *s)
{
- fprintf(ps,"%%%% %s\n",s);
+ fprintf(ps->fp,"%%%% %s\n",s);
}
mov eax, [ebp + 8]
mov ebx, [ebp + 12]
mov ecx, [ebp + 16]
- mov edx, ecx
+ mov edx, ecx
movups xmm6,[sse_three]
movups xmm7,[sse_minushalf]
shr ecx, 3
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_xdrd_c = "$Id$";
#include "typedefs.h"
#include "xdrf.h"
#include "fatal.h"
int xdr3drcoord(XDR *xdrs, real *fp, int *size, real *precision)
{
#ifdef DOUBLE
- static float *ffp=NULL;
+ float *ffp;
float fprec;
int i,ret,isize;
isize=*size*DIM;
- if (ffp == NULL) {
- if (isize > 0) {
- snew(ffp,isize);
- }
- else
- fatal_error(0,"Don't know what to malloc for ffp (file %s, line %d)",
- __FILE__,__LINE__);
- }
+ if (isize > 0)
+ snew(ffp,isize);
+ else
+ fatal_error(0,"Don't know what to malloc for ffp (file %s, line %d)",
+ __FILE__,__LINE__);
+
for(i=0; (i<isize); i++)
ffp[i]=fp[i];
fprec=*precision;
*precision=fprec;
for(i=0; (i<isize); i++)
fp[i]=ffp[i];
-
+
+ sfree(ffp);
return ret;
#else
return xdr3dfcoord(xdrs,(float *)fp,size,(float *)precision);
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_xmlio_c = "$Id$";
+
#ifdef HAVE_XML
#include <libxml/parser.h>
#include <libxml/tree.h>
#include "symtab.h"
#include "xmlio.h"
-static char *xyz_names[] = {
+static const char *xyz_names[] = {
"x", "y", "z"
};
-static char *tensor_names[] = {
+static const char *tensor_names[] = {
"xx", "xy", "xz", "yx", "yy", "yz", "zx", "zy", "zz"
};
real value;
} t_masstype;
-static char *xmltypes[] = {
+static const char *xmltypes[] = {
NULL,
"XML_ELEMENT_NODE",
"XML_ATTRIBUTE_NODE",
exmlCOORDINATES, exmlVELOCITIES, exmlFORCES, exmlNR
};
-static char *exml_names[] = {
+static const char *exml_names[] = {
"gromacs",
/* Inputrec stuff */
"parameters", "output", "coupling", "cutoff", "pmeparm",
return i;
}
-static char *sp(int n)
+static char *sp(int n, char buf[], int maxindent)
{
- static char buf[80];
int i;
+ if(n>=maxindent)
+ n=maxindent-1;
- /* Don't indent more than 80 characters */
- n = n % 80;
+ /* Don't indent more than maxindent characters */
for(i=0; (i<n); i++)
buf[i] = ' ';
buf[i] = '\0';
int indent,t_xmlrec *xml)
{
char *attrname,*attrval;
+ char buf[100];
while (attr != NULL) {
attrname = (char *)attr->name;
case exmlFORCES:
default:
if (fp)
- fprintf(fp,"%sProperty: '%s' Value: '%s'\n",sp(indent),
+ fprintf(fp,"%sProperty: '%s' Value: '%s'\n",sp(indent,buf,99),
attrname,attrval);
}
attr = attr->next;
static void process_tree(FILE *fp,xmlNodePtr tree,int indent,t_xmlrec *xml)
{
int elem;
+ char buf[100];
while (tree != NULL) {
switch (tree->type) {
case XML_ELEMENT_NODE:
elem = find_elem((char *)tree->name,exmlNR,exml_names);
if (fp)
- fprintf(fp,"%sElement node name %s\n",sp(indent),(char *)tree->name);
+ fprintf(fp,"%sElement node name %s\n",sp(indent,buf,99),(char *)tree->name);
process_attr(fp,tree->properties,elem,indent+2,xml);
sfree(xml);
}
-static char *itoa(int i)
-{
- static char buf[32];
- sprintf(buf,"%d",i);
- return buf;
-}
-
-static char *dtoa(double d)
-{
- static char buf[32];
- sprintf(buf,"%g",d);
- return buf;
-}
-
static void add_xml_int(xmlNodePtr ptr,char *name,int val)
{
- if (xmlSetProp(ptr,name,itoa(val)) == 0)
+ char buf[32];
+ sprintf(buf,"%d",val);
+ if (xmlSetProp(ptr,name,buf) == 0)
fatal_error(0,"Setting %s %d",name,val);
}
static void add_xml_real(xmlNodePtr ptr,char *name,real val)
{
- if (xmlSetProp(ptr,name,dtoa(val)) == 0)
+ char buf[32];
+ sprintf(buf,"%g",val);
+ if (xmlSetProp(ptr,name,buf) == 0)
fatal_error(0,"Setting %s %f",name,val);
}
add_xml_int(outputptr,"energy",ir->nstenergy);
add_xml_int(outputptr,"x-xtc",ir->nstxtcout);
add_xml_int(outputptr,"xtc-precision",ir->xtcprec);
+ add_xml_int(outputptr,"andersen_seed",ir->andersen_seed);
tcptr = add_xml_child(irptr,exmlTCOUPLING);
add_xml_char(tcptr,"algorithm",etcoupl_names[ir->etc]);
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_xmlio_h = "$Id$";
extern void read_xml(char *fn,int *step,real *t,real *lambda,
t_inputrec *ir,rvec *box,int *natoms,
rvec **x,rvec **v,rvec **f,t_topology *top);
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_xtcio_c = "$Id$";
+
#include <string.h>
#include "typedefs.h"
#include "xdrf.h"
* And Hey:
* Gnomes, ROck Monsters And Chili Sauce
*/
-static char *SRCID_xvgr_c = "$Id$";
+
#include <string.h>
#include <ctype.h>
#include "sysstuff.h"
return (env!=NULL && strcmp(env,"xmgr")==0);
}
-FILE *xvgropen(char *fn,char *title,char *xaxis,char *yaxis)
+FILE *xvgropen(const char *fn,const char *title,const char *xaxis,const char *yaxis)
{
FILE *xvgr;
+ char pukestr[100];
+
time_t t;
xvgr=(FILE *)ffopen(fn,"w");
fprintf(xvgr,"# This file was created by %s\n",Program());
fprintf(xvgr,"# which is part of G R O M A C S:\n");
- fprintf(xvgr,"# %s\n",bromacs());
+ fprintf(xvgr,"# %s\n",bromacs(pukestr,99));
time(&t);
fprintf(xvgr,"# All this happened at: %s",ctime(&t));
fprintf(xvgr,"#\n");
fprintf(out, "@ s%d color %d\n", NrSet, LineColor);
}
-static char *LocTypeStr[] = { "view", "world" };
-static char *BoxFillStr[] = { "none", "color", "pattern" };
+static const char *LocTypeStr[] = { "view", "world" };
+static const char *BoxFillStr[] = { "none", "color", "pattern" };
void xvgr_box(FILE *out,
int LocType,
return 0;
}
-static char *fgets3(FILE *fp)
+static char *fgets3(FILE *fp,char ptr[],int *len)
{
- static char *ptr = NULL;
- static int len = STRLEN;
char *p;
int slen;
-
- if (ptr==NULL)
- snew(ptr,len);
- if (fgets(ptr,len-1,fp) == NULL)
+ if (fgets(ptr,*len-1,fp) == NULL)
return NULL;
p = ptr;
while ((strchr(ptr,'\n') == NULL) && (!feof(fp))) {
/* This line is longer than len characters, let's increase len! */
- len += STRLEN;
- p += STRLEN;
- srenew(ptr,len);
+ *len += STRLEN;
+ p += STRLEN;
+ srenew(ptr,*len);
if (fgets(p-1,STRLEN,fp) == NULL)
break;
}
slen = strlen(ptr);
if (ptr[slen-1] == '\n')
ptr[slen-1] = '\0';
+
return ptr;
}
int k,line=0,nny,nx,maxx,rval;
double lf;
real **yy=NULL;
-
+ char *tmpbuf;
+ int len=STRLEN;
*ny = 0;
nny = 0;
nx = 0;
maxx = 0;
fp = ffopen(fn,"r");
- while ((ptr = fgets3(fp)) != NULL) {
+
+ snew(tmpbuf,len);
+
+ while ((ptr = fgets3(fp,tmpbuf,&len)) != NULL) {
line++;
trim(ptr);
if ((ptr[0] != '@') && (ptr[0] != '#')) {
ffclose(fp);
*y = yy;
-
+ sfree(tmpbuf);
+
return nx;
}
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_add_par_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <string.h>
#include "typedefs.h"
#include "smalloc.h"
#ifndef _add_par_h
#define _add_par_h
-static char *SRCID_add_par_h = "$Id$";
+
#include "typedefs.h"
#include "pdb2top.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_convparm_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <math.h>
#include "sysstuff.h"
#include "physics.h"
real old[MAXFORCEPARAM])
{
int i,j;
-
+
/* Set to zero */
for(j=0; (j<MAXFORCEPARAM); j++)
new->generic.buf[j]=0.0;
new->orires.obs = old[4];
new->orires.kfac = old[5];
break;
+ case F_DIHRES:
+ new->dihres.label = old[0];
+ new->dihres.phi = old[1];
+ new->dihres.dphi = old[2];
+ new->dihres.kfac = old[3];
+ new->dihres.power = old[4];
+ break;
case F_RBDIHS:
for (i=0; (i<NR_RBDIHS); i++) {
new->rbdihs.rbcA[i]=old[i];
new->rbdihs.rbcB[i]=old[NR_RBDIHS+i];
}
break;
+ case F_FOURDIHS:
+ /* Read the dihedral parameters to temporary arrays,
+ * and convert them to the computationally faster
+ * Ryckaert-Bellemans form.
+ */
+ /* Use conversion formula for OPLS to Ryckaert-Bellemans: */
+ new->rbdihs.rbcA[0]=old[1]+0.5*(old[0]+old[2]);
+ new->rbdihs.rbcA[1]=0.5*(3.0*old[2]-old[0]);
+ new->rbdihs.rbcA[2]=4.0*old[3]-old[1];
+ new->rbdihs.rbcA[3]=-2.0*old[2];
+ new->rbdihs.rbcA[4]=-4.0*old[3];
+ new->rbdihs.rbcA[5]=0.0;
+
+ new->rbdihs.rbcB[0]=old[NR_FOURDIHS+1]+0.5*(old[NR_FOURDIHS+0]+old[NR_FOURDIHS+2]);
+ new->rbdihs.rbcB[1]=0.5*(3.0*old[NR_FOURDIHS+2]-old[NR_FOURDIHS+0]);
+ new->rbdihs.rbcB[2]=4.0*old[NR_FOURDIHS+3]-old[NR_FOURDIHS+1];
+ new->rbdihs.rbcB[3]=-2.0*old[NR_FOURDIHS+2];
+ new->rbdihs.rbcB[4]=-4.0*old[NR_FOURDIHS+3];
+ new->rbdihs.rbcB[5]=0.0;
+ break;
case F_SHAKE:
case F_SHAKENC:
new->shake.dA = old[0];
&maxtypes,TRUE,TRUE);
enter_function(&(plist[F_POSRES]),(t_functype)F_POSRES,idef,
&maxtypes,FALSE,TRUE);
-
+
for(i=0; (i<F_NRE); i++) {
flags = interaction_function[i].flags;
if ((i != F_LJ) && (i != F_BHAM) && (i != F_POSRES) &&
#ifndef _convparm_h
#define _convparm_h
-static char *SRCID_convparm_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) convparm.h 1.2 12/16/92"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_do_gct_c = "$Id$";
+
#include "typedefs.h"
#include "xmdrun.h"
#include "block_tx.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_dum_parm_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _dum_parm_h
#define _dum_parm_h
-static char *SRCID_dum_parm_h = "$Id$";
+
#include "typedefs.h"
#include "grompp.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_ffscan_c = "$Id$";
+
#include <math.h>
#include "typedefs.h"
#include "macros.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_gctio_c = "$Id$";
+
#include "typedefs.h"
#include "xmdrun.h"
#include "block_tx.h"
return res;
}
-static char *NoYes[] = { "No", "Yes" };
+static const char *NoYes[] = { "No", "Yes" };
static void send_tcr(int dest,t_coupl_rec *tcr)
{
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_gen_ad_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <math.h>
#include <ctype.h>
#include "sysstuff.h"
snew(index,*ndih+1);
if (bAlldih) {
fprintf(stderr,"Keeping all generated dihedrals\n");
- nind = *ndih+1;
+ nind = *ndih;
for(i=0; i<nind; i++)
index[i] = i;
+ index[nind] = *ndih;
} else {
/* Make an index of all dihedrals over each bond */
nind = 0;
k++;
}
}
+
for (i=k; i<*ndih; i++)
strcpy(dih[i].s,"");
*ndih = k;
/* Sort angles with respect to j-i-k (middle atom first) */
if (nang > 1)
qsort(ang,nang,(size_t)sizeof(ang[0]),acomp);
-
+
/* Sort dihedrals with respect to j-k-i-l (middle atoms first) */
if (ndih > 1)
qsort(dih,ndih,(size_t)sizeof(dih[0]),dcomp);
-
+
/* Sort the pairs */
if (npai > 1)
qsort(pai,npai,(size_t)sizeof(pai[0]),pcomp);
/* Sort the impropers */
sort_id(nidih,idih);
-
+
if (ndih > 0) {
/* Remove dihedrals which are impropers
and when bAlldih is not set remove multiple dihedrals over one bond.
fprintf(stderr,"Before cleaning: %d dihedrals\n",ndih);
clean_dih(dih,&ndih,idih,nidih,atoms,bAlldih);
}
-
+
/* Now we have unique lists of angles and dihedrals
* Copy them into the destination struct
*/
#ifndef _gen_ad_h
#define _gen_ad_h
-static char *SRCID_gen_ad_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) gen_ad.h 1.17 9/30/97"
-#endif /* HAVE_IDENT */
+
#include "typedefs.h"
#include "toputil.h"
#include "topio.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_gen_dum_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
typedef char t_dirname[STRLEN];
-static t_dirname ddb_dirnames[DDB_DIR_NR] = {
+static const t_dirname ddb_dirnames[DDB_DIR_NR] = {
"CH3",
"NH3",
"NH2",
#ifndef _gen_dum_h
#define _gen_dum_h
-static char *SRCID_gen_dum_h = "$Id$";
+
#include "typedefs.h"
#include "grompp.h"
#include "hackblock.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_genhydro_c = "$Id$";
+
#include <time.h>
#include <ctype.h>
#include "assert.h"
return hb;
}
-static char Hnum[] = "123456";
+static const char Hnum[] = "123456";
static void expand_hackblocks_one(t_hackblock *hbr, char *atomname,
int *nabi, t_hack **abi, bool bN, bool bC)
{
int j, k, l, d;
bool bIgnore;
- /* recursion depth is recorded for debug purposes only: */
- static int depth=-1;
- depth++;
/* we'll recursively add atoms to atoms */
- if (debug) fprintf(debug,"\n[%d] %s:",depth,atomname);
for(j=0; j < hbr->nhack; j++) {
/* first check if we're in the N- or C-terminus, then we should ignore
all hacks involving atoms from resp. previous or next residue
nabi, abi, bN, bC);
}
}
- depth--;
}
static void expand_hackblocks(t_atoms *pdba, t_hackblock hb[],
#ifndef _genhydro_h
#define _genhydro_h
-static char *SRCID_genhydro_h = "$Id$";
+
#include "pdbio.h"
#include "hackblock.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_glaasje_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "typedefs.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_glaasje_h = "$Id$";
+
extern void do_glas(FILE *log,int start,int homenr,rvec x[],rvec f[],
t_forcerec *fr,t_mdatoms *md,int atnr,t_inputrec *ir,
real ener[]);
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_gmxcheck_c = "$Id$";
+
#include <stdio.h>
#include <string.h>
#include <ctype.h>
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_gmxdump_c = "$Id$";
+
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "trnio.h"
#include "txtdump.h"
-static void list_tpx(char *fn)
+static void list_tpx(char *fn, bool bShowNumbers)
{
int step,natoms,fp,indent,i,j,**gcount,atot;
real t,lambda;
t_inputrec ir;
t_tpxheader tpx;
t_topology top;
-
- read_tpxheader(fn,&tpx);
+ read_tpxheader(fn,&tpx,TRUE,NULL,NULL);
snew(x,tpx.natoms);
snew(v,tpx.natoms);
snew(f,tpx.natoms);
+
read_tpx(fn,&step,&t,&lambda,
tpx.bIr ? &ir : NULL,
tpx.bBox ? box : NULL,
pr_rvecs(stdout,indent,"x",x,natoms);
pr_rvecs(stdout,indent,"v",v,natoms);
pr_rvecs(stdout,indent,"f",f,natoms);
- pr_top(stdout,indent,"topology",&(top));
+ pr_top(stdout,indent,"topology",&(top),bShowNumbers);
}
snew(gcount,egcNR);
CopyRight(stderr,argv[0]);
parse_common_args(&argc,argv,0,NFILE,fnm,asize(pa),pa,
asize(desc),desc,0,NULL);
-
- pr_shownumbers(bShowNumbers);
+
+
if (ftp2bSet(efTPX,NFILE,fnm))
- list_tpx(ftp2fn(efTPX,NFILE,fnm));
+ list_tpx(ftp2fn(efTPX,NFILE,fnm),bShowNumbers);
if (ftp2bSet(efTRX,NFILE,fnm))
list_trx(ftp2fn(efTRX,NFILE,fnm),bXVG);
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_grompp_c = "$Id$";
+
#include <sys/types.h>
#include <math.h>
#include <string.h>
if (bVerbose && i)
fprintf(stderr,"removed %d orientation restraints\n",i);
}
+ if (opts->eDihre == edrNone) {
+ i = rm_interactions(F_DIHRES,nrmols,molinfo);
+ if (bVerbose && i)
+ fprintf(stderr,"removed %d dihedral restraints\n",i);
+ }
topcat(msys,nrmols,molinfo,ntab,tab,Nsim,Sims,bEnsemble);
sfree(v);
}
-static int search_array(int atnr,int *n,int map[],int key,
- t_param param[],int ftype)
+static int
+search_atomtypes(t_atomtype *at,int *n,int typelist[],int thistype,
+ t_param param[],int ftype)
{
int i,nn,nrfp,j,k,found;
nrfp = NRFP(ftype);
for(i=0; (i<nn); i++) {
- if (map[i] == key) /* This type number has already been added */
+ if (typelist[i] == thistype) /* This type number has already been added */
break;
/* If not, check if the parameters are identical */
found=1;
- for(j=0;j<atnr && found;j++) {
- for(k=0;k<nrfp && found;k++)
- found=(param[atnr*map[i]+j].c[k]==param[atnr*key+j].c[k]);
+ for(j=0;j<at->nr && found;j++) {
+ /* Check nonbonded parameters */
+ for(k=0;k<nrfp && found;k++)
+ found=(param[at->nr*typelist[i]+j].c[k]==param[at->nr*thistype+j].c[k]);
+ /* Check radius, volume, surftens */
+ found = found && ((at->radius[typelist[i]] == at->radius[thistype]) &&
+ (at->vol[typelist[i]] == at->vol[thistype]) &&
+ (at->surftens[typelist[i]] == at->surftens[thistype]));
}
if(found)
break;
if (i == nn) {
if (debug)
- fprintf(debug,"Renumbering atomtype %d to %d\n",key,nn);
- if (nn == atnr)
+ fprintf(debug,"Renumbering atomtype %d to %d\n",thistype,nn);
+ if (nn == at->nr)
fatal_error(0,"Atomtype horror n = %d, %s, %d",nn,__FILE__,__LINE__);
- map[nn]=key;
+ typelist[nn]=thistype;
nn++;
}
*n = nn;
}
static int renum_atype(t_params plist[],t_topology *top,
- int atnr,t_inputrec *ir,bool bVerbose)
+ t_atomtype *at,bool bVerbose)
{
int i,j,k,l,mi,mj,nat,nrfp,ftype;
t_param *nbsnew;
- int *map;
+ int *typelist;
- snew(map,atnr);
+ snew(typelist,at->nr);
if (bVerbose)
fprintf(stderr,"renumbering atomtypes...\n");
* we want to reduce the number of atom types by merging
* ones with identical nonbonded interactions, in addition
* to removing unused ones.
+ *
+ * With Generalized-Born electrostatics, or implicit solvent
+ * we also check that the atomtype radius, effective_volume
+ * and surface tension match.
*/
/* Get nonbonded interaction type */
else
ftype=F_BHAM;
- /* Renumber atomtypes and meanwhile make a list of atomtypes.
- * We provide the list of nonbonded parameters so search_array
+ /* Renumber atomtypes by first making a list of which ones are actually used.
+ * We provide the list of nonbonded parameters so search_atomtypes
* can determine if two types should be merged.
*/
nat=0;
for(i=0; (i<top->atoms.nr); i++) {
top->atoms.atom[i].type=
- search_array(atnr,&nat,map,top->atoms.atom[i].type,plist[ftype].param,ftype);
+ search_atomtypes(at,&nat,typelist,top->atoms.atom[i].type,
+ plist[ftype].param,ftype);
top->atoms.atom[i].typeB=
- search_array(atnr,&nat,map,top->atoms.atom[i].typeB,plist[ftype].param,ftype);
+ search_atomtypes(at,&nat,typelist,top->atoms.atom[i].typeB,
+ plist[ftype].param,ftype);
}
+ /* We now have a list of unique atomtypes in typelist */
+
if (debug)
- pr_ivec(debug,0,"map",map,nat);
-
- /* Renumber nlist */
+ pr_ivec(debug,0,"typelist",typelist,nat,TRUE);
+ /* Renumber nlist */
nbsnew = NULL;
snew(nbsnew,plist[ftype].nr);
+
nrfp = NRFP(ftype);
for(i=k=0; (i<nat); i++) {
- mi=map[i];
+ mi=typelist[i];
for(j=0; (j<nat); j++,k++) {
- mj=map[j];
+ mj=typelist[j];
for(l=0; (l<nrfp); l++)
- nbsnew[k].c[l]=plist[ftype].param[atnr*mi+mj].c[l];
+ nbsnew[k].c[l]=plist[ftype].param[at->nr*mi+mj].c[l];
}
+ at->radius[i] = at->radius[mi];
+ at->vol[i] = at->vol[mi];
+ at->surftens[i] = at->surftens[mi];
}
+
for(i=0; (i<nat*nat); i++) {
for(l=0; (l<nrfp); l++)
plist[ftype].param[i].c[l]=nbsnew[i].c[l];
}
plist[ftype].nr=i;
-
+ srenew(at->radius,nat);
+ srenew(at->vol,nat);
+ srenew(at->surftens,nat);
+
+ at->nr=nat;
+
sfree(nbsnew);
- sfree(map);
+ sfree(typelist);
return nat;
}
char fn[STRLEN],*mdparin;
int nerror;
bool bNeedVel,bGenVel;
-
+ bool have_radius,have_vol,have_surftens;
+
t_filenm fnm[] = {
{ efMDP, NULL, NULL, ffOPTRD },
{ efMDP, "-po", "mdout", ffWRITE },
/* Command line options */
static bool bVerbose=TRUE,bRenum=TRUE,bShuffle=FALSE;
static bool bRmDumBds=TRUE,bSort=FALSE,bCheckPairs=FALSE;
- static int nnodes=1,maxwarn=10;
+ static int i,nnodes=1,maxwarn=10;
static real fr_time=-1;
static char *cap=NULL;
t_pargs pa[] = {
}
}
+ /* If we are doing GBSA, check that we got the parameters we need */
+ have_radius=have_vol=have_surftens=TRUE;
+ for(i=0;i<atype.nr;i++) {
+ have_radius=have_radius && (atype.radius[i]>0);
+ have_vol=have_vol && (atype.vol[i]>0);
+ have_surftens=have_surftens && (atype.surftens[i]>=0);
+ }
+ if(!have_radius && ir->coulombtype==eelGB) {
+ fprintf(stderr,"Can't do GB electrostatics; the forcefield is missing values for\n"
+ "atomtype radii, or they might be zero.");
+ nerror++;
+ }
+ if(!have_vol && ir->gb_algorithm==egbKARPLUS) {
+ fprintf(stderr,"Can't calculate Karplus Born radii; the forcefield is missing values\n"
+ " for atomtype effective volumes, or they might be zero.");
+ nerror++;
+ }
+ if(!have_surftens && ir->implicit_solvent!=eisNO) {
+ fprintf(stderr,"Can't do implicit solvent; the forcefield is missing values\n"
+ " for atomtype surface tension.");
+ nerror++;
+ }
+
if (nerror) {
print_warn_num();
if (nerror==1)
clean_dum_bondeds(msys.plist,sys->atoms.nr,bRmDumBds);
if (bRenum)
- atype.nr=renum_atype(plist, sys, atype.nr, ir, bVerbose);
+ atype.nr=renum_atype(plist, sys, &atype, bVerbose);
+ /* Copy the atomtype data to the topology atomtype list */
+ sys->atomtypes.nr=atype.nr;
+ snew(sys->atomtypes.radius,atype.nr);
+ snew(sys->atomtypes.vol,atype.nr);
+ snew(sys->atomtypes.surftens,atype.nr);
+
+ for(i=0;i<atype.nr;i++) {
+ sys->atomtypes.radius[i]=atype.radius[i];
+ sys->atomtypes.vol[i]=atype.vol[i];
+ sys->atomtypes.surftens[i]=atype.surftens[i];
+ }
+
if (debug)
pr_symtab(debug,0,"After renum_atype",&sys->symtab);
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_h_db_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <string.h>
#include "string2.h"
#include "sysstuff.h"
* Here these number are given. Because arrays start at 0 an
* extra dummy for index 0 is added
*/
-/* 1 2 3 4 5 6 7 8 9 */
-int ncontrol[12] = { -1, 3, 3, 3, 3, 4, 3, 1, 3, 3 };
+/* 1 2 3 4 5 6 7 8 9 */
+const int ncontrol[12] = { -1, 3, 3, 3, 3, 4, 3, 1, 3, 3 };
int compaddh(const void *a,const void *b)
{
#ifndef _h_db_h
#define _h_db_h
-static char *SRCID_h_db_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) h_db.h 1.10 2/2/97"
-#endif /* HAVE_IDENT */
#include "sysstuff.h"
#include "hackblock.h"
/* number of control atoms for each 'add' type */
-extern int ncontrol[];
+extern const int ncontrol[];
/* functions for the h-database */
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_hackblock_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <string.h>
#include "hackblock.h"
#include "smalloc.h"
#include "string2.h"
/* these MUST correspond to the enum in hackblock.h */
-char *btsNames[ebtsNR] = { "bonds", "angles", "dihedrals", "impropers", "exclusions" };
-int btsNiatoms[ebtsNR] = { 2, 3, 4, 4, 2 };
+const char *btsNames[ebtsNR] = { "bonds", "angles", "dihedrals", "impropers", "exclusions" };
+const int btsNiatoms[ebtsNR] = { 2, 3, 4, 4, 2 };
static void free_t_bonded(t_rbonded *rb)
{
#ifndef _hackblock_h
#define _hackblock_h
-static char *SRCID_hackblock_h = "$Id$";
+
#include "typedefs.h"
#include "pdbio.h"
#include "grompp.h"
/* ebtsBONDS must be the first, new types can be added to the end */
/* these *MUST* correspond to the arrays in hackblock.c */
enum { ebtsBONDS, ebtsANGLES, ebtsPDIHS, ebtsIDIHS, ebtsEXCLS, ebtsNR };
-extern char *btsNames[ebtsNR];
-extern int btsNiatoms[ebtsNR];
+extern const char *btsNames[ebtsNR];
+extern const int btsNiatoms[ebtsNR];
/* if changing any of these structs, make sure that all of the
free/clear/copy/merge_t_* functions stay updated */
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_hizzie_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <stdio.h>
#include <string.h>
#include "typedefs.h"
#include "pdb2top.h"
#include "string2.h"
-static int in_strings(char *key,int nstr,char **str)
+static int in_strings(char *key,int nstr,const char **str)
{
int j;
}
void set_histp(t_atoms *pdba,rvec *x,real angle,real dist){
- static char *prot_acc[] = {
+ static const char *prot_acc[] = {
"O", "OD1", "OD2", "OE1", "OE2", "OG", "OG1", "OH", "OW"
};
#define NPA asize(prot_acc)
- static char *prot_don[] = {
+ static const char *prot_don[] = {
"N", "NH1", "NH2", "NE", "ND1", "ND2", "NE2", "NZ", "OG", "OG1", "OH", "NE1", "OW"
};
#define NPD asize(prot_don)
#ifndef _hizzie_h
#define _hizzie_h
-static char *SRCID_hizzie_h = "$Id$";
+
extern void set_histp(t_atoms *pdba,rvec *x,real angle,real distance);
/* calculate HIStidine protonation state */
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_init_sh_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
#include "xmdrun.h"
#include "smalloc.h"
#include "assert.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_ion_data_h = "$Id$";
+
typedef struct {
real photo,coh,incoh,incoh_abs;
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_ionize_c = "$Id$";
+
#include <string.h>
#include "smalloc.h"
#include "typedefs.h"
/* Units are barn. They are converted to nm^2 by multiplying */
/* by 1e-10, which is done in Imax (ionize.c) */
-static t_cross cross_sec_h[] = {
+static const t_cross cross_sec_h[] = {
{ 2.63e-2, 1.01e-1, 5.49e-1, 7.12e-3 },
{ 9.79e-3, 6.18e-2, 5.83e-1, 9.60e-3 },
{ 4.55e-3, 4.16e-2, 5.99e-1, 1.19e-2 },
{ 1.12e-3, 1.96e-2, 6.09e-1, 1.73e-2 },
{ 4.16e-4, 1.13e-2, 6.07e-1, 2.23e-2 }
};
-static t_cross cross_sec_c[] = {
+static const t_cross cross_sec_c[] = {
{ 1.99e+2, 5.88e+0, 2.29e+0, 3.06e-2 },
{ 8.01e+1, 4.22e+0, 2.56e+0, 4.38e-2 },
{ 3.92e+1, 3.26e+0, 2.74e+0, 5.72e-2 },
{ 1.06e+1, 1.97e+0, 3.04e+0, 9.15e-2 },
{ 4.15e+0, 1.30e+0, 3.20e+0, 1.24e-1 }
};
-static t_cross cross_sec_n[] = {
+static const t_cross cross_sec_n[] = {
{ 3.91e+2, 8.99e+0, 2.49e+0, 3.43e-2 },
{ 1.59e+2, 6.29e+0, 2.86e+0, 5.01e-2 },
{ 7.88e+1, 4.76e+0, 3.10e+0, 6.57e-2 },
{ 2.16e+1, 2.82e+0, 3.46e+0, 1.05e-1 },
{ 8.52e+0, 1.88e+0, 3.65e+0, 1.43e-1 }
};
-static t_cross cross_sec_o[] = {
+static const t_cross cross_sec_o[] = {
{ 6.90e+2, 1.33e+1, 2.66e+0, 3.75e-2 },
{ 2.84e+2, 9.21e+0, 3.14e+0, 5.62e-2 },
{ 1.42e+2, 6.85e+0, 3.44e+0, 7.43e-2 },
{ 3.95e+1, 3.97e+0, 3.87e+0, 1.18e-1 },
{ 1.57e+1, 2.64e+0, 4.10e+0, 1.61e-1 }
};
-static t_cross cross_sec_s[] = {
+static const t_cross cross_sec_s[] = {
{ 1.10e+4, 5.54e+1, 3.98e+0, 5.42e-2 },
{ 4.91e+3, 4.29e+1, 4.71e+0, 8.38e-2 },
{ 2.58e+3, 3.36e+1, 5.32e+0, 1.16e-1 },
typedef struct {
char *name;
int nel;
- t_cross *cross;
+ const t_cross *cross;
} t_element;
-static t_element element[] = {
+static const t_element element[] = {
{ "H", 1, cross_sec_h },
{ "C", 6, cross_sec_c },
{ "N", 7, cross_sec_n },
real E_K,E_L,Prob_K,tau;
} t_recoil;
-t_recoil recoil[] = {
+const t_recoil recoil[] = {
{ 0.0, 0.0, 0.0, 0},
{ 0.0136, 0.0, 0.0, 0},
{ 0.0246, 0.0, 0.0, 0},
static int dq_tot,nkd_tot,ephot,mode;
static t_cross_atom *ca;
static int Eindex=-1;
-
+ static t_Gaussdata gaussrand=NULL;
+
real factor,E_lost=0;
real pt,ptot,pphot,pcoll[ecollNR],tmax;
real hboxx,hboxy,rho2;
nphot = ir->userreal2; /* Intensity */
width = ir->userreal3; /* Width of the peak (in time) */
rho = ir->userreal4; /* Diameter of the focal spot (nm) */
- ionize_seed = ir->userint1; /* Random seed for stochastic ionization */
+ ionize_seed= ir->userint1; /* Random seed for stochastic ionization */
ephot = ir->userint2; /* Energy of the photons */
mode = ir->userint3; /* Mode of ionizing */
interval = 0.001*ir->userint4; /* Interval between pulses (ps) */
-
+ gaussrand=init_gauss(ionize_seed);
+
if ((width <= 0) || (nphot <= 0))
fatal_error(0,"Your parameters for ionization are not set properly\n"
"width (userreal3) = %f, nphot (userreal2) = %f",
/* Get parameters for photoelestic effect */
/* Note that in the article this is called 2 theta */
- theta = DEG2RAD*gauss(70.0,26.0,&ionize_seed);
+ theta = DEG2RAD*gauss(gaussrand)*26.0+70.0;
+
phi = 2*M_PI*rando(&ionize_seed);
if (bL)
dv[m] -= factor*ddv[m];
if (debug)
- pr_rvec(debug,0,"ELL",dv,DIM);
+ pr_rvec(debug,0,"ELL",dv,DIM,TRUE);
bIonize = TRUE;
}
dv[ZZ] -= factor*cos(theta);
*/
if (debug)
- pr_rvec(debug,0,"INELL",dv,DIM);
+ pr_rvec(debug,0,"INELL",dv,DIM,TRUE);
}
break;
}
#ifndef _ionize_h
#define _ionize_h
-static char *SRCID_ionize_h = "$Id$";
+
#include <stdio.h>
#include "typedefs.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_luck_c = "$Id$";
+
#include <stdio.h>
#include "copyrite.h"
#include "string.h"
int main(int argc,char *argv[])
{
-
+ char quote[256];
+
/* Necessary to find the library directory before installation */
set_program_name(argv[0]);
if ( argc == 2 )
if ( strcmp(argv[1],"-c")==0)
CopyRight(stdout,argv[0]);
- printf("%s\n",cool_quote());
+ printf("%s\n",cool_quote(quote,255,NULL));
return 0;
}
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_md_c = "$Id$";
+
#include <signal.h>
#include <stdlib.h>
#include "typedefs.h"
#include "xmdrun.h"
#include "disre.h"
#include "orires.h"
+#include "dihre.h"
#include "pppm.h"
#include "pme.h"
#include "mdatoms.h"
init_orires(stdlog,top->idef.il[F_ORIRES].nr,top->idef.il[F_ORIRES].iatoms,
top->idef.iparams,x,mdatoms,&(parm->ir),mcr,fcd);
+ /* Dihedral Restraints */
+ init_dihres(stdlog,top->idef.il[F_DIHRES].nr,top->idef.il[F_DIHRES].iatoms,
+ top->idef.iparams,&(parm->ir),mcr,fcd);
+
/* check if there are dummies */
bDummies=FALSE;
for(i=0; (i<F_NRE) && !bDummies; i++)
int fp_ene=0,fp_trn=0,step;
FILE *fp_dgdl=NULL;
time_t start_t;
- real t,lambda,t0,lam0,SAfactor;
- bool bNS,bStopCM,bTYZ,bRerunMD,bNotLastFrame=FALSE,
+ real t,lambda,t0,lam0;
+ bool bNS,bSimAnn,bStopCM,bTYZ,bRerunMD,bNotLastFrame=FALSE,
bFirstStep,bLastStep,bNEMD,do_log,bRerunWarnNoV=TRUE;
tensor force_vir,pme_vir,shake_vir;
t_nrnb mynrnb;
bFFscan = (Flags & MD_FFSCAN) == MD_FFSCAN;
/* Initial values */
- init_md(cr,&parm->ir,parm->box,&t,&t0,&lambda,&lam0,&SAfactor,
+ init_md(cr,&parm->ir,parm->box,&t,&t0,&lambda,&lam0,
&mynrnb,&bTYZ,top,
nfile,fnm,&traj,&xtc_traj,&fp_ene,&fp_dgdl,&mdebin,grps,
- force_vir,pme_vir,shake_vir,mdatoms,mu_tot,&bNEMD,&vcm,nsb);
+ force_vir,pme_vir,shake_vir,mdatoms,mu_tot,&bNEMD,&bSimAnn,&vcm,nsb);
debug_gmx();
/* Check for polarizable models */
ener[F_TEMP] = sum_ekin(&(parm->ir.opts),grps,parm->ekin,bTYZ);
if(parm->ir.etc==etcBERENDSEN)
berendsen_tcoupl(&(parm->ir.opts),grps,
- parm->ir.delta_t,SAfactor);
+ parm->ir.delta_t);
else if(parm->ir.etc==etcNOSEHOOVER)
nosehoover_tcoupl(&(parm->ir.opts),grps,
- parm->ir.delta_t,SAfactor);
+ parm->ir.delta_t);
debug_gmx();
/* Initiate data for the special cases */
fprintf(stderr,"starting mdrun '%s'\n%d steps, %8.1f ps.\n\n",
*(top->name),parm->ir.nsteps,parm->ir.nsteps*parm->ir.delta_t);
}
+
+ /* Initialize values for invmass, etc. */
+ update_mdatoms(mdatoms,lambda,TRUE);
+
/* Set the node time counter to 0 after initialisation */
start_time();
debug_gmx();
/* Set values for invmass etc. This routine not parallellized, but hardly
* ever used, only when doing free energy calculations.
*/
- init_mdatoms(mdatoms,lambda,bFirstStep);
+ if(parm->ir.efep != efepNO)
+ update_mdatoms(mdatoms,lambda,FALSE);
clear_mat(force_vir);
else
lambda = lam0 + step*parm->ir.delta_lambda;
}
- if (parm->ir.bSimAnn) {
- SAfactor = 1.0 - t/parm->ir.zero_temp_time;
- if (SAfactor < 0)
- SAfactor = 0;
- }
+ if (bSimAnn)
+ update_annealing_target_temp(&(parm->ir.opts),t);
if (MASTER(cr) && do_log && !bFFscan)
- print_ebin_header(log,step,t,lambda,SAfactor);
+ print_ebin_header(log,step,t,lambda);
if (bDummies)
spread_dummy_f(log,x,f,&mynrnb,&top->idef,dummycomm,cr);
/* bOK = update(nsb->natoms,START(nsb),HOMENR(nsb),step,lambda,&ener[F_DVDL], */
bOK = TRUE;
update(nsb->natoms,START(nsb),HOMENR(nsb),step,lambda,&ener[F_DVDL],
- parm,SAfactor,mdatoms,x,graph,f,buf,vold,vt,v,
+ parm,mdatoms,x,graph,f,buf,vold,vt,v,
top,grps,shake_vir,cr,&mynrnb,bTYZ,TRUE,edyn,&pulldata,bNEMD);
if (!bOK && !bFFscan)
fatal_error(0,"Constraint error: Shake, Lincs or Settle could not solve the constrains");
/* erase the terminate signal */
terminate = 0;
}
-
+
/* Do center of mass motion removal */
if (bStopCM && !bFFscan) {
check_cm_grp(log,vcm);
* target temp when doing simulated annealing
*/
if(parm->ir.etc==etcBERENDSEN)
- berendsen_tcoupl(&(parm->ir.opts),grps,parm->ir.delta_t,SAfactor);
+ berendsen_tcoupl(&(parm->ir.opts),grps,parm->ir.delta_t);
else if(parm->ir.etc==etcNOSEHOOVER)
- nosehoover_tcoupl(&(parm->ir.opts),grps,parm->ir.delta_t,SAfactor);
+ nosehoover_tcoupl(&(parm->ir.opts),grps,parm->ir.delta_t);
/* Calculate pressure and apply LR correction if PPPM is used */
calc_pres(fr->ePBC,parm->box,parm->ekin,parm->vir,parm->pres,
/* Output stuff */
if (MASTER(cr) && !bFFscan) {
- bool do_ene,do_dr,do_or;
+ bool do_ene,do_dr,do_or,do_dihr;
upd_mdebin(mdebin,fp_dgdl,mdatoms->tmass,step,t,ener,parm->box,shake_vir,
force_vir,parm->vir,parm->pres,grps,mu_tot,
do_ene = do_per_step(step,parm->ir.nstenergy) || bLastStep;
do_dr = do_per_step(step,parm->ir.nstdisreout) || bLastStep;
do_or = do_per_step(step,parm->ir.nstorireout) || bLastStep;
- print_ebin(fp_ene,do_ene,do_dr,do_or,do_log?log:NULL,step,t,
- eprNORMAL,bCompact,mdebin,fcd,&(top->atoms));
+ do_dihr= do_per_step(step,parm->ir.nstdihreout) || bLastStep;
+ print_ebin(fp_ene,do_ene,do_dr,do_or,do_dihr,do_log?log:NULL,step,t,
+ eprNORMAL,bCompact,mdebin,fcd,&(top->atoms),&(parm->ir.opts));
if (bVerbose)
fflush(log);
}
sfree(ct);
}
if (MASTER(cr)) {
- print_ebin(fp_ene,FALSE,FALSE,FALSE,log,step,t,
- eprAVER,FALSE,mdebin,fcd,&(top->atoms));
- print_ebin(fp_ene,FALSE,FALSE,FALSE,log,step,t,
- eprRMS,FALSE,mdebin,fcd,&(top->atoms));
+ print_ebin(fp_ene,FALSE,FALSE,FALSE,FALSE,log,step,t,
+ eprAVER,FALSE,mdebin,fcd,&(top->atoms),&(parm->ir.opts));
+ print_ebin(fp_ene,FALSE,FALSE,FALSE,FALSE,log,step,t,
+ eprRMS,FALSE,mdebin,fcd,&(top->atoms),&(parm->ir.opts));
close_enx(fp_ene);
if (!bRerunMD && parm->ir.nstxtcout)
close_xtc_traj();
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_mdrun_c = "$Id$";
+
#include "typedefs.h"
#include "macros.h"
#include "copyrite.h"
static int nDLB=0;
static int nnodes=1;
static int nstepout=10;
+ static int nthreads=1;
+
static t_pargs pa[] = {
{ "-np", FALSE, etINT, {&nnodes},
"Number of nodes, must be the same as used for grompp" },
+ { "-nt", FALSE, etINT, {&nthreads},
+ "Number of threads to start on each node" },
{ "-v", FALSE, etBOOL,{&bVerbose},
"Be loud and noisy" },
{ "-compact", FALSE, etBOOL,{&bCompact},
if (nnodes > 1)
fatal_error(0,"GROMACS compiled without MPI support - can't do parallel runs");
#endif
+#ifndef USE_THREADS
+ if(nthreads > 1)
+ fatal_error(0,"GROMACS compiled without threads support - can only use one thread");
+#endif
open_log(ftp2fn(efLOG,NFILE,fnm),cr);
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_mk_ghat_c = "$Id$";
+
#include <math.h>
#include <stdio.h>
#include "copyrite.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_nm2type_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "maths.h"
#include "macros.h"
#include "copyrite.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_pdb2gmx_c = "$Id$";
+
#include <time.h>
#include <ctype.h>
#include "assert.h"
#include "hizzie.h"
-static char *select_res(int nr,int resnr,char *name[],char *expl[],char *title)
+static const char *select_res(int nr,int resnr,const char *name[],const char *expl[],char *title)
{
int sel=0;
return name[sel];
}
-static char *get_asptp(int resnr)
+static const char *get_asptp(int resnr)
{
enum { easp, easpH, easpNR };
- static char *lh[easpNR] = { "ASP", "ASPH" };
- static char *expl[easpNR] = {
+ const char *lh[easpNR] = { "ASP", "ASPH" };
+ const char *expl[easpNR] = {
"Not protonated (charge -1)",
"Protonated (charge 0)"
};
return select_res(easpNR,resnr,lh,expl,"ASPARTIC ACID");
}
-static char *get_glutp(int resnr)
+static const char *get_glutp(int resnr)
{
enum { eglu, egluH, egluNR };
- static char *lh[egluNR] = { "GLU", "GLUH" };
- static char *expl[egluNR] = {
+ const char *lh[egluNR] = { "GLU", "GLUH" };
+ const char *expl[egluNR] = {
"Not protonated (charge -1)",
"Protonated (charge 0)"
};
return select_res(egluNR,resnr,lh,expl,"GLUTAMIC ACID");
}
-static char *get_lystp(int resnr)
+static const char *get_lystp(int resnr)
{
enum { elys, elysH, elysNR };
- static char *lh[elysNR] = { "LYS", "LYSH" };
- static char *expl[elysNR] = {
+ const char *lh[elysNR] = { "LYS", "LYSH" };
+ const char *expl[elysNR] = {
"Not protonated (charge 0)",
"Protonated (charge +1)"
};
return select_res(elysNR,resnr,lh,expl,"LYSINE");
}
-static char *get_cystp(int resnr)
+static const char *get_cystp(int resnr)
{
enum { ecys, ecysH, ecysNR };
- static char *lh[ecysNR] = { "CYS", "CYSH" };
- static char *expl[ecysNR] = {
+ const char *lh[ecysNR] = { "CYS", "CYSH" };
+ const char *expl[ecysNR] = {
"Cysteine in disulfide bridge",
"Protonated"
};
}
-static char *get_histp(int resnr)
+static const char *get_histp(int resnr)
{
- static char *expl[ehisNR] = {
+ const char *expl[ehisNR] = {
"H on ND1 only",
"H on NE2 only",
"H on ND1 and NE2",
}
static void rename_pdbresint(t_atoms *pdba,char *oldnm,
- char *gettp(int),bool bFullCompare,
+ const char *gettp(int),bool bFullCompare,
t_symtab *symtab)
{
int i;
- char *ptr,*resnm;
+ const char *ptr;
+ char *resnm;
for(i=0; i<pdba->nres; i++) {
resnm=*pdba->resname[i];
char **gnames;
matrix box;
rvec box_space;
- char *ff;
+ char ff[256];
int i,j,k,l,nrtp;
int *swap_index,si;
int bts[ebtsNR];
t_symtab symtab;
t_atomtype *atype;
char fn[256],*top_fn,itp_fn[STRLEN],posre_fn[STRLEN],buf_fn[STRLEN];
- char molname[STRLEN],title[STRLEN],resname[STRLEN];
+ char molname[STRLEN],title[STRLEN],resname[STRLEN],quote[256];
char *c;
int nah,nNtdb,nCtdb,ntdblist;
t_hackblock *ntdb,*ctdb,**tdblist;
check_occupancy(&pdba_all,opt2fn("-f",NFILE,fnm));
- ff=choose_ff();
+ choose_ff(ff,255);
printf("Using %s force field\n",ff);
/* Read atomtypes... */
sprintf(fn,"chain.pdb");
else
sprintf(fn,"chain_%c.pdb",cc->chain);
- write_sto_conf(fn,cool_quote(),pdba,x,NULL,box);
+ write_sto_conf(fn,cool_quote(quote,255,NULL),pdba,x,NULL,box);
}
}
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_pdb2top_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include <ctype.h>
#include "add_par.h"
/* this must correspond to enum in pdb2top.h */
-char *hh[ehisNR] = { "HISA", "HISB", "HISH", "HIS1" };
+const char *hh[ehisNR] = { "HISA", "HISB", "HISH", "HIS1" };
static int missing_atoms(t_restp *rp, int resnr,
t_atoms *at, int i0, int i, bool bCTer)
return (fabs(x-ix) < tol);
}
-char *choose_ff(void)
+char *choose_ff(char ffbuf[],int size)
{
typedef struct { char *desc,*fn; } t_fff;
- static char *fnsel;
FILE *in;
t_fff *fff;
int i,nff,sel;
else
sel=0;
- fnsel=strdup(fff[sel].fn);
+ strncpy(ffbuf,fff[sel].fn,size-1);
for(i=0; (i<nff); i++) {
sfree(fff[i].desc);
}
sfree(fff);
- return fnsel;
+ return ffbuf;
}
static int name2type(t_atoms *at, int **cgnr, t_atomtype *atype,
void print_top_comment(FILE *out,char *filename,char *title,bool bITP)
{
+ char tmp[256];
+
nice_header(out,filename);
fprintf(out,";\tThis is your %stopology file\n",bITP ? "include " : "");
- fprintf(out,";\t%s\n",title[0]?title:cool_quote());
+ fprintf(out,";\t%s\n",title[0]?title:cool_quote(tmp,255,NULL));
fprintf(out,";\n");
}
#ifndef _pdb2top_h
#define _pdb2top_h
-static char *SRCID_pdb2top_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) pdb2top.h 1.19 2/2/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
#include "toputil.h"
#include "hackblock.h"
/* this *MUST* correspond to array in pdb2top.c */
enum { ehisA, ehisB, ehisH, ehis1, ehisNR };
-extern char *hh[ehisNR];
+extern const char *hh[ehisNR];
typedef struct {
int res1,res2;
int nr;
} t_mols;
-extern char *choose_ff(void);
+extern char *choose_ff(char buf[],int sz);
/* Strange place for this function... */
extern void print_top_comment(FILE *out,char *filename,char *title,bool bITP);
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_pgutil_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifndef _pgutil_h
#define _pgutil_h
-static char *SRCID_pgutil_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) pgutil.h 1.14 9/30/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
extern atom_id search_atom(char *type,int start,
* And Hey:\r
* GROningen Mixture of Alchemy and Childrens' Stories\r
*/\r
-static char *SRCID_protonate_c = "$Id$";\r
#include <math.h>\r
#include "typedefs.h"\r
#include "macros.h"\r
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_readir_c = "$Id$";
+
#include <ctype.h>
#include <stdlib.h>
+#include <limits.h>
#include "sysstuff.h"
#include "smalloc.h"
#include "typedefs.h"
#include "symtab.h"
#include "string2.h"
#include "readinp.h"
-#include "readir.h"
+#include "readir.h"
#include "toputil.h"
#include "index.h"
#include "network.h"
acc[STRLEN],accgrps[STRLEN],freeze[STRLEN],frdim[STRLEN],
energy[STRLEN],user1[STRLEN],user2[STRLEN],vcm[STRLEN],xtc_grps[STRLEN],
orirefitgrp[STRLEN],egexcl[STRLEN];
+static char anneal[STRLEN],anneal_npoints[STRLEN],
+ anneal_time[STRLEN],anneal_temp[STRLEN];
static char efield_x[STRLEN],efield_xt[STRLEN],efield_y[STRLEN],
efield_yt[STRLEN],efield_z[STRLEN],efield_zt[STRLEN];
"changing \"yes\" to \"Berendsen\"\n");
}
- if(ir->etc==etcNOSEHOOVER && ir->epc==epcBERENDSEN) {
+ if((ir->etc==etcNOSEHOOVER || ir->etc==etcANDERSEN || ir->etc==etcANDERSENINTERVAL )
+ && ir->epc==epcBERENDSEN) {
sprintf(warn_buf,"Using Berendsen pressure coupling invalidates the "
- "true ensemble for the Nose-Hoover thermostat");
+ "true ensemble for the thermostat");
warning(NULL);
}
+
/* ELECTROSTATICS */
/* More checks are in triple check (grompp.c) */
sprintf(err_buf,"epsilon_r must be >= 0 instead of %g\n",ir->epsilon_r);
if((ir->coulombtype == eelSHIFT) || (ir->coulombtype == eelSWITCH) ||
(ir->vdwtype == evdwSWITCH) || (ir->vdwtype == evdwSHIFT))
if((ir->rlist == ir->rcoulomb) || (ir->rlist == ir->rvdw)) {
- sprintf(warn_buf,"For strict energy conservation with switch/shift potentials, rlist should be 0.1 to 0.3 nm larger than rcoulomb/rvdw.");
+ sprintf(warn_buf,"For energy conservation with switch/shift potentials, rlist should be 0.1 to 0.3 nm larger than rcoulomb/rvdw.");
warning(NULL);
}
-
+ /* CONSTRAINTS */
+ if(ir->etc==etcNO && ir->eConstrAlg==estLINCS && ir->nLincsIter==1) {
+ sprintf(warn_buf,"For energy conservation with LINCS, lincs_iter should be 2 or larger.\n"
+ "You can safely ignore this if your system doesn't have any LINCS-constrained bonds;\n"
+ "for water molecules we normally use the analytical SETTLE algorithm instead.");
+ warning(NULL);
+ }
+ if(((ir->eI == eiSteep) || (ir->eI == eiCG)) && (ir->nLincsIter<4)) {
+ sprintf(warn_buf,"For energy minimization with constraints, lincs_iter should be 4 to 8.");
+ warning(NULL);
+ }
}
static int str_nelem(char *str,int maxptr,char *ptr[])
snew(dumstr[0],STRLEN);
snew(dumstr[1],STRLEN);
+
CCTYPE ("VARIOUS PREPROCESSING OPTIONS");
STYPE ("title", opts->title, NULL);
STYPE ("cpp", opts->cpp, "/lib/cpp");
RTYPE ("tinit", ir->init_t, 0.0);
RTYPE ("dt", ir->delta_t, 0.001);
ITYPE ("nsteps", ir->nsteps, 0);
+ CTYPE ("after checkpoint or tpbconv restart we can start on step > 0");
+ ITYPE ("init_step", ir->init_step, 0);
CTYPE ("mode for center of mass motion removal");
EETYPE("comm-mode", ecm_mode, ecm_names, nerror, TRUE);
CTYPE ("number of steps for center of mass motion removal");
ITYPE ("nstxout", ir->nstxout, 100);
ITYPE ("nstvout", ir->nstvout, 100);
ITYPE ("nstfout", ir->nstfout, 0);
+ CTYPE ("Checkpointing helps you continue after crashes");
+ ITYPE ("nstcheckpoint", ir->nstcheckpoint, 1000);
CTYPE ("Output frequency for energies to log file and energy file");
ITYPE ("nstlog", ir->nstlog, 100);
ITYPE ("nstenergy", ir->nstenergy, 100);
CTYPE ("cut-off lengths");
RTYPE ("rvdw-switch", ir->rvdw_switch, 0.0);
RTYPE ("rvdw", ir->rvdw, 1.0);
-
+
+
CTYPE ("Apply long range dispersion corrections for Energy and Pressure");
EETYPE("DispCorr", ir->eDispCorr, edispc_names, nerror, TRUE);
CTYPE ("Spacing for the PME/PPPM FFT grid");
RTYPE ("epsilon_surface", ir->epsilon_surface, 0.0);
EETYPE("optimize_fft",ir->bOptFFT, yesno_names, nerror, TRUE);
+ CCTYPE ("GENERALIZED BORN ELECTROSTATICS");
+ CTYPE ("Algorithm for calculating Born radii");
+ EETYPE("gb_algorithm", ir->gb_algorithm, egb_names, nerror, TRUE);
+ CTYPE ("Frequency of calculating the Born radii inside rlist");
+ ITYPE ("nstgbradii", ir->nstgbradii, 1);
+ CTYPE ("Cutoff for Born radii calculation; the contribution from atoms");
+ CTYPE ("between rlist and rgbradii is updated every nstlist steps");
+ RTYPE ("rgbradii", ir->rgbradii, 2.0);
+ CTYPE ("Salt concentration in M for Generalized Born models");
+ RTYPE ("gb_saltconc", ir->gb_saltconc, 0.0);
+
+ CCTYPE("IMPLICIT SOLVENT (for use with Generalized Born electrostatics)");
+ EETYPE("implicit_solvent", ir->implicit_solvent, eis_names, nerror, TRUE);
+
/* Coupling stuff */
CCTYPE ("OPTIONS FOR WEAK COUPLING ALGORITHMS");
CTYPE ("Temperature coupling");
STYPE ("compressibility", dumstr[0], NULL);
STYPE ("ref-p", dumstr[1], NULL);
+ CTYPE ("Random seed for Andersen thermostat");
+ ITYPE ("andersen_seed", ir->andersen_seed, 815131);
+
/* Simulated annealing */
- CCTYPE ("SIMULATED ANNEALING CONTROL");
- EETYPE("annealing", ir->bSimAnn, yesno_names, nerror, TRUE);
- CTYPE ("Time at which temperature should be zero (ps)");
- RTYPE ("zero-temp_time",ir->zero_temp_time,0.0);
+ CCTYPE("SIMULATED ANNEALING");
+ CTYPE ("Type of annealing for each temperature group (no/single/periodic)");
+ STYPE ("annealing", anneal, NULL);
+ CTYPE ("Number of time points to use for specifying annealing in each group");
+ STYPE ("annealing_npoints", anneal_npoints, NULL);
+ CTYPE ("List of times at the annealing points for each group");
+ STYPE ("annealing_time", anneal_time, NULL);
+ CTYPE ("Temp. at each annealing point, for each group.");
+ STYPE ("annealing_temp", anneal_temp, NULL);
/* Startup run */
CCTYPE ("GENERATE VELOCITIES FOR STARTUP RUN");
RTYPE ("shake-tol", ir->shake_tol, 0.0001);
CTYPE ("Highest order in the expansion of the constraint coupling matrix");
ITYPE ("lincs-order", ir->nProjOrder, 4);
+ CTYPE ("Number of iterations in the final step of LINCS. 1 is fine for");
+ CTYPE ("normal simulations, but use 2 to conserve energy in NVE runs.");
+ CTYPE ("For energy minimization with constraints it should be 4 to 8.");
+ ITYPE ("lincs-iter", ir->nLincsIter, 1);
CTYPE ("Lincs will write a warning to the stderr if in one step a bond");
CTYPE ("rotates over more degrees than");
RTYPE ("lincs-warnangle", ir->LincsWarnAngle, 30.0);
STYPE ("orire-fitgrp",orirefitgrp, NULL);
CTYPE ("Output frequency for trace(SD) to energy file");
ITYPE ("nstorireout", ir->nstorireout, 100);
+ CTYPE ("Dihedral angle restraints: No, Simple or Ensemble");
+ EETYPE("dihre", opts->eDihre, edisre_names, nerror, TRUE);
+ RTYPE ("dihre-fc", ir->dihre_fc, 1000.0);
+ RTYPE ("dihre-tau", ir->dihre_tau, 0.0);
+ CTYPE ("Output frequency for dihedral values to energy file");
+ ITYPE ("nstdihreout", ir->nstdihreout, 100);
/* Free energy stuff */
CCTYPE ("Free energy control stuff");
unsigned short *cbuf;
t_grps *groups=&(atoms->grps[gtype]);
int i,j,gid,aj,ognr,ntot=0;
- char *title;
+ const char *title;
if (debug)
fprintf(debug,"Starting numbering %d groups of type %d\n",ng,gtype);
{
t_block *grps;
char warnbuf[STRLEN],**gnames;
- int nr,ntcg,ntau_t,nref_t,nacc,nofg;
+ int nr,ntcg,ntau_t,nref_t,nacc,nofg,nSA,nSA_points,nSA_time,nSA_temp;
int nacg,nfreeze,nfrdim,nenergy,nuser,negexcl;
char *ptr1[MAXPTR],*ptr2[MAXPTR],*ptr3[MAXPTR];
int i,j,k,restnm;
- bool bExcl,bSetTCpar;
+ real SAtime;
+ bool bExcl,bSetTCpar,bAnneal;
if (bVerbose)
fprintf(stderr,"processing index file...\n");
for(i=0; (i<atoms->nr); i++)
for(j=0; (j<egcNR); j++)
atoms->atom[i].grpnr[j]=NOGID;
-
- if (ir->bSimAnn) {
- if (ir->eI==eiMD && ir->etc==etcNO)
- fatal_error(0,"You must select a temperature coupling algorithm "
- "for simulated annealing");
- if (ir->zero_temp_time == 0)
- fatal_error(0,"Cannot anneal to zero temp at t=0");
- }
ntau_t = str_nelem(tau_t,MAXPTR,ptr1);
nref_t = str_nelem(ref_t,MAXPTR,ptr2);
}
}
+ /* Simulated annealing for each group. There are nr groups */
+ nSA = str_nelem(anneal,MAXPTR,ptr1);
+ if(nSA>0 && nSA != nr)
+ fatal_error(0,"Not enough annealing values: %d (for %d groups)\n",nSA,nr);
+ else {
+ snew(ir->opts.annealing,nr);
+ snew(ir->opts.anneal_npoints,nr);
+ snew(ir->opts.anneal_time,nr);
+ snew(ir->opts.anneal_temp,nr);
+ if(nSA==0) {
+ fprintf(stderr,"Not using any simulated annealing\n");
+ for(i=0;i<nr;i++) {
+ ir->opts.annealing[i]=eannNO;
+ ir->opts.anneal_npoints[i]=0;
+ ir->opts.anneal_time[i]=NULL;
+ ir->opts.anneal_temp[i]=NULL;
+ }
+ } else {
+ bAnneal=FALSE;
+ for(i=0;i<nr;i++) {
+ if(ptr1[i][0]=='n' || ptr1[i][0]=='N') {
+ ir->opts.annealing[i]=eannNO;
+ } else if(ptr1[i][0]=='s'|| ptr1[i][0]=='S') {
+ ir->opts.annealing[i]=eannSINGLE;
+ bAnneal=TRUE;
+ } else if(ptr1[i][0]=='p'|| ptr1[i][0]=='P') {
+ ir->opts.annealing[i]=eannPERIODIC;
+ bAnneal=TRUE;
+ }
+ }
+ if(bAnneal) {
+ /* Read the other fields too */
+ nSA_points = str_nelem(anneal_npoints,MAXPTR,ptr1);
+ if(nSA_points!=nSA)
+ fatal_error(0,"Found %d annealing_npoints values for %d groups\n",nSA_points,nSA);
+ for(k=0,i=0;i<nr;i++) {
+ ir->opts.anneal_npoints[i]=strtol(ptr1[i],NULL,10);
+ if(ir->opts.anneal_npoints[i]==1)
+ fatal_error(0,"It doesn't make sense to use only one point for annealing!\n");
+ snew(ir->opts.anneal_time[i],ir->opts.anneal_npoints[i]);
+ snew(ir->opts.anneal_temp[i],ir->opts.anneal_npoints[i]);
+ k += ir->opts.anneal_npoints[i];
+ }
+
+ nSA_time = str_nelem(anneal_time,MAXPTR,ptr1);
+ if(nSA_time!=k)
+ fatal_error(0,"Found %d annealing_time values, wanter %d\n",nSA_time,k);
+ nSA_temp = str_nelem(anneal_temp,MAXPTR,ptr2);
+ if(nSA_temp!=k)
+ fatal_error(0,"Found %d annealing_temp values, wanted %d\n",nSA_temp,k);
+ for(i=0,k=0;i<nr;i++) {
+ if(ir->opts.anneal_time[i][0] > (ir->init_t+GMX_REAL_EPS))
+ fatal_error(0,"First time point for annealing > init_t.\n");
+
+ for(j=0;j<ir->opts.anneal_npoints[i];j++) {
+ ir->opts.anneal_time[i][j]=atof(ptr1[k]);
+ ir->opts.anneal_temp[i][j]=atof(ptr2[k]);
+ if(j>0 && (ir->opts.anneal_time[i][j]<ir->opts.anneal_time[i][j-1]))
+ fatal_error(0,"Annealing timepoints out of order: t=%f comes after t=%f\n",
+ ir->opts.anneal_time[i][j],ir->opts.anneal_time[i][j-1]);
+ if(ir->opts.anneal_temp[i][j]<0)
+ fatal_error(0,"Found negative temperature in annealing: %f\n",ir->opts.anneal_temp[i][j]);
+ k++;
+ }
+ }
+ /* Print out some summary information, to make sure we got it right */
+ for(i=0,k=0;i<nr;i++) {
+ if(ir->opts.annealing[i]!=eannNO) {
+ j=atoms->grps[egcTC].nm_ind[i];
+ fprintf(stderr,"Simulated annealing for group %s: %s, %d timepoints\n",
+ *(atoms->grpname[j]),eann_names[ir->opts.annealing[i]],
+ ir->opts.anneal_npoints[i]);
+ fprintf(stderr,"Time (ps) Temperature (K)\n");
+ /* All terms except the last one */
+ for(j=0;j<(ir->opts.anneal_npoints[i]-1);j++)
+ fprintf(stderr,"%9.1f %5.1f\n",ir->opts.anneal_time[i][j],ir->opts.anneal_temp[i][j]);
+
+ /* Finally the last one */
+ j = ir->opts.anneal_npoints[i]-1;
+ if(ir->opts.annealing[i]==eannSINGLE)
+ fprintf(stderr,"%9.1f- %5.1f\n",ir->opts.anneal_time[i][j],ir->opts.anneal_temp[i][j]);
+ else {
+ fprintf(stderr,"%9.1f %5.1f\n",ir->opts.anneal_time[i][j],ir->opts.anneal_temp[i][j]);
+ if(fabs(ir->opts.anneal_temp[i][j]-ir->opts.anneal_temp[i][0])>GMX_REAL_EPS)
+ fprintf(stderr,"Note: There is a temperature jump when your annealing loops back.\n");
+ }
+ }
+ }
+ }
+ }
+ }
+
nacc = str_nelem(acc,MAXPTR,ptr1);
nacg = str_nelem(accgrps,MAXPTR,ptr2);
if (nacg*DIM != nacc)
fatal_error(0,"Invalid Acceleration input: %d groups and %d acc. values",
nacg,nacc);
do_numbering(atoms,nacg,ptr2,grps,gnames,egcACC,
- restnm,forward,FALSE,bVerbose);
- nr=atoms->grps[egcACC].nr;
+ restnm,forward,FALSE,bVerbose); nr=atoms->grps[egcACC].nr;
snew(ir->opts.acc,nr);
ir->opts.ngacc=nr;
sfree(gnames);
done_block(grps);
sfree(grps);
-}
+ }
- static void check_disre(t_topology *sys)
+ static void check_disre(t_topology *sys)
{
t_functype *functype;
t_iparams *ip;
if (TRICLINIC(box))
fprintf(stderr,"Grid search might allow larger cut-off's than simple search with triclinic boxes.");
}
-
}
}
}
#ifndef _readir_h
#define _readir_h
-static char *SRCID_readir_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) readir.h 1.20 9/30/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
#include "string2.h"
enum { eshNONE, eshHBONDS, eshALLBONDS, eshHANGLES, eshALLANGLES, eshNR };
-static char *constraints[eshNR+1] = {
+static const char *constraints[eshNR+1] = {
"none", "h-bonds", "all-bonds", "h-angles", "all-angles", NULL
};
int seed;
int eDisre;
bool bOrire;
+ int eDihre;
bool bMorse;
} t_gromppopts;
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_relax_sh_c = "$Id$";
+
#include <string.h>
#include "assert.h"
#include "typedefs.h"
k_1 = s[i].k_1;
do_1pos(xnew[shell],xold[shell],f[shell],k_1,step);
if (debug && 0) {
- pr_rvec(debug,0,"fshell",f[shell],DIM);
- pr_rvec(debug,0,"xold",xold[shell],DIM);
- pr_rvec(debug,0,"xnew",xnew[shell],DIM);
+ pr_rvec(debug,0,"fshell",f[shell],DIM,TRUE);
+ pr_rvec(debug,0,"xold",xold[shell],DIM,TRUE);
+ pr_rvec(debug,0,"xnew",xnew[shell],DIM,TRUE);
}
}
}
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_resall_c = "$Id$";
+
#include "sysstuff.h"
#include <ctype.h>
#include "assert.h"
#ifndef _resall_h
#define _resall_h
-static char *SRCID_resall_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) resall.h 1.16 9/30/97"
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
#include "hackblock.h"
#include "grompp.h"
* And Hey:
* GROningen Mixture of Alchemy and Childrens' Stories
*/
-static char *SRCID_pdb2gmx_c = "$Id$";
+
#include <time.h>
#include <ctype.h>
#include "assert.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_sorting_c = "$Id$";
+
#include <limits.h>
#include "sysstuff.h"
#include "smalloc.h"
#ifndef _sorting_h
#define _sorting_h
-static char *SRCID_sorting_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) sorting.h 1.21 9/30/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
typedef atom_id t_bond[2];
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_specbond_c = "$Id$";
+
#include <ctype.h>
#include <math.h>
#include "typedefs.h"
t_specbond *get_specbonds(int *nspecbond)
{
- static char *sbfile="specbond.dat";
+ const char *sbfile="specbond.dat";
t_specbond *sb=NULL;
char r1buf[32],r2buf[32],a1buf[32],a2buf[32],nr1buf[32],nr2buf[32];
#ifndef _specbond_h
#define _specbond_h
-static char *SRCID_specbond_h = "$Id$";
#include "pdb2top.h"
extern int mk_specbonds(t_atoms *pdba,rvec x[],bool bInteractive,
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_splitter_c = "$Id$";
+
#include <stdio.h>
#include "sysstuff.h"
#include "assert.h"
atom_id *shknum,*cgsnum;
if (debug) {
- pr_block(debug,0,"cgs",cgs);
- pr_block(debug,0,"sblock",sblock);
+ pr_block(debug,0,"cgs",cgs,TRUE);
+ pr_block(debug,0,"sblock",sblock,TRUE);
}
shknum = make_invblock(sblock,cgs->nra+1);
return dd;
}
-typedef enum { egcolWhite, egcolGrey, egcolBlack, egcolNR } egCol;
-
static int mk_grey(int nnodes,egCol egc[],t_graph *g,int *AtomI,
t_sid sid[])
{
int ng,nnodes;
int nW,nG,nB; /* Number of Grey, Black, White */
int fW,fG; /* First of each category */
- static egCol *egc=NULL; /* The colour of each node */
+ egCol *egc=NULL; /* The colour of each node */
int g0,nblock;
if (!g->nbound)
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_splitter_h = "$Id$";
+
extern void split_top(bool bVerbose,int nnodes,t_topology *top,real *capacity);
/* Split the topology (blocks and forces, based on charge groups
* and shake blocks.
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_ter_db_c = "$Id$";
+
#include "sysstuff.h"
#include "smalloc.h"
#include "typedefs.h"
#ifndef _ter_db_h
#define _ter_db_h
-static char *SRCID_ter_db_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) ter_db.h 1.16 9/30/97"
-#endif /* HAVE_IDENT */
#include "sysstuff.h"
#include "hackblock.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_tomorse_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
#include <stdlib.h>
#include <math.h>
#include <ctype.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_topcat_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "smalloc.h"
#ifndef _topcat_h
#define _topcat_h
-static char *SRCID_topcat_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) topcat.h 1.23 9/30/97"
-#endif /* HAVE_IDENT */
-
#include "typedefs.h"
extern void topcat(t_molinfo *dest,int nsrc,t_molinfo src[],
#ifndef _topdef_h
#define _topdef_h
-static char *SRCID_topdef_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) topdef.h 1.9 11/23/92"
-#endif /* HAVE_IDENT */
/* These are the indices for combination rule selection */
#define COMB_GROMOS 1 /* Gromos rules */
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_topdirs_c = "$Id$";
+
#include <stdio.h>
#include <stdarg.h>
return F_IDIHS;
case 3:
return F_RBDIHS;
+ case 4:
+ return F_PIDIHS;
+ case 5:
+ return F_FOURDIHS;
default:
fatal_error(0,"Invalid dihedral type %d",type);
}
return F_DISRES;
case d_orientation_restraints:
return F_ORIRES;
+ case d_dihedral_restraints:
+ return F_DIHRES;
default:
fatal_error(0,"invalid directive %s in ifunc_index (%s:%s)",
dir2str(d),__FILE__,__LINE__);
set_nec(&(necessary[d_angle_restraints_z]),d_atoms,d_none);
set_nec(&(necessary[d_distance_restraints]),d_atoms,d_none);
set_nec(&(necessary[d_orientation_restraints]),d_atoms,d_none);
+ set_nec(&(necessary[d_dihedral_restraints]),d_atoms,d_none);
for(i=0; (i<d_maxdir); i++) {
if (debug)
fprintf(debug,"%20s: ",dir2str((directive)i));
#ifndef _topdirs_h
#define _topdirs_h
-static char *SRCID_topdirs_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) topdirs.h 1.30 9/30/97"
-#endif /* HAVE_IDENT */
#include "grompp.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_topexcl_c = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) topexcl.c 1.38 2/2/97"
-#endif
+/* This file is completely threadsafe - keep it that way! */
#include "assert.h"
#include "sysstuff.h"
#include "smalloc.h"
#ifndef _topexcl_h
#define _topexcl_h
-static char *SRCID_topexcl_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) topexcl.h 1.11 11/23/92"
-#endif /* HAVE_IDENT */
#include "topio.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_topio_c = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) topio.c 1.87 9/30/97"
-#endif
-
#include <math.h>
#include <sys/types.h>
#include <stdio.h>
char *cpp,char *define,
char *include)
{
- static char libdir[1024];
- static bool bFirst=TRUE;
+ char libdir[1024];
char *lib;
char command[2048];
int error;
- if (bFirst) {
- lib=getenv("GMXLIB");
- if (lib!=NULL) {
- strcpy(libdir,lib);
- }
- else {
- if(!get_libdir(libdir))
- strcpy(libdir,GMXLIBDIR);
- }
- bFirst=FALSE;
+ lib=getenv("GMXLIB");
+ if (lib!=NULL) {
+ strcpy(libdir,lib);
+ }
+ else {
+ if(!get_libdir(libdir))
+ strcpy(libdir,GMXLIBDIR);
}
-
+
/* build the command line. Second output name is not supported
* on OS X it seems, so we use redirection instead in that case.
*/
if (debug)
fprintf(debug,"Command line for cpp:\n\t%s\n",command);
-
+
/* execute preprocessor */
error=system(command);
if (error) {
bool bReadDefaults,bReadMolType,bGenPairs;
double qt=0,qBt=0; /* total charge */
t_bond_atomtype *batype;
+ int lastcg=-1;
/* open input and output file */
if ((in = fopen(infile,"r")) == NULL)
atype->nr);
fprintf(stderr,"Generated %d of the %d non-bonded parameter combinations\n",ncombs-ncopy,ncombs);
free_nbparam(nbparam,atype->nr);
-
- if (bGenPairs) {
+ if (bGenPairs) {
gen_pairs(&(plist[nb_funct]),&(plist[F_LJ14]),fudgeLJ,bVerbose);
ncopy = copy_nbparams(pair,nb_funct,&(plist[F_LJ14]),
atype->nr);
fprintf(stderr,"Generated %d of the %d 1-4 parameter combinations\n",ncombs-ncopy,ncombs);
free_nbparam(pair,atype->nr);
}
+ /* Copy GBSA parameters to atomtype array */
+
bReadMolType = TRUE;
}
break;
}
case d_atoms:
- push_atom(symtab,&(mi0->cgs),&(mi0->atoms),atype,pline);
+ push_atom(symtab,&(mi0->cgs),&(mi0->atoms),atype,pline,&lastcg);
break;
case d_pairs:
case d_angle_restraints_z:
case d_distance_restraints:
case d_orientation_restraints:
+ case d_dihedral_restraints:
case d_dihedrals:
push_bond(d,plist,mi0->plist,&(mi0->atoms),atype,pline,TRUE,bGenPairs);
break;
#ifndef _topio_h
#define _topio_h
-static char *SRCID_topio_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) topio.h 1.46 9/30/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
#include "readir.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_toppush_c = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) toppush.c 1.72 9/30/97"
-#endif
#include <math.h>
#include "symtab.h"
#include "fatal.h"
-static char errbuf[256];
void generate_nbparams(int comb,int ftype,t_params *plist,t_atomtype *atype,
real npow)
int i,j,k=-1,nf;
int nr,nrfp;
real c,sig6,sigma_ij,eps_ij,bi,bj;
+ char errbuf[256];
/* Lean mean shortcuts */
nr = atype->nr;
};
int nr,i,nfields,j,pt,nfp0=-1;
- int batype_nr;
+ int batype_nr,nread;
char type[STRLEN],btype[STRLEN],ptype[STRLEN];
double m,q;
double c[MAXFORCEPARAM];
- char tmpfield[10][100]; /* Max 10 fields of width 100 */
-
+ double radius,vol,surftens;
+ char tmpfield[12][100]; /* Max 12 fields of width 100 */
+ char errbuf[256];
+
/* First assign input line to temporary array */
- nfields=sscanf(line,"%s%s%s%s%s%s%s%s%s%s",
- tmpfield[0],tmpfield[1],tmpfield[2],tmpfield[3],tmpfield[4],
- tmpfield[5],tmpfield[6],tmpfield[7],tmpfield[8],tmpfield[9]);
-
+ nfields=sscanf(line,"%s%s%s%s%s%s%s%s%s%s%s%s",
+ tmpfield[0],tmpfield[1],tmpfield[2],tmpfield[3],tmpfield[4],tmpfield[5],
+ tmpfield[6],tmpfield[7],tmpfield[8],tmpfield[9],tmpfield[10],tmpfield[11]);
+
switch (nb_funct) {
case F_LJ:
nfp0 = 2;
- /* If the 5th field is a particletype and we have 7 fields in total there
- * is a bond_atomtype in field 2, otherwise not (set it identical to atomtype then) */
- if(nfields==7 && strlen(tmpfield[4])==1 && isalpha(tmpfield[4][0]))
- sscanf (line,"%s%s%lf%lf%s%lf%lf",type,btype,&m,&q,ptype,&c[0],&c[1]);
- else if (nfields==6) {
- sscanf (line,"%s%lf%lf%s%lf%lf",type,&m,&q,ptype,&c[0],&c[1]);
+ /* If the 5th field is a particletype, then there is a bond_atomtype
+ *iin field 2, otherwise not (set it identical to atomtype then) */
+ if(nfields>=7 && strlen(tmpfield[4])==1 && isalpha(tmpfield[4][0])) {
+ nread = sscanf (line,"%s%s%lf%lf%s%lf%lf%lf%lf%lf",
+ type,btype,&m,&q,ptype,&c[0],&c[1],&radius,&vol,&surftens);
+ if(nread<10)
+ surftens = -1;
+ if(nread<9)
+ vol = 0;
+ if(nread<8)
+ radius = 0;
+ }
+ else if (nfields>=6) {
+ nread = sscanf (line,"%s%lf%lf%s%lf%lf%lf%lf%lf",
+ type,&m,&q,ptype,&c[0],&c[1],&radius,&vol,&surftens);
+ if(nread<9)
+ surftens = -1;
+ if(nread<8)
+ vol = 0;
+ if(nread<7)
+ radius = 0;
strcpy(btype,type);
+
} else {
too_few();
return;
- }
+ }
break;
case F_BHAM:
nfp0 = 3;
/* If the 5th field is a particletype and we have 8 fields in total there
* is a bond_atomtype in field 2, otherwise not (set it identical to atomtype then) */
- if(nfields==8 && strlen(tmpfield[4])==1 && isalpha(tmpfield[4][0]))
- sscanf (line,"%s%s%lf%lf%s%lf%lf%lf",type,btype,&m,&q,ptype,&c[0],&c[1],&c[2]);
- else if (nfields==7) {
- sscanf (line,"%s%lf%lf%s%lf%lf%lf",type,&m,&q,ptype,&c[0],&c[1],&c[2]);
+ if(nfields>=8 && strlen(tmpfield[4])==1 && isalpha(tmpfield[4][0])) {
+ nread = sscanf (line,"%s%s%lf%lf%s%lf%lf%lf%lf%lf%lf",
+ type,btype,&m,&q,ptype,&c[0],&c[1],&c[2],&radius,&vol,&surftens);
+ if(nread<11)
+ surftens = -1;
+ if(nread<10)
+ vol = 0;
+ if(nread<9)
+ radius = 0;
+ }
+ else if (nfields>=7) {
+ nread = sscanf (line,"%s%lf%lf%s%lf%lf%lf%lf%lf%lf",
+ type,&m,&q,ptype,&c[0],&c[1],&c[2],&radius,&vol,&surftens);
strcpy(btype,type);
+ if(nread<10)
+ surftens = -1;
+ if(nread<9)
+ vol = 0;
+ if(nread<8)
+ radius = 0;
} else {
too_few();
return;
srenew(at->atomname,nr+1);
srenew(at->bondatomtype,nr+1);
srenew(at->nb,nr+1);
+ srenew(at->radius,nr+1);
+ srenew(at->vol,nr+1);
+ srenew(at->surftens,nr+1);
at->nr++;
/* Add space in the non-bonded parameters matrix */
srenew(*nbparam,at->nr);
sprintf(errbuf,"Overriding atomtype %s",type);
warning(errbuf);
nr = i;
- }
+ }
+
/* fill the arrays */
at->atomname[nr] = put_symtab(symtab,type);
at->bondatomtype[nr] = batype_nr;
at->atom[nr].ptype = pt;
at->atom[nr].m = m;
at->atom[nr].q = q;
-
+ at->radius[nr] = radius;
+ at->vol[nr] = vol;
+ at->surftens[nr] = surftens;
+
for (i=0; (i<MAXFORCEPARAM); i++)
at->nb[nr].c[i] = c[i];
}
bool bTest,bFound,bId;
int nr = bt->nr;
int nrfp = NRFP(ftype);
+ char errbuf[256];
/* Check if this entry overwrites another */
bFound=FALSE;
void push_bt(directive d,t_params bt[],int nral,char ***typenames, int ntypes,char *line)
{
- static char *formal[MAXATOMLIST+1] = {
+ const char *formal[MAXATOMLIST+1] = {
"%s",
"%s%s",
"%s%s%s",
"%s%s%s%s%s",
"%s%s%s%s%s%s"
};
- static char *formnl[MAXATOMLIST+1] = {
+ const char *formnl[MAXATOMLIST+1] = {
"%*s",
"%*s%*s",
"%*s%*s%*s",
"%*s%*s%*s%*s%*s",
"%*s%*s%*s%*s%*s%*s"
};
- static char *formlf[MAXFORCEPARAM] = {
+ const char *formlf[MAXFORCEPARAM] = {
"%lf",
"%lf%lf",
"%lf%lf%lf",
char alc[MAXATOMLIST+1][20];
double c[MAXFORCEPARAM];
t_param p;
-
+ char errbuf[256];
+
/* Make format string (nral ints+functype) */
if ((nn=sscanf(line,formal[nral],
alc[0],alc[1],alc[2],alc[3],alc[4],alc[5])) != nral+1) {
void push_dihedraltype(directive d,t_params bt[],char ***typenames,int ntypes,char *line)
{
- static char *formal[MAXATOMLIST+1] = {
+ const char *formal[MAXATOMLIST+1] = {
"%s",
"%s%s",
"%s%s%s",
"%s%s%s%s%s",
"%s%s%s%s%s%s"
};
- static char *formnl[MAXATOMLIST+1] = {
+ const char *formnl[MAXATOMLIST+1] = {
"%*s",
"%*s%*s",
"%*s%*s%*s",
"%*s%*s%*s%*s%*s",
"%*s%*s%*s%*s%*s%*s"
};
- static char *formlf[MAXFORCEPARAM] = {
+ const char *formlf[MAXFORCEPARAM] = {
"%lf",
"%lf%lf",
"%lf%lf%lf",
char alc[MAXATOMLIST+1][20];
double c[MAXFORCEPARAM];
t_param p;
+ char errbuf[256];
/* This routine accepts dihedraltypes defined from either 2 or 4 atoms.
*
char *pline,int nb_funct)
{
/* swap the atoms */
- static char *form2="%*s%*s%*s%lf%lf";
- static char *form3="%*s%*s%*s%lf%lf%lf";
+ const char *form2="%*s%*s%*s%lf%lf";
+ const char *form3="%*s%*s%*s%lf%lf%lf";
char a0[80],a1[80];
int i,f,k,ftype,atnr,nrfp;
double c[3];
atom_id ai,aj;
t_nbparam *nbp;
bool bId;
-
+ char errbuf[256];
+
if (sscanf (pline,"%s%s%d",a0,a1,&f) != 3) {
too_few();
return;
}
void push_atom(t_symtab *symtab,t_block *cgs,
- t_atoms *at,t_atomtype *atype,char *line)
+ t_atoms *at,t_atomtype *atype,char *line,int *lastcg)
{
int nr,ptype;
- static int lastcg;
int resnumber,cgnumber,atomnr,type,typeB,nscan;
char id[STRLEN],ctype[STRLEN],ctypeB[STRLEN],
resname[STRLEN],name[STRLEN];
if (debug)
fprintf(debug,"mB=%g, qB=%g, typeB=%d\n",mB,qB,typeB);
- push_cg(cgs,&lastcg,cgnumber,nr);
+ push_cg(cgs,lastcg,cgnumber,nr);
push_atom_now(symtab,at,atomnr,type,ctype,ptype,resnumber,cgnumber,
resname,name,m0,q0,typeB,
void push_bond(directive d,t_params bondtype[],t_params bond[],
t_atoms *at,t_atomtype *atype,char *line,bool bBonded,bool bGenPairs)
{
- static char *aaformat[MAXATOMLIST]= {
+ const char *aaformat[MAXATOMLIST]= {
"%d%d",
"%d%d%d",
"%d%d%d%d",
"%d%d%d%d%d",
"%d%d%d%d%d%d"
};
- static char *asformat[MAXATOMLIST]= {
+ const char *asformat[MAXATOMLIST]= {
"%*s%*s",
"%*s%*s%*s",
"%*s%*s%*s%*s",
"%*s%*s%*s%*s%*s",
"%*s%*s%*s%*s%*s%*s"
};
- static char *ccformat[MAXFORCEPARAM+1]= {
+ const char *ccformat[MAXFORCEPARAM+1]= {
"",
"%lf",
"%lf%lf",
int aa[MAXATOMLIST+1];
t_param param,paramB;
bool bFoundA,bFoundB,bDef,bPert,bSwapParity=FALSE;
-
+ char errbuf[256];
+
ftype = ifunc_index(d,1);
nral = NRAL(ftype);
for(j=0; j<MAXATOMLIST; j++)
#ifndef _toppush_h
#define _toppush_h
-static char *SRCID_toppush_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) toppush.h 1.31 9/30/97"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
#include "toputil.h"
t_block *cgs,
t_atoms *at,
t_atomtype *atype,
- char *line);
+ char *line,
+ int *lastcg);
extern void push_bondnow (t_params *bond, t_param *b);
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_topshake_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
#include <ctype.h>
#include "sysstuff.h"
#ifndef _topshake_h
#define _topshake_h
-static char *SRCID_topshake_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) topshake.h 1.19 9/30/97"
-#endif /* HAVE_IDENT */
#include "topio.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_toputil_c = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) toputil.c 1.68 9/30/97"
-#endif
#include "assert.h"
#include "smalloc.h"
at->atomname = NULL;
at->nb = NULL;
at->bondatomtype = NULL;
+ at->radius = NULL;
+ at->vol = NULL;
+ at->surftens = NULL;
+
}
void init_bond_atomtype (t_bond_atomtype *bat)
/* This dihp is a DIRTY patch because the dih-types do not use
* all four atoms to determine the type.
*/
- static int dihp[2][2] = { { 1,2 }, { 0,3 } };
+ const int dihp[2][2] = { { 1,2 }, { 0,3 } };
t_params *bt;
int i,j,f,nral,nrfp;
bool bDih=FALSE,bSwapParity;
break;
case F_PDIHS:
case F_RBDIHS:
+ case F_FOURDIHS:
bDih=TRUE;
break;
case F_IDIHS:
#ifndef _toputil_h
#define _toputil_h
-static char *SRCID_toputil_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) toputil.h 1.25 19 Nov 1995"
-#endif /* HAVE_IDENT */
#include "grompp.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_tpbcmp_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
#include <math.h>
#include <stdio.h>
#include <string.h>
cmp_ilist(fp,i,&(id1->il[i]),&(id2->il[i]));
}
-static void cmp_block(FILE *fp,t_block *b1,t_block *b2,char *s)
+static void cmp_block(FILE *fp,t_block *b1,t_block *b2,const char *s)
{
int i,j,k;
char buf[32];
static void cmp_grpopts(FILE *fp,t_grpopts *opt1,t_grpopts *opt2,real ftol)
{
- int i;
+ int i,j;
+ char buf1[256],buf2[256];
cmp_int(fp,"inputrec->grpopts.ngtc",0, opt1->ngtc,opt2->ngtc);
cmp_int(fp,"inputrec->grpopts.ngacc",0, opt1->ngacc,opt2->ngacc);
cmp_real(fp,"inputrec->grpopts.nrdf",i,opt1->nrdf[i],opt2->nrdf[i],ftol);
cmp_real(fp,"inputrec->grpopts.ref_t",i,opt1->ref_t[i],opt2->ref_t[i],ftol);
cmp_real(fp,"inputrec->grpopts.tau_t",i,opt1->tau_t[i],opt2->tau_t[i],ftol);
+ cmp_int(fp,"inputrec->grpopts.annealing",i,opt1->annealing[i],opt2->annealing[i]);
+ cmp_int(fp,"inputrec->grpopts.anneal_npoints",i,
+ opt1->anneal_npoints[i],opt2->anneal_npoints[i]);
+ if(opt1->anneal_npoints[i]==opt2->anneal_npoints[i]) {
+ sprintf(buf1,"inputrec->grpopts.anneal_time[%d]",i);
+ sprintf(buf2,"inputrec->grpopts.anneal_temp[%d]",i);
+ for(j=0;j<opt1->anneal_npoints[i];j++) {
+ cmp_real(fp,buf1,j,opt1->anneal_time[i][j],opt2->anneal_time[i][j],ftol);
+ cmp_real(fp,buf2,j,opt1->anneal_temp[i][j],opt2->anneal_temp[i][j],ftol);
+ }
+ }
}
for(i=0; (i<min(opt1->ngacc,opt2->ngacc)); i++)
cmp_rvec(fp,"inputrec->grpopts.acc",i,opt1->acc[i],opt2->acc[i],ftol);
*/
cmp_int(fp,"inputrec->eI",0,ir1->eI,ir2->eI);
cmp_int(fp,"inputrec->nsteps",0,ir1->nsteps,ir2->nsteps);
+ cmp_int(fp,"inputrec->init_step",0,ir1->init_step,ir2->init_step);
cmp_int(fp,"inputrec->ePBC",0,ir1->ePBC,ir2->ePBC);
cmp_int(fp,"inputrec->ns_type",0,ir1->ns_type,ir2->ns_type);
cmp_int(fp,"inputrec->nstlist",0,ir1->nstlist,ir2->nstlist);
cmp_int(fp,"inputrec->bDomDecomp",0,ir1->bDomDecomp,ir2->bDomDecomp);
cmp_int(fp,"inputrec->decomp_dir",0,ir1->decomp_dir,ir2->decomp_dir);
cmp_int(fp,"inputrec->nstcomm",0,ir1->nstcomm,ir2->nstcomm);
+ cmp_int(fp,"inputrec->nstcheckpoint",0,ir1->nstcheckpoint,ir2->nstcheckpoint);
cmp_int(fp,"inputrec->nstlog",0,ir1->nstlog,ir2->nstlog);
cmp_int(fp,"inputrec->nstxout",0,ir1->nstxout,ir2->nstxout);
cmp_int(fp,"inputrec->nstvout",0,ir1->nstvout,ir2->nstvout);
cmp_rvec(fp,"inputrec->compress(x)",0,ir1->compress[XX],ir2->compress[XX],ftol);
cmp_rvec(fp,"inputrec->compress(y)",0,ir1->compress[YY],ir2->compress[YY],ftol);
cmp_rvec(fp,"inputrec->compress(z)",0,ir1->compress[ZZ],ir2->compress[ZZ],ftol);
- cmp_int(fp,"inputrec->bSimAnn",0,ir1->bSimAnn,ir2->bSimAnn);
- cmp_real(fp,"inputrec->zero_temp_time",0,ir1->zero_temp_time,ir2->zero_temp_time,ftol);
+ cmp_int(fp,"inputrec->andersen_seed",0,ir1->andersen_seed,ir2->andersen_seed);
cmp_real(fp,"inputrec->rlist",0,ir1->rlist,ir2->rlist,ftol);
cmp_int(fp,"inputrec->coulombtype",0,ir1->coulombtype,ir2->coulombtype);
cmp_real(fp,"inputrec->rcoulomb_switch",0,ir1->rcoulomb_switch,ir2->rcoulomb_switch,ftol);
cmp_real(fp,"inputrec->rvdw_switch",0,ir1->rvdw_switch,ir2->rvdw_switch,ftol);
cmp_real(fp,"inputrec->rvdw",0,ir1->rvdw,ir2->rvdw,ftol);
cmp_real(fp,"inputrec->epsilon_r",0,ir1->epsilon_r,ir2->epsilon_r,ftol);
+ cmp_int(fp,"inputrec->gb_algorithm",0,ir1->gb_algorithm,ir2->gb_algorithm);
+ cmp_int(fp,"inputrec->nstgbradii",0,ir1->nstgbradii,ir2->nstgbradii);
+ cmp_real(fp,"inputrec->rgbradii",0,ir1->rgbradii,ir2->rgbradii,ftol);
+ cmp_real(fp,"inputrec->gb_saltconc",0,ir1->gb_saltconc,ir2->gb_saltconc,ftol);
+ cmp_int(fp,"inputrec->implicit_solvent",0,ir1->implicit_solvent,ir2->implicit_solvent);
cmp_int(fp,"inputrec->eDispCorr",0,ir1->eDispCorr,ir2->eDispCorr);
cmp_real(fp,"inputrec->shake_tol",0,ir1->shake_tol,ir2->shake_tol,ftol);
cmp_real(fp,"inputrec->fudgeQQ",0,ir1->fudgeQQ,ir2->fudgeQQ,ftol);
cmp_real(fp,"inputrec->orires_fc",0,ir1->orires_fc,ir2->orires_fc,ftol);
cmp_real(fp,"inputrec->orires_tau",0,ir1->orires_tau,ir2->orires_tau,ftol);
cmp_int(fp,"inputrec->nstorireout",0,ir1->nstorireout,ir2->nstorireout);
+ cmp_real(fp,"inputrec->dihre_fc",0,ir1->dihre_fc,ir2->dihre_fc,ftol);
+ cmp_int(fp,"inputrec->nstdihreout",0,ir1->nstdihreout,ir2->nstdihreout);
+ cmp_real(fp,"inputrec->dihre_tau",0,ir1->dihre_tau,ir2->dihre_tau,ftol);
cmp_real(fp,"inputrec->em_stepsize",0,ir1->em_stepsize,ir2->em_stepsize,ftol);
cmp_real(fp,"inputrec->em_tol",0,ir1->em_tol,ir2->em_tol,ftol);
cmp_int(fp,"inputrec->niter",0,ir1->niter,ir2->niter);
cmp_int(fp,"inputrec->eConstrAlg",0,ir1->eConstrAlg,ir2->eConstrAlg);
cmp_int(fp,"inputrec->nProjOrder",0,ir1->nProjOrder,ir2->nProjOrder);
cmp_real(fp,"inputrec->LincsWarnAngle",0,ir1->LincsWarnAngle,ir2->LincsWarnAngle,ftol);
+ cmp_int(fp,"inputrec->nLincsIter",0,ir1->nLincsIter,ir2->nLincsIter);
cmp_real(fp,"inputrec->bd_temp",0,ir1->bd_temp,ir2->bd_temp,ftol);
cmp_real(fp,"inputrec->bd_fric",0,ir1->bd_fric,ir2->bd_fric,ftol);
cmp_int(fp,"inputrec->ld_seed",0,ir1->ld_seed,ir2->ld_seed);
ff[0]=fn1;
ff[1]=fn2;
for(i=0; (i<2); i++) {
- read_tpxheader(ff[i],&(sh[i]));
+ read_tpxheader(ff[i],&(sh[i]),FALSE,NULL,NULL);
snew(xx[i],sh[i].natoms);
snew(vv[i],sh[i].natoms);
read_tpx(ff[i],&step,&t,&lambda,&(ir[i]),box[i],&natoms,
#ifndef _tpbcmp_h
#define _tpbcmp_h
-static char *SRCID_tpbcmp_h = "$Id$";
+
extern void comp_tpx(char *fn1,char *fn2,real ftol);
/* Compare two binary topology files */
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_tpbconv_c = "$Id$";
+
#include <math.h>
#include "rdgroup.h"
#include "fatal.h"
}
static void reduce_block(atom_id invindex[],bool bKeep[],t_block *block,
- char *name,bool bExcl)
+ const char *name,bool bExcl)
{
atom_id *index,*a;
int i,j,k,newi,newj;
top_fn = ftp2fn(efTPX,NFILE,fnm);
fprintf(stderr,"Reading toplogy and shit from %s\n",top_fn);
- read_tpxheader(top_fn,&tpx);
+ read_tpxheader(top_fn,&tpx,FALSE,NULL,NULL);
snew(x,tpx.natoms);
snew(v,tpx.natoms);
snew(ir,1);
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_x2top_c = "$Id$";
+
#include "maths.h"
#include "macros.h"
#include "copyrite.h"
t_nextnb nnb;
t_nm2type *nm2t;
t_mols mymol;
- char *ff;
+ char ff[256];
int nnm;
char title[STRLEN];
rvec *x; /* coordinates? */
read_stx_conf(opt2fn("-f",NFILE,fnm),title,atoms,x,NULL,box);
- ff = choose_ff();
+ choose_ff(ff,255);
snew(nbonds,atoms->nr);
#ifndef _x2top_h
#define _x2top_h
-static char *SRCID_x2top_h = "$Id$";
#include <stdio.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_xlate_c = "$Id$";
+
#include <ctype.h>
#include <string.h>
#include "typedefs.h"
static t_xlate_atom *get_xlatoms(int *nxlatom)
{
- static char *xlfile="xlateat.dat";
+ const char *xlfile="xlateat.dat";
t_xlate_atom *xl=NULL;
char rbuf[32],abuf[32],repbuf[32];
#ifndef _xlate_h
#define _xlate_h
-static char *SRCID_xlate_h = "$Id$";
+
extern void rename_atoms(t_atoms *atoms,t_symtab *symtab);
#endif
#ifndef _xmdrun_h
#define _xmdrun_h
-static char *SRCID_xmdrun_h = "$Id$";
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_xutils_c = "$Id$";
+
#include "typedefs.h"
#include "smalloc.h"
force.c ghat.c init.c \
mdatom.c mdebin.c minimize.c \
ns.c nsb.c nsgrid.c \
- pme.c poisson.c pppm.c \
- psgather.c pull.c pullinit.c \
- pullio.c pullutil.c pssolve.c \
- psspread.c shakef.c sim_util.c \
+ pme.c pppm.c \
+ pull.c pullinit.c \
+ pullio.c pullutil.c \
+ shakef.c sim_util.c \
splittop.c tables.c tgroup.c \
update.c vcm.c wnblist.c \
- poisson.h splittop.h wnblist.h \
+ splittop.h wnblist.h \
pull_internal.h
EXTRA_libmd@LIBSUFFIX@_la_SOURCES = \
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_calcmu_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <stdio.h>
#include <stdlib.h>
#include "typedefs.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_calcvir_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "sysstuff.h"
#include "force.h"
#include "assert.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_callf77_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "callf77.h"
#include "fatal.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_clincs_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <math.h>
#include "main.h"
#include "constr.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_compnl_c = "$Id$";
+
#include "ns.h"
#include "smalloc.h"
#include "wnblist.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_constr_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
static real *bllen,*blc,*blcc,*blm,*tmp1,*tmp2,*tmp3,*lincslam,
*bllen0,*ddist;
static int nc;
- static bool bItEqOrder;
char buf[STRLEN];
int b,i,j,nit,warn,p_imax,error;
&r,&bla1,&bla2,&blnr,&blbnb,
&bllen,&blc,&blcc,&blm,&tmp1,&tmp2,&tmp3,&lincslam,
&bllen0,&ddist);
- bItEqOrder = (getenv("GMX_ACCURATE_LINCS") != NULL);
}
else if (nc != 0) {
/* If there are any constraints */
if (do_per_step(step,ir->nstlog) || step<0)
cconerr(&p_max,&p_rms,&p_imax,xprime,nc,bla1,bla2,bllen);
-
- if ((ir->eI == eiSteep) || (ir->eI == eiCG) || bItEqOrder)
- /* Use more iterations when doing energy minimization, *
- * because we need very accurate positions and forces. */
- nit = ir->nProjOrder;
- else
- nit = 1;
+
+ nit = ir->nLincsIter;
#ifdef USE_FORTRAN
F77_FUNC(flincs,FLINCS)(x[0],xprime[0],&nc,bla1,bla2,blnr,blbnb,
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_coupling_c = "$Id$";
+
#include "typedefs.h"
#include "smalloc.h"
#include "update.h"
*/
int d,n;
- static tensor winv;
- static bool bFirst=TRUE;
+ tensor winv;
real vol=box[XX][XX]*box[YY][YY]*box[ZZ][ZZ];
real fac=vol/PRESFAC;
real atot,arel,change,maxchange,xy_pressure;
tensor invbox,pdiff,t1,t2;
- if(bFirst) {
- real maxl;
- maxl=max(box[XX][XX],box[YY][YY]);
- maxl=max(maxl,box[ZZ][ZZ]);
- for(d=0;d<DIM;d++)
- for(n=0;n<DIM;n++)
- winv[d][n]=(4*M_PI*M_PI*ir->compress[d][n])/(3*ir->tau_p*ir->tau_p*maxl);
- bFirst=FALSE;
- }
+ real maxl;
+ maxl=max(box[XX][XX],box[YY][YY]);
+ maxl=max(maxl,box[ZZ][ZZ]);
+ for(d=0;d<DIM;d++)
+ for(n=0;n<DIM;n++)
+ winv[d][n]=(4*M_PI*M_PI*ir->compress[d][n])/(3*ir->tau_p*ir->tau_p*maxl);
+
m_inv(box,invbox);
m_sub(pres,ir->ref_p,pdiff);
}
}
-void berendsen_tcoupl(t_grpopts *opts,t_groups *grps,
- real dt,real SAfactor)
+void berendsen_tcoupl(t_grpopts *opts,t_groups *grps,real dt)
{
int i;
+
real T,reft=0,lll;
for(i=0; (i<opts->ngtc); i++) {
T = grps->tcstat[i].T;
if ((opts->tau_t[i] > 0) && (T > 0.0)) {
- reft = max(0.0,opts->ref_t[i]*SAfactor);
+
+ reft = max(0.0,opts->ref_t[i]);
lll = sqrt(1.0 + (dt/opts->tau_t[i])*(reft/T-1.0));
grps->tcstat[i].lambda = max(min(lll,1.25),0.8);
}
}
}
-void nosehoover_tcoupl(t_grpopts *opts,t_groups *grps,
- real dt,real SAfactor)
+void nosehoover_tcoupl(t_grpopts *opts,t_groups *grps,real dt)
{
- static real *Qinv=NULL;
- int i;
- real reft=0,xit,oldxi;
-
- if (Qinv == NULL) {
- snew(Qinv,opts->ngtc);
-
- /* Use inputrec ref_t - Q shouldnt change during the run. */
- for(i=0;i<opts->ngtc;i++) {
- if ((opts->tau_t[i] > 0) && (opts->ref_t[i] > 0))
- Qinv[i]=1.0/(opts->tau_t[i]*opts->tau_t[i]*opts->ref_t[i])/(4*M_PI*M_PI);
- else
- Qinv[i]=0.0;
- }
- }
+ real Qinv;
+ int i;
+ real reft=0,xit,oldxi;
for(i=0; (i<opts->ngtc); i++) {
- reft = max(0.0,opts->ref_t[i]*SAfactor);
- grps->tcstat[i].xi += dt*Qinv[i]*(grps->tcstat[i].T-reft);
+ if ((opts->tau_t[i] > 0) && (opts->ref_t[i] > 0))
+ Qinv=1.0/(opts->tau_t[i]*opts->tau_t[i]*opts->ref_t[i])/(4*M_PI*M_PI);
+ else
+ Qinv=0.0;
+ reft = max(0.0,opts->ref_t[i]);
+ grps->tcstat[i].xi += dt*Qinv*(grps->tcstat[i].T-reft);
}
}
+/* set target temperatures if we are annealing */
+void
+update_annealing_target_temp(t_grpopts *opts,real t)
+{
+ int i,j,n;
+ real pert,thist,x;
+
+ for(i=0;i<opts->ngtc;i++) {
+ if(opts->annealing[i] == eannNO)
+ continue;
+ else if(opts->annealing[i] == eannPERIODIC) {
+ /* calculate time modulo the period */
+ pert = opts->anneal_time[i][opts->anneal_npoints[i]-1];
+ n = t / pert;
+ thist = t - n*pert; /* modulo time */
+ /* Make sure rounding didn't get us outside the interval */
+ if(fabs(thist-pert)<GMX_REAL_EPS*100)
+ thist=0;
+ } else /* nonperiodic annealing run */ {
+ thist = t;
+ }
+ /* We are doing annealing for this group if we got here,
+ * and we have the (relative) time as thist.
+ * calculate target temp */
+ j=0;
+ while(thist>(opts->anneal_time[i][j+1]))
+ j++;
+ /* Found our position between points j and j+1.
+ * Interpolate: x is the amount from j+1, (1-x) from point j
+ * First treat possible jumps in temperature as a special case.
+ */
+ if((opts->anneal_time[i][j+1]-opts->anneal_time[i][j])<GMX_REAL_EPS*100)
+ opts->ref_t[i]=opts->anneal_temp[i][j+1];
+ else {
+ x=(thist-opts->anneal_time[i][j])/(opts->anneal_time[i][j+1]-opts->anneal_time[i][j]);
+ opts->ref_t[i]=x*opts->anneal_temp[i][j+1]+(1-x)*opts->anneal_temp[i][j];
+ }
+ }
+}
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_csettle_c = "$Id$";
+
#include <math.h>
#include <stdio.h>
#include "vec.h"
}
#endif
+
+/* Our local shake routine to be used when settle breaks down due to a zero determinant */
+static int xshake(real b4[], real after[], real dOH, real dHH, real mO, real mH)
+{
+ real bondsq[3];
+ real bond[9];
+ real invmass[3];
+ real M2[3];
+ int iconv;
+ int iatom[3]={0,0,1};
+ int jatom[3]={1,2,2};
+ real rijx,rijy,rijz,tx,ty,tz,im,jm,acor,rp,diff;
+ int i,ll,ii,jj,l3,ix,iy,iz,jx,jy,jz,conv;
+
+ invmass[0]=1.0/mO;
+ invmass[1]=1.0/mH;
+ invmass[2]=1.0/mH;
+
+ bondsq[0]=dOH*dOH;
+ bondsq[1]=bondsq[0];
+ bondsq[2]=dHH*dHH;
+
+ M2[0]=1.0/(2.0*(invmass[0]+invmass[1]));
+ M2[1]=M2[0];
+ M2[2]=1.0/(2.0*(invmass[1]+invmass[2]));
+
+ for(ll=0;ll<3;ll++) {
+ l3=3*ll;
+ ix=3*iatom[ll];
+ jx=3*jatom[ll];
+ for(i=0;i<3;i++)
+ bond[l3+i]= b4[ix+i] - b4[jx+i];
+ }
+
+ for(i=0,iconv=0;i<1000 && iconv<3; i++) {
+ for(ll=0;ll<3;ll++) {
+ ii = iatom[ll];
+ jj = jatom[ll];
+ l3 = 3*ll;
+ ix = 3*ii;
+ jx = 3*jj;
+ iy = ix+1;
+ jy = jx+1;
+ iz = ix+2;
+ jz = jx+2;
+
+ rijx = bond[l3];
+ rijy = bond[l3+1];
+ rijz = bond[l3+2];
+
+
+ tx = after[ix]-after[jx];
+ ty = after[iy]-after[jy];
+ tz = after[iz]-after[jz];
+
+ rp = tx*tx+ty*ty+tz*tz;
+ diff = bondsq[ll] - rp;
+
+ if(fabs(diff)<1e-8) {
+ iconv++;
+ } else {
+ rp = rijx*tx+rijy*ty+rijz*tz;
+ if(rp<1e-8) {
+ printf("SHITSHITSHIT\n");
+ return -1;
+ }
+ acor = diff*M2[ll]/rp;
+ im = invmass[ii];
+ jm = invmass[jj];
+ tx = rijx*acor;
+ ty = rijy*acor;
+ tz = rijz*acor;
+ after[ix] += tx*im;
+ after[iy] += ty*im;
+ after[iz] += tz*im;
+ after[jx] -= tx*jm;
+ after[jy] -= ty*jm;
+ after[jz] -= tz*jm;
+ }
+ }
+ }
+ return 0;
+}
+
+
void csettle(FILE *fp,int nshake, int owptr[],real b4[], real after[],
real dOH,real dHH,real mO,real mH,int *error)
{
za1d, xb1d, yb1d, zb1d, xc1d, yc1d, zc1d, ya2d, xb2d, yb2d, yc2d,
xa3d, ya3d, za3d, xb3d, yb3d, zb3d, xc3d, yc3d, zc3d;
real t1,t2;
+
+ int doshake;
- int i, ow1, hw2, hw3;
+ int i, shakeret, ow1, hw2, hw3;
*error=-1;
if (bFirst) {
#pragma ivdep
#endif
for (i = 0; i < nshake; ++i) {
+ doshake = 0;
/* --- Step1 A1' --- */
ow1 = owptr[i] * 3;
hw2 = ow1 + 3;
tmp = rone - sinphi * sinphi;
if (tmp <= 0) {
*error = i;
+ doshake = 1;
cosphi = 0;
}
else
tmp2 = rone - sinpsi * sinpsi;
if (tmp2 <= 0) {
*error = i;
+ doshake = 1;
cospsi = 0;
}
else
cospsi = tmp2*invsqrt(tmp2);
/* 46 flops */
- ya2d = ra * cosphi;
- xb2d = -rc * cospsi;
- t1 = -rb * cosphi;
- t2 = rc * sinpsi * sinphi;
- yb2d = t1 - t2;
- yc2d = t1 + t2;
- /* 7 flops */
-
- /* --- Step3 al,be,ga --- */
- alpa = xb2d * (xb0d - xc0d) + yb0d * yb2d + yc0d * yc2d;
- beta = xb2d * (yc0d - yb0d) + xb0d * yb2d + xc0d * yc2d;
- gama = xb0d * yb1d - xb1d * yb0d + xc0d * yc1d - xc1d * yc0d;
- al2be2 = alpa * alpa + beta * beta;
- tmp2 = (al2be2 - gama * gama);
- sinthe = (alpa * gama - beta * tmp2*invsqrt(tmp2)) / al2be2;
- /* 47 flops */
-
- /* --- Step4 A3' --- */
- tmp2 = rone - sinthe *sinthe;
- costhe = tmp2*invsqrt(tmp2);
- xa3d = -ya2d * sinthe;
- ya3d = ya2d * costhe;
- za3d = za1d;
- xb3d = xb2d * costhe - yb2d * sinthe;
- yb3d = xb2d * sinthe + yb2d * costhe;
- zb3d = zb1d;
- xc3d = -xb2d * costhe - yc2d * sinthe;
- yc3d = -xb2d * sinthe + yc2d * costhe;
- zc3d = zc1d;
- /* 26 flops */
-
- /* --- Step5 A3 --- */
- xa3 = trns11 * xa3d + trns12 * ya3d + trns13 * za3d;
- ya3 = trns21 * xa3d + trns22 * ya3d + trns23 * za3d;
- za3 = trns31 * xa3d + trns32 * ya3d + trns33 * za3d;
- xb3 = trns11 * xb3d + trns12 * yb3d + trns13 * zb3d;
- yb3 = trns21 * xb3d + trns22 * yb3d + trns23 * zb3d;
- zb3 = trns31 * xb3d + trns32 * yb3d + trns33 * zb3d;
- xc3 = trns11 * xc3d + trns12 * yc3d + trns13 * zc3d;
- yc3 = trns21 * xc3d + trns22 * yc3d + trns23 * zc3d;
- zc3 = trns31 * xc3d + trns32 * yc3d + trns33 * zc3d;
- /* 45 flops */
-
- after[ow1] = xcom + xa3;
- after[ow1 + 1] = ycom + ya3;
- after[ow1 + 2] = zcom + za3;
- after[hw2] = xcom + xb3;
- after[hw2 + 1] = ycom + yb3;
- after[hw2 + 2] = zcom + zb3;
- after[hw3] = xcom + xc3;
- after[hw3 + 1] = ycom + yc3;
- after[hw3 + 2] = zcom + zc3;
+ if(!doshake) {
+ ya2d = ra * cosphi;
+ xb2d = -rc * cospsi;
+ t1 = -rb * cosphi;
+ t2 = rc * sinpsi * sinphi;
+ yb2d = t1 - t2;
+ yc2d = t1 + t2;
+ /* 7 flops */
+
+ /* --- Step3 al,be,ga --- */
+ alpa = xb2d * (xb0d - xc0d) + yb0d * yb2d + yc0d * yc2d;
+ beta = xb2d * (yc0d - yb0d) + xb0d * yb2d + xc0d * yc2d;
+ gama = xb0d * yb1d - xb1d * yb0d + xc0d * yc1d - xc1d * yc0d;
+ al2be2 = alpa * alpa + beta * beta;
+ tmp2 = (al2be2 - gama * gama);
+ sinthe = (alpa * gama - beta * tmp2*invsqrt(tmp2)) / al2be2;
+ /* 47 flops */
+
+ /* --- Step4 A3' --- */
+ tmp2 = rone - sinthe *sinthe;
+ costhe = tmp2*invsqrt(tmp2);
+ xa3d = -ya2d * sinthe;
+ ya3d = ya2d * costhe;
+ za3d = za1d;
+ xb3d = xb2d * costhe - yb2d * sinthe;
+ yb3d = xb2d * sinthe + yb2d * costhe;
+ zb3d = zb1d;
+ xc3d = -xb2d * costhe - yc2d * sinthe;
+ yc3d = -xb2d * sinthe + yc2d * costhe;
+ zc3d = zc1d;
+ /* 26 flops */
+
+ /* --- Step5 A3 --- */
+ xa3 = trns11 * xa3d + trns12 * ya3d + trns13 * za3d;
+ ya3 = trns21 * xa3d + trns22 * ya3d + trns23 * za3d;
+ za3 = trns31 * xa3d + trns32 * ya3d + trns33 * za3d;
+ xb3 = trns11 * xb3d + trns12 * yb3d + trns13 * zb3d;
+ yb3 = trns21 * xb3d + trns22 * yb3d + trns23 * zb3d;
+ zb3 = trns31 * xb3d + trns32 * yb3d + trns33 * zb3d;
+ xc3 = trns11 * xc3d + trns12 * yc3d + trns13 * zc3d;
+ yc3 = trns21 * xc3d + trns22 * yc3d + trns23 * zc3d;
+ zc3 = trns31 * xc3d + trns32 * yc3d + trns33 * zc3d;
+ /* 45 flops */
+ after[ow1] = xcom + xa3;
+ after[ow1 + 1] = ycom + ya3;
+ after[ow1 + 2] = zcom + za3;
+ after[hw2] = xcom + xb3;
+ after[hw2 + 1] = ycom + yb3;
+ after[hw2 + 2] = zcom + zb3;
+ after[hw3] = xcom + xc3;
+ after[hw3 + 1] = ycom + yc3;
+ after[hw3 + 2] = zcom + zc3;
/* 9 flops */
+ } else {
+ /* If we couldn't settle this water, try a simplified iterative shake instead */
+ if(xshake(b4+ow1,after+ow1,dOH,dHH,mO,mH)!=0)
+ *error=i;
+ }
#ifdef DEBUG
check_cons(fp,"settle",after,ow1,hw2,hw3);
#endif
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_dummies_c = "$Id$";
+
#include <stdio.h>
#include "typedefs.h"
#include "assert.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_ebin_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <math.h>
#include <string.h>
#include "sysstuff.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_edsam_c = "$Id$";
+
#include <stdio.h>
#include <time.h>
#include "typedefs.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_ewald_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "typedefs.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_fftgrid_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "assert.h"
#include "typedefs.h"
#include "futil.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_force_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "typedefs.h"
#include "ewald_util.h"
#include "shift_util.h"
#include "pppm.h"
-#include "poisson.h"
#include "ewald.h"
#include "pme.h"
#include "mdrun.h"
set_avcsix(fp,fr,mdatoms);
if (fr->bBHAM)
set_bham_b_max(fp,fr,mdatoms);
-
+
+ /* Copy the GBSA data (radius, volume and surftens for each
+ * atomtype) from the topology atomtype section to forcerec.
+ */
+ snew(fr->atype_radius,fr->ntype);
+ snew(fr->atype_vol,fr->ntype);
+ snew(fr->atype_surftens,fr->ntype);
+ for(i=0;i<fr->ntype;i++)
+ fr->atype_radius[i]=top->atomtypes.radius[i];
+ for(i=0;i<fr->ntype;i++)
+ fr->atype_vol[i]=top->atomtypes.vol[i];
+ for(i=0;i<fr->ntype;i++)
+ fr->atype_surftens[i]=top->atomtypes.surftens[i];
+
/* Now update the rest of the vars */
update_forcerec(fp,fr,box);
/* if we are using LR electrostatics, and they are tabulated,
Vlr = do_pppm(fp,FALSE,x,fr->f_pme,md->chargeT,
box_size,fr->phi,cr,nsb,nrnb);
break;
- case eelPOISSON:
- Vlr = do_poisson(fp,FALSE,ir,md->nr,x,fr->f_pme,md->chargeT,
- box_size,fr->phi,cr,nrnb,&nit,TRUE);
- break;
case eelPME:
Vlr = do_pme(fp,FALSE,ir,x,fr->f_pme,md->chargeT,
box,cr,nsb,nrnb,lr_vir,fr->ewaldcoeff,bGatherOnly);
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_ghat_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include <stdio.h>
#include "typedefs.h"
#include "futil.h"
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_init_c = "$Id$";
+
#include <stdio.h>
#include "typedefs.h"
#include "tpxio.h"
#include "smalloc.h"
#include "vec.h"
-#include "vveclib.h"
#include "main.h"
#include "mvdata.h"
#include "fatal.h"
fn,np,ShortProgram(),nnodes);
}
-static char *int_title(char *title,int nodeid)
+static char *int_title(char *title,int nodeid,char buf[], int size)
{
- static char buf[BUFSIZE];
-
- sprintf(buf,"%s (%d)",title,nodeid);
+ snprintf(buf,size-1,"%s (%d)",title,nodeid);
return buf;
}
snew(tpx,1);
- read_tpxheader(tpxfile,tpx);
+ read_tpxheader(tpxfile,tpx,FALSE,NULL,NULL);
snew(*x,tpx->natoms);
snew(*v,tpx->natoms);
t_nsborder nsb;
rvec *x,*v;
- read_tpxheader(tpxfile,&tpx);
+ read_tpxheader(tpxfile,&tpx,FALSE,NULL,NULL);
snew(x,tpx.natoms);
snew(v,tpx.natoms);
read_tpx(tpxfile,&step,&t,&lambda,&parm->ir,parm->box,
t_nsborder *nsb,int list, bool *bParallelDummies,
t_comm_dummies *dummycomm)
{
+ char buf[256];
+
ld_data(cr->left,cr->right,parm,nsb,top,x,v);
if (cr->nodeid != 0)
mv_data(cr->left,cr->right,parm,nsb,top,*x,*v);
if (list&LIST_PARM)
write_parm(log,"parameters of the run",cr->nodeid,parm);
if (list&LIST_X)
- pr_rvecs(log,0,int_title("x",0),*x,nsb->natoms);
+ pr_rvecs(log,0,int_title("x",0,buf,255),*x,nsb->natoms);
if (list&LIST_V)
- pr_rvecs(log,0,int_title("v",0),*v,nsb->natoms);
+ pr_rvecs(log,0,int_title("v",0,buf,255),*v,nsb->natoms);
if (list&LIST_TOP)
- pr_top(log,0,int_title("topology",cr->nodeid),top);
+ pr_top(log,0,int_title("topology",cr->nodeid,buf,255),top,TRUE);
fflush(log);
}
*mdatoms=atoms2md(log,&(top->atoms),parm->ir.opts.nFreeze,
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_mdatom_c = "$Id$";
+
#include "typedefs.h"
#include "mdatoms.h"
#include "smalloc.h"
}
}
-void init_mdatoms(t_mdatoms *md,real lambda,bool bFirst)
+void update_mdatoms(t_mdatoms *md,real lambda, bool bFirst)
{
- static real lambda0;
int i,end;
real L1=1.0-lambda;
- if (bFirst)
- lambda0 = lambda;
end=md->nr;
-
- /* Only do this loop the first time, or when lambda has changed.
- * One could also check whether there is any perturbed atom at all,
- * but if you don't have perturbed atoms, it does not make sense to modify lambda.
- * In principle this has to be parallellized, although it would mean extra
- * communication. Basically only the charges are used on other nodes...
- */
- if (bFirst || (lambda0 != lambda)) {
- for(i=0; (i<end); i++) {
- if (md->bPerturbed[i] || bFirst) {
- md->massT[i]=L1*md->massA[i]+lambda*md->massB[i];
- if (md->invmass[i] > 1.1*ALMOST_ZERO)
- md->invmass[i]=1.0/md->massT[i];
- md->chargeT[i]=L1*md->chargeA[i]+lambda*md->chargeB[i];
- }
+
+ for(i=0; (i<end); i++) {
+ if (md->bPerturbed[i] || bFirst) {
+ md->massT[i]=L1*md->massA[i]+lambda*md->massB[i];
+ if (md->invmass[i] > 1.1*ALMOST_ZERO)
+ md->invmass[i]=1.0/md->massT[i];
+ md->chargeT[i]=L1*md->chargeA[i]+lambda*md->chargeB[i];
}
}
- lambda0 = lambda;
}
-
-
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_mdebin_c = "$Id$";
+
#include <string.h>
#include "typedefs.h"
#include "string2.h"
fprintf(log," ======>\n\n");
}
-void print_ebin_header(FILE *log,int steps,real time,real lamb,real SAfactor)
+void print_ebin_header(FILE *log,int steps,real time,real lamb)
{
- fprintf(log," %12s %12s %12s %12s\n"
- " %12d %12.5f %12.5f %12.5f\n\n",
- "Step","Time","Lambda","Annealing",steps,time,lamb,SAfactor);
+ fprintf(log," %12s %12s %12s\n"
+ " %12d %12.5f %12.5f\n\n",
+ "Step","Time","Lambda",steps,time,lamb);
}
-void print_ebin(int fp_ene,bool bEne,bool bDR,bool bOR,
+void print_ebin(int fp_ene,bool bEne,bool bDR,bool bOR,bool bDihR,
FILE *log,int steps,real time,int mode,bool bCompact,
- t_mdebin *md,t_fcdata *fcd,t_atoms *atoms)
+ t_mdebin *md,t_fcdata *fcd,t_atoms *atoms, t_grpopts *opts)
{
static char **grpnms=NULL;
static char *kjm="(kJ/mol)";
int nr[enxNR];
real *block[enxNR];
t_enxframe fr;
-
+
switch (mode) {
case eprNORMAL:
fr.t = time;
}
if (log) {
+ for(i=0;i<opts->ngtc;i++)
+ if(opts->annealing[i]!=eannNO)
+ fprintf(log,"Current ref_t for group %s: %8.1f\n",
+ *(atoms->grpname[atoms->grps[egcTC].nm_ind[i]]),opts->ref_t[i]);
+
if (mode==eprNORMAL && fcd->orires.nr>0)
print_orires_log(log,fcd);
* To help us fund GROMACS development, we humbly ask that you cite
* the papers on the package - you can find them in the top README file.
*
+
* For more info, check our website at http://www.gromacs.org
*
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_minimize_c = "$Id$";
+
#include <string.h>
#include <time.h>
#include <math.h>
#include "dummies.h"
#include "mdrun.h"
-static void sp_header(FILE *out,char *minimizer,real ftol,int nsteps)
+static void sp_header(FILE *out,const char *minimizer,real ftol,int nsteps)
{
fprintf(out,"%s:\n",minimizer);
fprintf(out," Tolerance = %12.5e\n",ftol);
"off constraints alltogether (set constraints = none in mdp file)\n");
}
-static void print_converged(FILE *fp,char *alg,real ftol,int count,bool bDone,
+static void print_converged(FILE *fp,const char *alg,real ftol,int count,bool bDone,
int nsteps,real epot,real fmax)
{
if (bDone)
return sqrt(fnorm2);
}
-static void init_em(FILE *log,char *title,
+static void init_em(FILE *log,const char *title,
t_parm *parm,real *lambda,t_nrnb *mynrnb,rvec mu_tot,rvec box_size,
t_forcerec *fr,t_mdatoms *mdatoms,t_topology *top,t_nsborder *nsb,
t_commrec *cr,t_vcm **vcm,int *start,int *end)
*end = nsb->homenr[cr->nodeid] + *start;
/* Set initial values for invmass etc. */
- init_mdatoms(mdatoms,*lambda,TRUE);
+ update_mdatoms(mdatoms,*lambda,TRUE);
*vcm = init_vcm(log,top,cr,mdatoms,
*start,HOMENR(nsb),parm->ir.nstcomm);
t_commrec *cr,t_commrec *mcr,t_graph *graph,
t_forcerec *fr,rvec box_size)
{
- static char *CG="Conjugate Gradients";
+ const char *CG="Conjugate Gradients";
double gpa,gpb;
double EpotA=0.0,EpotB=0.0,a=0.0,b,beta=0.0,zet,w;
real lambda,fmax,testf,smin;
force_vir,parm->vir,parm->pres,grps,mu_tot,
(parm->ir.etc==etcNOSEHOOVER));
- print_ebin_header(log,count,count,lambda,0.0);
- print_ebin(fp_ene,TRUE,FALSE,FALSE,log,count,count,eprNORMAL,
- TRUE,mdebin,fcd,&(top->atoms));
+ print_ebin_header(log,count,count,lambda);
+ print_ebin(fp_ene,TRUE,FALSE,FALSE,FALSE,log,count,count,eprNORMAL,
+ TRUE,mdebin,fcd,&(top->atoms),&(parm->ir.opts));
}
where();
force_vir,parm->vir,parm->pres,grps,mu_tot,
(parm->ir.etc==etcNOSEHOOVER));
/* Print the energies allways when we should be verbose */
- print_ebin_header(log,count,count,lambda,0.0);
- print_ebin(fp_ene,TRUE,FALSE,FALSE,log,count,count,eprNORMAL,
- TRUE,mdebin,fcd,&(top->atoms));
+ print_ebin_header(log,count,count,lambda);
+ print_ebin(fp_ene,TRUE,FALSE,FALSE,FALSE,log,count,count,eprNORMAL,
+ TRUE,mdebin,fcd,&(top->atoms),&(parm->ir.opts));
}
/* Stop when the maximum force lies below tolerance */
t_commrec *cr,t_commrec *mcr,t_graph *graph,
t_forcerec *fr,rvec box_size)
{
- static char *SD="Steepest Descents";
+ const char *SD="Steepest Descents";
real stepsize,constepsize,lambda,fmax;
rvec *pos[2],*force[2],*xcf=NULL;
rvec *xx,*ff;
sum_epot(&(parm->ir.opts),grps,ener);
if (MASTER(cr))
- print_ebin_header(log,count,count,lambda,0.0);
+ print_ebin_header(log,count,count,lambda);
if (bConstrain) {
fmax=f_max(cr->left,cr->right,nsb->nnodes,&(parm->ir.opts),mdatoms,start,end,
print_ebin(fp_ene,TRUE,
do_per_step(steps_accepted,parm->ir.nstdisreout),
do_per_step(steps_accepted,parm->ir.nstorireout),
- log,count,count,eprNORMAL,TRUE,mdebin,fcd,&(top->atoms));
+ do_per_step(steps_accepted,parm->ir.nstdihreout),
+ log,count,count,eprNORMAL,TRUE,mdebin,fcd,&(top->atoms),&(parm->ir.opts));
fflush(log);
}
}
bBHAM,b14,parm->ir.efep!=efepNO,parm->ir.epc,
parm->ir.eDispCorr,TRICLINIC(parm->ir.compress),(parm->ir.etc==etcNOSEHOOVER),cr);
- /* Calculate Temperature coupling parameters lambda */
- ener[F_TEMP]=sum_ekin(&(parm->ir.opts),grps,parm->ekin,bTYZ);
+ ener[F_TEMP]=sum_ekin(&(parm->ir.opts),grps,parm->ekin,bTYZ);
if(parm->ir.etc==etcBERENDSEN)
- berendsen_tcoupl(&(parm->ir.opts),grps,parm->ir.delta_t,lam0);
+ berendsen_tcoupl(&(parm->ir.opts),grps,parm->ir.delta_t);
else if(parm->ir.etc==etcNOSEHOOVER)
- nosehoover_tcoupl(&(parm->ir.opts),grps,parm->ir.delta_t,lam0);
+ nosehoover_tcoupl(&(parm->ir.opts),grps,parm->ir.delta_t);
where();
lambda=lam0+step*parm->ir.delta_lambda;
if (MASTER(cr)) {
- print_ebin(-1,FALSE,FALSE,FALSE,log,step,t,eprAVER,
- FALSE,mdebin,fcd,&(top->atoms));
- print_ebin(-1,FALSE,FALSE,FALSE,log,step,t,eprRMS,
- FALSE,mdebin,fcd,&(top->atoms));
+ print_ebin(-1,FALSE,FALSE,FALSE,FALSE,log,step,t,eprAVER,
+ FALSE,mdebin,fcd,&(top->atoms),&(parm->ir.opts));
+ print_ebin(-1,FALSE,FALSE,FALSE,FALSE,log,step,t,eprRMS,
+ FALSE,mdebin,fcd,&(top->atoms),&(parm->ir.opts));
}
/* Construct dummy particles, for last output frame */
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_ns_c = "$Id$";
+
#ifdef USE_THREADS
#include <pthread.h> /* must come first */
#endif
}
}
if (debug)
- pr_ivec(debug,0,"bHaveLJ",bHaveLJ,fr->ntype);
+ pr_ivec(debug,0,"bHaveLJ",bHaveLJ,fr->ntype,TRUE);
bFirst=FALSE;
}
* And Hey:
* Getting the Right Output Means no Artefacts in Calculating Stuff
*/
-static char *SRCID_nsb_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "sysstuff.h"
#include "assert.h"
#include "typedefs.h"
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_nsgrid_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include "assert.h"
#include "sysstuff.h"
#include "typedefs.h"
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_pme_c = "$Id$";
+
/* IMPORTANT FOR DEVELOPERS:
*
* Triclinic pme stuff isn't entirely trivial, and we've experienced
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_pppm_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "assert.h"
/* Check whether boxes correspond */
for(m=0; (m<DIM); m++)
if (fabs(box[m]-grids[m]*spacing[m]) > tol) {
- pr_rvec(log,0,"box",box,DIM);
- pr_rvec(log,0,"grid-spacing",spacing,DIM);
- pr_ivec(log,0,"grid size",grids,DIM);
+ pr_rvec(log,0,"box",box,DIM,TRUE);
+ pr_rvec(log,0,"grid-spacing",spacing,DIM,TRUE);
+ pr_ivec(log,0,"grid size",grids,DIM,TRUE);
fflush(log);
fatal_error(0,"Box sizes in tpb file and Ghat file %s do not match\n"
"Check your log file!",ghatfn);
* And Hey:
* Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
*/
-static char *SRCID_pull_c = "$Id$";
+
#include "futil.h"
#include "rdgroup.h"
#include "statutil.h"
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_pull_internal_h = "$Id$";
+
#ifndef _pull_internal_h
#define _pull_internal_h
* And Hey:
* Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
*/
-static char *SRCID_pullinit_c = "$Id$";
+
+/* This file is threadsafe - keep it that way */
+
#include <string.h>
#include "princ.h"
#include <stdlib.h>
* And Hey:
* Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
*/
-static char *SRCID_pullio_c = "$Id$";
+
#include <string.h>
#include <stdlib.h>
#include "sysstuff.h"
enum {
erunSTART, erunAFM, erunConstraint, erunUmbrella, erunTest, erunNR
};
- static char *runtypes[erunNR+1] = {
+ static const char *runtypes[erunNR+1] = {
"start", "afm", "constraint", "umbrella", "test", NULL
};
enum {
erefCom, erefComT0, erefDyn, erefDynT0, erefNR
};
- static char *reftypes[erefNR+1] = {
+ static const char *reftypes[erefNR+1] = {
"com", "com_t0", "dynamic", "dynamic_t0", NULL
};
enum {
ereverseTO_REF, ereverseFROM_REF, ereverseNR
};
- static char *reversetypes[ereverseNR+1] = {
+ static const char *reversetypes[ereverseNR+1] = {
"from_reference", "to_reference", NULL
};
enum {
everboseYES, everboseNO, everboseNR
};
- static char *verbosetypes[erefNR+1] = {
+ static const char *verbosetypes[erefNR+1] = {
"no", "yes", NULL
};
int nerror = 0;
* And Hey:
* Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
*/
-static char *SRCID_pullutil_c = "$Id$";
+
#include <stdlib.h>
#include "sysstuff.h"
#include "princ.h"
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_shakef_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "typedefs.h"
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_sim_util_c = "$Id$";
+
#include <stdio.h>
#include <time.h>
#include "typedefs.h"
fprintf(log,"\nConstraining the starting coordinates (step %d)\n",step);
clear_mat(shake_vir);
update(nsb->natoms,start,homenr,step,lambda,&ener[F_DVDL],
- parm,1.0,md,x,graph,
+ parm,md,x,graph,
NULL,NULL,vold,NULL,x,top,grps,shake_vir,cr,nrnb,bTYZ,
FALSE,edyn,pulldata,FALSE);
/* Compute coordinates at t=-dt, store them in buf */
fprintf(log,"\nConstraining the coordinates at t0-dt (step %d)\n",step);
clear_mat(shake_vir);
update(nsb->natoms,start,homenr,
- step,lambda,&ener[F_DVDL],parm,1.0,md,f,graph,
+ step,lambda,&ener[F_DVDL],parm,md,f,graph,
NULL,NULL,vold,NULL,buf,top,grps,shake_vir,cr,nrnb,bTYZ,FALSE,
edyn,pulldata,FALSE);
}
void init_md(t_commrec *cr,t_inputrec *ir,tensor box,real *t,real *t0,
- real *lambda,real *lam0,real *SAfactor,
+ real *lambda,real *lam0,
t_nrnb *mynrnb,bool *bTYZ,t_topology *top,
int nfile,t_filenm fnm[],char **traj,
char **xtc_traj,int *fp_ene,
FILE **fp_dgdl,t_mdebin **mdebin,t_groups *grps,
tensor force_vir,tensor pme_vir,
tensor shake_vir,t_mdatoms *mdatoms,rvec mu_tot,
- bool *bNEMD,t_vcm **vcm,t_nsborder *nsb)
+ bool *bNEMD,bool *bSimAnn,t_vcm **vcm,t_nsborder *nsb)
{
bool bBHAM,b14,bLR,bLJLR;
- int i;
-
+ int i,j,n;
+ real tmpt,mod;
+
/* Initial values */
*t = *t0 = ir->init_t;
if (ir->efep != efepNO) {
else {
*lambda = *lam0 = 0.0;
}
- if (ir->bSimAnn) {
- *SAfactor = 1.0 - *t0/ir->zero_temp_time;
- if (*SAfactor < 0)
- *SAfactor = 0;
- } else
- *SAfactor = 1.0;
-
+
+ *bSimAnn=FALSE;
+ for(i=0;i<ir->opts.ngtc;i++) {
+ /* set bSimAnn if any group is being annealed */
+ if(ir->opts.annealing[i]!=eannNO)
+ *bSimAnn = *bSimAnn || TRUE;
+ }
+ if(*bSimAnn)
+ update_annealing_target_temp(&(ir->opts),ir->init_t);
+
init_nrnb(mynrnb);
/* Check Environment variables & other booleans */
clear_rvec(mu_tot);
/* Set initial values for invmass etc. */
- init_mdatoms(mdatoms,*lambda,TRUE);
+ update_mdatoms(mdatoms,*lambda,TRUE);
*vcm = init_vcm(stdlog,top,cr,mdatoms,START(nsb),HOMENR(nsb),ir->nstcomm);
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_splittop_c = "$Id$";
+/* This file is completely threadsafe - keep it that way! */
+
#include "sysstuff.h"
#include "typedefs.h"
#include "splittop.h"
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_splittop_h = "$Id$";
+
#include "dummies.h"
extern void mdsplit_top(FILE *log,t_topology *top,t_commrec *cr,
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_tables_c = "$Id$";
+
#include <math.h>
#include "typedefs.h"
#include "names.h"
etabRF, etabCOUL, etabEwald, etabLJ6Switch, etabLJ12Switch,etabCOULSwitch,
etabEXPMIN,etabUSER, etabNR
};
-static char *tabnm[etabNR] = {
+static const char *tabnm[etabNR] = {
"LJ6", "LJ12", "LJ6Shift", "LJ12Shift", "Shift",
"RF", "COUL", "Ewald", "LJ6Switch", "LJ12Switch","COULSwitch",
"EXPMIN","USER"
void make_tables(FILE *out,t_forcerec *fr,bool bVerbose,char *fn)
{
- static char *fns[3] = { "ctab.xvg", "dtab.xvg", "rtab.xvg" };
+ const char *fns[3] = { "ctab.xvg", "dtab.xvg", "rtab.xvg" };
FILE *fp;
t_tabledata *td;
bool bReadTab,bGenTab;
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_tgroup_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
#include <math.h>
#include "macros.h"
#include "main.h"
#include "vec.h"
#include "network.h"
#include "smalloc.h"
-#include "vveclib.h"
#include "update.h"
#include "rbin.h"
#include "assert.h"
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_timefft_c = "$Id$";
+
#include <math.h>
#include <stdio.h>
#include <time.h>
* And Hey:
* GROup of MAchos and Cynical Suckers
*/
-static char *SRCID_update_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "nrnb.h"
#include "physics.h"
#include "macros.h"
-#include "vveclib.h"
#include "vec.h"
#include "main.h"
#include "confio.h"
real d;
} t_sdconst;
-/* constants for a (bad) random number generator */
-const unsigned long im = 0xffff;
-const unsigned long ia = 1093;
-const unsigned long ic = 18257;
-const real inv_im = 1.0/(0xffff);
+
+
+
static t_sdconst *sdc;
}
}
-static real fgauss(unsigned long *jran)
-{
- static real sqrt3 = 1.7320508075688772;
- real jr;
-
- *jran = (*jran*ia+ic) & im;
- jr = (real)*jran;
- *jran = (*jran*ia+ic) & im;
- jr += (real)*jran;
- *jran = (*jran*ia+ic) & im;
- jr += (real)*jran;
- *jran = (*jran*ia+ic) & im;
- jr += (real)*jran;
-
- return sqrt3*(jr*inv_im-2);
-}
void init_sd_consts(int ngtc,real tau_t[],real dt)
{
rvec accel[],ivec nFreeze[],
real invmass[],unsigned short ptype[],
unsigned short cFREEZE[],unsigned short cACC[],
- unsigned short cTC[],real SAfactor,
+ unsigned short cTC[],
rvec x[],rvec xprime[],rvec v[],rvec vold[],rvec f[],
int ngtc,real tau_t[],real ref_t[],
- int *seed, bool bFirstHalf)
+ t_Gaussdata gaussrand, bool bFirstHalf)
{
typedef struct {
real V;
if(bFirstHalf) {
for(n=0; n<ngtc; n++) {
- kT = BOLTZ*SAfactor*ref_t[n];
+ kT = BOLTZ*ref_t[n];
/* The mass is encounted for later, since this differs per atom */
sig[n].V = sqrt(kT*(1-sdc[n].em));
sig[n].X = sqrt(kT*sqr(tau_t[n])*sdc[n].c);
}
}
- jran = (unsigned long)((real)im*rando(seed));
-
for(n=start; n<start+homenr; n++) {
ism = sqrt(invmass[n]);
gf = cFREEZE[n];
if(bFirstHalf) {
if(bFirst)
- X[n-start][d] = ism*sig[gt].X*fgauss(&jran);
+ X[n-start][d] = ism*sig[gt].X*gauss(gaussrand);
Vmh = X[n-start][d]*sdc[gt].d/(tau_t[gt]*sdc[gt].c)
- + ism*sig[gt].Yv*fgauss(&jran);
- V[n-start][d] = ism*sig[gt].V*fgauss(&jran);
+ + ism*sig[gt].Yv*gauss(gaussrand);
+ V[n-start][d] = ism*sig[gt].V*gauss(gaussrand);
v[n][d] = vn*sdc[gt].em
+ (invmass[n]*f[n][d] + accel[ga][d])*tau_t[gt]*(1 - sdc[gt].em)
(xprime[n][d] - x[n][d])/(tau_t[gt]*(sdc[gt].eph - sdc[gt].emh));
Xmh = V[n-start][d]*tau_t[gt]*sdc[gt].d/(sdc[gt].em-1)
- + ism*sig[gt].Yx*fgauss(&jran);
- X[n-start][d] = ism*sig[gt].X*fgauss(&jran);
+ + ism*sig[gt].Yx*gauss(gaussrand);
+ X[n-start][d] = ism*sig[gt].X*gauss(gaussrand);
xprime[n][d] += X[n-start][d] - Xmh;
rvec x[],rvec xprime[],rvec v[],rvec vold[],
rvec f[],real temp,real fr,
int ngtc,real tau_t[],real ref_t[],
- int *seed)
+ t_Gaussdata gaussrand)
{
int gf,gt;
real vn;
for(n=0; n<ngtc; n++)
rf[n] = sqrt(2.0*BOLTZ*ref_t[n]);
- jran = (unsigned long)((real)im*rando(seed));
-
for(n=start; (n<start+homenr); n++) {
gf = cFREEZE[n];
gt = cTC[n];
vold[n][d] = v[n][d];
if((ptype[n]!=eptDummy) && (ptype[n]!=eptShell) && !nFreeze[gf][d]) {
if(fr)
- vn = invfr*f[n][d] + rfac*fgauss(&jran);
+ vn = invfr*f[n][d] + rfac*gauss(gaussrand);
else
/* NOTE: invmass = 1/(mass*fric_const*dt) */
vn = invmass[n]*f[n][d]*dt
- + sqrt(invmass[n])*rf[gt]*fgauss(&jran);
+ + sqrt(invmass[n])*rf[gt]*gauss(gaussrand);
v[n][d] = vn;
xprime[n][d] = x[n][d]+vn*dt;
real lambda,
real *dvdlambda, /* FEP stuff */
t_parm *parm, /* input record and box stuff */
- real SAfactor, /* simulated annealing factor */
t_mdatoms *md,
rvec x[], /* coordinates of home particles */
t_graph *graph,
int i,n,m,g;
matrix M;
t_inputrec *ir=&(parm->ir);
-
+ t_Gaussdata sd_gaussrand=NULL;
+
if(bFirst) {
bHaveConstr = init_constraints(stdlog,top,&(parm->ir),md,start,homenr,
ir->eI!=eiSteep,cr);
init_edsam(stdlog,top,md,start,homenr,x,parm->box,
edyn,&edpar);
+ /* Initiate random number generator for stochastic and brownian dynamic integrators */
+ if(ir->eI==eiSD || ir->eI==eiBD)
+ sd_gaussrand=init_gauss(ir->ld_seed);
+
/* Allocate memory for xold, original atomic positions
* and for xprime.
*/
/* Copy the pointer to the external acceleration in the opts */
ngacc=ir->opts.ngacc;
ngtc=ir->opts.ngtc;
-
snew(lamb,ngtc);
/* done with initializing */
do_update_sd(start,homenr,
ir->opts.acc,ir->opts.nFreeze,
md->invmass,md->ptype,
- md->cFREEZE,md->cACC,md->cTC,SAfactor,
+ md->cFREEZE,md->cACC,md->cTC,
x,xprime,v,vold,force,
ir->opts.ngtc,ir->opts.tau_t,ir->opts.ref_t,
- &ir->ld_seed,TRUE);
+ sd_gaussrand,TRUE);
if(bHaveConstr) {
for(n=start; n<start+homenr; n++)
copy_rvec(xprime[n],x_unc[n-start]);
do_update_sd(start,homenr,
ir->opts.acc,ir->opts.nFreeze,
md->invmass,md->ptype,
- md->cFREEZE,md->cACC,md->cTC,SAfactor,
+ md->cFREEZE,md->cACC,md->cTC,
x,xprime,v,vold,force,
ir->opts.ngtc,ir->opts.tau_t,ir->opts.ref_t,
- &ir->ld_seed,FALSE);
+ sd_gaussrand,FALSE);
} else if(ir->eI==eiBD)
do_update_bd(start,homenr,dt,
ir->opts.nFreeze,md->invmass,md->ptype,
x,xprime,v,vold,force,
ir->bd_temp,ir->bd_fric,
ir->opts.ngtc,ir->opts.tau_t,ir->opts.ref_t,
- &ir->ld_seed);
+ sd_gaussrand);
else
fatal_error(0,"Don't know how to update coordinates");
* And Hey:
* Gromacs Runs On Most of All Computer Systems
*/
-static char *SRCID_vcm_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
+
#include "macros.h"
#include "vcm.h"
#include "vec.h"
* And Hey:
* Gromacs Runs On Most of All Computer Systems
*/
-static char *SRCID_wnblist_c = "$Id$";
+
+/* This file is completely threadsafe - keep it that way! */
#include <stdio.h>
#include <string.h>
#include "string2.h"
#ifndef _wnblist_h
#define _wnblist_h
-static char *SRCID_wnblist_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) wnblist.h 1.1 23 Oct 1994"
-#endif /* HAVE_IDENT */
+
#include "stdio.h"
#include "typedefs.h"
#ifndef _Xstuff_h
#define _Xstuff_h
-static char *SRCID_Xstuff_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) Xstuff.h 1.16 11/23/92"
-#endif /* HAVE_IDENT */
-
/* The altivec extensions for ppc define some stupid overlapping
* macros like pixel and vector - turn them off here, we only
* need them in the inner loops.
#ifndef _alert_bm
#define _alert_bm
-#ifdef HAVE_IDENT
-#ident "@(#) alert.bm 1.4 9/29/92"
-#endif /* HAVE_IDENT */
#define alert_width 48
#define alert_height 42
* And Hey:
* Gromacs Runs On Most of All Computer Systems
*/
-static char *SRCID_buttons_c = "$Id$";
+
#include <sysstuff.h>
#include <string.h>
#include <smalloc.h>
#ifndef _buttons_h
#define _buttons_h
-static char *SRCID_buttons_h = "$Id$";
+
#include <xutil.h>
enum {
* And Hey:
* Gromacs Runs On Most of All Computer Systems
*/
-static char *SRCID_dialogs_c = "$Id$";
+
#include "smalloc.h"
#include "sysstuff.h"
#include "macros.h"
#ifndef _dialogs_h
#define _dialogs_h
-static char *SRCID_dialogs_h = "$Id$";
+
#include "xdlg.h"
#include "pulldown.h"
#include "manager.h"
* And Hey:
* Gromacs Runs On Most of All Computer Systems
*/
-static char *SRCID_dlg_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <xdlghi.h>
#ifndef _ff_bm
#define _ff_bm
-#ifdef HAVE_IDENT
-#ident "@(#) ff.bm 1.2 11/23/92"
-#endif /* HAVE_IDENT */
#define ff_width 40
#define ff_height 32
static unsigned char ff_bits[] = {
* And Hey:
* Gromacs Runs On Most of All Computer Systems
*/
-static char *SRCID_fgrid_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef _fgrid_h
#define _fgrid_h
-static char *SRCID_fgrid_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) fgrid.h 1.3 9/29/92"
-#endif /* HAVE_IDENT */
-
#include <typedefs.h>
#include <xdlg.h>
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_filter_c = "$Id$";
+
#include <string.h>
#include "sysstuff.h"
#include "futil.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_gmxlogo_c = "$Id$";
+
#include "logo.h"
void main(int argc, char *argv[])
#ifndef _gromacs_bm
#define _gromacs_bm
-#ifdef HAVE_IDENT
-#ident "@(#) gromacs.bm 1.9 9/29/92"
-#endif /* HAVE_IDENT */
#define gromacs_width 48
#define gromacs_height 48
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_highway_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "futil.h"
#ifndef _info_bm
#define _info_bm
-#ifdef HAVE_IDENT
-#ident "@(#) info.bm 1.4 9/29/92"
-#endif /* HAVE_IDENT */
-
#define info_width 48
#define info_height 48
static unsigned char info_bits[] = {
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_logo_c = "$Id$";
+
#include "sysstuff.h"
#include "Xstuff.h"
#include "xutil.h"
#ifndef _logo_h
#define _logo_h
-static char *SRCID_logo_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) logo.h 1.15 9/30/97"
-#endif /* HAVE_IDENT */
#include <x11.h>
#include <xutil.h>
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_manager_c = "$Id$";
+
#include <sysstuff.h>
#include <string.h>
#include <smalloc.h>
void set_file(t_x11 *x11,t_manager *man,char *trajectory,char *status)
{
- char buf[256];
+ char buf[256],quote[256];
t_tpxheader sh;
t_atoms *at;
bool *bB;
int i,idum;
real rdum;
- read_tpxheader(status,&sh);
+ read_tpxheader(status,&sh,TRUE,NULL,NULL);
snew(man->ix,sh.natoms);
snew(man->zz,sh.natoms);
snew(man->col,sh.natoms);
"do not match",status,man->top.atoms.nr,
trajectory,man->natom);
- sprintf(buf,"%s: %s",*man->top.name,cool_quote());
+ sprintf(buf,"%s: %s",*man->top.name,cool_quote(quote,255,NULL));
man->title.text = strdup(buf);
man->view = init_view(man->box);
at=&(man->top.atoms);
#ifndef _manager_h
#define _manager_h
-static char *SRCID_manager_h = "$Id$";
#include <stdio.h>
#include "typedefs.h"
#include "x11.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_molps_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "string.h"
#define MSIZE 4
-static void ps_draw_atom(FILE *ps,atom_id ai,iv2 vec2[],char **atomnm[])
+static void ps_draw_atom(t_psdata ps,atom_id ai,iv2 vec2[],char **atomnm[])
{
int xi,yi;
return TRUE;
}
-static void ps_draw_bond(FILE *ps,
+static void ps_draw_bond(t_psdata ps,
atom_id ai,atom_id aj,iv2 vec2[],
rvec x[],char **atomnm[],int size[],bool bBalls)
{
}
}
-void ps_draw_objects(FILE *ps,int nobj,t_object objs[],iv2 vec2[],rvec x[],
+void ps_draw_objects(t_psdata ps,int nobj,t_object objs[],iv2 vec2[],rvec x[],
char **atomnm[],int size[],bool bShowHydro,int bond_type,
bool bPlus)
{
v2[YY]=y0-sy*x4[YY]*inv_z;
}
-static void draw_box(FILE *ps,t_3dview *view,matrix box,
+static void draw_box(t_psdata ps,t_3dview *view,matrix box,
int x0,int y0,real sx,real sy)
{
int ivec[8][4] = {
vec2[bonds[i][1]][XX],vec2[bonds[i][1]][YY]);
}
-void ps_draw_mol(FILE *ps,t_manager *man)
+void ps_draw_mol(t_psdata ps,t_manager *man)
{
static char tstr[2][20];
static int ntime=0;
#ifndef _molps_h
#define _molps_h
-static char *SRCID_molps_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) molps.h 1.10 9/30/97"
-#endif /* HAVE_IDENT */
#include "sysstuff.h"
#include "manager.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_nener_c = "$Id$";
+
#include <math.h>
#include <smalloc.h>
#include <macros.h>
#ifndef _nener_h
#define _nener_h
-static char *SRCID_nener_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) nener.h 1.19 9/30/97"
-#endif /* HAVE_IDENT */
#include "x11.h"
#include "xutil.h"
#include "popup.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_ngmx_c = "$Id$";
+
#include <ctype.h>
#include <string.h>
static void dump_it(t_manager *man)
{
- FILE *ps;
+ t_psdata ps;
ps=ps_open("ngmx.ps",0,0,man->molw->wd.width,man->molw->wd.height);
ps_draw_mol(ps,man);
matrix box;
t_trxframe fr;
int status;
-
+ char quote[256];
+
snew(gmx,1);
snew(gmx->wd,1);
/* Creates a simple window */
w0=DisplayWidth(x11->disp,x11->screen)-132;
h0=DisplayHeight(x11->disp,x11->screen)-140;
- InitWin(gmx->wd,0,0,w0,h0,3,bromacs());
+ InitWin(gmx->wd,0,0,w0,h0,3,bromacs(quote,255));
gmx->wd->self=XCreateSimpleWindow(x11->disp,x11->root,
gmx->wd->x, gmx->wd->y,
gmx->wd->width,gmx->wd->height,
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_nleg_c = "$Id$";
+
#include <ctype.h>
#include <string.h>
#include <smalloc.h>
#ifndef _nleg_h
#define _nleg_h
-static char *SRCID_nleg_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) nleg.h 1.19 9/30/97"
-#endif /* HAVE_IDENT */
#include "x11.h"
#include "xutil.h"
#include "writeps.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_nload_c = "$Id$";
+
#include <math.h>
#include <typedefs.h>
#include <macros.h>
#ifndef _nload_h
#define _nload_h
-static char *SRCID_nload_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) nload.h 1.19 9/30/97"
-#endif /* HAVE_IDENT */
#include "x11.h"
#include "xutil.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_nmol_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "string.h"
#ifndef _nmol_h
#define _nmol_h
-static char *SRCID_nmol_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) nmol.h 1.1 11/19/92"
-#endif /* HAVE_IDENT */
#include "x11.h"
#include "xutil.h"
#ifndef _play_bm
#define _play_bm
-#ifdef HAVE_IDENT
-#ident "@(#) play.bm 1.2 11/23/92"
-#endif /* HAVE_IDENT */
#define play_width 40
#define play_height 32
static unsigned char play_bits[] = {
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_popup_c = "$Id$";
+
#include <string.h>
#include <math.h>
#include <macros.h>
#ifndef _popup_h
#define _popup_h
-static char *SRCID_popup_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) popup.h 1.3 11/23/92"
-#endif /* HAVE_IDENT */
#include "x11.h"
#include "xutil.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_pulldown_c = "$Id$";
+
#include <string.h>
#include <smalloc.h>
#include <x11.h>
#ifndef _pulldown_h
#define _pulldown_h
-static char *SRCID_pulldown_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) pulldown.h 1.4 11/23/92"
-#endif /* HAVE_IDENT */
+
#include "popup.h"
typedef struct {
#ifndef _rewind_bm
#define _rewind_bm
-#ifdef HAVE_IDENT
-#ident "@(#) rewind.bm 1.2 11/23/92"
-#endif /* HAVE_IDENT */
#define rewind_width 40
#define rewind_height 32
static unsigned char rewind_bits[] = {
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_scrollw_c = "$Id$";
+
#include <sysstuff.h>
#include <Xstuff.h>
#include <xutil.h>
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_showcol_c = "$Id$";
+
#include <math.h>
#include <smalloc.h>
#include <sysstuff.h>
#ifndef _stop_bm
#define _stop_bm
-#ifdef HAVE_IDENT
-#ident "@(#) stop.bm 1.4 9/29/92"
-#endif /* HAVE_IDENT */
#define stop_width 48
#define stop_height 48
#ifndef _stop_ani_bm
#define _stop_ani_bm
-#ifdef HAVE_IDENT
-#ident "@(#) stop_ani.bm 1.2 11/23/92"
-#endif /* HAVE_IDENT */
+
#define stop_ani_width 40
#define stop_ani_height 32
static unsigned char stop_ani_bits[] = {
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_vbox_c = "$Id$";
+
#include "x11.h"
#include "nmol.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_x11_c = "$Id$";
+
#include <Xstuff.h>
#include <x11.h>
#include "sysstuff.h"
#ifndef _x11_h
#define _x11_h
-static char *SRCID_x11_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) x11.h 1.6 12/16/92"
-#endif /* HAVE_IDENT */
-
#include <stdio.h>
#include "typedefs.h"
#include "Xstuff.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_xdlg_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef _xdlg_h
#define _xdlg_h
-static char *SRCID_xdlg_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) xdlg.h 1.3 9/29/92"
-#endif /* HAVE_IDENT */
#include <xdlgitem.h>
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_xdlghi_c = "$Id$";
+
#include <assert.h>
#include <string.h>
#ifndef _xdlghi_h
#define _xdlghi_h
-static char *SRCID_xdlghi_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) xdlghi.h 1.2 9/29/92"
-#endif /* HAVE_IDENT */
#include <stdarg.h>
#include "Xstuff.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_xdlgitem_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef _xdlgitem_h
#define _xdlgitem_h
-static char *SRCID_xdlgitem_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) xdlgitem.h 1.4 9/29/92"
-#endif /* HAVE_IDENT */
-
#include <typedefs.h>
#include <Xstuff.h>
#include <xutil.h>
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_xmb_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef _xmb_h
#define _xmb_h
-static char *SRCID_xmb_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) xmb.h 1.3 9/29/92"
-#endif /* HAVE_IDENT */
-
#include <x11.h>
#define MB_OK 1
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_xrama_c = "$Id$";
+
#include <stdlib.h>
#include <math.h>
#include <string.h>
};
t_x11 *x11;
+ t_topology *ramatop;
t_app *app;
t_filenm fnm[] = {
{ efTRX, "-f", NULL, ffREAD },
XSetForeground(x11->disp,x11->gc,x11->fg);
app=init_app(x11,argc,argv);
- init_rama(ftp2fn(efTRX,NFILE,fnm),ftp2fn(efTPX,NFILE,fnm),app->xr);
+ ramatop = init_rama(ftp2fn(efTRX,NFILE,fnm),ftp2fn(efTPX,NFILE,fnm),app->xr);
mk_gly(app);
XMapWindow(x11->disp,app->wd.self);
XMapSubwindows(x11->disp,app->wd.self);
x11->MainLoop(x11);
x11->CleanUp(x11);
-
+
thanx(stderr);
return 0;
}
+
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_xstat_c = "$Id$";
+
#include "sysstuff.h"
#include "smalloc.h"
#include "x11.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_xutil_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifndef _xutil_h
#define _xutil_h
-static char *SRCID_xutil_h = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) xutil.h 1.5 11/11/92"
-#endif /* HAVE_IDENT */
#include "typedefs.h"
#include "writeps.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_addconf_c = "$Id$";
+
#include <stdlib.h>
#include <string.h>
#include "vec.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_addconf_h = "$Id$";
#include "typedefs.h"
extern
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_anadih_c = "$Id$";
+
#include <math.h>
#include <stdio.h>
+#include <string.h>
#include "physics.h"
#include "smalloc.h"
#include "macros.h"
real core_frac, bool bAll, char *fnall)
{
- bool bRotZero, bHaveChi;
- int accum, index, i,j,k,Xi,n,b ;
+ bool bRotZero, bHaveChi=FALSE;
+ int accum=0, index, i,j,k,Xi,n,b ;
real *chi_prtrj;
int *chi_prhist;
int nbin ;
if (debug) {
fprintf(debug,"Angle[0]=%g, costh=%g, index0 = %d, %d, %d\n",
ang[0],costh,index[0],index[1],index[2]);
- pr_rvec(debug,0,"rij",r_ij,DIM);
- pr_rvec(debug,0,"rkj",r_kj,DIM);
+ pr_rvec(debug,0,"rij",r_ij,DIM,TRUE);
+ pr_rvec(debug,0,"rkj",r_kj,DIM,TRUE);
pr_rvecs(debug,0,"box",box,DIM);
}
}
#ifndef _angstat_h
#define _angstat_h
-static char *SRCID_angstat_h = "$Id$";
#include <stdio.h>
#include <typedefs.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_autocorr_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "macros.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_average_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "string2.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_bondlist_c = "$Id$";
+
#include "cdist.h"
typedef struct list {
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_calcpot_c = "$Id$";
+
#include "vec.h"
#include "calcpot.h"
#include "nrnb.h"
t_forcerec **fr,real **pot,
matrix box)
{
- real t,t0,lam,lam0,SAfac;
- bool bTYZ,bNEMD;
+ real t,t0,lam,lam0;
+ bool bTYZ,bNEMD,bSA;
char *traj,*xtc_traj;
rvec *v,mutot;
t_nrnb nrnb;
init_nrnb(&nrnb);
init_single(stdlog,parm,ftp2fn(efTPX,nfile,fnm),top,x,&v,mdatoms,nsb);
- init_md(cr,&(parm->ir),parm->box,&t,&t0,&lam,&lam0,&SAfac,
+ init_md(cr,&(parm->ir),parm->box,&t,&t0,&lam,&lam0,
&nrnb,&bTYZ,top,-1,NULL,&traj,&xtc_traj,&fp_ene,NULL,
&mdebin,grps,force_vir,pme_vir,
- shake_vir,*mdatoms,mutot,&bNEMD,&vcm,nsb);
+ shake_vir,*mdatoms,mutot,&bNEMD,&bSA,&vcm,nsb);
init_groups(stdlog,*mdatoms,&(parm->ir.opts),grps);
/* Calculate intramolecular shift vectors to make molecules whole again */
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_calcpot_h = "$Id$";
extern void init_calcpot(int nfile,t_filenm fnm[],t_topology *top,
rvec **x,t_parm *parm,t_commrec *cr,
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_cdist_c = "$Id$";
+
#include <stdlib.h>
#include <ctype.h>
#include "assert.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_cdist_h = "$Id$";
+
#define HEAD_LOADED
#include <stdio.h>
#include <math.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_cmat_c = "$Id$";
+
#include "cmat.h"
#include "smalloc.h"
#include "macros.h"
#ifndef _cmat_h
#define _cmat_h
-static char *SRCID_cmat_h = "$Id$";
#include "typedefs.h"
typedef struct {
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_correct_c = "$Id$";
+
#include <math.h>
#include "assert.h"
#include "vec.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_disco_c = "$Id$";
+
#include "macros.h"
#include "statutil.h"
#include "pdbio.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_disco_h = "$Id$";
+
#define _correct_h
#include <stdio.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_discopar_c = "$Id$";
+
#include "typedefs.h"
#include "network.h"
#include "smalloc.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_dlist_c = "$Id$";
+
#include <stdlib.h>
#include "string2.h"
#include "smalloc.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_do_dssp_c = "$Id$";
+
#include "sysstuff.h"
#include "typedefs.h"
#include "string2.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_dtools_c = "$Id$";
+
#include "smalloc.h"
#include "strdb.h"
#include "futil.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_editconf_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include <ctype.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_edittop_c = "$Id$";
+
#include "smalloc.h"
#include "string2.h"
#include "fatal.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_eigio_c = "$Id$";
+
#include "smalloc.h"
#include "vec.h"
#include "eigio.h"
#ifndef _eigio_h
#define _eigio_h
-static char *SRCID_eigio_h = "$Id$";
+
#include "typedefs.h"
enum { eWXR_NO, eWXR_YES, eWXR_NOFIT };
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_eneconv_c = "$Id$";
+
#include <string.h>
#include <math.h>
#include "string2.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_expfit_c = "$Id$";
+
#include <sysstuff.h>
#include <string.h>
#include <math.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_fitahx_c = "$Id$";
+
#include "fitahx.h"
#include "vec.h"
#include "do_fit.h"
#ifndef _fitahx_h
#define _fitahx_h
-static char *SRCID_fitahx_h = "$Id$";
#include "typedefs.h"
#include "hxprops.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_anaeig_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "statutil.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_analyze_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "statutil.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_angle_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "sysstuff.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_bond_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "sysstuff.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_bundle_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "statutil.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_chi_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "confio.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_cluster_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include <ctype.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_clustsize_c = "$Id$";
+
#include <math.h>
#include <ctype.h>
#include "string2.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_com_c = "$Id$";
+
#include "sysstuff.h"
#include "smalloc.h"
#include "macros.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_confrms_c = "$Id$";
+
#include "filenm.h"
#include "smalloc.h"
#include "macros.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_covar_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include <time.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_density_c = "$Id$";
+
#include <math.h>
#include <ctype.h>
#include "sysstuff.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_dielectric_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_dih_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "string2.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_dipoles_c = "$Id$";
+
#include <string.h>
#include <math.h>
#include "macros.h"
}
if (debug)
- pr_rvec(debug,0,"Quadrupole",quad,DIM);
+ pr_rvec(debug,0,"Quadrupole",quad,DIM,TRUE);
/* clean-up */
for(i=0; (i<DIM); i++) {
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_disre_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include <assert.h>
if (ntop)
init5(ntop);
- read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&header);
+ read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&header,FALSE,NULL,NULL);
snew(xtop,header.natoms);
read_tpx(ftp2fn(efTPX,NFILE,fnm),&step,&t,&lambda,&ir,
box,&ntopatoms,xtop,NULL,NULL,&top);
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_dist_c = "$Id$";
+
#include <typedefs.h>
#include "smalloc.h"
#include "macros.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_dyndom_c = "$Id$";
+
#include "3dview.h"
#include "statutil.h"
#include "smalloc.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_enemat_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_energy_c = "$Id$";
+
#include <string.h>
#include <math.h>
#include "typedefs.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_gyrate_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "statutil.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_h2order_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "string.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_hbond_c = "$Id$";
-#ifdef HAVE_IDENT
-#ident "@(#) g_hbond.cc 1.29 9/30/97"
-#endif /* HAVE_IDENT */
#include "statutil.h"
#include "copyrite.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_helix_c = "$Id$";
+
#include <math.h>
#include "confio.h"
#include "copyrite.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_lie_c = "$Id$";
+
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_mdmat_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "macros.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_mindist_c = "$Id$";
+
+
#include <math.h>
#include <stdlib.h>
#include "sysstuff.h"
int trxout;
char buf[256];
char **leg;
+<<<<<<< g_mindist.c
+ real t,md,**mdist=NULL;
+ int nd,status;
+=======
real t,dmin,dmax,**mindres,**maxdres;
int nmin,nmax,status;
+>>>>>>> 1.29
int i,j,k,natoms;
int min1,min2,max1,max2;
atom_id oindex[2];
int find_residues(t_atoms *atoms, int n, atom_id index[], atom_id **resindex)
{
int i;
- int nres,resnr, presnr;
+ int nres=0,resnr, presnr;
int *residx;
/* build index of first atom numbers for each residue */
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_morph_c = "$Id$";
+
#include "confio.h"
#include "statutil.h"
#include "smalloc.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_msd_c = "$Id$";
+
#include <string.h>
#include <ctype.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_g_multipoles_c = "$Id$";
+
#include <math.h>
#include "statutil.h"
#include "macros.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_nmeig_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "statutil.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_nmens_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "statutil.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_order_c = "$Id$";
+
#include <math.h>
#include <ctype.h>
#include "sysstuff.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_potential_c = "$Id$";
+
#include <math.h>
#include <ctype.h>
#include "sysstuff.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_rama_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "string.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_rdf_c = "$Id$";
+
#include <math.h>
#include <ctype.h>
#include "string2.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_relax_c = "$Id$";
+
#include <math.h>
#include <stdlib.h>
#include "sysstuff.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_rms_c = "$Id$";
+
#include "smalloc.h"
#include "math.h"
#include "macros.h"
int maxframe=NFRAME,maxframe2=NFRAME;
real t,lambda,*w_rls,*w_rms,tmas,*w_rls_m=NULL,*w_rms_m=NULL;
bool bTruncOct,bNorm,bAv,bFreq2,bFile2,bMat,bBond,bDelta,bMirror,bMass;
- bool bFit,bReset;
+ bool bFit=FALSE,bReset=FALSE;
t_topology top;
t_iatom *iatom=NULL;
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_rmsdist_c = "$Id$";
+
#include <math.h>
#include <ctype.h>
#include "macros.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_rmsf_c = "$Id$";
+
#include "smalloc.h"
#include "math.h"
#include "macros.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_rotacf_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "sysstuff.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_run_rms_c = "$Id$";
+
#include <math.h>
#include "smalloc.h"
#include "typedefs.h"
real t,lambda,*w_rls,*w_rms,tmas;
int status;
t_tpxheader header;
- t_inputrec ir;
t_topology top;
matrix box;
rvec **x,*xp,*v,xcm,*temp;
NFILE,fnm,asize(pa),pa,asize(desc),desc,0,NULL);
snew(x,run_time+1);
- read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&header);
+ read_tpxheader(ftp2fn(efTPX,NFILE,fnm),&header,TRUE);
snew(xp,header.natoms);
for(i=0;(i<run_time+1);i++)
snew(x[i],header.natoms);
snew(v,header.natoms);
read_tpx(ftp2fn(efTPX,NFILE,fnm),
- &step,&t,&lambda,&ir,
+ &step,&t,&lambda,NULL,
box,&natom,xp,NULL,NULL,&top);
/*set box type*/
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_saltbr_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "macros.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_sas_c = "$Id$";
+
#include <math.h>
#include <stdlib.h>
#include "sysstuff.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_sgangle_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "string.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_sorient_c = "$Id$";
+
#include "macros.h"
#include "statutil.h"
#include "smalloc.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_tcaf_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "confio.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_traj_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "statutil.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_g_velacc_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "confio.h"
*/
/* This line is only for CVS version info */
-static char *SRCID_template_c = "$Id$";
+
static float Temperature=298.0;
#include "statutil.h"
#include "typedefs.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_genbox_c = "$Id$";
+
#include "sysstuff.h"
#include "typedefs.h"
#include "smalloc.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_genconf_c = "$Id$";
+
#include "maths.h"
#include "macros.h"
#include "copyrite.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_gendr_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include <string.h>
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_genion_c = "$Id$";
+
#include <ctype.h>
#include "copyrite.h"
#include "string2.h"
* And Hey:
* Gromacs Runs One Microsecond At Cannonball Speeds
*/
-static char *SRCID_genpr_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "statutil.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_hxprops_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "macros.h"
#ifndef _hxprops_h
#define _hxprops_h
-static char *SRCID_hxprops_h = "$Id$";
+
#include <stdio.h>
#include "typedefs.h"
* And Hey:
* GROtesk MACabre and Sinister
*/
-static char *SRCID_levenmar_c = "$Id$";
+
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_lsq_c = "$Id$";
+
#include "typedefs.h"
#include "gstat.h"
#include "vec.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_luck_c = "$Id$";
+
#include <stdio.h>
#include "copyrite.h"
#include "string.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_make_ndx_c = "$Id$";
+
#include <ctype.h>
#include "sysstuff.h"
#include "strdb.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_mcprop_c = "$Id$";
+
#include <math.h>
#include "typedefs.h"
#include "random.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_mcprop_h = "$Id$";
+
#include "typedefs.h"
typedef real t_propfunc(int nx,real x[]);
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_mk_angndx_c = "$Id$";
+
#include "typedefs.h"
#include "smalloc.h"
#include "copyrite.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_my_rdf_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "string.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_nsc_c = "$Id$";
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_nsc_h = "$Id$";
+
#include "typedefs.h"
#define FLAG_DOTS 01
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_orise_c = "$Id$";
+
#include "typedefs.h"
#include "maths.h"
#include "string2.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_orise_h = "$Id$";
+
#include "typedefs.h"
#include "pinput.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_pinput_c = "$Id$";
+
#include "paramio.h"
#include "pinput.h"
#ifndef _pinput_h
#define _pinput_h
-static char *SRCID_pinput_h = "$Id$";
#include "typedefs.h"
#include "string2.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_polynomials_c = "$Id$";
+
#include <stdio.h>
#include <math.h>
#include "typedefs.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_pp2shift_c = "$Id$";
+
#include <stdlib.h>
#include <math.h>
#include "typedefs.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_proptim_c = "$Id$";
+
#include "typedefs.h"
#include "maths.h"
#include "string2.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_ql77_c = "$Id$";
+
#include <math.h>
#include "typedefs.h"
#include "vec.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_ql77_h = "$Id$";
+
extern void ql77 (int n,real *x,real *d);
/* Determine the eigenvalues d[n] and eigenvectors *
* of the symmetric n x n matrix x. The eigenvectors *
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_readev_c = "$Id$";
+
#include "readev.h"
#include "futil.h"
#include "smalloc.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_readev_h = "$Id$";
+
#include "typedefs.h"
#ifndef _readev_h
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_recomb_c = "$Id$";
+
#include "recomb.h"
#include "futil.h"
#include "wgms.h"
#ifndef _recomb_h
#define _recomb_h
-static char *SRCID_recomb_h = "$Id$";
#include "typedefs.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_residues_c = "$Id$";
+
#include <math.h>
#include "assert.h"
#include "cdist.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_sas2mat_c = "$Id$";
+
#include <string.h>
#include "sysstuff.h"
#include "matio.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_smooth_c = "$Id$";
+
#include "cdist.h"
#define NMRLEN 99.9
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_testacf_c = "$Id$";
+
#include <math.h>
#include "typedefs.h"
#include "xvgr.h"
* And Hey:
* Glycine aRginine prOline Methionine Alanine Cystine Serine
*/
-static char *SRCID_trjcat_c = "$Id$";
+
#include <string.h>
#include <math.h>
#include "macros.h"
#include "rmpbc.h"
#include "wgms.h"
#include "magic.h"
-#include "binio.h"
#include "pbc.h"
#define TIME_EXPLICIT 0
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_trjconv_c = "$Id$";
+
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "rmpbc.h"
#include "wgms.h"
#include "magic.h"
-#include "binio.h"
#include "pbc.h"
#include "viewit.h"
"Start writing new file when t MOD split = first time (%t)" },
{ "-sep", FALSE, etBOOL, {&bSeparate},
"Write each frame to a separate .gro, .g96 or .pdb file"},
- { "-ter", FALSE, etBOOL, &bTer,
+ { "-ter", FALSE, etBOOL, {&bTer},
"Use 'TER' in pdb file as end of frame in stead of default 'ENDMDL'" }
};
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_trjorder_c = "$Id$";
+
#include <math.h>
#include <string.h>
#include "statutil.h"
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_wheel_c = "$Id$";
+
#include <math.h>
#include "sysstuff.h"
#include "physics.h"
const real fontasp = 0.6;
const real fontwidth = fontsize*fontasp;
- FILE *out;
+ t_psdata out;
int i,sl,slen;
real ring,inner,outer;
real xc,yc,box;
* And Hey:
* Green Red Orange Magenta Azure Cyan Skyblue
*/
-static char *SRCID_xpm2ps_c = "$Id$";
+
#include <math.h>
#include "string2.h"
#include "copyrite.h"
void get_params(char *mpin,char *mpout,t_psrec *psr)
{
- static char *bools[BOOL_NR+1] = { "no", "yes", NULL };
+ static const char *bools[BOOL_NR+1] = { "no", "yes", NULL };
/* this must correspond to t_rgb *linecolors[] below */
- static char *colors[] = { "none", "black", "white", NULL };
+ static const char *colors[] = { "none", "black", "white", NULL };
t_inpfile *inp;
char *tmp;
int ninp;
return bDiff;
}
-void leg_discrete(FILE *ps,real x0,real y0,char *label,
+void leg_discrete(t_psdata ps,real x0,real y0,char *label,
real fontsize,char *font,int nmap,t_mapping map[])
{
int i;
}
}
-void leg_continuous(FILE *ps,real x0,real x,real y0,char *label,
+void leg_continuous(t_psdata ps,real x0,real x,real y0,char *label,
real fontsize,char *font,
int nmap,t_mapping map[])
{
ps_ctext(ps,xx0+(nmap*boxxh)-boxxh/2,yhh,map[nmap-1].desc,eXCenter);
}
-void leg_bicontinuous(FILE *ps,real x0,real x,real y0,char *label1,char *label2,
+void leg_bicontinuous(t_psdata ps,real x0,real x,real y0,char *label1,char *label2,
real fontsize,char *font,
int nmap1,t_mapping map1[],int nmap2,t_mapping map2[])
{
return (psr->boxspacing>(1.5*psr->X.minorticklen));
}
-static void draw_boxes(FILE *out,real x0,real y0,real w,
+static void draw_boxes(t_psdata ps,real x0,real y0,real w,
int nmat,t_matrix mat[],t_psrec *psr)
{
char buf[12];
strlength = 0;
/* Draw the box */
- ps_rgb(out,BLACK);
- ps_linewidth(out,psr->boxlinewidth);
+ ps_rgb(ps,BLACK);
+ ps_linewidth(ps,psr->boxlinewidth);
yy00=y0;
for(i=0; (i<nmat); i++) {
dy=box_height(&(mat[i]),psr);
- ps_box(out,x0-1,yy00-1,x0+w+1,yy00+dy+1);
+ ps_box(ps,x0-1,yy00-1,x0+w+1,yy00+dy+1);
yy00+=dy+box_dh(psr)+box_dh_top(IS_ONCE,psr);
}
/* Draw the ticks on the axes */
- ps_linewidth(out,psr->ticklinewidth);
+ ps_linewidth(ps,psr->ticklinewidth);
xx00=x0-1;
yy00=y0-1;
for (i=0; (i<nmat); i++) {
sprintf(buf,"%g",mat[i].axis_x[j]);
xtick[j]=strdup(buf);
}
- ps_strfont(out,psr->X.tickfont,psr->X.tickfontsize);
+ ps_strfont(ps,psr->X.tickfont,psr->X.tickfontsize);
for(x=0; (x<mat[i].nx); x++) {
xx=xx00+(x+0.7)*psr->xboxsize;
if ( ( bRmod(mat[i].axis_x[x] - psr->X.offset, psr->X.major) ||
(psr->X.first && (x==0))) &&
( (i == 0) || box_do_all_x_maj_ticks(psr) ) ) {
/* Longer tick marks */
- ps_line (out,xx,yy00,xx,yy00-psr->X.majorticklen);
+ ps_line (ps,xx,yy00,xx,yy00-psr->X.majorticklen);
/* Plot label on lowest graph only */
if (i == 0)
- ps_ctext(out,xx,
+ ps_ctext(ps,xx,
yy00-DDD-psr->X.majorticklen-psr->X.tickfontsize*0.8,
xtick[x],eXCenter);
} else if ( bRmod(mat[i].axis_x[x] - psr->X.offset, psr->X.minor) &&
( (i == 0) || box_do_all_x_min_ticks(psr) ) ){
/* Shorter tick marks */
- ps_line(out,xx,yy00,xx,yy00-psr->X.minorticklen);
+ ps_line(ps,xx,yy00,xx,yy00-psr->X.minorticklen);
} else if ( bRmod(mat[i].axis_x[x] - psr->X.offset, psr->X.major) ) {
/* Even shorter marks, only each X.major */
- ps_line(out,xx,yy00,xx,yy00-(psr->boxspacing/2));
+ ps_line(ps,xx,yy00,xx,yy00-(psr->boxspacing/2));
}
}
- ps_strfont(out,psr->Y.tickfont,psr->Y.tickfontsize);
+ ps_strfont(ps,psr->Y.tickfont,psr->Y.tickfontsize);
snew(ytick,mat[i].ny);
for(j=0; (j<mat[i].ny); j++) {
sprintf(buf,"%g",mat[i].axis_y[j]);
(psr->Y.first && (y==0))) {
/* Major ticks */
strlength=max(strlength,(int)strlen(ytick[y]));
- ps_line (out,xx00,yy,xx00-psr->Y.majorticklen,yy);
- ps_ctext(out,xx00-psr->Y.majorticklen-DDD,
+ ps_line (ps,xx00,yy,xx00-psr->Y.majorticklen,yy);
+ ps_ctext(ps,xx00-psr->Y.majorticklen-DDD,
yy-psr->Y.tickfontsize/3.0,ytick[y],eXRight);
}
else if ( bRmod(mat[i].axis_y[y] - psr->Y.offset, psr->Y.minor) ) {
/* Minor ticks */
- ps_line(out,xx00,yy,xx00-psr->Y.minorticklen,yy);
+ ps_line(ps,xx00,yy,xx00-psr->Y.minorticklen,yy);
}
}
sfree(xtick);
else
mylab = mat[i].label_y;
if (strlen(mylab) > 0) {
- fprintf(out,"%%%% Printing Y-label\n");
- ps_strfont(out,psr->Y.font,psr->Y.fontsize);
- ps_rotate(out,TRUE);
+ ps_strfont(ps,psr->Y.font,psr->Y.fontsize);
+ ps_rotate(ps,TRUE);
xxx=x0-psr->X.majorticklen-psr->X.tickfontsize*strlength-DDD;
- ps_ctext(out,yy00+box_height(&mat[i],psr)/2.0,612.5-xxx,
+ ps_ctext(ps,yy00+box_height(&mat[i],psr)/2.0,612.5-xxx,
mylab,eXCenter);
- ps_rotate(out,FALSE);
+ ps_rotate(ps,FALSE);
}
}
else
mylab = mat[0].label_x;
if (strlen(mylab) > 0) {
- fprintf(out,"%%%% Printing X-label\n");
- ps_strfont(out,psr->X.font,psr->X.fontsize);
- ps_ctext(out,x0+w/2,y0-DDD-psr->X.majorticklen-psr->X.tickfontsize*FUDGE-
+ ps_strfont(ps,psr->X.font,psr->X.fontsize);
+ ps_ctext(ps,x0+w/2,y0-DDD-psr->X.majorticklen-psr->X.tickfontsize*FUDGE-
psr->X.fontsize,mylab,eXCenter);
}
}
-static void draw_zerolines(FILE *out,real x0,real y0,real w,
+static void draw_zerolines(t_psdata out,real x0,real y0,real w,
int nmat,t_matrix mat[],t_psrec *psr)
{
real xx,yy,dy,xx00,yy00;
int elegend,real boxx,real boxy,char *m2p,char *m2pout)
{
char *libm2p,buf[256],*legend;
- FILE *out;
+ t_psdata out;
t_psrec psrec,*psr;
int W,H;
int i,j,x,y,col,leg=0;