diff options
author | Christoph Junghans <ottxor@gentoo.org> | 2012-03-03 17:15:13 -0700 |
---|---|---|
committer | Christoph Junghans <ottxor@gentoo.org> | 2012-03-03 17:15:13 -0700 |
commit | 708c5ea3d1ee5d14c2be986d2861176a145cc442 (patch) | |
tree | 1fb97657485cd014c587296f109635fc1d0f82ad /sci-chemistry | |
parent | Merge branch 'master' of git://git.overlays.gentoo.org/proj/sci (diff) | |
parent | sci-chemistry/ambertools: Add another buffer overflow patch (diff) | |
download | sci-708c5ea3d1ee5d14c2be986d2861176a145cc442.tar.gz sci-708c5ea3d1ee5d14c2be986d2861176a145cc442.tar.bz2 sci-708c5ea3d1ee5d14c2be986d2861176a145cc442.zip |
Merge branch 'master' of git://git.overlays.gentoo.org/proj/sci
Diffstat (limited to 'sci-chemistry')
-rw-r--r-- | sci-chemistry/ambertools/ChangeLog | 12 | ||||
-rw-r--r-- | sci-chemistry/ambertools/ambertools-1.5-r3.ebuild | 158 | ||||
-rw-r--r-- | sci-chemistry/ambertools/files/ambertools-1.5-bugfix_22-27.patch | 3343 | ||||
-rw-r--r-- | sci-chemistry/ambertools/files/ambertools-1.5-overflow.patch | 30 |
4 files changed, 3542 insertions, 1 deletions
diff --git a/sci-chemistry/ambertools/ChangeLog b/sci-chemistry/ambertools/ChangeLog index 50f0545ba..09fcfa633 100644 --- a/sci-chemistry/ambertools/ChangeLog +++ b/sci-chemistry/ambertools/ChangeLog @@ -1,7 +1,17 @@ # ChangeLog for sci-chemistry/ambertools -# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ambertools/ChangeLog,v 1.2 2011/08/02 14:42:37 alexxy Exp $ + 03 Mar 2012; Reinis Danne <rei4dan@gmail.com> ambertools-1.5-r3.ebuild, + +files/ambertools-1.5-overflow.patch: + Add another buffer overflow patch. + +*ambertools-1.5-r3 (03 Mar 2012) + + 03 Mar 2012; Reinis Danne <rei4dan@gmail.com> +ambertools-1.5-r3.ebuild, + +files/ambertools-1.5-bugfix_22-27.patch: + Add bugfixes 22-27. + 26 Oct 2011; Reinis Danne <rei4dan@gmail.com> files/ambertools-1.5-gentoo2.patch: Fix possible buffer overflow. diff --git a/sci-chemistry/ambertools/ambertools-1.5-r3.ebuild b/sci-chemistry/ambertools/ambertools-1.5-r3.ebuild new file mode 100644 index 000000000..44bd0599a --- /dev/null +++ b/sci-chemistry/ambertools/ambertools-1.5-r3.ebuild @@ -0,0 +1,158 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ambertools/ambertools-1.5-r1.ebuild,v 1.2 2011/08/02 14:42:37 alexxy Exp $ + +EAPI=4 + +inherit eutils fortran-2 toolchain-funcs + +DESCRIPTION="A suite for carrying out complete molecular mechanics investigations" +HOMEPAGE="http://ambermd.org/#AmberTools" +SRC_URI=" + AmberTools-${PV}.tar.bz2" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux" +IUSE="openmp X" + +RESTRICT="fetch" + +RDEPEND=" + virtual/cblas + virtual/lapack + sci-libs/clapack + sci-libs/arpack + sci-libs/cifparse-obj + sci-chemistry/mopac7 + sci-libs/netcdf + sci-libs/fftw:2.1 + sci-chemistry/reduce + virtual/fortran" +DEPEND="${RDEPEND} + dev-util/byacc + dev-libs/libf2c + sys-devel/ucpp" +S="${WORKDIR}/amber11" + +pkg_nofetch() { + einfo "Go to ${HOMEPAGE} and get ${A}" + einfo "Place it in ${DISTDIR}" +} + +pkg_setup() { + fortran-2_pkg_setup + if use openmp; then + tc-has-openmp || \ + die "Please select an openmp capable compiler like gcc[openmp]" + fi + AMBERHOME="${S}" +} + +src_prepare() { + epatch \ + "${FILESDIR}/${P}-bugfix_1-21.patch" \ + "${FILESDIR}/${P}-bugfix_22-27.patch" \ + "${FILESDIR}/${P}-gentoo2.patch" \ + "${FILESDIR}/${P}-overflow.patch" + cd "${S}"/AmberTools/src + rm -r \ + arpack \ + blas \ + byacc \ + lapack \ + fftw-2.1.5 \ + fftw-3.2.2 \ + c9x-complex \ + cifparse \ + netcdf \ + pnetcdf \ + reduce \ + ucpp-1.3 \ + || die +} + +src_configure() { + cd "${S}"/AmberTools/src + sed -e "s:\\\\\$(LIBDIR)/arpack.a:-larpack:g" \ + -e "s:\\\\\$(LIBDIR)/lapack.a:$(pkg-config lapack --libs) -lclapack:g" \ + -e "s:\\\\\$(LIBDIR)/blas.a:$(pkg-config blas cblas --libs):g" \ + -e "s:\\\\\$(LIBDIR)/libdrfftw.a:${EPREFIX}/usr/$(get_libdir)/libdrfftw.a:g" \ + -e "s:\\\\\$(LIBDIR)/libdfftw.a:${EPREFIX}/usr/$(get_libdir)/libdrfftw.a:g" \ + -e "s:GENTOO_CFLAGS:${CFLAGS} -DBINTRAJ :g" \ + -e "s:GENTOO_CXXFLAGS:${CXXFLAGS}:g" \ + -e "s:GENTOO_FFLAGS:${FFLAGS}:g" \ + -e "s:GENTOO_LDFLAGS:${LDFLAGS}:g" \ + -e "s:fc=g77:fc=$(tc-getFC):g" \ + -e "s:\$netcdflib:$(pkg-config netcdf --libs):g" \ + -e "s:NETCDF=\$netcdf:NETCDF=netcdf.mod:g" \ + -i configure || die + sed -e "s:arsecond_:arscnd_:g" \ + -i sff/time.c \ + -i sff/sff.h \ + -i sff/sff.c || die + sed -e "s:\$(NAB):\$(NAB) -lrfftw:g" \ + -i nss/Makefile || die + + local myconf + + use X || myconf="${myconf} -noX11" + + use openmp && myconf="${myconf} -openmp" + + ./configure \ + ${myconf} \ + -nobintraj \ + -nomdgx \ + -nomtkpp \ + -nopython \ + -nosleap \ + gnu +} + +src_compile() { + cd "${S}"/AmberTools/src + emake || die +} + +src_test() { + cd "${S}"/AmberTools/test + make test || die +} + +src_install() { + rm -r bin/chemistry bin/MMPBSA_mods + rm bin/ante-MMPBSA.py bin/extractFrcmod.py + + for x in bin/* + do dobin ${x} || die + done + + dobin AmberTools/src/antechamber/mopac.sh + sed -e "s:\$AMBERHOME/bin/mopac:mopac7:g" \ + -i "${ED}/usr/bin/mopac.sh" || die + + # Make symlinks untill binpath for amber will be fixed + dodir /usr/share/${PN}/bin + cd "${ED}/usr/bin" + for x in * + do dosym /usr/bin/${x} /usr/share/${PN}/bin/${x} + done + cd "${S}" + + dodoc doc/AmberTools.pdf doc/leap_pg.pdf + dolib.a lib/* + insinto /usr/include/${PN} + doins include/* + insinto /usr/share/${PN} + doins -r dat + cd AmberTools + doins -r benchmarks + doins -r examples + doins -r test + + cat >> "${T}"/99ambertools <<- EOF + AMBERHOME="${EPREFIX}/usr/share/ambertools" + EOF + doenvd "${T}"/99ambertools +} diff --git a/sci-chemistry/ambertools/files/ambertools-1.5-bugfix_22-27.patch b/sci-chemistry/ambertools/files/ambertools-1.5-bugfix_22-27.patch new file mode 100644 index 000000000..6df705cff --- /dev/null +++ b/sci-chemistry/ambertools/files/ambertools-1.5-bugfix_22-27.patch @@ -0,0 +1,3343 @@ +diff -urN amber11.orig/AmberTools/examples/mtkpp/MCPB/run.MCPB.csh amber11/AmberTools/examples/mtkpp/MCPB/run.MCPB.csh +--- amber11.orig/AmberTools/examples/mtkpp/MCPB/run.MCPB.csh 2011-04-14 15:30:12.000000000 +0300 ++++ amber11/AmberTools/examples/mtkpp/MCPB/run.MCPB.csh 2012-03-03 20:03:01.387032575 +0200 +@@ -2,111 +2,10 @@ + echo " " + echo " MTK++ MCPB example " + echo " " +- +-# Clean up +-rm -rf 1AMP_OH.README +-rm -rf *.bcl +-rm -rf createLibraries.sh createRespAdditions.sh getCharges.sh +-rm -rf *.pdb +-rm -rf *.log +- +-cp data/*.pdb . +-cp data/*.bcl . +-cp data/*.log . +-cp data/*.fchk . +- +-echo "Generating scripts " +-sh genMetalFF.sh -n 1AMP_OH +- +-cp data/1AMP.pdb . +-cp data/1AMP_OH_fixed.pdb . +-cp data/1AMP_OH_sidechain.bcl . +-cp data/1AMP_OH_addStdMol.bcl . +-cp data/1AMP_OH_large.bcl . +-cp data/1AMP_OH_large_mk.log . +- +-cp data/1AMP_OH_sidechain_fc_md.log . +-cp data/1AMP_OH_sidechain_opt_md.fchk . +-cp data/1AMP_OH_sidechain_opt_md.log . +- +-echo "Adding Hydrogens to pdb file " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_addHs.bcl \ +- -l 1AMP_OH_addHs.bcl.log || goto error +- +-echo "Creating Model 1" +-$AMBERHOME/bin/MCPB -i 1AMP_OH_sidechain.bcl \ +- -l 1AMP_OH_sidechain.bcl.log || goto error +- +-echo "Adding standard molecule to library " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_addStdMol.bcl \ +- -l 1AMP_OH_addStdMol.bcl.log || goto error +- +-echo "Creating Model 2 " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_large.bcl \ +- -l 1AMP_OH_large.bcl.log || goto error +- +-echo "Creating RESP files 0 " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_large_mk0.bcl \ +- -l 1AMP_OH_large_mk0.bcl.log || goto error +-mv 1AMP_OH_large_respAdds 1AMP_OH_large_respAdds0 || goto error +- +-echo "Creating RESP files 1 " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_large_mk1.bcl \ +- -l 1AMP_OH_large_mk1.bcl.log || goto error +-mv 1AMP_OH_large_respAdds 1AMP_OH_large_respAdds1 || goto error +- +-echo "Creating RESP files 2 " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_large_mk2.bcl \ +- -l 1AMP_OH_large_mk2.bcl.log || goto error +-mv 1AMP_OH_large_respAdds 1AMP_OH_large_respAdds2 || goto error +- +-echo "Creating RESP files 3 " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_large_mk3.bcl \ +- -l 1AMP_OH_large_mk3.bcl.log || goto error +-mv 1AMP_OH_large_respAdds 1AMP_OH_large_respAdds3 || goto error +- +-echo "Determining charges " +-sh ./getCharges.sh 0 || goto error +-sh ./getCharges.sh 1 || goto error +-sh ./getCharges.sh 2 || goto error +-sh ./getCharges.sh 3 || goto error +- +-echo "Creating library files " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_large_chg0.bcl \ +- -l 1AMP_OH_large_chg0.bcl.log || goto error +- +-$AMBERHOME/bin/MCPB -i 1AMP_OH_large_chg1.bcl \ +- -l 1AMP_OH_large_chg1.bcl.log || goto error +- +-$AMBERHOME/bin/MCPB -i 1AMP_OH_large_chg2.bcl \ +- -l 1AMP_OH_large_chg2.bcl.log || goto error +- +-$AMBERHOME/bin/MCPB -i 1AMP_OH_large_chg3.bcl \ +- -l 1AMP_OH_large_chg3.bcl.log || goto error +- +-echo "Determining Seminario force constants " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_sidechain_fc_sem.bcl \ +- -l 1AMP_OH_sidechain_fc_sem.bcl.log || goto error +- +-echo "Determining Traditional force constants " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_sidechain_fc_md.bcl \ +- -l 1AMP_OH_sidechain_fc_md.bcl.log || goto error +- +-echo "Exporting Seminario library to AMBER format " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_toAmberFormats_sem.bcl \ +- -l 1AMP_OH_toAmberFormats_sem.bcl.log || goto error +- +-echo "Exporting Traditional library to AMBER format " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_toAmberFormats_md.bcl \ +- -l 1AMP_OH_toAmberFormats_md.bcl.log || goto error +- +-echo "Reading protonated file and updating residue names " +-$AMBERHOME/bin/MCPB -i 1AMP_OH_resNames.bcl \ +- -l 1AMP_OH_resNames.bcl.log || goto error +- +-echo No errors detected ++echo " " ++echo " This example has been removed due to incompatibility with" ++echo " the current minor revision of MTK++. An updated MCPB example" ++echo " is planned for a future release." ++echo " " + exit(0) + +-error: +-echo Problem: check log files and try again +-exit(1) +diff -urN amber11.orig/AmberTools/examples/mtkpp/stats/pca1/run.stats.csh amber11/AmberTools/examples/mtkpp/stats/pca1/run.stats.csh +--- amber11.orig/AmberTools/examples/mtkpp/stats/pca1/run.stats.csh 2011-04-14 15:30:12.000000000 +0300 ++++ amber11/AmberTools/examples/mtkpp/stats/pca1/run.stats.csh 2012-03-03 20:03:01.387032575 +0200 +@@ -3,12 +3,12 @@ + echo " MTK++ stats example" + echo " " + +-../$AMBERHOME/bin/stats -i pca.stats \ +- -l pca.stats.log || goto error ++$AMBERHOME/bin/stats -i pca.stats \ ++ -l pca.stats.log || goto error + + echo No errors detected + exit(0) + + error: + echo Problem: check .out and try again +-exit(1) +\ Nav jaunu rindu faila beigās ++exit(1) +diff -urN amber11.orig/AmberTools/src/configure amber11/AmberTools/src/configure +--- amber11.orig/AmberTools/src/configure 2012-03-03 22:42:38.558776473 +0200 ++++ amber11/AmberTools/src/configure 2012-03-03 20:02:57.727033628 +0200 +@@ -61,6 +61,9 @@ + -debug Compile with debug symbols + -noopt Disable all compiler optimisations (sometimes needed if + debug symbols are requested) ++ -nopatch Do NOT run \$AMBERHOME/AT15_Amber11.py after configure writes ++ the config.h file, even if Amber11 is found in the directory. ++ This flag has no effect if Amber11 is not present. + + Rarely used/tested NAB options: + -scalapack Use ScaLAPACK for linear algebra. Do not use in +@@ -165,6 +168,7 @@ + debug='no' + optimise='yes' + is_mac='no' ++nopatch='no' + + #------------------------------------------------------------------------------ + # Architecture specific: +@@ -216,6 +220,7 @@ + -nomtkpp) mtkpp='';; + -debug) debug='yes';; + -noopt) optimise='no';; ++ -nopatch) nopatch='yes';; + -help) usage;; + --help) usage;; + -h) usage;; +@@ -2144,7 +2149,7 @@ + fi + + # For AmberTools 1.5 + Amber 11, print a message about running AT15_Amber11.py +-if [ -d ../../src/sander ]; then ++if [ -d ../../src/sander -a "$nopatch" = 'yes' ]; then + echo "" + echo " NOTE: after installing AmberTools, if you want to compile" + echo " Amber11 using AmberTools 1.5, you must run the " +@@ -2155,5 +2160,14 @@ + echo " script will modify your Amber11 files.)" + fi + ++if [ -d ../../src/sander -a "$nopatch" = 'no' ]; then ++ echo "" ++ echo " Running \$AMBERHOME/AT15_Amber11.py to patch config.h for building Amber 11." ++ echo " Check Amber11_Conversion.log for details of what was done. Running this script" ++ echo " a second time has no effect (positive or negative)" ++ echo "" ++ ../../AT15_Amber11.py > Amber11_Conversion.log 2>&1 ++fi ++ + exit + +diff -urN amber11.orig/AmberTools/src/cpptraj/src/AmberRestart.cpp amber11/AmberTools/src/cpptraj/src/AmberRestart.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/AmberRestart.cpp 2012-03-03 22:42:00.557775196 +0200 ++++ amber11/AmberTools/src/cpptraj/src/AmberRestart.cpp 2012-03-03 20:03:06.928030979 +0200 +@@ -53,7 +53,7 @@ + mprintf("Error: AmberRestart::open(): Reading restart atoms/time.\n"); + return 1; + } +- nread=sscanf(buffer,"%5i%15lE%15lE",&restartAtoms,&restartTime,&restartTemp); ++ nread=sscanf(buffer,"%i %lE %lE",&restartAtoms,&restartTime,&restartTemp); + if (nread<1) { + mprintf("Error: AmberRestart::open(): Getting restart atoms/time.\n"); + return 1; +diff -urN amber11.orig/AmberTools/src/cpptraj/src/main.cpp amber11/AmberTools/src/cpptraj/src/main.cpp +--- amber11.orig/AmberTools/src/cpptraj/src/main.cpp 2012-03-03 22:42:47.132776753 +0200 ++++ amber11/AmberTools/src/cpptraj/src/main.cpp 2012-03-03 20:03:06.928030979 +0200 +@@ -6,7 +6,7 @@ + #include "PtrajMpi.h" + #include "CpptrajStdio.h" + #ifndef CPPTRAJ_VERSION_STRING +-#define CPPTRAJ_VERSION_STRING "V1.1.1" ++#define CPPTRAJ_VERSION_STRING "V1.1.2" + #endif + + void Usage(char *programName) { +diff -urN amber11.orig/AmberTools/src/mmpbsa_py/MMPBSA_mods/amberoutputs.py amber11/AmberTools/src/mmpbsa_py/MMPBSA_mods/amberoutputs.py +--- amber11.orig/AmberTools/src/mmpbsa_py/MMPBSA_mods/amberoutputs.py 2011-04-14 15:30:17.000000000 +0300 ++++ amber11/AmberTools/src/mmpbsa_py/MMPBSA_mods/amberoutputs.py 2012-03-03 20:03:11.481029669 +0200 +@@ -2315,7 +2315,7 @@ + return math.sqrt(abs(_stdev(self.com_data[0]) ** 2 + _stdev(self.rec_data[0]) ** 2 + _stdev(self.lig_data[0]) ** 2)) + + sum = sum2 = 0 +- for i in range(len(self.com_data)): ++ for i in range(len(self.com_data[0])): + sum += self.com_data[0][i] - self.rec_data[0][i] - self.lig_data[0][i] + sum2 += (self.com_data[0][i] - self.rec_data[0][i] - self.lig_data[0][i]) ** 2 + +diff -urN amber11.orig/AmberTools/src/mtkpp/configure amber11/AmberTools/src/mtkpp/configure +--- amber11.orig/AmberTools/src/mtkpp/configure 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/configure 2012-03-03 20:03:01.397032571 +0200 +@@ -788,7 +788,6 @@ + with_gnu_ld + with_sysroot + enable_libtool_lock +-with_gnu_ld + with_mkl_dir + with_mkl_libs + with_boost +@@ -811,22 +810,9 @@ + CCC + CC + CFLAGS +-LDFLAGS +-LIBS +-CPPFLAGS + CPP +-CPPFLAGS + CXXCPP +-CPPFLAGS +-XMKMF +-CXX +-LDFLAGS +-LIBS +-CPPFLAGS +-CCC +-CC +-LDFLAGS +-LIBS' ++XMKMF' + + + # Initialize some variables set by options. +@@ -16665,7 +16651,7 @@ + *) platform=UNKNOWN + is_unknown=yes + echo 'ERROR: this platform is not supported at this time!' +- exit 1 ;; ++ exit ;; + esac + if test "$is_darwin" = "yes"; then + IS_DARWIN_TRUE= +@@ -17838,8 +17824,8 @@ + $as_echo "#define HAVE_ZLIB 1" >>confdefs.h + + CFLAGS=$CFLAGS" -DHAVE_ZLIB" +- CXXFLAGS=$CXXFLAGS" -DHAVE_ZLIB -DHAVE_ZLIB" +- defines_string=$defines_string" -DHAVE_ZLIB -DHAVE_ZLIB" ++ CXXFLAGS=$CXXFLAGS" -DHAVE_ZLIB" ++ defines_string=$defines_string" -DHAVE_ZLIB" + FLIBS=$FLIBS" -lz" + else + +diff -urN amber11.orig/AmberTools/src/mtkpp/configure.in amber11/AmberTools/src/mtkpp/configure.in +--- amber11.orig/AmberTools/src/mtkpp/configure.in 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/configure.in 2012-03-03 20:03:01.400032571 +0200 +@@ -383,7 +383,7 @@ + *) platform=UNKNOWN + is_unknown=yes + echo 'ERROR: this platform is not supported at this time!' +- exit 1 ;; ++ exit ;; + esac + AM_CONDITIONAL(IS_DARWIN, test "$is_darwin" = "yes") + AM_CONDITIONAL(IS_LINUX, test "$is_linux" = "yes") +@@ -457,8 +457,8 @@ + if test $ac_have_zlibh = yes; then + AC_DEFINE(HAVE_ZLIB, 1, [Define to 1 if ZLIB is available.]) + CFLAGS=$CFLAGS" -DHAVE_ZLIB" +- CXXFLAGS=$CXXFLAGS" -DHAVE_ZLIB -DHAVE_ZLIB" +- defines_string=$defines_string" -DHAVE_ZLIB -DHAVE_ZLIB" ++ CXXFLAGS=$CXXFLAGS" -DHAVE_ZLIB" ++ defines_string=$defines_string" -DHAVE_ZLIB" + FLIBS=$FLIBS" -lz" + else + AC_DEFINE(HAVE_ZLIB, 0, [Define to 0 if ZLIB is unavailable.]) +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Minimizers/Makefile.am amber11/AmberTools/src/mtkpp/src/Minimizers/Makefile.am +--- amber11.orig/AmberTools/src/mtkpp/src/Minimizers/Makefile.am 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Minimizers/Makefile.am 2012-03-03 20:03:01.400032571 +0200 +@@ -1,4 +1,4 @@ +-DIAGNOSTICS_LD=-L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD=-L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB=-lDiagnostics + INCLUDES = -I$(srcdir)/.. + +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Minimizers/Makefile.in amber11/AmberTools/src/mtkpp/src/Minimizers/Makefile.in +--- amber11.orig/AmberTools/src/mtkpp/src/Minimizers/Makefile.in 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Minimizers/Makefile.in 2012-03-03 20:03:01.401032571 +0200 +@@ -239,7 +239,7 @@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + xerces_path = @xerces_path@ +-DIAGNOSTICS_LD = -L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD = -L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB = -lDiagnostics + INCLUDES = -I$(srcdir)/.. + lib_LTLIBRARIES = libMinimizers.la +diff -urN amber11.orig/AmberTools/src/mtkpp/src/MM/Makefile.am amber11/AmberTools/src/mtkpp/src/MM/Makefile.am +--- amber11.orig/AmberTools/src/mtkpp/src/MM/Makefile.am 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/MM/Makefile.am 2012-03-03 20:03:01.400032571 +0200 +@@ -1,6 +1,6 @@ +-DIAGNOSTICS_LD=-L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD=-L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB=-lDiagnostics +-LOG_LD=-L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD=-L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB=-lLog + + INCLUDES = -I@boost_inc@ -I$(srcdir)/.. +diff -urN amber11.orig/AmberTools/src/mtkpp/src/MM/Makefile.in amber11/AmberTools/src/mtkpp/src/MM/Makefile.in +--- amber11.orig/AmberTools/src/mtkpp/src/MM/Makefile.in 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/MM/Makefile.in 2012-03-03 20:03:01.400032571 +0200 +@@ -241,9 +241,9 @@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + xerces_path = @xerces_path@ +-DIAGNOSTICS_LD = -L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD = -L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB = -lDiagnostics +-LOG_LD = -L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD = -L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB = -lLog + INCLUDES = -I@boost_inc@ -I$(srcdir)/.. + lib_LTLIBRARIES = libMM.la +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/atomType.h amber11/AmberTools/src/mtkpp/src/Molecule/atomType.h +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/atomType.h 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Molecule/atomType.h 2012-03-03 20:03:01.402032570 +0200 +@@ -74,6 +74,9 @@ + + //! + double evalue; ++ ++ //! Atomic polarizability in A**3 ++ double atomPolarizability; + }; + + // ============================================================ +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/collection.cpp amber11/AmberTools/src/mtkpp/src/Molecule/collection.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/collection.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Molecule/collection.cpp 2012-03-03 20:03:01.403032569 +0200 +@@ -484,6 +484,11 @@ + for (moleculeIterator m = this->itsMoleculeList.begin(); + m != this->itsMoleculeList.end(); m++) { + pMolecule = *m; ++ ++ if (pMolecule->getName() == "Reference") { ++ continue; ++ } ++ + std::vector<submolecule*> subMolList = pMolecule->getSubMoleculeList(); + for (sMolIterator c = subMolList.begin(); c != subMolList.end(); c++) { + pSubMolecule = *c; +@@ -3408,7 +3413,10 @@ + } + errMessage += metalAtom->getParent()->getName() + "@|" + + metalAtom->getName() + "|-" +- + primShellAtoms[e]->getParent()->getName() + "@|" ++ + primShellAtoms[e]->getParent()->getName() ++ + i2s(primShellAtoms[e]->getParent()->getSubMolId()) ++ + primShellAtoms[e]->getParent()->getiCode() ++ + "@|" + + primShellAtoms[e]->getName() + "| dist = " + d2s(localBond->size) +"\n"; + + // Angles +@@ -3488,7 +3496,8 @@ + std::vector<stdGroup*> stdGrpList = this->pStdLibrary->getStdGroupList(); + + for (unsigned int i = 0; i < stdGrpList.size(); i++) { +-//std::cout << i << " " << stdGrpList.size() << " " << stdGrpList[i]->getName() << " " << stdGrpList[i]->hasStdMolecule() << std::endl; ++//std::cout << "\n\ncollection::assignMetalParameters " << i << " " << stdGrpList.size() << " " << stdGrpList[i]->getName() << " " ++// << stdGrpList[i]->hasStdMolecule() << std::endl; + if (stdGrpList[i]->hasStdMolecule()) { + //std::cout << "stdgroup name: " << stdGrpList[i]->getName() << std::endl; + //stdGroup* pStdGroup = stdGrpList[i]; +@@ -3515,6 +3524,7 @@ + + // create new molecule + molecule* pNewMolecule = this->addMolecule(); ++ std::vector<atom*> atomList; + + // copy residues + std::vector<metalCenter*> metCens = itsMetalGroups[j]->getMetalCenters(); +@@ -3536,6 +3546,10 @@ + addedResidues.push_back(primShellAtoms[l]->getParent()); + submolecule* pNewSubmolecule = pNewMolecule->addSubMolecule(); + pNewSubmolecule->copy(primShellAtoms[l]->getParent()); ++ std::vector<atom*> atomListTmp = primShellAtoms[l]->getParent()->getAtomList(); ++ for (unsigned int i = 0 ; i < atomListTmp.size(); i++) { ++ atomList.push_back(atomListTmp[i]); ++ } + /* + std::cout << "Primary Shell " << primShellAtoms[l]->getParent()->getName() << " " + << primShellAtoms[l]->getParent()->getSubMolId() << " " +@@ -3556,6 +3570,11 @@ + addedResidues.push_back(secShellAtoms[l]->getParent()); + submolecule* pNewSubmolecule = pNewMolecule->addSubMolecule(); + pNewSubmolecule->copy(secShellAtoms[l]->getParent()); ++ ++ std::vector<atom*> atomListTmp = secShellAtoms[l]->getParent()->getAtomList(); ++ for (unsigned int i = 0 ; i < atomListTmp.size(); i++) { ++ atomList.push_back(atomListTmp[i]); ++ } + /* + std::cout << "Secondary Shell " << secShellAtoms[l]->getParent()->getName() << " " + << secShellAtoms[l]->getParent()->getSubMolId() +@@ -3573,6 +3592,12 @@ + addedResidues.push_back(metalAtom->getParent()); + submolecule* pNewSubmolecule = pNewMolecule->addSubMolecule(); + pNewSubmolecule->copy(metalAtom->getParent()); ++ ++ std::vector<atom*> atomListTmp = metalAtom->getParent()->getAtomList(); ++ for (unsigned int i = 0 ; i < atomListTmp.size(); i++) { ++ atomList.push_back(atomListTmp[i]); ++ } ++ + /* + std::cout << "Metal Atom " << metalAtom->getParent()->getName() << " " + << metalAtom->getParent()->getSubMolId() +@@ -3582,7 +3607,7 @@ + } + } + +-//std::cout << " \n\n NEW MOLECULE \n"; ++//std::cout << "NEW MOLECULE \n"; + + // Copy bonds + if (pNewMolecule) { +@@ -3646,16 +3671,26 @@ + } + } + } ++ ++//std::cout << " After copy " << std::endl; ++ + int nAtomsA = pStdMolecule->getNumAtoms(); + int nAtomsB = pNewMolecule->getNumAtoms(); ++ ++ int nBondsA = pStdMolecule->getNumBonds(); ++ int nBondsB = pNewMolecule->getNumBonds(); ++ + int nHeavyAtomsA = pStdMolecule->getNumHeavyAtoms(); + int nHeavyAtomsB = pNewMolecule->getNumHeavyAtoms(); + ++//std::cout << "CHECK " << nAtomsA << " " << nAtomsB << " " << nBondsA << " " << nBondsB << "\n"; + int w = 0; + if (nAtomsA != nAtomsB) w++; + int h = 0; + if (nHeavyAtomsA != nHeavyAtomsB) h++; + ++//std::cout << " w = " << w << " h = " << h << std::endl; ++ + if (w or h) { + std::string eMes = " " + stdGrpList[i]->getName() + " is not a match \n"; + eMes += " std mol nAtoms: " + i2s(nAtomsA) + +@@ -3671,8 +3706,17 @@ + // Determine corresponences between two molecules + std::vector<std::vector<int> > correspondenceMatrices; + //int cor = 0; ++//std::cout << " superimpose " << std::endl; + superimpose* pSuperImpose = new superimpose(); +- int f = pSuperImpose->initializeCorrespondences(pStdMolecule, pNewMolecule, 3, correspondenceMatrices); ++ int f = 0; ++ try { ++ f = pSuperImpose->initializeCorrespondences(pStdMolecule, pNewMolecule, 3, correspondenceMatrices); ++ } ++ catch (...) { ++ f = 1; ++ } ++ ++//std::cout << " after superimpose " << std::endl; + + if (f != 0) { + std::string eMes = " Error initializing correspondences\n " + stdGrpList[i]->getName() + " is not a match \n"; +@@ -3689,6 +3733,8 @@ + pNewMolecule->getCoordinates(CoordsB); + int cor = 0; + ++//std::cout << " f = 0 " << std::endl; ++ + double dRMSD = pSuperImpose->rmsd(pStdMolecule, CoordsB, correspondenceMatrices, cor); + std::string eMes = " " + stdGrpList[i]->getName() + " is a match with rmsd of " + d2s(dRMSD) + "\n"; + MTKpp::errorLogger.throwError("collection::assignMetalParameters", eMes, INFO); +@@ -3703,38 +3749,52 @@ + for (int t = 0; t < nHeavyAtoms; t++) { + for (int t2 = 0; t2 < nHeavyAtoms; t2++) { + if (correspondenceMatrices[cor][t*nHeavyAtoms+t2]) { +-//std::cout << t+1 << ":" << t2+1 << "; |"; +- + atom* pA1 = molHeavyAtoms1[t]; + atom* pA2 = molHeavyAtoms2[t2]; + + if (pA1 and pA2) { +-//atom* collection::getAtom(int number, bool atomIndex, bool fileId, bool atomColIndex) +- ++ // getAtom(int number, bool atomIndex, bool fileId, bool atomColIndex) + atom* pOrgAtom = this->getAtom(pA2->getFileID(), 0, 1, 0); +-/* +-std::cout << pA1->getName() << "|" << pA2->getName() << "|" << pOrgAtom->getName() << " " +- << pA1->getParent()->getName() << "|" << pA2->getParent()->getName() << "|" << pOrgAtom->getParent()->getName() << " |" +- << pA1->getFileID() << "|" << pA2->getFileID() << "|" << pOrgAtom->getFileID() << "|" +- << pA1->getColIndex() << "|" << pA2->getColIndex() << "|" << pOrgAtom->getColIndex() +- << " |\n"; +-*/ +- pOrgAtom->getParent()->setName(pA1->getParent()->getName()); ++ // atom* pOrgAtom = this->getAtom(pA2->getColIndex(), 0, 0, 1); ++ ++ ++//std::cout << pA1->getName() << "|" << pA2->getName() << "|" << pOrgAtom->getName() << " " ++// << pA1->getParent()->getName() << "|" << pA2->getParent()->getName() << "|" << pOrgAtom->getParent()->getName() << " |" ++// << pA1->getFileID() << "|" << pA2->getFileID() << "|" << pOrgAtom->getFileID() << "|" ++// << pA1->getColIndex() << "|" << pA2->getColIndex() << "|" << pOrgAtom->getColIndex() ++// << " |\n"; ++ ++ //pOrgAtom->getParent()->setName(pA1->getParent()->getName()); ++ ++ for (unsigned int i = 0 ; i < atomList.size(); i++) { ++ if (atomList[i]->getFileID() == pA2->getFileID()) { ++ //std::cout << "setting " << atomList[i]->getParent()->getName() << " to " ++ // << pA1->getParent()->getName() << "\n"; ++ atomList[i]->getParent()->setName(pA1->getParent()->getName()); ++ } + } ++//std::cout << pOrgAtom->getParent() << " " << pOrgAtom->getParent()->getName() << " " ++//<< pA2->getFileID() ++// << " " << pOrgAtom->getParent()->getColIndex() << "\n"; + } + } + } + } ++ ++ } + } + } + } ++ + // delete new molecule ++ if (pNewMolecule) { + this->delMolecule(pNewMolecule); + } + } + } + } + } ++ } + + /////////////////////////////////////////////////////////////////////////////// + /////////////////////////////////////////////////////////////////////////////// +@@ -4377,6 +4437,7 @@ + } + std::cout << " TOTAL CHARGE = " << localTotalCharge << std::endl; + */ ++ + } + + // ============================================================ +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/hydrophobize.cpp amber11/AmberTools/src/mtkpp/src/Molecule/hydrophobize.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/hydrophobize.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Molecule/hydrophobize.cpp 2012-03-03 20:03:01.404032569 +0200 +@@ -315,7 +315,7 @@ + if (!vertices[i]->isVisited()) { + graph* subGraph = new graph(); + +- std::cout << "\n " << vertices[i]->getIndex() << " "; ++// std::cout << "\n " << vertices[i]->getIndex() << " "; + molGraph->dfs(vertices[i]); + + for (unsigned int j = 0; j < vertices.size(); j++) { +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/Makefile.am amber11/AmberTools/src/mtkpp/src/Molecule/Makefile.am +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/Makefile.am 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Molecule/Makefile.am 2012-03-03 20:03:01.401032571 +0200 +@@ -1,8 +1,8 @@ +-DIAGNOSTICS_LD=-L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD=-L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB=-lDiagnostics +-GRAPH_LD=-L$(top_builddir)/src/Graph/$(SRCDIR) ++GRAPH_LD=-L$(abs_top_builddir)/src/Graph/$(SRCDIR) + GRAPH_LIB=-lGraph +-LOG_LD=-L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD=-L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB=-lLog + + INCLUDES = -I@boost_inc@ -I$(srcdir)/.. -I$(top_srcdir)/src/eigen3b2 +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/Makefile.in amber11/AmberTools/src/mtkpp/src/Molecule/Makefile.in +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/Makefile.in 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Molecule/Makefile.in 2012-03-03 20:03:01.401032571 +0200 +@@ -248,11 +248,11 @@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + xerces_path = @xerces_path@ +-DIAGNOSTICS_LD = -L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD = -L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB = -lDiagnostics +-GRAPH_LD = -L$(top_builddir)/src/Graph/$(SRCDIR) ++GRAPH_LD = -L$(abs_top_builddir)/src/Graph/$(SRCDIR) + GRAPH_LIB = -lGraph +-LOG_LD = -L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD = -L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB = -lLog + INCLUDES = -I@boost_inc@ -I$(srcdir)/.. -I$(top_srcdir)/src/eigen3b2 + lib_LTLIBRARIES = libMolecule.la +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/parameters.cpp amber11/AmberTools/src/mtkpp/src/Molecule/parameters.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/parameters.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Molecule/parameters.cpp 2012-03-03 20:03:01.404032569 +0200 +@@ -145,6 +145,7 @@ + pAtomType->description = ""; + pAtomType->rvalue = 0.0; + pAtomType->evalue = 0.0; ++ pAtomType->atomPolarizability = 0.0; + pAtomType->groupName = ""; + pAtomType->optimize = false; + this->itsTypeList.push_back(pAtomType); +@@ -184,6 +185,7 @@ + pAtomType->description = a->description; + pAtomType->rvalue = a->rvalue; + pAtomType->evalue = a->evalue; ++ pAtomType->atomPolarizability = a->atomPolarizability; + pAtomType->groupName = g; + pAtomType->optimize = a->optimize; + +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/parameters.h amber11/AmberTools/src/mtkpp/src/Molecule/parameters.h +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/parameters.h 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Molecule/parameters.h 2012-03-03 20:03:01.405032569 +0200 +@@ -76,6 +76,9 @@ + //! Well Depth + double evalue; + ++ //! Atomic polarizability in A**3 ++ double atomPolarizability; ++ + //! group name + std::string groupName; + +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/stdFrag.cpp amber11/AmberTools/src/mtkpp/src/Molecule/stdFrag.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/stdFrag.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Molecule/stdFrag.cpp 2012-03-03 20:03:01.405032569 +0200 +@@ -305,7 +305,8 @@ + this->itsSymbol = symbol; + } + else { +- std::cout << " Length of Fragment Symbol = " << symbol.size() ++ std::cout << " Length of Fragment Symbol (" << symbol ++ << ") = " << symbol.size() + << " --> Must be 3." << std::endl; + } + } +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/stdGroup.cpp amber11/AmberTools/src/mtkpp/src/Molecule/stdGroup.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/stdGroup.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Molecule/stdGroup.cpp 2012-03-03 20:03:01.406032569 +0200 +@@ -35,6 +35,7 @@ + #include "stdLibrary.h" + + #include "molecule.h" ++#include "submolecule.h" + + namespace MTKpp + { +@@ -258,5 +259,24 @@ + } + } + ++// ============================================================ ++// Function : getCharge() ++// ------------------------------------------------------------ ++// ++// ============================================================ ++double stdGroup::getCharge() ++{ ++ double d = 0.0; ++ if (pMolecule) { ++ std::vector<submolecule*> sList = this->pMolecule->getSubMoleculeList(); ++ for (unsigned int p = 0; p < sList.size(); p++) { ++ this->pStdFrag = this->getStdFrag(sList[p]->getName()); ++ d += this->pStdFrag->getCharge(); ++ //std::cout << this->pStdFrag->getSymbol() << " " << this->pStdFrag->getCharge() << std::endl; ++ } ++ } ++ return d; ++} ++ + } // MTKpp namespace + +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/stdGroup.h amber11/AmberTools/src/mtkpp/src/Molecule/stdGroup.h +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/stdGroup.h 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Molecule/stdGroup.h 2012-03-03 20:03:01.406032569 +0200 +@@ -160,6 +160,12 @@ + */ + molecule* getStdMolecule(); + ++ /*! ++ \brief Get getCharge ++ \return molecule charge ++ */ ++ double getCharge(); ++ + protected: + //! stdLibrary pointer + stdLibrary* pParent; +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/frcmodParser.cpp amber11/AmberTools/src/mtkpp/src/Parsers/frcmodParser.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/frcmodParser.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/frcmodParser.cpp 2012-03-03 20:03:01.407032569 +0200 +@@ -98,6 +98,7 @@ + while (ifrcmod) { + std::string buffer(80,'*'); + getline(ifrcmod,fileline); ++//std::cout << "|" << fileline << "|" << std::endl; + bMASS = false; + bBOND = false; + bANGLE = false; +@@ -105,118 +106,311 @@ + bIMPROPER = false; + bNONBON = false; + ++ if ( (fileline.size() > 0) and (stripString(fileline, " ") != "") ) { ++ std::vector<std::string> splitstring; ++ splitString(fileline, " ", splitstring, 0); ++ ++ if (splitstring[0] == "MASS") bMASS = true; ++ if (splitstring[0] == "BOND") bBOND = true; ++ if (splitstring[0] == "ANGL" or splitstring[0] == "ANGLE") bANGLE = true; ++ if (splitstring[0] == "DIHE" or splitstring[0] == "DIHEDRAL") bDIHE = true; ++ if (splitstring[0] == "IMPROP" or splitstring[0] == "IMPROPER") bIMPROPER = true; ++ if (splitstring[0] == "NONB" or splitstring[0] == "NONBON") bNONBON = true; ++ } ++/* ++ try { + if (fileline.substr(0,4) == "MASS") bMASS = true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range MAS " << std::endl; ++ } ++ ++ try { + if (fileline.substr(0,4) == "BOND") bBOND = true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range BOND " << std::endl; ++ } ++ ++ try { + if (fileline.substr(0,5) == "ANGLE") bANGLE = true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range ANG" << std::endl; ++ } ++ ++ try { + if (fileline.substr(0,4) == "DIHE") bDIHE = true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range DIHE " << std::endl; ++ } ++ ++ try { + if (fileline.substr(0,8) == "IMPROPER") bIMPROPER = true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range IMP " << std::endl; ++ } ++ ++ try { + if (fileline.substr(0,6) == "NONBON") bNONBON = true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range NONB" << std::endl; ++ } ++*/ + + if (bMASS) { + getline(ifrcmod,fileline); +- while (fileline != "") { ++ while (stripString(fileline, " ") != "") { ++ //while (GetAlphaChar(fileline, 0) != "0") { ++ std::vector<std::string> splitLine; ++ splitString(fileline, " ", splitLine, 0); ++ if (splitLine.size() >= 2) { ++ for (unsigned int i = 0; i < 2; i++) { ++ splitLine[i] = stripString(splitLine[i], " "); ++ } + pAtomType = pParameters->addAtomType(); ++ pAtomType->name = splitLine[0]; + pAtomType->groupName = this->groupName; +- pAtomType->mass = strtod(fileline.substr(3,5).c_str(), 0); ++ pAtomType->mass = string2Double(splitLine[1]); //strtod(fileline.substr(3,5).c_str(), 0); ++ ++ if (splitLine.size() > 2) { ++ char *end; ++ double ret_double = strtod(splitLine[2].c_str(), &end); ++ if (!*end) { ++ pAtomType->atomPolarizability = ret_double; ++ } ++//std::cout << splitLine[2] << " " << ret_double << std::endl; ++ } ++ + getline(ifrcmod,fileline); + } + } ++ } + + if (bBOND) { + getline(ifrcmod,fileline); +- while (fileline != "") { +- std::string atomNames = fileline.substr(0,5); ++ //while (fileline != "") { ++ while (stripString(fileline, " ") != "") { ++ //std::string atomNames = fileline.substr(0,5); + std::vector<std::string> splitLine; +- splitString(atomNames, "-", splitLine, 0); +- if (splitLine.size() == 2) { +- for (unsigned int i = 0; i < 2; i++) { +- splitLine[i] = stripString(splitLine[i]," "); +- } ++ splitString(fileline, "-", splitLine, 0); ++ ++ std::vector<std::string> splitLine2; ++ splitString(splitLine[1], " ", splitLine2, 0); ++ ++ //if (splitLine.size() == 2) { ++ //for (unsigned int i = 0; i < 2; i++) { ++ // splitLine[i] = stripString(splitLine[i]," "); ++ //} + pBondParam = pParameters->addBondParam(); + pBondParam->groupName = this->groupName; +- pBondParam->atomType1 = std::string(splitLine[0]); +- pBondParam->atomType2 = std::string(splitLine[1]); +- pBondParam->keq = strtod(fileline.substr(7,5).c_str(), 0); +- pBondParam->req = strtod(fileline.substr(16,5).c_str(), 0); ++ pBondParam->atomType1 = stripString(splitLine[0], " "); ++ pBondParam->atomType2 = stripString(splitLine2[0], " "); ++//std::cout << "|" << pBondParam->atomType1 << "|" << pBondParam->atomType2 << "|" << std::endl; ++ pBondParam->keq = string2Double(splitLine2[1]); ++ pBondParam->req = string2Double(splitLine2[2]); ++ ++// pBondParam->keq = strtod(fileline.substr(7,5).c_str(), 0); ++// pBondParam->req = strtod(fileline.substr(16,5).c_str(), 0); ++ ++//std::cout << "\n " << fileline << std::endl; ++//std::cout << " BOND " << pBondParam->atomType1 << " " << pBondParam->atomType2 << " " << pBondParam->keq << " " << pBondParam->req << std::endl; ++//std::cout << " BOND " << fileline.substr(7,5) << " " << fileline.substr(16,5) <<std::endl; ++ + getline(ifrcmod,fileline); +- } ++ //} + } + } + + if (bANGLE) { + getline(ifrcmod,fileline); +- while (fileline != "") { +- std::string atomNames = fileline.substr(0,8); ++ //while (fileline != "") { ++ while (stripString(fileline, " ") != "") { ++// std::string atomNames = fileline.substr(0,8); ++ + std::vector<std::string> splitLine; +- splitString(atomNames, "-", splitLine, 0); +- if (splitLine.size() == 3) { +- for (unsigned int i = 0; i < 3; i++) { +- splitLine[i] = stripString(splitLine[i]," "); +- } ++ splitString(fileline, "-", splitLine, 0); ++ ++ std::vector<std::string> splitLine2; ++ splitString(splitLine[2], " ", splitLine2, 0); ++ ++ //std::vector<std::string> splitLine; ++ //splitString(atomNames, "-", splitLine, 0); ++ ++ //std::vector<std::string> splitLine2; ++ //splitString(fileline, " ", splitLine2, 0); ++ ++ //if (splitLine.size() == 3) { ++ //for (unsigned int i = 0; i < 3; i++) { ++ // splitLine[i] = stripString(splitLine[i]," "); ++ //} + pAngleParam = pParameters->addAngleParam(); + pAngleParam->groupName = this->groupName; +- pAngleParam->atomType1 = std::string(splitLine[0]); +- pAngleParam->atomType2 = std::string(splitLine[1]); +- pAngleParam->atomType3 = std::string(splitLine[2]); +- pAngleParam->keq = strtod(fileline.substr(11,7).c_str(), 0); +- pAngleParam->req = strtod(fileline.substr(20,8).c_str(), 0) * DEG2RAD; ++ pAngleParam->atomType1 = stripString(splitLine[0], " "); ++ pAngleParam->atomType2 = stripString(splitLine[1], " "); ++ pAngleParam->atomType3 = stripString(splitLine2[0], " "); ++//std::cout << "|" << pAngleParam->atomType1 << "|" << pAngleParam->atomType2 << "|" << pAngleParam->atomType3 << "|" << std::endl; ++ ++ pAngleParam->keq = string2Double(splitLine2[1]); ++ pAngleParam->req = string2Double(splitLine2[2]) * DEG2RAD; ++ ++ //pAngleParam->keq = strtod(fileline.substr(11,7).c_str(), 0); ++ //pAngleParam->req = strtod(fileline.substr(20,8).c_str(), 0) * DEG2RAD; ++ ++//std::cout << "\n " << fileline << std::endl; ++//std::cout << " ANGLE " << pAngleParam->atomType1 << " " << pAngleParam->atomType2 << " " << pAngleParam->atomType3 << " " << pAngleParam->keq << " " << string2Double(splitLine2[2]) << std::endl; ++ + getline(ifrcmod,fileline); +- } ++ //} + } + } + + if (bDIHE) { + getline(ifrcmod,fileline); +- while (fileline != "") { +- std::string atomNames = fileline.substr(0,11); ++ //while (fileline != "") { ++ while (stripString(fileline, " ") != "") { ++ ++//std::cout << "\n " << fileline << std::endl; ++ ++//std::cout << fileline.substr(0,12) << std::endl; ++ ++// snip = str.substr(0,12); ++//(3) erase the substring of 0..where str.erase(0,where); ++ ++ std::string atTypes = fileline.substr(0,12); + std::vector<std::string> splitLine; +- splitString(atomNames, "-", splitLine, 0); +- if (splitLine.size() == 4) { +- for (unsigned int i = 0; i < 4; i++) { +- splitLine[i] = stripString(splitLine[i]," "); +- } ++ splitString(atTypes, "-", splitLine, 0); ++ ++/*for (unsigned int i = 0; i < splitLine.size(); i++) { ++ std::cout << splitLine[i] << std::endl; ++}*/ ++ ++ fileline.erase(0,12); ++ ++ std::vector<std::string> splitLine2; ++ splitString(fileline, " ", splitLine2, 0); ++/* ++for (unsigned int i = 0; i < splitLine2.size(); i++) { ++ std::cout << splitLine2[i] << std::endl; ++}*/ ++ ++ //std::string atomNames = fileline.substr(0,11); ++ //std::vector<std::string> splitLine; ++ //splitString(atomNames, "-", splitLine, 0); ++ ++ //if (splitLine.size() == 4) { ++ //for (unsigned int i = 0; i < 4; i++) { ++ //splitLine[i] = stripString(splitLine[i], " "); ++ //} + pTorsionParam = pParameters->addTorsionParam(); + pTorsionParam->groupName = this->groupName; +- pTorsionParam->atomType1 = std::string(splitLine[0]); +- pTorsionParam->atomType2 = std::string(splitLine[1]); +- pTorsionParam->atomType3 = std::string(splitLine[2]); +- pTorsionParam->atomType4 = std::string(splitLine[3]); +- pTorsionParam->npth = atoi(fileline.substr(11,4).c_str()); +- pTorsionParam->Vn = strtod(fileline.substr(18,8).c_str(), 0); +- pTorsionParam->gamma = strtod(fileline.substr(31,8).c_str(), 0) * DEG2RAD; +- pTorsionParam->Nt = strtod(fileline.substr(42,12).c_str(), 0); ++ pTorsionParam->atomType1 = stripString(splitLine[0], " "); ++ pTorsionParam->atomType2 = stripString(splitLine[1], " "); ++ pTorsionParam->atomType3 = stripString(splitLine[2], " "); ++ pTorsionParam->atomType4 = stripString(splitLine[3], " "); ++ ++ pTorsionParam->npth = string2Int(splitLine2[0]); ++ pTorsionParam->Vn = string2Double(splitLine2[1]); ++ pTorsionParam->gamma = string2Double(splitLine2[2]) * DEG2RAD; ++ pTorsionParam->Nt = string2Double(splitLine2[3]); ++ ++ //pTorsionParam->npth = atoi(fileline.substr(11,4).c_str()); ++ //pTorsionParam->Vn = strtod(fileline.substr(18,8).c_str(), 0); ++ //pTorsionParam->gamma = strtod(fileline.substr(31,8).c_str(), 0) * DEG2RAD; ++ //pTorsionParam->Nt = strtod(fileline.substr(42,12).c_str(), 0); ++ ++//std::cout << " DIHE " << pTorsionParam->atomType1 << " " << pTorsionParam->atomType2 << " " << pTorsionParam->atomType3 << " " << pTorsionParam->atomType4 << " " << pTorsionParam->npth << " " << pTorsionParam->Vn << " " << string2Double(splitLine2[2]) << " " << pTorsionParam->Nt << std::endl; ++ + getline(ifrcmod,fileline); +- } ++//std::cout << " DIHE LINE: " << fileline << std::endl; ++ //} + } + } + + if (bIMPROPER) { + getline(ifrcmod,fileline); +- while (fileline != "") { +- std::string atomNames = fileline.substr(0,11); ++ //while (fileline != "") { ++ while (stripString(fileline, " ") != "") { ++ ++ std::string atTypes = fileline.substr(0,12); + std::vector<std::string> splitLine; +- splitString(atomNames, "-", splitLine, 0); +- if (splitLine.size() == 4) { +- for (unsigned int i = 0; i < 4; i++) { +- splitLine[i] = stripString(splitLine[i]," "); +- } ++ splitString(atTypes, "-", splitLine, 0); ++ ++ fileline.erase(0,12); ++ ++ std::vector<std::string> splitLine2; ++ splitString(fileline, " ", splitLine2, 0); ++ ++// std::vector<std::string> splitLine; ++// splitString(fileline, "-", splitLine, 0); ++ ++// std::vector<std::string> splitLine2; ++// splitString(splitLine[3], " ", splitLine2, 0); ++ ++ //std::string atomNames = fileline.substr(0,11); ++ //std::vector<std::string> splitLine; ++ //splitString(atomNames, "-", splitLine, 0); ++ //if (splitLine.size() == 4) { ++ //for (unsigned int i = 0; i < 4; i++) { ++ //splitLine[i] = stripString(splitLine[i]," "); ++ //} + pImproperParam = pParameters->addImproperParam(); + pImproperParam->groupName = this->groupName; +- pImproperParam->atomType1 = std::string(splitLine[0]); +- pImproperParam->atomType2 = std::string(splitLine[1]); +- pImproperParam->atomType3 = std::string(splitLine[2]); +- pImproperParam->atomType4 = std::string(splitLine[3]); +- pImproperParam->Vn = strtod(fileline.substr(18,8).c_str(), 0); +- pImproperParam->gamma = strtod(fileline.substr(31,8).c_str(), 0) * DEG2RAD; +- pImproperParam->Nt = strtod(fileline.substr(42,12).c_str(), 0); ++ pImproperParam->atomType1 = stripString(splitLine[0], " "); ++ pImproperParam->atomType2 = stripString(splitLine[1], " "); ++ pImproperParam->atomType3 = stripString(splitLine[2], " "); ++ pImproperParam->atomType4 = stripString(splitLine[3], " "); ++ ++ pImproperParam->Vn = string2Double(splitLine2[0]); ++ pImproperParam->gamma = string2Double(splitLine2[1]) * DEG2RAD; ++ pImproperParam->Nt = string2Double(splitLine2[2]); ++ ++ //pImproperParam->Vn = strtod(fileline.substr(18,8).c_str(), 0); ++ //pImproperParam->gamma = strtod(fileline.substr(31,8).c_str(), 0) * DEG2RAD; ++ //pImproperParam->Nt = strtod(fileline.substr(42,12).c_str(), 0); ++ ++//std::cout << "\n " << fileline << std::endl; ++//std::cout << " IMPR " << pImproperParam->atomType1 << " " << pImproperParam->atomType2 << " " << pImproperParam->atomType3 << " " << pImproperParam->atomType4 << " " << pImproperParam->Vn << " " << string2Double(splitLine2[1]) << " " << pImproperParam->Nt << std::endl; ++ + getline(ifrcmod,fileline); +- } ++ //} + } + } + if (bNONBON) { ++ getline(ifrcmod,fileline); ++//std::cout << fileline << std::endl; ++ //while (fileline != "") { ++ while (stripString(fileline, " ") != "") { ++ std::vector<std::string> splitLine; ++ splitString(fileline, " ", splitLine, 0); ++ if (splitLine.size() >= 3) { ++ for (unsigned int i = 0; i < 3; i++) { ++ splitLine[i] = stripString(splitLine[i], " "); ++ } ++//std::cout << " |" << splitLine[0] << "|" << std::endl; ++ ++//std::cout << "\n " << fileline << std::endl; ++ ++ pAtomType = pParameters->getAtomType(stripString(splitLine[0], " ")); ++ if (pAtomType) { ++ pAtomType->rvalue = string2Double(splitLine[1]); ++ pAtomType->evalue = string2Double(splitLine[2]); + ++//std::cout << pAtomType->name << " " << pAtomType->rvalue << " " << pAtomType->evalue << std::endl; ++ ++ } ++ else { ++ std::cout << " Can't find atom type " << std::endl; ++ } ++ getline(ifrcmod,fileline); ++ } ++ } + } + } ++ + ifrcmod.close(); + } + +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/gaussianParser.cpp amber11/AmberTools/src/mtkpp/src/Parsers/gaussianParser.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/gaussianParser.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/gaussianParser.cpp 2012-03-03 20:03:01.408032569 +0200 +@@ -84,7 +84,7 @@ + + this->bMem = 0; + +- this->bnProc = 0; ++ this->bNProc = 0; + + this->bWriteInternalCoords = true; + this->bWriteCartCoords = false; +@@ -168,7 +168,7 @@ + while (igau) { + getline(igau,fileline); + +- if (containsSubStr(fileline, "modredundant")) { ++ if (containsSubStr(fileline, "ModRedundant")) { + bModRedundant = true; + } + if (fileline.substr(0,59) == " Redundant internal coordinates taken from checkpoint file:") { +@@ -626,6 +626,7 @@ + void gaussianParser::Write(const std::string &gaussfile, molecule* pMolecule, + std::vector< vector3d > &coordinates) + { ++ std::string routecard; + std::ofstream ogauss; + ogauss.open(gaussfile.c_str()); + +@@ -643,52 +644,64 @@ + return; + } + +- ogauss << "$rungauss" << std::endl; ++ ogauss << "$RunGauss" << std::endl; + + if (bChkPt) { +- ogauss << "%chk=" << this->itsChkPtFile << std::endl; ++ ogauss << "%Chk=" << this->itsChkPtFile << std::endl; + } + if (bMem) { +- ogauss << "%mem=" << this->itsMem << std::endl; ++ ogauss << "%Mem=" << this->itsMem << std::endl; + } +- if (bnProc) { +- ogauss << "%nproc=" << this->itsnProc << std::endl; ++ if (bNProc) { ++ ogauss << "%NProcShared=" << this->itsNProc << std::endl; + } + +- ogauss << "#" << this->itsVerbosity << " " << this->itsTheory << "/" << this->itsBasisSet << " "; ++ routecard = "#" + this->itsVerbosity + " " + this->itsTheory + "/" + this->itsBasisSet; + + if (!itsCommandOptions.empty()) { + for (mapIterator p = itsCommandOptions.begin(); p != itsCommandOptions.end(); p++) { + std::string c = p->first; + std::vector<std::string> o = p->second; ++ std::string opts = ""; + if (o.size() == 1) { +- if ( p->second[0] == "NONE") { +- ogauss << p->first << " "; +- } +- else { +- ogauss << p->first << "=" << p->second[0] << " "; ++ if ( p->second[0] != "NONE") { ++ opts = "=" + p->second[0]; + } + } + else { +- ogauss << p->first << "("; ++ opts = "("; + for (unsigned int i = 0; i < o.size(); i++) { +- if (i == o.size()-1) { +- ogauss << o[i]; ++ opts = opts + o[i]; ++ if (i != o.size()-1) { ++ opts = opts + ","; + } +- else { +- ogauss << o[i] << ","; + } ++ opts = opts + ")"; + } +- ogauss << ")" << " "; ++ ++ if (routecard.length() + c.length() + opts.length() < 72) { ++ routecard = routecard + " " + c + opts; ++ } else { ++ if (routecard.length() != 0) { ++ ogauss << routecard << std::endl; ++ } ++ routecard = c + opts; + } + } + } + for (unsigned int i = 0; i < this->iops.size(); i++) { +- ogauss << this->iops[i] << " "; ++ if (routecard.length() + this->iops[i].length() < 72) { ++ routecard = routecard + " " + this->iops[i]; ++ } else { ++ if (routecard.length() != 0) { ++ ogauss << routecard << std::endl; ++ } ++ routecard = this->iops[i]; ++ } + } + + // Flush command block and follow with a blank line +- ogauss << "\n" << std::endl; ++ ogauss << routecard << "\n" << std::endl; + + // Write name (if required) and follow with a blank line + if (bWriteMoleculeName) { +@@ -740,11 +753,11 @@ + ogauss << std::endl; + } + +- std::vector<std::string> optOptions = this->getCommandOption("opt"); ++ std::vector<std::string> optOptions = this->getCommandOption("Opt"); + if (optOptions.size() > 0) { + bool bMD = 0; + for (unsigned int x = 0; x < optOptions.size(); x++) { +- if (optOptions[x] == "modredundant") { ++ if (optOptions[x] == "ModRedundant") { + bMD = 1; + } + } +@@ -766,13 +779,13 @@ + } + } + +- if (this->itsBasisSet.substr(0,3) == "GEN") { ++ if (this->itsBasisSet.substr(0,3) == "Gen") { + std::ifstream iBSFile; + iBSFile.open(this->itsBasisSetFile.c_str()); + + if (!iBSFile) { + std::cout << "\nERROR!" +- << "\nBasis set \"GEN\" requires a custom file." ++ << "\nBasis set \"Gen\" requires a custom file." + << "\nFile \"" << this->itsBasisSetFile << "\" is missing or unreadable." + << "\nPlease choose another file. For instructions, consult your program's" + << "\ndocumentation." +@@ -789,13 +802,13 @@ + } + + // +BPR +- if (this->getCommandOption("pseudo").size() > 0) { ++ if (this->getCommandOption("Pseudo").size() > 0) { + std::ifstream iPseudoFile; + iPseudoFile.open(this->itsPseudoPotentialFile.c_str()); + + if (!iPseudoFile) { + std::cout << "\nERROR!" +- << "\npseudo=read or pseudo=cards requires a custom file." ++ << "\nPseudo=Read or Pseudo=Cards requires a custom file." + << "\nFile \"" << this->itsPseudoPotentialFile << "\" is missing or unreadable." + << "\nPlease choose another file. For instructions, consult your program's" + << "\ndocumentation." +@@ -812,7 +825,7 @@ + } + // -BPR + +- if (this->getCommandOption("pop").size() > 0) { ++ if (this->getCommandOption("Pop").size() > 0) { + if (!itsMKRadii.empty()) { + for (dMapIterator p = itsMKRadii.begin(); p != itsMKRadii.end(); p++) { + ogauss << p->first << "=" << p->second << "\n"; +@@ -1037,14 +1050,14 @@ + } + + // ============================================================ +-// Function : setnProc ++ // Function : setNProc + // ------------------------------------------------------------ + // + // ============================================================ +-void gaussianParser::setnProc(const std::string &n) ++ void gaussianParser::setNProc(const std::string &n) + { +- this->bnProc = 1; +- this->itsnProc = n; ++ this->bNProc = 1; ++ this->itsNProc = n; + } + + // ============================================================ +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/gaussianParser.h amber11/AmberTools/src/mtkpp/src/Parsers/gaussianParser.h +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/gaussianParser.h 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/gaussianParser.h 2012-03-03 20:03:01.408032569 +0200 +@@ -196,9 +196,9 @@ + + /*! + \brief Set number of processors to use +- \param n nprocs ++ \param n number of processors + */ +- void setnProc(const std::string &n); ++ void setNProc(const std::string &n); + + /*! + \brief Set level of theory +@@ -354,10 +354,10 @@ + bool bMem; + + //! number of processors +- std::string itsnProc; ++ std::string itsNProc; + +- //! Turn on mem +- bool bnProc; ++ //! Turn on number of processors ++ bool bNProc; + + //! Use internal or cartesian coordinates + bool bWriteInternalCoords; +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/Makefile.am amber11/AmberTools/src/mtkpp/src/Parsers/Makefile.am +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/Makefile.am 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/Makefile.am 2012-03-03 20:03:01.406032569 +0200 +@@ -1,15 +1,15 @@ +-DIAGNOSTICS_LD=-L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD=-L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB=-lDiagnostics +-MOLECULE_LD=-L$(top_builddir)/src/Molecule/$(SRCDIR) ++MOLECULE_LD=-L$(abs_top_builddir)/src/Molecule/$(SRCDIR) + MOLECULE_LIB=-lMolecule +-GA_LD=-L$(top_builddir)/src/GA/$(SRCDIR) ++GA_LD=-L$(abs_top_builddir)/src/GA/$(SRCDIR) + GA_LIB=-lGA +-LOG_LD=-L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD=-L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB=-lLog +-STATS_LD=-L$(top_builddir)/src/Statistics/$(SRCDIR) ++STATS_LD=-L$(abs_top_builddir)/src/Statistics/$(SRCDIR) + STATS_LIB=-lStatistics + +-TINYXML_LD=-L$(top_builddir)/src/tinyxml/$(SRCDIR) ++TINYXML_LD=-L$(abs_top_builddir)/src/tinyxml/$(SRCDIR) + TINYXML_LIB=-ltinyxml + + if USE_XERCES +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/Makefile.in amber11/AmberTools/src/mtkpp/src/Parsers/Makefile.in +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/Makefile.in 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/Makefile.in 2012-03-03 20:03:01.407032569 +0200 +@@ -267,17 +267,17 @@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + xerces_path = @xerces_path@ +-DIAGNOSTICS_LD = -L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD = -L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB = -lDiagnostics +-MOLECULE_LD = -L$(top_builddir)/src/Molecule/$(SRCDIR) ++MOLECULE_LD = -L$(abs_top_builddir)/src/Molecule/$(SRCDIR) + MOLECULE_LIB = -lMolecule +-GA_LD = -L$(top_builddir)/src/GA/$(SRCDIR) ++GA_LD = -L$(abs_top_builddir)/src/GA/$(SRCDIR) + GA_LIB = -lGA +-LOG_LD = -L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD = -L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB = -lLog +-STATS_LD = -L$(top_builddir)/src/Statistics/$(SRCDIR) ++STATS_LD = -L$(abs_top_builddir)/src/Statistics/$(SRCDIR) + STATS_LIB = -lStatistics +-TINYXML_LD = -L$(top_builddir)/src/tinyxml/$(SRCDIR) ++TINYXML_LD = -L$(abs_top_builddir)/src/tinyxml/$(SRCDIR) + TINYXML_LIB = -ltinyxml + @USE_XERCES_TRUE@XERCES_LD = -L@xerces_path@/lib/ + @USE_XERCES_TRUE@XERCES_LIB = -lxerces-c +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/mtkppParser.cpp amber11/AmberTools/src/mtkpp/src/Parsers/mtkppParser.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/mtkppParser.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/mtkppParser.cpp 2012-03-03 20:03:01.409032568 +0200 +@@ -1769,6 +1769,15 @@ + atomElem->SetAttribute("type", int2String(pAtom->getType())); + atomElem->SetAttribute("formalCharge", int2String(pAtom->getFormalCharge())); + ++ // Coordinates ++ TiXmlElement* coordElem = new TiXmlElement("coord"); ++ atomElem->LinkEndChild(coordElem); ++ ++ coordElem->SetAttribute("x", double2String(pAtom->getX())); ++ coordElem->SetAttribute("y", double2String(pAtom->getY())); ++ coordElem->SetAttribute("z", double2String(pAtom->getZ())); ++ ++ // Properties + std::map<std::string, double> atomDMap = pAtom->getPropertyMap(); + std::map<std::string, int> atomIMap = pAtom->getIntPropertyMap(); + +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/paramParser.cpp amber11/AmberTools/src/mtkpp/src/Parsers/paramParser.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/paramParser.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/paramParser.cpp 2012-03-03 20:03:01.410032567 +0200 +@@ -144,6 +144,10 @@ + pAtomType->evalue = string2Double(element->Attribute("potentialWellDepth")); + } + ++ if (element->Attribute("atomPolarizability")) { ++ pAtomType->atomPolarizability = string2Double(element->Attribute("atomPolarizability")); ++ } ++ + if (element->Attribute("element")) { + pAtomType->element = element->Attribute("element"); + } +@@ -1808,6 +1812,7 @@ + entry->SetAttribute("mass" , double2String(pAtomType->mass).c_str()); + entry->SetAttribute("vdwRadius" , double2String(pAtomType->rvalue).c_str()); + entry->SetAttribute("potentialWellDepth" , double2String(pAtomType->evalue).c_str()); ++ entry->SetAttribute("atomPolarizability" , double2String(pAtomType->atomPolarizability).c_str()); + entry->SetAttribute("element" , pAtomType->element); + entry->SetAttribute("hybridization" , pAtomType->hybridization); + entry->SetAttribute("groupName" , pAtomType->groupName); +@@ -2035,6 +2040,7 @@ + typeElem->setAttribute(X("mass"), X(double2String(pAtomType->mass).c_str())); + typeElem->setAttribute(X("vdwRadius"), X(double2String(pAtomType->rvalue).c_str())); + typeElem->setAttribute(X("potentialWellDepth"), X(double2String(pAtomType->evalue).c_str())); ++ typeElem->setAttribute(X("atomPolarizability"), X(double2String(pAtomType->atomPolarizability).c_str())); + typeElem->setAttribute(X("element"), X(pAtomType->element.c_str())); + typeElem->setAttribute(X("hybridization"), X(pAtomType->hybridization.c_str())); + typeElem->setAttribute(X("groupName"), X(pAtomType->groupName.c_str())); +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/pdbParser.cpp amber11/AmberTools/src/mtkpp/src/Parsers/pdbParser.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/pdbParser.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/pdbParser.cpp 2012-03-03 20:03:01.410032567 +0200 +@@ -840,6 +840,7 @@ + for (atomIterator a = atomList.begin(); a != atomList.end(); a++) { + pAtom = *a; + pSubMolecule = pAtom->getParent(); ++ //std::cout << pSubMolecule->getColIndex() << std::endl; + char temp[100]; + + char tmp_element[3]; +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/prepParser.cpp amber11/AmberTools/src/mtkpp/src/Parsers/prepParser.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/prepParser.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/prepParser.cpp 2012-03-03 20:03:01.411032567 +0200 +@@ -66,71 +66,106 @@ + prepParser::~prepParser() {} + + // ========================================================= +-// Function : Read +-// --------------------------------------------------------- +-// parsers a prep file +-// --------------------------------------------------------- +-// Format : +-// ========================================================= +-void prepParser::Read(const std::string &prepfile, stdGroup* pStdGroup) +-{ +- std::string errorMessage = " Reading " + prepfile + " " + +- pStdGroup->getName() + " ... implement "; +- errorLogger.throwError("prepParser", errorMessage, 1); +-} +- +-// ========================================================= +-// Function : Read ++// Function : openFile + // --------------------------------------------------------- +-// parsers a prep file ++// open a prep file + // --------------------------------------------------------- + // Format : + // ========================================================= +-void prepParser::Read(const std::string &prepfile, stdFrag* pStdFrag) ++int prepParser::openFile(const std::string &prepfile) + { +- errorLogger.throwError("prepParser", "Read", INFO); +- +- std::ifstream iprep; + iprep.open(prepfile.c_str()); + ++ //std::cout << "\n\n prepParser::openFile " << prepfile << std::endl; + if (!iprep) { + setError(1); + std::string errorMessage = " Error, Can't Find " + prepfile; + setErrorMessage(errorMessage); + errorLogger.throwError("prepParser::Read", errorMessage, 1); +- return; ++ return 1; + } + + std::string fileline; +- std::string title; +- std::string atom; +- std::string buffer(80,'*'); + + // SKIP FIRST TWO LINES + getline(iprep,fileline); + getline(iprep,fileline); ++ ++ return 0; ++} ++ ++// ========================================================= ++// Function : read fragment header section ++// --------------------------------------------------------- ++// ++// --------------------------------------------------------- ++// Format : ++// ========================================================= ++int prepParser::readHeader(std::string &name, std::string &symbol, double &charge) ++{ ++ std::string fileline; ++ + getline(iprep,fileline); +- //std::string name = stripString(fileline," "); +- //pStdFrag->setName(fileline); ++ if (stripString(fileline, " ") == "STOP") return 1; ++ ++ name = stripString(fileline," "); ++ ++ // blank line + getline(iprep,fileline); ++ ++ // symbol + getline(iprep,fileline); + std::vector<std::string> splitLine; + splitString(fileline, " ", splitLine, 0); +- pStdFrag->setSymbol(splitLine[0]); ++ symbol = splitLine[0]; ++ ++ // + getline(iprep,fileline); ++ ++ // charge + getline(iprep,fileline); +- //pStdFrag->setCharge(splitLine[0]); ++ charge = string2Double(stripString(fileline, " ")); ++ ++ return 0; ++} ++ ++// ========================================================= ++// Function : read fragment main section ++// --------------------------------------------------------- ++// ++// --------------------------------------------------------- ++// Format : ++// ========================================================= ++void prepParser::readFragment(stdFrag* pStdFrag) ++{ ++ std::string fileline; ++ ++ std::vector<stdBond*> todos; + + while (iprep) { + getline(iprep,fileline); +- if (fileline == "") break; ++ ++ std::string filelineTest = stripString(fileline, " "); ++ if (filelineTest == "") break; ++ ++//std::cout << "|" << fileline << "|" << std::endl; + + std::vector<std::string> splitstring; + splitString(fileline, " ", splitstring, 0); + if (atoi(splitstring[0].c_str()) > 3) { + stdAtom* pStdAtom = pStdFrag->addStdAtom(); + int atIndex = atoi(splitstring[0].c_str()) - 3; +- std::string atomName = fileline.substr(6,4); ++ ++//////// ++ //std::string atomName = fileline.substr(6,4); ++ std::string atomName = splitstring[1]; ++ if (atomName.size() == 1) atomName = " " + atomName + " "; ++ else if (atomName.size() == 2) atomName = " " + atomName + " "; ++ else if (atomName.size() == 3) atomName = " " + atomName; ++ ++//std::cout << "|" << atomName << "|" << std::endl; ++///////// ++ + std::string atomType = splitstring[2]; + std::string atomChain = splitstring[3]; + +@@ -170,32 +205,54 @@ + pStdBond->atom1 = pStdAtom->index; + pStdBond->atom2 = pStdAtom->bond12; + pStdBond->type = 1; ++ + if (pStdAtom->atSymbol == "H") { + if (pStdAtom->bond12 > 0) { + stdAtom* pStdBondedAtom = pStdFrag->getStdAtom(pStdAtom->bond12); ++ ++ if (pStdBondedAtom) { + std::string bondedAtomSymbol = pStdBondedAtom->atSymbol; + if (bondedAtomSymbol == "N" or bondedAtomSymbol == "O" or bondedAtomSymbol == "S") { + pStdBond->kind = 1; + } + } ++ else { ++ todos.push_back(pStdBond); ++ } ++ } + } + else { + pStdBond->kind = 0; + } ++ + pStdBond->topology = 2; + pStdBond->stereo = 0; + pStdBond->length = pStdAtom->bondLength; + } + } + ++ for (unsigned int x = 0; x < todos.size(); x++) { ++ stdAtom* pStdBondedAtom1 = pStdFrag->getStdAtom(todos[x]->atom1); ++ stdAtom* pStdBondedAtom2 = pStdFrag->getStdAtom(todos[x]->atom2); ++ if (pStdBondedAtom1 and pStdBondedAtom2) { ++ std::string bondedAtomSymbol = pStdBondedAtom2->atSymbol; ++ if (bondedAtomSymbol == "N" or bondedAtomSymbol == "O" or bondedAtomSymbol == "S") { ++ todos[x]->kind = 1; ++ } ++ } ++ } ++ + // Read charge, alias, loop, and improper data + while (iprep) { + getline(iprep,fileline); ++//std::cout << "!" << fileline << "!" << std::endl; + if (fileline != "") { + if (fileline.substr(0,6) == "CHARGE") { + while (iprep) { + getline(iprep,fileline); +- if (fileline == "") break; ++ ++ std::string filelineTest = stripString(fileline, " "); ++ if (filelineTest == "") break; + } + } + else if (fileline.substr(0,5) == "ALIAS") { +@@ -252,7 +309,7 @@ + else { + std::string errorMessage = " ALIAS Tag Error ... exiting "; + errorLogger.throwError("prepParser::Read", errorMessage, 1); +- //exit(0); ++ + std::stringstream ss; + ss << "prepParser::Read"<< errorMessage; + throw MTKException(ss.str()); +@@ -263,11 +320,20 @@ + else if (fileline.substr(0,4) == "LOOP") { + while (iprep) { + getline(iprep,fileline); +- if (fileline == "") break; ++ ++ std::string filelineTest = stripString(fileline, " "); ++ if (filelineTest == "") break; ++ ++ //if (fileline == "") break; + + std::vector<std::string> atomNames; + splitString(fileline, " ", atomNames, 0); +- ++/* ++for (unsigned int x = 0; x <atomNames.size();x++){ ++ std::cout << atomNames[x] <<std::endl; ++} ++pStdFrag->print(); ++*/ + std::vector< std::vector<std::string> > possibleNames; + for (int d = 0; d < 2; d++) { + int atNameSize = atomNames[d].size(); +@@ -315,17 +381,22 @@ + else { + std::string errorMessage = " LOOP Tag Error ... exiting "; + errorLogger.throwError("prepParser::Read", errorMessage, 1); +- //exit(0); +- + std::stringstream ss; + ss << "prepParser::Read"<< errorMessage; + throw MTKException(ss.str()); + } + } + } ++ else if (fileline.substr(0,4) == "DONE") { ++ break; ++ } + else if (fileline.substr(0,8) == "IMPROPER") { + while (iprep) { + getline(iprep,fileline); ++ ++ std::string filelineTest = stripString(fileline, " "); ++ if (filelineTest == "") break; ++ + if (fileline == "") break; + + std::vector<std::string> atomNames; +@@ -424,7 +495,6 @@ + else { + std::string errorMessage = " IMPROPER Tag Error ... exiting "; + errorLogger.throwError("prepParser::Read", errorMessage, 1); +- //exit(0); + + std::stringstream ss; + ss << "prepParser::Read" << errorMessage; +@@ -642,8 +712,112 @@ + } + // QBio end + } +- + errorLogger.throwError("prepParser::Read", eMessage, INFO); ++} ++ ++// ========================================================= ++// Function : Read ++// --------------------------------------------------------- ++// parsers a prep file ++// --------------------------------------------------------- ++// Format : ++// ========================================================= ++void prepParser::Read(const std::string &prepfile, stdGroup* pStdGroup) ++{ ++ int r = openFile(prepfile); ++ if (r == 1) return; ++ ++ while(iprep) { ++ std::string name = ""; ++ std::string symbol = ""; ++ double charge = 0.0; ++ int h = readHeader(name, symbol, charge); ++ if (h == 1) break; ++ ++ stdFrag* pStdFrag = pStdGroup->addStdFrag(); ++ if (!pStdFrag) { ++ setError(1); ++ std::string errorMessage = " Error creating fragment "; ++ setErrorMessage(errorMessage); ++ errorLogger.throwError("prepParser::Read", errorMessage, 1); ++ return; ++ } ++ ++ if (symbol.size() == 1) symbol = symbol + " "; ++ if (symbol.size() == 2) symbol = symbol + " "; ++ if (symbol.size() > 3) symbol = symbol.substr(1,3); ++ ++ pStdFrag->setSymbol(symbol); // 3L code ++ //pStdFrag->setCode("P2XML"+name); // 8L code ++ pStdFrag->setName(name); // long name ++ pStdFrag->setType("m"); // fragment type ++ ++ //std::cout << " prepParser::Read " << name << " charge " << charge << " symbol " << symbol << std::endl; ++ readFragment(pStdFrag); ++ } ++ ++ iprep.close(); ++ ++ return; ++} ++ ++// ========================================================= ++// Function : Read ++// --------------------------------------------------------- ++// parsers a prep file ++// --------------------------------------------------------- ++// Format : ++// ========================================================= ++void prepParser::Read(const std::string &prepfile, stdFrag* pStdFrag) ++{ ++ errorLogger.throwError("prepParser", "Read", INFO); ++/* ++ std::ifstream iprep; ++ iprep.open(prepfile.c_str()); ++ ++ if (!iprep) { ++ setError(1); ++ std::string errorMessage = " Error, Can't Find " + prepfile; ++ setErrorMessage(errorMessage); ++ errorLogger.throwError("prepParser::Read", errorMessage, 1); ++ return; ++ } ++*/ ++ ++ int r = openFile(prepfile); ++ if (r == 1) return; ++ ++ std::string fileline; ++ std::string title; ++ std::string atom; ++ //std::string buffer(80,'*'); ++ ++ // SKIP FIRST TWO LINES ++ //getline(iprep,fileline); ++ //getline(iprep,fileline); ++ ++/* ++ getline(iprep,fileline); ++ //std::string name = stripString(fileline," "); ++ //pStdFrag->setName(fileline); ++ getline(iprep,fileline); ++ getline(iprep,fileline); ++ std::vector<std::string> splitLine; ++ splitString(fileline, " ", splitLine, 0); ++ pStdFrag->setSymbol(splitLine[0]); ++ getline(iprep,fileline); ++ getline(iprep,fileline); ++ //pStdFrag->setCharge(splitLine[0]); ++*/ ++ ++ std::string name = ""; ++ std::string symbol = ""; ++ double charge = 0.0; ++ readHeader(name, symbol, charge); ++ ++ pStdFrag->setSymbol(symbol); ++ ++ readFragment(pStdFrag); + + iprep.close(); + } +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/prepParser.h amber11/AmberTools/src/mtkpp/src/Parsers/prepParser.h +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/prepParser.h 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/prepParser.h 2012-03-03 20:03:01.411032567 +0200 +@@ -89,6 +89,25 @@ + ~prepParser(); + + /*! ++ \brief open prep file ++ \param i input file ++ */ ++ int openFile(const std::string &i); ++ ++ /*! ++ \brief read fragment header section ++ \param name fragment name ++ \param symbol fragment symbol ++ \param charge fragment charge ++ */ ++ int readHeader(std::string &name, std::string &symbol, double &charge); ++ ++ /*! ++ \brief read fragment main section ++ */ ++ void readFragment(stdFrag* pStdFrag); ++ ++ /*! + \brief Read prep file + \param i input file + \param g stdGroup pointer +@@ -127,6 +146,9 @@ + + //! atom pointer + atom* pAtom; ++ ++ //! file handler ++ std::ifstream iprep; + }; + + } // MTKpp namespace +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/stdLibParser.cpp amber11/AmberTools/src/mtkpp/src/Parsers/stdLibParser.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/stdLibParser.cpp 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Parsers/stdLibParser.cpp 2012-03-03 20:03:01.412032567 +0200 +@@ -3280,7 +3280,7 @@ + // ------------------------------------------------------------ + // Write xml files using tinyxml + // ------------------------------------------------------------ +-void stdLibParser::Write(std::string fileName) ++void stdLibParser::Write(std::string fileName) // TinyXML + { + std::string errMessage = " Writing " + fileName; + errorLogger.throwError("stdLibParser", errMessage, INFO); +@@ -3512,6 +3512,7 @@ + TiXmlElement* impElem = new TiXmlElement("improper"); + frag->LinkEndChild(impElem); + ++ /* + if (improperList[k]->atom1 == -1) { + impElem->SetAttribute("Atom1", "p1"); + } +@@ -3520,7 +3521,8 @@ + } + else { + impElem->SetAttribute("Atom1", int2String(improperList[k]->atom1)); +- } ++ }*/ ++ impElem->SetAttribute("Atom1", int2String(improperList[k]->atom1)); + impElem->SetAttribute("Atom2", int2String(improperList[k]->atom2)); + impElem->SetAttribute("Atom3", int2String(improperList[k]->atom3)); + impElem->SetAttribute("Atom4", int2String(improperList[k]->atom4)); +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Statistics/Makefile.am amber11/AmberTools/src/mtkpp/src/Statistics/Makefile.am +--- amber11.orig/AmberTools/src/mtkpp/src/Statistics/Makefile.am 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Statistics/Makefile.am 2012-03-03 20:03:01.413032567 +0200 +@@ -1,4 +1,4 @@ +-DIAGNOSTICS_LD=-L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD=-L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB=-lDiagnostics + + INCLUDES = -I@boost_inc@ -I$(srcdir)/.. -I$(top_srcdir)/src/eigen3b2 +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Statistics/Makefile.in amber11/AmberTools/src/mtkpp/src/Statistics/Makefile.in +--- amber11.orig/AmberTools/src/mtkpp/src/Statistics/Makefile.in 2011-04-14 15:30:18.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/src/Statistics/Makefile.in 2012-03-03 20:03:01.413032567 +0200 +@@ -241,7 +241,7 @@ + top_builddir = @top_builddir@ + top_srcdir = @top_srcdir@ + xerces_path = @xerces_path@ +-DIAGNOSTICS_LD = -L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD = -L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB = -lDiagnostics + INCLUDES = -I@boost_inc@ -I$(srcdir)/.. -I$(top_srcdir)/src/eigen3b2 + lib_LTLIBRARIES = libStatistics.la +diff -urN amber11.orig/AmberTools/src/mtkpp/tests/Makefile.am amber11/AmberTools/src/mtkpp/tests/Makefile.am +--- amber11.orig/AmberTools/src/mtkpp/tests/Makefile.am 2011-04-14 15:30:19.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/tests/Makefile.am 2012-03-03 20:03:01.414032567 +0200 +@@ -42,25 +42,25 @@ + LAPACK_LIB=-llapack -lblas -lg2c + endif + +-MOLECULE_LD=-L$(top_builddir)/src/Molecule ++MOLECULE_LD=-L$(abs_top_builddir)/src/Molecule + MOLECULE_LIB=-lMolecule +-DIAGNOSTICS_LD=-L$(top_builddir)/src/Diagnostics ++DIAGNOSTICS_LD=-L$(abs_top_builddir)/src/Diagnostics + DIAGNOSTICS_LIB=-lDiagnostics +-LOG_LD=-L$(top_builddir)/src/Log ++LOG_LD=-L$(abs_top_builddir)/src/Log + LOG_LIB=-lLog +-GRAPH_LD=-L$(top_builddir)/src/Graph ++GRAPH_LD=-L$(abs_top_builddir)/src/Graph + GRAPH_LIB=-lGraph +-GA_LD=-L$(top_builddir)/src/GA ++GA_LD=-L$(abs_top_builddir)/src/GA + GA_LIB=-lGA +-MM_LD=-L$(top_builddir)/src/MM ++MM_LD=-L$(abs_top_builddir)/src/MM + MM_LIB=-lMM +-MINIMIZERS_LD=-L$(top_builddir)/src/Minimizers ++MINIMIZERS_LD=-L$(abs_top_builddir)/src/Minimizers + MINIMIZERS_LIB=-lMinimizers +-PARSERS_LD=-L$(top_builddir)/src/Parsers ++PARSERS_LD=-L$(abs_top_builddir)/src/Parsers + PARSERS_LIB=-lParsers +-STATS_LD=-L$(top_builddir)/src/Statistics ++STATS_LD=-L$(abs_top_builddir)/src/Statistics + STATS_LIB=-lStatistics +-TINYXML_LD=-L$(top_builddir)/src/tinyxml ++TINYXML_LD=-L$(abs_top_builddir)/src/tinyxml + TINYXML_LIB=-ltinyxml + + # INCLUDES = -I@boost_inc@ -I@xerces_path@/include -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_srcdir)/src/tinyxml -I$(top_srcdir)/src/Parsers -I$(top_srcdir)/src/Molecule -I$(top_srcdir)/src/Statistics -I$(top_srcdir)/src/Utils $(tmpQT_INCPATH) +diff -urN amber11.orig/AmberTools/src/mtkpp/tests/Makefile.in amber11/AmberTools/src/mtkpp/tests/Makefile.in +--- amber11.orig/AmberTools/src/mtkpp/tests/Makefile.in 2011-04-14 15:30:19.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/tests/Makefile.in 2012-03-03 20:03:01.414032567 +0200 +@@ -303,25 +303,25 @@ + @USE_QT_TRUE@tmpQT_LIBS = $(QT_LIBS) + @IS_LINUX_TRUE@LAPACK_LD = -L/usr/lib64 + @IS_LINUX_TRUE@LAPACK_LIB = -llapack -lblas -lg2c +-MOLECULE_LD = -L$(top_builddir)/src/Molecule ++MOLECULE_LD = -L$(abs_top_builddir)/src/Molecule + MOLECULE_LIB = -lMolecule +-DIAGNOSTICS_LD = -L$(top_builddir)/src/Diagnostics ++DIAGNOSTICS_LD = -L$(abs_top_builddir)/src/Diagnostics + DIAGNOSTICS_LIB = -lDiagnostics +-LOG_LD = -L$(top_builddir)/src/Log ++LOG_LD = -L$(abs_top_builddir)/src/Log + LOG_LIB = -lLog +-GRAPH_LD = -L$(top_builddir)/src/Graph ++GRAPH_LD = -L$(abs_top_builddir)/src/Graph + GRAPH_LIB = -lGraph +-GA_LD = -L$(top_builddir)/src/GA ++GA_LD = -L$(abs_top_builddir)/src/GA + GA_LIB = -lGA +-MM_LD = -L$(top_builddir)/src/MM ++MM_LD = -L$(abs_top_builddir)/src/MM + MM_LIB = -lMM +-MINIMIZERS_LD = -L$(top_builddir)/src/Minimizers ++MINIMIZERS_LD = -L$(abs_top_builddir)/src/Minimizers + MINIMIZERS_LIB = -lMinimizers +-PARSERS_LD = -L$(top_builddir)/src/Parsers ++PARSERS_LD = -L$(abs_top_builddir)/src/Parsers + PARSERS_LIB = -lParsers +-STATS_LD = -L$(top_builddir)/src/Statistics ++STATS_LD = -L$(abs_top_builddir)/src/Statistics + STATS_LIB = -lStatistics +-TINYXML_LD = -L$(top_builddir)/src/tinyxml ++TINYXML_LD = -L$(abs_top_builddir)/src/tinyxml + TINYXML_LIB = -ltinyxml + + # INCLUDES = -I@boost_inc@ -I@xerces_path@/include -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_srcdir)/src/tinyxml -I$(top_srcdir)/src/Parsers -I$(top_srcdir)/src/Molecule -I$(top_srcdir)/src/Statistics -I$(top_srcdir)/src/Utils $(tmpQT_INCPATH) +diff -urN amber11.orig/AmberTools/src/mtkpp/tools/Makefile.am amber11/AmberTools/src/mtkpp/tools/Makefile.am +--- amber11.orig/AmberTools/src/mtkpp/tools/Makefile.am 2011-04-14 15:30:19.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/tools/Makefile.am 2012-03-03 20:03:01.417032565 +0200 +@@ -25,7 +25,7 @@ + tmpQT_LIBS = $(QT_LIBS) + endif + +-DIAGNOSTICS_LD = -L$(top_builddir)/src/Diagnostics ++DIAGNOSTICS_LD = -L$(abs_top_builddir)/src/Diagnostics + DIAGNOSTICS_LIB = -lDiagnostics + MOLECULE_LD = -L$(top_builddir)/src/Molecule + MOLECULE_LIB = -lMolecule +diff -urN amber11.orig/AmberTools/src/mtkpp/tools/Makefile.in amber11/AmberTools/src/mtkpp/tools/Makefile.in +--- amber11.orig/AmberTools/src/mtkpp/tools/Makefile.in 2011-04-14 15:30:19.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/tools/Makefile.in 2012-03-03 20:03:01.417032565 +0200 +@@ -392,7 +392,7 @@ + @USE_XERCES_TRUE@XERCES_LIB = -lxerces-c + @USE_QT_TRUE@tmpQT_INCPATH = $(QT_INCPATH) + @USE_QT_TRUE@tmpQT_LIBS = $(QT_LIBS) +-DIAGNOSTICS_LD = -L$(top_builddir)/src/Diagnostics ++DIAGNOSTICS_LD = -L$(abs_top_builddir)/src/Diagnostics + DIAGNOSTICS_LIB = -lDiagnostics + MOLECULE_LD = -L$(top_builddir)/src/Molecule + MOLECULE_LIB = -lMolecule +diff -urN amber11.orig/AmberTools/src/mtkpp/tools/MCPB.cpp amber11/AmberTools/src/mtkpp/tools/MCPB.cpp +--- amber11.orig/AmberTools/src/mtkpp/tools/MCPB.cpp 2011-04-14 15:30:19.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/tools/MCPB.cpp 2012-03-03 20:03:01.416032566 +0200 +@@ -67,6 +67,7 @@ + #include "Parsers/mtkppParser.h" + #include "Parsers/dMParser.h" + #include "Parsers/commLineOptions.h" ++#include "Parsers/StringManip.h" + + // - Log + #include "Log/errorHandler.h" +@@ -84,6 +85,12 @@ + + using namespace MTKpp; + ++std::string getEnvVar(std::string const& key) ++{ ++ char const* val = getenv(key.c_str()); ++ return val == NULL ? std::string() : std::string(val); ++} ++ + void printFunctionList() + { + std::string functionList = "\n MCPB Functions:\n"; +@@ -181,32 +188,32 @@ + functionList += " Find all metal centers in the collection\n"; + functionList += " syntax: findMetalCenters\n"; + functionList += "\n"; +- functionList += " g03Charges\n"; ++ functionList += " gaussianCharges\n"; + functionList += " Generate a Gaussian input file for partial-charge computation\n"; + functionList += " Optional: set the Gaussian job file name\n"; +- functionList += " syntax: g03Charges //cuCYM4 cuCYM4.com\n"; ++ functionList += " syntax: gaussianCharges //cuCYM4 cuCYM4.com\n"; + functionList += "\n"; +- functionList += " g03Mem\n"; +- functionList += " Set amount of memory requested for g03\n"; +- functionList += " syntax: g03Mem 3600MB\n"; ++ functionList += " gaussianMem\n"; ++ functionList += " Set amount of memory requested for Gaussian\n"; ++ functionList += " syntax: gaussianMem 3600MB\n"; + functionList += "\n"; +- functionList += " g03MoldenFormat\n"; ++ functionList += " gaussianMoldenFormat\n"; + functionList += " Request Gaussian log files formatted for viewing in Molden\n"; +- functionList += " (adds the GFINPUT and IOP(6/7=3) keywords)\n"; +- functionList += " syntax: g03MoldenFormat\n"; ++ functionList += " (adds the GFInput and IOp(6/7=3) keywords)\n"; ++ functionList += " syntax: gaussianMoldenFormat\n"; + functionList += "\n"; +- functionList += " g03nProc\n"; +- functionList += " Set number of processors requested for g03\n"; +- functionList += " syntax: g03nProc 2\n"; ++ functionList += " gaussianNProc\n"; ++ functionList += " Set number of processors requested for Gaussian\n"; ++ functionList += " syntax: gaussianNProc 2\n"; + functionList += "\n"; +- functionList += " g03OptAndFC\n"; ++ functionList += " gaussianOptAndFC\n"; + functionList += " Generate Gaussian input files for optimisation and force constants\n"; + functionList += " Optional: set the Gaussian job file name\n"; +- functionList += " syntax: g03OptAndFC //cuCYM4 cuCYM4.com\n"; ++ functionList += " syntax: gaussianOptAndFC //cuCYM4 cuCYM4.com\n"; + functionList += "\n"; +- functionList += " g03Verbosity\n"; ++ functionList += " gaussianVerbosity\n"; + functionList += " Set the verbosity of Gaussian output ([T]erse, [N]ormal, [P]rolix)\n"; +- functionList += " syntax: g03Verbosity [T|N|P]\n"; ++ functionList += " syntax: gaussianVerbosity [T|N|P]\n"; + functionList += "\n"; + functionList += " levelOfTheory\n"; + functionList += " Set Gaussian Theory Level\n"; +@@ -256,9 +263,9 @@ + functionList += " Read Formatted Checkpoint file\n"; + functionList += " syntax: readFormattedChkPtFile file.fchk\n"; + functionList += "\n"; +- functionList += " readG03Output\n"; +- functionList += " Read G03 Output\n"; +- functionList += " syntax: readG03Output cuCYM4.log\n"; ++ functionList += " readGaussianOutput\n"; ++ functionList += " Read Gaussian Output\n"; ++ functionList += " syntax: readGaussianOutput cuCYM4.log\n"; + functionList += "\n"; + functionList += " readMolZmatMapping\n"; + functionList += " Read Molecule <--> Z-Matrix mapping file\n"; +@@ -470,7 +477,7 @@ + else { + printHeader(std::cout, prog_name, authors); + clo->printUsage(); +- std::cout << " Please provide a MCPB file " << std::endl; ++ std::cout << " Please provide an MCPB file " << std::endl; + return 0; + } + +@@ -515,7 +522,9 @@ + std::string errorMessage = ""; + + std::vector<std::vector<std::string> > inputFileContents; ++ + int failure = readInputFile(inputFile, inputFileContents); ++ + if (failure) { + printHeader(std::cout, prog_name, authors); + clo->printUsage(); +@@ -660,7 +669,7 @@ + std::vector<std::vector<std::string> > sourceInputFileContents; + failure = readInputFile(cur[1], sourceInputFileContents); + if (failure) { +- errorMessage = " Error Reading File " + cur[1]; ++ errorMessage = " Error reading file " + cur[1]; + MTKpp::errorLogger.throwError("MCPB::source", errorMessage, 1); + exit(1); + } +@@ -668,7 +677,7 @@ + sourceInputFileContents.end()); + } + else { +- errorMessage = " Error Reading File " + cur[1]; ++ errorMessage = " Error reading file " + cur[1]; + MTKpp::errorLogger.throwError("MCPB::source", errorMessage, 1); + exit(1); + } +@@ -742,6 +751,20 @@ + \endcode + */ + if ((inputFileContents[i].size() == 3)) { ++ //std::cout << "SET COMMAND " << inputFileContents[i][2] << std::endl; ++ if (inputFileContents[i][2].compare(0,1,"$") == 0) { ++ std::string envVariable = ""; ++ std::string tVar = inputFileContents[i][2]; ++ envVariable = getEnvVar(tVar.substr(1,tVar.size()-1)); ++ if (envVariable == "") { ++ std::cout << " Environment variable " << tVar.substr(1,tVar.size()-1) ++ << " is unset " << std::endl; ++ exit(1); ++ } ++ //std::cout << "Environment variable = " << envVariable << std::endl; ++ inputFileContents[i][2] = envVariable; ++ } ++ + variableMap[inputFileContents[i][1]] = inputFileContents[i][2]; + for (unsigned int j = i+1; j < inputFileContents.size(); j++) { + bool bReplaced = false; +@@ -813,6 +836,115 @@ + } + } + ++ else if (inputFileContents[i][0] == "printGroupCharge") { ++ /*! ++ @ingroup MCPB_commands ++ \code ++ Function: printFrag ++ ++ Description: Print fragment details ++ ++ syntax: printGroupCharge Zn-CCCC ++ ++ \endcode ++ */ ++ if ((inputFileContents[i].size() != 2) or (!pCollection)) { ++ MTKpp::errorLogger.throwError("MCPB::printGroupCharge", " Incorrect use of printGroupCharge ... exiting", MTK_ERROR); ++ exit(1); ++ } ++ else { ++ stdLibrary* pStdLibrary = pCollection->getStdLibrary(); ++ if (pStdLibrary) { ++ stdGroup* pStdGroup = pStdLibrary->getStdGroup(inputFileContents[i][1]); ++ std::cout << " Group " << pStdGroup->getName() << "\n"; ++ if (pStdGroup) { ++ molecule* pM = pStdGroup->getStdMolecule(); ++ if (pM) { ++ double groupCharge = 0.0; ++ std::vector<submolecule*> pSM = pM->getSubMoleculeList(); ++ //std::cout << " Number of submolecules = " << pSM.size() << "\n"; ++ for (unsigned int x = 0; x < pSM.size(); x++) { ++ stdFrag* pSF = pStdGroup->getStdFrag(pSM[x]->getName()); ++ if (pSF) { ++ std::cout << " " << pSF->getSymbol() << "\n"; ++ double fCharge = 0.0; ++ std::vector<atom*> pA = pSM[x]->getAtomList(); ++ for (unsigned int y = 0; y < pA.size(); y++) { ++ stdAtom* pSA = pA[y]->getStdAtom(); ++ if (pSA) { ++ fCharge += pSA->atmCharge; ++ std::cout << " |" << pSA->identity << "| " << pSA->atmCharge << "\n"; ++ } ++ else { ++ std::cout << " Error find std atom " << std::endl; ++ exit(1); ++ } ++ } ++ groupCharge += fCharge; ++ std::cout << " Total Fragment Charge " << pSF->getCharge() << "\n"; ++ } ++ } ++ /*std::vector<stdFrag*> pL = pStdGroup->getStdFragList(); ++ for (unsigned int x = 0; x < pL.size(); x++) { ++ std::cout << " Fragment " << pL[x]->getSymbol() << "\n"; ++ std::vector<stdAtom*> pL2 = pL[x]->getStdAtomList(); ++ double fCharge = 0.0; ++ for (unsigned int y = 0; y < pL2.size(); y++) { ++ fCharge += pL2[y]->atmCharge; ++ std::cout << " Atom " << pL2[y]->identity << " " << pL2[y]->atmCharge << "\n"; ++ } ++ groupCharge += fCharge; ++ //groupCharge += pL[x]->getCharge(); ++ std::cout << " Fragment Charge " << pL[x]->getCharge() << "\n"; ++ } ++ */ ++ ++ std::cout << " Total Charge = " << groupCharge << "\n" << std::endl; ++ } ++ } ++ } ++ } ++ } ++ ++ else if (inputFileContents[i][0] == "printFrag") { ++ /*! ++ @ingroup MCPB_commands ++ \code ++ Function: printFrag ++ ++ Description: Print fragment details ++ ++ syntax: printFrag Zn-CCCC CY1 ++ ++ \endcode ++ */ ++ if ((inputFileContents[i].size() != 3) or (!pCollection)) { ++ MTKpp::errorLogger.throwError("MCPB::printFrag", " Incorrect use of printFrag ... exiting", MTK_ERROR); ++ exit(1); ++ } ++ else { ++ stdLibrary* pStdLibrary = pCollection->getStdLibrary(); ++ if (pStdLibrary) { ++ stdGroup* pStdGroup = pStdLibrary->getStdGroup(inputFileContents[i][1]); ++ ++ double groupCharge = 0.0; ++ std::vector<stdFrag*> pL = pStdGroup->getStdFragList(); ++ for (unsigned int x = 0; x < pL.size(); x++) { ++ groupCharge += pL[x]->getCharge(); ++ ++ } ++ std::cout << " Group " << inputFileContents[i][1] << " charge = " ++ << groupCharge << std::endl; ++ ++ stdFrag* pStdFrag = pStdGroup->getStdFrag(inputFileContents[i][2]); ++ if (pStdFrag) { ++ std::cout << " Fragment " << inputFileContents[i][2] << " charge = " ++ << pStdFrag->getCharge() << std::endl; ++ } ++ } ++ } ++ } ++ + else if (inputFileContents[i][0] == "readPdb") { + /*! + @ingroup MCPB_commands +@@ -2227,7 +2359,8 @@ + double resCharge = 0.0; + for (unsigned int y = 0; y < residueAtoms.size(); y++) { + stdAtom* pLStdAtom = residueAtoms[y]->getStdAtom(); +- std::cout << " " << residueAtoms[y]->getName() << " " << residueAtoms[y]->getFileID() ++ std::cout << " " ++ << residueAtoms[y]->getName() << " " << residueAtoms[y]->getFileID() + << " " << residueAtoms[y]->getType() << " " << residueAtoms[y]->getValence() + << " " << residueAtoms[y]->getHybridization() << " "; + if (pLStdAtom) { +@@ -2437,6 +2570,11 @@ + molecule* selMol = pSel->getMol(); + pPdbParser->Write(inputFileContents[i][2], selMol); + } ++ else { ++ MTKpp::errorLogger.throwError("MCPB::writePdb", ++ " Error molecule was not selected ... exiting ", MTK_ERROR); ++ exit(1); ++ } + } + } + +@@ -2674,7 +2812,6 @@ + + syntax: basisSet GEN bs.txt + syntax: basisSet GEN.6D.7F bs.txt +- syntax: basisSet GENECP bs.txt pseudo.txt + \endcode + */ + if (inputFileContents[i].size() == 2) { +@@ -2685,6 +2822,11 @@ + pGParser->setBasisSet(inputFileContents[i][1]); + pGParser->setBasisSetFile(inputFileContents[i][2]); + } ++ else { ++ MTKpp::errorLogger.throwError("MCPB::basisSet", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } + } + + else if (inputFileContents[i][0] == "pseudoPotentials") { +@@ -2698,8 +2840,15 @@ + syntax: pseudoPotential pseudo.txt + \endcode + */ +- pGParser->addCommandOption("pseudo","read"); ++ if (inputFileContents[i].size() == 2) { ++ pGParser->addCommandOption("Pseudo","Read"); + pGParser->setPseudoPotentialFile(inputFileContents[i][1]); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::pseudoPotentials", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } ++ + } + + else if (inputFileContents[i][0] == "modRedundant") { +@@ -2713,8 +2862,14 @@ + syntax: modRedundant modred.txt + \endcode + */ +- pGParser->addCommandOption("opt","modredundant"); ++ if (inputFileContents[i].size() == 2) { ++ pGParser->addCommandOption("Opt","ModRedundant"); + pGParser->setModRedundantFile(inputFileContents[i][1]); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::modRedundant", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } + } + + else if (inputFileContents[i][0] == "clusterCharge") { +@@ -2728,7 +2883,13 @@ + syntax: clusterCharge cuCYM4 -3 + \endcode + */ ++ if (inputFileContents[i].size() == 3) { + pGParser->setCharge(atoi(inputFileContents[i][2].c_str())); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::clusterCharge", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } + } + + else if (inputFileContents[i][0] == "clusterSpin") { +@@ -2742,76 +2903,94 @@ + syntax: clusterSpin 0 + \endcode + */ ++ if (inputFileContents[i].size() == 2) { + pGParser->setMultiplicity(atoi(inputFileContents[i][1].c_str())); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::clusterSpin", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } + } + +- else if (inputFileContents[i][0] == "g03MoldenFormat") { ++ else if (inputFileContents[i][0] == "gaussianMoldenFormat") { + /*! + @ingroup MCPB_commands + \code +- Function: g03MoldenFormat ++ Function: gaussianMoldenFormat + + Description: Use Molden formatted output in log file. Print out + details of the basis set and the molecular orbitals. + +- syntax: g03MoldenFormat (bare word) ++ syntax: gaussianMoldenFormat (bare word) + \endcode + */ +- pGParser->addCommandOption("gfinput"); +- pGParser->addIop("iop(6/7=3)"); ++ pGParser->addCommandOption("GFInput"); ++ pGParser->addIop("IOp(6/7=3)"); + } + +- else if (inputFileContents[i][0] == "g03Verbosity") { ++ else if (inputFileContents[i][0] == "gaussianVerbosity") { + if (inputFileContents[i].size() == 2) { + pGParser->setVerbosity(inputFileContents[i][1]); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::gaussianVerbosity", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); + } + } + +- else if (inputFileContents[i][0] == "g03Mem") { ++ else if (inputFileContents[i][0] == "gaussianMem") { + /*! + @ingroup MCPB_commands + \code +- Function: g03Mem ++ Function: gaussianMem + +- Description: Set amount of memory requested for g03 ++ Description: Set amount of memory requested for Gaussian + +- syntax: g03Mem 3600MB ++ syntax: gaussianMem 3600MB + \endcode + */ + if (inputFileContents[i].size() == 2) { + pGParser->setMem(inputFileContents[i][1]); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::gaussianMem", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); + } + } + +- else if (inputFileContents[i][0] == "g03nProc") { ++ else if (inputFileContents[i][0] == "gaussianNProc") { + /*! + @ingroup MCPB_commands + \code +- Function: g03nProc ++ Function: gaussianNProc + +- Description: Set number of processors requested for g03 ++ Description: Set number of processors requested for Gaussian + +- syntax: g03nProc 2 ++ syntax: gaussianNProc 2 + \endcode + */ + if (inputFileContents[i].size() == 2) { +- pGParser->setnProc(inputFileContents[i][1]); ++ pGParser->setNProc(inputFileContents[i][1]); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::gaussianNProc", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); + } + } + +- else if (inputFileContents[i][0] == "g03OptAndFC") { ++ else if (inputFileContents[i][0] == "gaussianOptAndFC") { + /*! + @ingroup MCPB_commands + \code +- Function: g03OptAndFC ++ Function: gaussianOptAndFC + + Description: Set Gaussian input name + +- syntax: g03OptAndFC //cuCYM4 cuCYM4.com ++ syntax: gaussianOptAndFC //cuCYM4 cuCYM4.com + \endcode + */ + if ((inputFileContents[i].size() != 3) or (!pCollection)) { +- MTKpp::errorLogger.throwError("MCPB::g03OptAndFC", ++ MTKpp::errorLogger.throwError("MCPB::gaussianOptAndFC", + " Incorrect use ... exiting ", MTK_ERROR); + exit(1); + } +@@ -2819,7 +2998,7 @@ + selection* pSel = new selection(pCollection); + failure = pSel->parse(inputFileContents[i][1]); + if (failure) { +- MTKpp::errorLogger.throwError("MCPB::g03OptAndFC", ++ MTKpp::errorLogger.throwError("MCPB::gaussianOptAndFC", + " Error in selection parsing ... exiting ", MTK_ERROR); + exit(1); + } +@@ -2833,17 +3012,17 @@ + pGParser->setCartesian(1); + pGParser->setWriteMoleculeName(1); + pGParser->setWriteChargeAndMult(1); +- pGParser->addCommandOption("integral(Grid=UltraFine)"); ++ pGParser->addCommandOption("Integral", "(Grid=UltraFine)"); + +- std::vector<std::string> optOptions = pGParser->getCommandOption("opt"); ++ std::vector<std::string> optOptions = pGParser->getCommandOption("Opt"); + if (optOptions.size() == 0) { +- pGParser->addCommandOption("opt"); ++ pGParser->addCommandOption("Opt"); + } + +- pGParser->addCommandOption("scf", "xqc"); +- pGParser->addCommandOption("geom", "PrintInputOrient"); ++ pGParser->addCommandOption("SCF", "XQC"); ++ pGParser->addCommandOption("Geom", "PrintInputOrient"); + pGParser->Write(fileNameBase+"_opt.com", pSelMol); +- pGParser->removeCommandOption("opt"); ++ pGParser->removeCommandOption("Opt"); + + // k's + // Do not write coordinates, name, charge or multiplicity, +@@ -2851,40 +3030,40 @@ + pGParser->setNoCoords(); + pGParser->setWriteMoleculeName(0); + pGParser->setWriteChargeAndMult(0); +- pGParser->addCommandOption("freq", "noraman"); +- pGParser->addCommandOption("geom", "allcheckpoint"); +- pGParser->addCommandOption("guess", "read"); +- pGParser->addIop("iop(7/33=1)"); ++ pGParser->addCommandOption("Freq", "NoRaman"); ++ pGParser->addCommandOption("Geom", "AllCheckpoint"); ++ pGParser->addCommandOption("Guess", "Read"); ++ pGParser->addIop("IOp(7/33=1)"); + pGParser->Write(fileNameBase+"_fc.com", pSelMol); + pGParser->clearIop(); + + /* + // optimization +- pGParser->addCommandOption("opt", "z-matrix"); ++ pGParser->addCommandOption("Opt", "Z-Matrix"); + pGParser->generateZMatrix(pSelMol); + // [molecule index] = zmatrix index; + pGParser->writeMappingFile(fileNameBase+"_zmat.map"); +- pGParser->addCommandOption("geom", "PrintInputOrient"); ++ pGParser->addCommandOption("Geom", "PrintInputOrient"); + pGParser->Write(fileNameBase+"_opt.com", pSelMol); +- pGParser->removeCommandOption("opt"); ++ pGParser->removeCommandOption("Opt"); + */ + } + } + } + +- else if (inputFileContents[i][0] == "g03Charges") { ++ else if (inputFileContents[i][0] == "gaussianCharges") { + /*! + @ingroup MCPB_commands + \code +- Function: g03Charges ++ Function: gaussianCharges + + Description: Set Gaussian input name + +- syntax: g03Charges //cuCYM4 cuCYM4.com ++ syntax: gaussianCharges //cuCYM4 cuCYM4.com + \endcode + */ + if ((inputFileContents[i].size() != 3) or (!pCollection)) { +- MTKpp::errorLogger.throwError("MCPB::g03Charges", ++ MTKpp::errorLogger.throwError("MCPB::gaussianCharges", + " Incorrect use ... exiting ", MTK_ERROR); + exit(1); + } +@@ -2892,7 +3071,7 @@ + selection* pSel = new selection(pCollection); + failure = pSel->parse(inputFileContents[i][1]); + if (failure) { +- MTKpp::errorLogger.throwError("MCPB::g03Charges", ++ MTKpp::errorLogger.throwError("MCPB::gaussianCharges", + " Error in selection parsing ... exiting ", MTK_ERROR); + exit(1); + } +@@ -2907,14 +3086,14 @@ + + // q's + std::vector<std::string> popOptions; +- popOptions.push_back("mk"); +- popOptions.push_back("readradii"); +- pGParser->addCommandOption("pop", popOptions); +- pGParser->removeCommandOption("freq"); +- pGParser->addIop("iop(6/33=2)"); ++ popOptions.push_back("MK"); ++ popOptions.push_back("ReadRadii"); ++ pGParser->addCommandOption("Pop", popOptions); ++ pGParser->removeCommandOption("Freq"); ++ pGParser->addIop("IOp(6/33=2)"); + +- pGParser->addCommandOption("integral(Grid=UltraFine)"); +- pGParser->addCommandOption("scf", "xqc"); ++ pGParser->addCommandOption("Integral", "(Grid=UltraFine)"); ++ pGParser->addCommandOption("SCF", "XQC"); + + pGParser->Write(fileNameBase+"_mk.com", pSelMol); + +@@ -3053,7 +3232,8 @@ + result = find(bbb.begin(), bbb.end(), dd); + + if (result != bbb.end()) { +- freezingAtoms += "\n BBB " + submols[s]->getName() + " " + int2String(submols[s]->getSubMolId()) + " " + dd; ++ freezingAtoms += "\n BBB " + submols[s]->getName() + " " ++ + int2String(submols[s]->getSubMolId()) + " " + dd; + sprintf(temp,"%5d%10.5f", 1, pStdAtom_a->atmCharge); + orespAdd << temp << std::endl; + sprintf(temp,"%5d%5d", 1, subAtoms[a]->getIndex()); +@@ -3071,7 +3251,6 @@ + MTKpp::errorLogger.throwError("MCPB::respgenAdditions", + freezingAtoms, INFO); + } +- + orespAdd << "\n" << std::endl; + orespAdd.close(); + } +@@ -3099,22 +3278,22 @@ + } + } + +- else if (inputFileContents[i][0] == "readG03Output") { ++ else if (inputFileContents[i][0] == "readGaussianOutput") { + /*! + @ingroup MCPB_commands + \code +- Function: readG03Output ++ Function: readGaussianOutput + +- Description: Read G03 Output ++ Description: Read Gaussian Output + +- syntax: readG03Output cuCYM4.log ++ syntax: readGaussianOutput cuCYM4.log + \endcode + */ + if ((inputFileContents[i].size() == 2) or (pGParser)) { + pGParser->Read(inputFileContents[i][1], pSheet); + } + else { +- MTKpp::errorLogger.throwError("MCPB::readG03Output", ++ MTKpp::errorLogger.throwError("MCPB::readGaussianOutput", + " Incorrect use ... exiting ", MTK_ERROR); + exit(1); + } +@@ -3481,8 +3660,8 @@ + pGParser->setCartesian(0); + pGParser->setWriteMoleculeName(1); + pGParser->setWriteChargeAndMult(1); +- pGParser->addCommandOption("freq", "noraman"); +- pGParser->addIop("iop(7/33=1)"); ++ pGParser->addCommandOption("Freq", "NoRaman"); ++ pGParser->addIop("IOp(7/33=1)"); + pGParser->Write(inputFileContents[i][2], pSelMol); + pGParser->writeMappingFile(inputFileContents[i][2]+".map"); + } +@@ -3826,6 +4005,7 @@ + if (pStdFrag) { + bool doIt = pStdGroup->hasStdFrag(pStdFrag->getSymbol()); + if (doIt) { ++ //std::cout << " " << pStdFrag->getSymbol() << "\n"; + //submolecule* pStdSubmol = pStdMolecule->addSubMolecule(); + //pStdSubmol->copy(submolList[t]); + std::vector<atom*> lAtomList = submolList[t]->getAtomList(); +@@ -3834,7 +4014,8 @@ + if (pStdAtom) { + //std::cout << " |" << lAtomList[r]->getName() << "| " << lAtomList[r]->getZcharge() << "\n"; + pStdAtom->atmCharge = lAtomList[r]->getZcharge(); +- groupCharge += lAtomList[r]->getZcharge(); ++ //groupCharge += lAtomList[r]->getZcharge(); ++ groupCharge += pStdAtom->atmCharge; + } + } + } +@@ -3861,11 +4042,398 @@ + */ + } + updateRespChargesMessage += " Charge: " + double2String(groupCharge, 2); ++ //std::cout << " Group charge = " << double2String(groupCharge, 2) << "\n"; + MTKpp::errorLogger.throwError("MCPB::updateRespCharges", + updateRespChargesMessage, INFO); + } + } + ++ else if (inputFileContents[i][0] == "respgen") { ++ /*! ++ @ingroup MCPB_commands ++ \code ++ Function: respgen ++ ++ Description: Create resp1 and resp2 files (recreates functionality of respgen) ++ ++ syntax: respgen /COL/MOL Group fileName ++ \endcode ++ */ ++ ++ if ((inputFileContents[i].size() != 4) or (!pCollection)) { ++ MTKpp::errorLogger.throwError("MCPB::respgen", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } ++ else { ++ selection* pSel = new selection(pCollection); ++ failure = pSel->parse(inputFileContents[i][1]); ++ if (failure) { ++ MTKpp::errorLogger.throwError("MCPB::respgen", ++ " Error in selection parsing ... exiting ", MTK_ERROR); ++ exit(1); ++ } ++ ++ stdLibrary* pStdLibrary = pCollection->getStdLibrary(); ++ stdGroup* pStdGroup = 0; ++ if (pStdLibrary) { ++ pStdGroup = pStdLibrary->getStdGroup(inputFileContents[i][2]); ++ if (!pStdGroup) { ++ MTKpp::errorLogger.throwError("MCPB::respgen", ++ " Can't find stdGroup ... exiting ", MTK_ERROR); ++ exit(1); ++ } ++ } ++ else { ++ MTKpp::errorLogger.throwError("MCPB::respgen", ++ " Error in selection parsing ... exiting ", MTK_ERROR); ++ } ++ ++ if (pSel->getSelectionType() == 1) { ++ molecule* pSelMol = pSel->getMol(); ++ if (!pSelMol) { ++ std::cout << " Error in respgen selection \n"; ++ exit(1); ++ } ++ ++ std::vector<std::string>::iterator result; ++ ++ acParser* pAcParser = new acParser(); ++ pAcParser->Write(inputFileContents[i][3]+".ac", pCollection); ++ delete pAcParser; ++ ++ std::string bb0FileResp1 = inputFileContents[i][3] + "_bb0.resp1"; ++ std::string bb0FileResp2 = inputFileContents[i][3] + "_bb0.resp2"; ++ std::ofstream obb0FileResp1; ++ std::ofstream obb0FileResp2; ++ obb0FileResp1.open(bb0FileResp1.c_str()); ++ obb0FileResp2.open(bb0FileResp2.c_str()); ++ ++ std::string bb1FileResp1 = inputFileContents[i][3] + "_bb1.resp1"; ++ std::string bb1FileResp2 = inputFileContents[i][3] + "_bb1.resp2"; ++ std::ofstream obb1FileResp1; ++ std::ofstream obb1FileResp2; ++ obb1FileResp1.open(bb1FileResp1.c_str()); ++ obb1FileResp2.open(bb1FileResp2.c_str()); ++ ++ std::string bb2FileResp1 = inputFileContents[i][3] + "_bb2.resp1"; ++ std::string bb2FileResp2 = inputFileContents[i][3] + "_bb2.resp2"; ++ std::ofstream obb2FileResp1; ++ std::ofstream obb2FileResp2; ++ obb2FileResp1.open(bb2FileResp1.c_str()); ++ obb2FileResp2.open(bb2FileResp2.c_str()); ++ ++ std::string bb3FileResp1 = inputFileContents[i][3] + "_bb3.resp1"; ++ std::string bb3FileResp2 = inputFileContents[i][3] + "_bb3.resp2"; ++ std::ofstream obb3FileResp1; ++ std::ofstream obb3FileResp2; ++ obb3FileResp1.open(bb3FileResp1.c_str()); ++ obb3FileResp2.open(bb3FileResp2.c_str()); ++ ++ if (!obb0FileResp1 or !obb0FileResp2 or !obb1FileResp1 or !obb1FileResp2 or ++ !obb2FileResp1 or !obb2FileResp2 or !obb3FileResp1 or !obb3FileResp2) { ++ MTKpp::errorLogger.throwError("MCPB::respgen", ++ " Unable to open RESP files ... exiting ", MTK_ERROR); ++ exit(1); ++ } ++ ++ std::vector<molecule*> molList = pCollection->getMoleculeList(); ++ ++ std::string terminalFrags = ""; ++ char temp[100]; ++ bool bFirst = true; ++ for (unsigned int m = 0; m < molList.size(); m++) { ++ molecule* pMol = molList[m]; ++ std::vector<submolecule*> submols = pMol->getSubMoleculeList(); ++ for (unsigned int s = 0; s < submols.size(); s++) { ++ if (submols[s]->hasStdFrag()) { ++ stdFrag* pStdFrag = submols[s]->getStdFrag(); ++ if (pStdFrag->getParent()->getName() != inputFileContents[i][2]) { ++ if (bFirst) { ++ sprintf(temp,"%5d%10.5f\n", pStdFrag->numStdAtoms(), 0.0); ++ bFirst = false; ++ } ++ else { ++ sprintf(temp,"\n%5d%10.5f\n", pStdFrag->numStdAtoms(), 0.0); ++ } ++ ++ terminalFrags += std::string(temp); ++ std::vector<atom*> atomList = submols[s]->getAtomList(); ++ char temp2[80]; ++ int counter = 0; ++ for (unsigned int a = 0; a < atomList.size(); a++) { ++ if (counter > 7) { // was 6 ++ terminalFrags += "\n"; ++ counter = 0; ++ } ++ sprintf(temp2,"%5d%5d", 1, atomList[a]->getIndex()); ++ terminalFrags += std::string(temp2); ++ counter++; ++ } ++ //terminalFrags += "\n"; ++ } ++ } ++ } ++ } ++ //std::cout << terminalFrags << std::endl; ++ ++ std::string bb0 = terminalFrags + "\n"; ++ std::string bb1 = terminalFrags + "\n"; ++ std::string bb2 = terminalFrags + "\n"; ++ std::string bb3 = terminalFrags + "\n"; ++ ++ int lInd = 0; ++ for (unsigned int m = 0; m < molList.size(); m++) { ++ molecule* pMol = molList[m]; ++ ++ if (pMol->getName() == "Reference") continue; ++ ++ std::vector<submolecule*> submols = pMol->getSubMoleculeList(); ++ for (unsigned int s = 0; s < submols.size(); s++) { ++ if (submols[s]->hasStdFrag()) { ++ stdFrag* pStdFrag = submols[s]->getStdFrag(); ++ //std::cout << " respgen " << pStdFrag->getParent()->getName() << " " << inputFileContents[i][2] << " \n "; ++ if (pStdFrag->getParent()->getName() != inputFileContents[i][2]) continue; ++ std::vector<atom*> subAtoms = submols[s]->getAtomList(); ++ for (unsigned int a = 0; a < subAtoms.size(); a++) { ++ stdAtom* pStdAtom_a = subAtoms[a]->getStdAtom(); ++ lInd++; ++ // iBB == 1 ++ if (pStdAtom_a) { ++ std::string dd = pStdAtom_a->identity + ":" + pStdAtom_a->type; ++ ++ //result = find(bb_heavy.begin(), bb_heavy.end(), subAtoms[a]->getName()); ++ //result = find(bb_heavy.begin(), bb_heavy.end(), pStdAtom_a->identity); ++ result = find(bb_heavy.begin(), bb_heavy.end(), dd); ++ ++ if (result != bb_heavy.end()) { ++ sprintf(temp,"%5d%10.5f\n", 1, pStdAtom_a->atmCharge); ++ //freezingAtoms += "\n BB Heavy " + submols[s]->getName() + " " + int2String(submols[s]->getSubMolId()) + " " + dd; ++ //std::cout << "\n BB Heavy " + submols[s]->getName() + " " + int2String(submols[s]->getSubMolId()) + " " + dd; ++ //std::cout << dd << " " << subAtoms[a]->getName() << " ---> " << subAtoms[a]->getStdAtom()->type << std::endl; ++ //orespAdd << temp << std::endl; ++ bb1 += std::string(temp); ++ sprintf(temp,"%5d%5d\n", 1, subAtoms[a]->getIndex()); ++ //orespAdd << temp << std::endl; ++ bb1 += std::string(temp); ++ } ++ ++ // iBB == 2 ++ dd = pStdAtom_a->identity + ":" + pStdAtom_a->type; ++ ++ //result = find(bb.begin(), bb.end(), subAtoms[a]->getName()); ++ result = find(bb.begin(), bb.end(), dd); ++ ++ if (result != bb.end()) { ++ //freezingAtoms += "\n BB " + submols[s]->getName() + " " + int2String(submols[s]->getSubMolId()) + " " + dd; ++ sprintf(temp,"%5d%10.5f\n", 1, pStdAtom_a->atmCharge); ++ //orespAdd << temp << std::endl; ++ bb2 += std::string(temp); ++ sprintf(temp,"%5d%5d\n", 1, subAtoms[a]->getIndex()); ++ //orespAdd << temp << std::endl; ++ bb2 += std::string(temp); ++ } ++ // iBB == 3 ++ dd = pStdAtom_a->identity + ":" + pStdAtom_a->type; ++ ++ //result = find(bbb.begin(), bbb.end(), subAtoms[a]->getName()); ++ result = find(bbb.begin(), bbb.end(), dd); ++ ++ if (result != bbb.end()) { ++ //freezingAtoms += "\n BBB " + submols[s]->getName() + " " ++ // + int2String(submols[s]->getSubMolId()) + " " + dd; ++ sprintf(temp,"%5d%10.5f\n", 1, pStdAtom_a->atmCharge); ++ bb3 += std::string(temp); ++ //orespAdd << temp << std::endl; ++ sprintf(temp,"%5d%5d\n", 1, subAtoms[a]->getIndex()); ++ bb3 += std::string(temp); ++ //orespAdd << temp << std::endl; ++ } ++ } ++ else { ++ MTKpp::errorLogger.throwError("MCPB::respgen", ++ " Unknown option ... exiting ", MTK_ERROR); ++ } ++ } ++ } ++ } ++ } ++ ++ std::string resp1 = ""; ++ resp1 += "Resp charges for organic molecule\n"; ++ resp1 += "\n"; ++ resp1 += " &cntrl\n"; ++ resp1 += "\n"; ++ resp1 += " nmol = 1,\n"; ++ resp1 += " ihfree = 1,\n"; ++ resp1 += " ioutopt = 1,\n"; ++ resp1 += "\n"; ++ resp1 += " &end\n"; ++ resp1 += " 1.0\n"; ++ resp1 += "Resp charges for organic molecule\n"; ++ ++ //std::cout << pStdGroup->getCharge() << " " << pSelMol->getNumAtoms() << std::endl; ++ sprintf(temp,"%5d%5d\n", int(pStdGroup->getCharge()), pSelMol->getNumAtoms()); ++ resp1 += std::string(temp); ++ ++ std::vector<submolecule*> sList = pSelMol->getSubMoleculeList(); ++ typedef std::map<std::string, int>::iterator mapIterator; ++ ++ std::map<std::string, int> lMap; ++ int ind = 0; ++ for (unsigned int p = 0; p < sList.size(); p++) { ++ std::vector<atom*> aList = sList[p]->getAtomList(); ++ for (unsigned int a = 0; a < aList.size(); a++) { ++ if (!aList[a]->getStdAtom()) { ++ std::cout << " Error ... exiting()\n"; ++ exit(1); ++ } ++ int elNum = aList[a]->getAtomicNum(); ++ std::string key = ""; ++ if (elNum == 1) { ++ std::vector<atom*> hBondedAtoms = aList[a]->getBondedAtoms(); ++ if (hBondedAtoms.size() == 1) { ++ key = aList[a]->getParent()->getName() + ":" + hBondedAtoms[0]->getName() + ":" + aList[a]->getStdAtom()->type; ++ } ++ else { ++ key = aList[a]->getParent()->getName() + ":" + aList[a]->getStdAtom()->type; ++ } ++ } ++ else { ++ key = aList[a]->getParent()->getName() + ":" + aList[a]->getName(); ++ } ++ ++ mapIterator mi = lMap.find(key); ++ ++ int fg = 0; ++ if (mi != lMap.end()){ ++ fg = lMap[key]+1; ++ } ++ else { ++ lMap[key] = ind; ++ } ++ //sprintf(temp,"%4d %-11s%5d%5d\n", ind+1, key.c_str(), aList[a]->getAtomicNum(), fg); ++ sprintf(temp,"%5d%5d\n", aList[a]->getAtomicNum(), fg); ++ resp1 += std::string(temp); ++ ind++; ++ } ++ } ++ ++ std::string resp2 = ""; ++ ++ resp2 += "Resp charges for organic molecule\n"; ++ resp2 += "\n"; ++ resp2 += " &cntrl\n"; ++ resp2 += "\n"; ++ resp2 += " nmol = 1,\n"; ++ resp2 += " ihfree = 1,\n"; ++ resp2 += " ioutopt = 1,\n"; ++ resp2 += " iqopt = 2,\n"; ++ resp2 += " qwt = 0.001,\n"; ++ resp2 += "\n"; ++ resp2 += " &end\n"; ++ resp2 += " 1.0\n"; ++ resp2 += "Resp charges for organic molecule\n"; ++ ++ sprintf(temp,"%5d%5d\n", int(pStdGroup->getCharge()), pSelMol->getNumAtoms()); ++ resp2 += std::string(temp); ++ ++ ind = 0; ++ std::map<std::string, int> lMap2; ++ ++ for (unsigned int p = 0; p < sList.size(); p++) { ++ std::vector<atom*> aList = sList[p]->getAtomList(); ++ for (unsigned int a = 0; a < aList.size(); a++) { ++ ++ if (!aList[a]->getStdAtom()) { ++ std::cout << " Error ... exiting()\n"; ++ exit(1); ++ } ++ int elNum = aList[a]->getAtomicNum(); ++ std::string key = ""; ++ if (elNum == 1) { ++ std::vector<atom*> hBondedAtoms = aList[a]->getBondedAtoms(); ++ if (hBondedAtoms.size() == 1) { ++ key = aList[a]->getParent()->getName() + ":" + hBondedAtoms[0]->getName() + ":" + ++ aList[a]->getStdAtom()->type; ++ } ++ else { ++ key = aList[a]->getParent()->getName() + ":" + aList[a]->getStdAtom()->type; ++ } ++ } ++ else { ++ key = aList[a]->getParent()->getName() + ":" + aList[a]->getName(); ++ } ++ ++ mapIterator mi = lMap2.find(key); ++ ++ int fg = 0; ++ if (mi != lMap2.end()){ ++ fg = lMap2[key]+1; ++ } ++ else { ++ lMap2[key] = ind; ++ } ++ std::string atName = aList[a]->getName(); ++ std::string atType = aList[a]->getStdAtom()->type; ++ int atNum = aList[a]->getAtomicNum(); ++ ++ if (atName == " CH3" or atName == " CB " or containsSubStr(key, " CB :H1") or ++ containsSubStr(key, " CB :HC") or ++ containsSubStr(key, " CH3:HC") or containsSubStr(key, " CH3:H1") or ++ containsSubStr(key, "GLY: CA ")) {// or (atNum > 16)) { ++ //if (atName == " CH3" or atName == " CB " or atType == "H1" or atType == "HC") { ++ //sprintf(temp,"%4d %-11s%5d%5d\n", ind+1, key.c_str(), aList[a]->getAtomicNum(), fg); ++ sprintf(temp,"%5d%5d\n", aList[a]->getAtomicNum(), fg); ++ } ++ else { ++ //sprintf(temp,"%4d %-11s%5d%5d\n", ind+1, key.c_str(), aList[a]->getAtomicNum(), -99); ++ sprintf(temp,"%5d%5d\n", aList[a]->getAtomicNum(), -99); ++ } ++ resp2 += std::string(temp); ++ ++ ind++; ++ } ++ } ++ ++ std::string twoBlankLine = "\n\n"; ++ bb0 += twoBlankLine; ++ bb1 += twoBlankLine; ++ bb2 += twoBlankLine; ++ bb3 += twoBlankLine; ++ ++ obb0FileResp1 << resp1; ++ obb0FileResp1 << bb0; ++ obb0FileResp2 << resp2; ++ obb0FileResp2 << bb0; ++ ++ obb1FileResp1 << resp1; ++ obb1FileResp1 << bb1; ++ obb1FileResp2 << resp2; ++ obb1FileResp2 << bb1; ++ ++ obb2FileResp1 << resp1; ++ obb2FileResp1 << bb2; ++ obb2FileResp2 << resp2; ++ obb2FileResp2 << bb2; ++ ++ obb3FileResp1 << resp1; ++ obb3FileResp1 << bb3; ++ obb3FileResp2 << resp2; ++ obb3FileResp2 << bb3; ++ ++ obb0FileResp1.close(); ++ obb0FileResp2.close(); ++ obb1FileResp1.close(); ++ obb1FileResp2.close(); ++ obb2FileResp1.close(); ++ obb2FileResp2.close(); ++ obb3FileResp1.close(); ++ obb3FileResp2.close(); ++ } ++ } ++ } ++ + else if (inputFileContents[i][0] == "addStdMol") { + /*! + @ingroup MCPB_commands +@@ -4496,63 +5064,63 @@ + table<double>* nmodeEVectors = pSheet->getTable("NMode EigenVectors"); + ublas::matrix<double> &nmodeEVectorsMatrixT = nmodeEVectors->getMatrix(); + +- table<double>* g03EValues = pSheet->getTable("Gaussian EigenValues"); +- ublas::matrix<double> &g03EValuesMatrix = g03EValues->getMatrix(); ++ table<double>* gaussianEValues = pSheet->getTable("Gaussian EigenValues"); ++ ublas::matrix<double> &gaussianEValuesMatrix = gaussianEValues->getMatrix(); + +- table<double>* g03EVectors = pSheet->getTable("Gaussian EigenVectors"); +- ublas::matrix<double> &g03EVectorsMatrixT = g03EVectors->getMatrix(); ++ table<double>* gaussianEVectors = pSheet->getTable("Gaussian EigenVectors"); ++ ublas::matrix<double> &gaussianEVectorsMatrixT = gaussianEVectors->getMatrix(); + + int nRowsNMode = nmodeEValues->getNumRows(); +- int nRowsG03 = g03EValues->getNumRows(); ++ int nRowsGaussian = gaussianEValues->getNumRows(); + + int nColsNMode = nmodeEVectors->getNumColumns(); +- int nColsG03 = g03EVectors->getNumColumns(); ++ int nColsGaussian = gaussianEVectors->getNumColumns(); + +- if (nRowsNMode != nRowsG03 and nColsNMode != nColsG03) { ++ if (nRowsNMode != nRowsGaussian and nColsNMode != nColsGaussian) { + std::cout << " PROBLEM " << std::endl; + } + else { + std::cout << " EIGENVALUES " << std::endl; + for (int z = 0; z < nRowsNMode; z++) { +- std::cout << nmodeEValuesMatrix(z, 0) << " " << g03EValuesMatrix(z, 0) << std::endl; ++ std::cout << nmodeEValuesMatrix(z, 0) << " " << gaussianEValuesMatrix(z, 0) << std::endl; + } + + //std::cout << " NMODE " << std::endl; + //nmodeEVectors->printMatrix(); + +- //std::cout << " G03 " << std::endl; +- //g03EVectors->printMatrix(); ++ //std::cout << " Gaussian " << std::endl; ++ //gaussianEVectors->printMatrix(); + //std::cout << " \n\n " << std::endl; + + // Normalize Eigenvector matrices + for (int zi = 0; zi < nRowsNMode; zi++) { + double normNMode = 0.0; +- double normG03 = 0.0; ++ double normGaussian = 0.0; + for (int zk = 0; zk < nColsNMode; zk++) { + normNMode += (nmodeEVectorsMatrixT(zi, zk) * nmodeEVectorsMatrixT(zi, zk)); +- normG03 += (g03EVectorsMatrixT(zi, zk) * g03EVectorsMatrixT(zi, zk)); ++ normGaussian += (gaussianEVectorsMatrixT(zi, zk) * gaussianEVectorsMatrixT(zi, zk)); + } + normNMode = sqrt(normNMode); +- normG03 = sqrt(normG03); ++ normGaussian = sqrt(normGaussian); + for (int zk = 0; zk < nColsNMode; zk++) { +- //std::cout << g03EVectorsMatrixT(zi, zk) << " " << normG03 << " " +- // << g03EVectorsMatrixT(zi, zk) / normG03 << " "; ++ //std::cout << gaussianEVectorsMatrixT(zi, zk) << " " << normGaussian << " " ++ // << gaussianEVectorsMatrixT(zi, zk) / normGaussian << " "; + double newValue1 = nmodeEVectorsMatrixT(zi, zk) / normNMode; +- double newValue2 = g03EVectorsMatrixT(zi, zk) / normG03; ++ double newValue2 = gaussianEVectorsMatrixT(zi, zk) / normGaussian; + nmodeEVectors->setCellValue(zi, zk, newValue1); +- g03EVectors->setCellValue(zi, zk, newValue2); +- //std::cout << g03EVectors->getCellValue(zi, zk) << std::endl; ++ gaussianEVectors->setCellValue(zi, zk, newValue2); ++ //std::cout << gaussianEVectors->getCellValue(zi, zk) << std::endl; + } + } + + ublas::matrix<double> &nmodeEVectorsMatrix = nmodeEVectors->getMatrix(); +- ublas::matrix<double> &g03EVectorsMatrix = g03EVectors->getMatrix(); ++ ublas::matrix<double> &gaussianEVectorsMatrix = gaussianEVectors->getMatrix(); + + //std::cout << " NMODE " << std::endl; + //nmodeEVectors->printMatrix(); + +- //std::cout << " G03 " << std::endl; +- //g03EVectors->printMatrix(); ++ //std::cout << " Gaussian " << std::endl; ++ //gaussianEVectors->printMatrix(); + //std::cout << " \n\n " << std::endl; + + // dot product +@@ -4563,12 +5131,12 @@ + double eN2 = 0.0; + double dff = 0.0; + for (int zi = 0; zi < nRowsNMode; zi++) { // NMode +- for (int zj = 0; zj < nRowsNMode; zj++) { // G03 ++ for (int zj = 0; zj < nRowsNMode; zj++) { // Gaussian + for (int zk = 0; zk < nColsNMode; zk++) { // Loop over coordinates in Eigenvector +- //std::cout << nmodeEVectorsMatrix(zi, zk) << " " << g03EVectorsMatrix(zj, zk) << " "; ++ //std::cout << nmodeEVectorsMatrix(zi, zk) << " " << gaussianEVectorsMatrix(zj, zk) << " "; + eN += (nmodeEVectorsMatrix(zi, zk) * nmodeEVectorsMatrix(zi, zk)); +- eN2 += (g03EVectorsMatrix(zj, zk) * g03EVectorsMatrix(zj, zk)); +- dotProduct += (nmodeEVectorsMatrix(zi, zk) * g03EVectorsMatrix(zj, zk)); ++ eN2 += (gaussianEVectorsMatrix(zj, zk) * gaussianEVectorsMatrix(zj, zk)); ++ dotProduct += (nmodeEVectorsMatrix(zi, zk) * gaussianEVectorsMatrix(zj, zk)); + } + //std::cout << " eN = " << sqrt(eN) << " eN2 = " << sqrt(eN2) << " "; + std::cout << zi << " - " << zj << " " << dotProduct << " " << dotProductMax << std::endl; +@@ -4582,11 +5150,11 @@ + } + dotProduct = 0.0; + } +- double dffL = nmodeEValuesMatrix(zi, 0) - g03EValuesMatrix(dotProductMaxIndex, 0); ++ double dffL = nmodeEValuesMatrix(zi, 0) - gaussianEValuesMatrix(dotProductMaxIndex, 0); + dffL *= dffL; + std::cout << " nmode index = " << zi << " BestMatch = " << dotProductMaxIndex + << " => dotProduct =" << dotProductMax << " EVALUES: " +- << " " << nmodeEValuesMatrix(zi, 0) << " " << g03EValuesMatrix(dotProductMaxIndex, 0) << " " ++ << " " << nmodeEValuesMatrix(zi, 0) << " " << gaussianEValuesMatrix(dotProductMaxIndex, 0) << " " + << dffL + << std::endl; + +@@ -4617,7 +5185,7 @@ + } + + else { +- std::string unknownCommand = " Unknown command " + inputFileContents[i][0]; ++ std::string unknownCommand = " Unknown command: \"" + inputFileContents[i][0] + "\""; + MTKpp::errorLogger.throwError("MCPB", unknownCommand, MTK_ERROR); + } + } +@@ -4628,4 +5196,3 @@ + delete pSheet; + return 0; + } +- +diff -urN amber11.orig/AmberTools/src/mtkpp/tools/prep2xml.cpp amber11/AmberTools/src/mtkpp/tools/prep2xml.cpp +--- amber11.orig/AmberTools/src/mtkpp/tools/prep2xml.cpp 2011-04-14 15:30:19.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/tools/prep2xml.cpp 2012-03-03 20:03:01.418032565 +0200 +@@ -86,6 +86,7 @@ + clo->addUsage( " -a log file " ); + clo->addUsage( " -l hybridize name \n" ); + clo->addUsage( " flags: " ); ++ clo->addUsage( " -c convert only " ); + clo->addUsage( " -h help \n" ); + + // 4. SET THE OPTION STRINGS/CHARACTERS +@@ -97,6 +98,7 @@ + clo->setOption( "hyb", 'l' ); + clo->setOption( "log", 'a' ); + ++ clo->setFlag ( "convert", 'c' ); + clo->setFlag ( "help", 'h' ); + + // 5. PROVIDE THE COMMANDLINE +@@ -117,6 +119,11 @@ + std::string fragName = ""; + std::string molName = ""; + std::string logFile = ""; ++ bool bConvertOnly = 0; ++ ++ if ( clo->getFlag( "convert" ) || clo->getFlag( 'c' ) ) { ++ bConvertOnly = 1; ++ } + + std::string AMBERHOME = getenv("AMBERHOME"); + std::string parametersFile = AMBERHOME + "/dat/mtkpp/hybridize/labute.txt"; +@@ -166,13 +173,13 @@ + else if ( clo->getValue( "frag" ) != 0 ) { + fragName = clo->getValue( "frag" ); + } +- else { ++/* else { + printHeader(std::cout, prog_name, authors); + clo->printUsage(); + std::cout << " Please provide a fragment name " << std::endl; + return 0; + } +- ++*/ + if ( clo->getValue( "l" ) != 0 ) { + parametersFile = clo->getValue( "l" ); + } +@@ -186,13 +193,14 @@ + else if ( clo->getValue( "mol" ) != 0 ) { + molName = clo->getValue( "mol" ); + } ++/* + else { + printHeader(std::cout, prog_name, authors); + clo->printUsage(); + std::cout << " Please provide a molecule name " << std::endl; + return 0; + } +- ++*/ + if ( clo->getValue( "a" ) != 0 ) { + logFile = clo->getValue( "a" ); + } +@@ -307,6 +315,22 @@ + std::cout << " Incorrect use of prep2xml " << std::endl; + exit(1); + } ++ ++ ///////// ++ if (fragName == "") { ++ prepParser* pPrepParser = new prepParser(); ++ pPrepParser->Read(prepFile, pStdGroup); ++ delete pPrepParser; ++ ++ pStdLibParser->Write(libXmlFile, groupName); ++ delete pStdLibParser; ++ ++ // - Clean up - // ++ delete pCollection; ++ return 0; ++ } ++ /////////// ++ + stdFrag* pStdFrag = pStdGroup->addStdFrag(); + if (!pStdFrag) { + std::cout << " Incorrect use of prep2xml " << std::endl; +@@ -322,6 +346,15 @@ + pPrepParser->Read(prepFile, pStdFrag); + delete pPrepParser; + ++ if (bConvertOnly) { ++ pStdLibParser->Write(libXmlFile, groupName); ++ delete pStdLibParser; ++ ++ // - Clean up - // ++ delete pCollection; ++ return 0; ++ } ++ + int f = pStdFrag->generateCoordinates(); + if (f) { + std::cout << " Incorrect use of prep2xml " << std::endl; +@@ -443,7 +476,7 @@ + // atoms + for (unsigned int i = 0; i < atomList.size(); i++) { + stdAtoms[i]->kind = atomList[i]->getType(); +- std::cout << atomList[i]->getIndex() << " " << atomList[i]->getName() << " " << atomList[i]->getType() << std::endl; ++ //std::cout << atomList[i]->getIndex() << " " << atomList[i]->getName() << " " << atomList[i]->getType() << std::endl; + } + + // bonds +diff -urN amber11.orig/AmberTools/src/mtkpp/tools/stdLib2Sdf.cpp amber11/AmberTools/src/mtkpp/tools/stdLib2Sdf.cpp +--- amber11.orig/AmberTools/src/mtkpp/tools/stdLib2Sdf.cpp 2011-04-14 15:30:19.000000000 +0300 ++++ amber11/AmberTools/src/mtkpp/tools/stdLib2Sdf.cpp 2012-03-03 20:03:01.418032565 +0200 +@@ -42,6 +42,9 @@ + // - COMMAND LINE OPTIONS + #include "Parsers/commLineOptions.h" + ++// - Log ++#include "Log/errorHandler.h" ++ + // temp + #include "time.h" + +@@ -174,7 +177,7 @@ + } + + // Set errorLog stream to the log file +- //MTKpp::errorLogger.setStream(&oLog); ++ MTKpp::errorLogger.setStream(&oLog); + + // Print MTK++ copyright message + printHeader(oLog, prog_name, authors); +diff -urN amber11.orig/AmberTools/src/pbsa/pb_list.f amber11/AmberTools/src/pbsa/pb_list.f +--- amber11.orig/AmberTools/src/pbsa/pb_list.f 2011-04-14 15:30:19.000000000 +0300 ++++ amber11/AmberTools/src/pbsa/pb_list.f 2012-03-03 20:02:55.131034376 +0200 +@@ -949,7 +949,7 @@ + ymin == ZERO .and. ymax == ZERO .and. & + zmin == ZERO .and. zmax == ZERO ) newbox = .true. + +- if ( newbox ) then ++ if ( .not. ligand ) then + if ( ifcap == 0 .or. ifcap == 5 ) then + xmin = 9999.0; ymin = 9999.0; zmin = 9999.0 + xmax = -9999.0; ymax = -9999.0; zmax = -9999.0 +diff -urN amber11.orig/AmberTools/src/rism/safemem.f amber11/AmberTools/src/rism/safemem.f +--- amber11.orig/AmberTools/src/rism/safemem.f 2012-03-03 22:43:02.986777264 +0200 ++++ amber11/AmberTools/src/rism/safemem.f 2012-03-03 20:02:52.131035237 +0200 +@@ -62,7 +62,7 @@ + !BYTES_PER_KILOBYTES :: used to convert between bytes and KB + integer*8,parameter :: BYTES_PER_KB = 1024**1 + +- type(memTracker),private :: totalMem ++ type(memTracker),save,private :: totalMem + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/sci-chemistry/ambertools/files/ambertools-1.5-overflow.patch b/sci-chemistry/ambertools/files/ambertools-1.5-overflow.patch new file mode 100644 index 000000000..14455f1ba --- /dev/null +++ b/sci-chemistry/ambertools/files/ambertools-1.5-overflow.patch @@ -0,0 +1,30 @@ +diff -urN amber11.orig/AmberTools/src/nab/database.c amber11/AmberTools/src/nab/database.c +--- amber11.orig/AmberTools/src/nab/database.c 2011-03-10 20:12:15.000000000 +0200 ++++ amber11/AmberTools/src/nab/database.c 2012-03-03 23:59:25.225368331 +0200 +@@ -671,7 +671,7 @@ + + static Bool zbDBReadLine( db, sLine ) + DATABASE db; +-char* sLine; ++char sLine[MAXDATALINELEN]; + { + + +@@ -706,7 +706,7 @@ + + static Bool zbDBReadDataLine( db, sLine ) + DATABASE db; +-char* sLine; ++char sLine[MAXDATALINELEN]; + { + + +@@ -1135,7 +1135,7 @@ + char* PBuffer; + int iBufferInc; + { +-String sLine; ++String sLine[MAXDATALINELEN]; + + + |