From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1S3wAS-0000X5-NN for garchives@archives.gentoo.org; Sat, 03 Mar 2012 21:07:07 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 24ED7E05F9; Sat, 3 Mar 2012 21:06:56 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 63F43E05F9 for ; Sat, 3 Mar 2012 21:06:55 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3AC6F1B400E for ; Sat, 3 Mar 2012 21:06:54 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id C40E8E542A for ; Sat, 3 Mar 2012 21:06:52 +0000 (UTC) From: "Reinis Danne" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Reinis Danne" Message-ID: <1330808084.8ce9886cd5e61b892ee7e1087c09013e310a15ea.rei4dan@gentoo> Subject: [gentoo-commits] proj/sci:master commit in: sci-chemistry/ambertools/files/, sci-chemistry/ambertools/ X-VCS-Repository: proj/sci X-VCS-Files: sci-chemistry/ambertools/ChangeLog sci-chemistry/ambertools/ambertools-1.5-r3.ebuild sci-chemistry/ambertools/files/ambertools-1.5-bugfix_22-27.patch X-VCS-Directories: sci-chemistry/ambertools/files/ sci-chemistry/ambertools/ X-VCS-Committer: rei4dan X-VCS-Committer-Name: Reinis Danne X-VCS-Revision: 8ce9886cd5e61b892ee7e1087c09013e310a15ea X-VCS-Branch: master Date: Sat, 3 Mar 2012 21:06:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 9d6e1687-2367-4147-801f-df82c77d35cb X-Archives-Hash: 5b20d762af3812e46d1d19bde4d7137b commit: 8ce9886cd5e61b892ee7e1087c09013e310a15ea Author: Reinis Danne gmail com> AuthorDate: Sat Mar 3 20:54:44 2012 +0000 Commit: Reinis Danne gmail com> CommitDate: Sat Mar 3 20:54:44 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/sci.git;a=3Dc= ommit;h=3D8ce9886c sci-chemistry/ambertools: Add bugfixes 22-27 --- sci-chemistry/ambertools/ChangeLog | 8 +- sci-chemistry/ambertools/ambertools-1.5-r3.ebuild | 157 + .../files/ambertools-1.5-bugfix_22-27.patch | 3343 ++++++++++++++= ++++++ 3 files changed, 3507 insertions(+), 1 deletions(-) diff --git a/sci-chemistry/ambertools/ChangeLog b/sci-chemistry/ambertool= s/ChangeLog index 50f0545..0945272 100644 --- a/sci-chemistry/ambertools/ChangeLog +++ b/sci-chemistry/ambertools/ChangeLog @@ -1,7 +1,13 @@ # 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 $ =20 +*ambertools-1.5-r3 (03 Mar 2012) + + 03 Mar 2012; Reinis Danne +ambertools-1.5-r3.ebuil= d, + +files/ambertools-1.5-bugfix_22-27.patch: + Add bugfixes 22-27. + 26 Oct 2011; Reinis Danne files/ambertools-1.5-gentoo2.patch: Fix possible buffer overflow. diff --git a/sci-chemistry/ambertools/ambertools-1.5-r3.ebuild b/sci-chem= istry/ambertools/ambertools-1.5-r3.ebuild new file mode 100644 index 0000000..bebf36c --- /dev/null +++ b/sci-chemistry/ambertools/ambertools-1.5-r3.ebuild @@ -0,0 +1,157 @@ +# 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=3D4 + +inherit eutils fortran-2 toolchain-funcs + +DESCRIPTION=3D"A suite for carrying out complete molecular mechanics inv= estigations" +HOMEPAGE=3D"http://ambermd.org/#AmberTools" +SRC_URI=3D" + AmberTools-${PV}.tar.bz2" + +LICENSE=3D"GPL-2" +SLOT=3D"0" +KEYWORDS=3D"~amd64 ~x86 ~amd64-linux" +IUSE=3D"openmp X" + +RESTRICT=3D"fetch" + +RDEPEND=3D" + 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=3D"${RDEPEND} + dev-util/byacc + dev-libs/libf2c + sys-devel/ucpp" +S=3D"${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=3D"${S}" +} + +src_prepare() { + epatch \ + "${FILESDIR}/${P}-bugfix_1-21.patch" \ + "${FILESDIR}/${P}-bugfix_22-27.patch" \ + "${FILESDIR}/${P}-gentoo2.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)/libdrfft= w.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=3Dg77:fc=3D$(tc-getFC):g" \ + -e "s:\$netcdflib:$(pkg-config netcdf --libs):g" \ + -e "s:NETCDF=3D\$netcdf:NETCDF=3Dnetcdf.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=3D"${myconf} -noX11" + + use openmp && myconf=3D"${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=3D"${EPREFIX}/usr/share/ambertools" + EOF + doenvd "${T}"/99ambertools +} diff --git a/sci-chemistry/ambertools/files/ambertools-1.5-bugfix_22-27.p= atch b/sci-chemistry/ambertools/files/ambertools-1.5-bugfix_22-27.patch new file mode 100644 index 0000000..6df705c --- /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 amber= 11/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) +=20 +-error: +-echo Problem: check log files and try again +-exit(1) +diff -urN amber11.orig/AmberTools/examples/mtkpp/stats/pca1/run.stats.cs= h 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-0= 3 20:03:01.387032575 +0200 +@@ -3,12 +3,12 @@ + echo " MTK++ stats example" + echo " " +=20 +-../$AMBERHOME/bin/stats -i pca.stats \ +- -l pca.stats.log || goto error ++$AMBERHOME/bin/stats -i pca.stats \ ++ -l pca.stats.log || goto error +=20 + echo No errors detected + exit(0) +=20 + error: + echo Problem: check .out and try again +-exit(1) +\ Nav jaunu rindu faila beig=C4=81s ++exit(1) +diff -urN amber11.orig/AmberTools/src/configure amber11/AmberTools/src/c= onfigure +--- 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 need= ed if + debug symbols are requested) ++ -nopatch Do NOT run \$AMBERHOME/AT15_Amber11.py after confi= gure writes ++ the config.h file, even if Amber11 is found in the= directory. ++ This flag has no effect if Amber11 is not present. +=20 + Rarely used/tested NAB options: + -scalapack Use ScaLAPACK for linear algebra. Do not use in +@@ -165,6 +168,7 @@ + debug=3D'no' + optimise=3D'yes' + is_mac=3D'no' ++nopatch=3D'no' +=20 + #----------------------------------------------------------------------= -------- + # Architecture specific:=20 +@@ -216,6 +220,7 @@ + -nomtkpp) mtkpp=3D'';; + -debug) debug=3D'yes';; + -noopt) optimise=3D'no';; ++ -nopatch) nopatch=3D'yes';; + -help) usage;; + --help) usage;; + -h) usage;; +@@ -2144,7 +2149,7 @@ + fi +=20 + # For AmberTools 1.5 + Amber 11, print a message about running AT15_Amb= er11.py +-if [ -d ../../src/sander ]; then ++if [ -d ../../src/sander -a "$nopatch" =3D '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 +=20 ++if [ -d ../../src/sander -a "$nopatch" =3D 'no' ]; then ++ echo "" ++ echo " Running \$AMBERHOME/AT15_Amber11.py to patch config.h for bui= lding Amber 11." ++ echo " Check Amber11_Conversion.log for details of what was done. Ru= nning this script" ++ echo " a second time has no effect (positive or negative)" ++ echo "" ++ ../../AT15_Amber11.py > Amber11_Conversion.log 2>&1 ++fi ++ + exit +=20 +diff -urN amber11.orig/AmberTools/src/cpptraj/src/AmberRestart.cpp amber= 11/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/tim= e.\n"); + return 1; + } +- nread=3Dsscanf(buffer,"%5i%15lE%15lE",&restartAtoms,&restartTime,= &restartTemp); ++ nread=3Dsscanf(buffer,"%i %lE %lE",&restartAtoms,&restartTime,&re= startTemp); + if (nread<1) { + mprintf("Error: AmberRestart::open(): Getting restart atoms/tim= e.\n"); + return 1; +diff -urN amber11.orig/AmberTools/src/cpptraj/src/main.cpp amber11/Amber= Tools/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.9280= 30979 +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 +=20 + 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 20= 11-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(se= lf.rec_data[0]) ** 2 + _stdev(self.lig_data[0]) ** 2)) +=20 + sum =3D sum2 =3D 0 +- for i in range(len(self.com_data)): ++ for i in range(len(self.com_data[0])): + sum +=3D self.com_data[0][i] - self.rec_data[0][i] - self.lig_= data[0][i] + sum2 +=3D (self.com_data[0][i] - self.rec_data[0][i] - self.li= g_data[0][i]) ** 2 +=20 +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.0000= 00000 +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' +=20 +=20 + # Initialize some variables set by options. +@@ -16665,7 +16651,7 @@ + *) platform=3DUNKNOWN + is_unknown=3Dyes + echo 'ERROR: this platform is not supported at this time!' +- exit 1 ;; ++ exit ;; + esac + if test "$is_darwin" =3D "yes"; then + IS_DARWIN_TRUE=3D +@@ -17838,8 +17824,8 @@ + $as_echo "#define HAVE_ZLIB 1" >>confdefs.h +=20 + CFLAGS=3D$CFLAGS" -DHAVE_ZLIB" +- CXXFLAGS=3D$CXXFLAGS" -DHAVE_ZLIB -DHAVE_ZLIB" +- defines_string=3D$defines_string" -DHAVE_ZLIB -DHAVE_ZLIB" ++ CXXFLAGS=3D$CXXFLAGS" -DHAVE_ZLIB" ++ defines_string=3D$defines_string" -DHAVE_ZLIB" + FLIBS=3D$FLIBS" -lz" + else +=20 +diff -urN amber11.orig/AmberTools/src/mtkpp/configure.in amber11/AmberTo= ols/src/mtkpp/configure.in +--- amber11.orig/AmberTools/src/mtkpp/configure.in 2011-04-14 15:30:18.0= 00000000 +0300 ++++ amber11/AmberTools/src/mtkpp/configure.in 2012-03-03 20:03:01.400032= 571 +0200 +@@ -383,7 +383,7 @@ + *) platform=3DUNKNOWN + is_unknown=3Dyes + echo 'ERROR: this platform is not supported at this time!' +- exit 1 ;; ++ exit ;; + esac + AM_CONDITIONAL(IS_DARWIN, test "$is_darwin" =3D "yes") + AM_CONDITIONAL(IS_LINUX, test "$is_linux" =3D "yes") +@@ -457,8 +457,8 @@ + if test $ac_have_zlibh =3D yes; then + AC_DEFINE(HAVE_ZLIB, 1, [Define to 1 if ZLIB is available.]) + CFLAGS=3D$CFLAGS" -DHAVE_ZLIB" +- CXXFLAGS=3D$CXXFLAGS" -DHAVE_ZLIB -DHAVE_ZLIB" +- defines_string=3D$defines_string" -DHAVE_ZLIB -DHAVE_ZLIB" ++ CXXFLAGS=3D$CXXFLAGS" -DHAVE_ZLIB" ++ defines_string=3D$defines_string" -DHAVE_ZLIB" + FLIBS=3D$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 a= mber11/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 2= 0:03:01.400032571 +0200 +@@ -1,4 +1,4 @@ +-DIAGNOSTICS_LD=3D-L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD=3D-L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB=3D-lDiagnostics + INCLUDES =3D -I$(srcdir)/.. +=20 +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Minimizers/Makefile.in a= mber11/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 2= 0:03:01.401032571 +0200 +@@ -239,7 +239,7 @@ + top_builddir =3D @top_builddir@ + top_srcdir =3D @top_srcdir@ + xerces_path =3D @xerces_path@ +-DIAGNOSTICS_LD =3D -L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD =3D -L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB =3D -lDiagnostics + INCLUDES =3D -I$(srcdir)/.. + lib_LTLIBRARIES =3D libMinimizers.la +diff -urN amber11.orig/AmberTools/src/mtkpp/src/MM/Makefile.am amber11/A= mberTools/src/mtkpp/src/MM/Makefile.am +--- amber11.orig/AmberTools/src/mtkpp/src/MM/Makefile.am 2011-04-14 15:3= 0: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=3D-L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD=3D-L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB=3D-lDiagnostics +-LOG_LD=3D-L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD=3D-L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB=3D-lLog +=20 + INCLUDES =3D -I@boost_inc@ -I$(srcdir)/.. +diff -urN amber11.orig/AmberTools/src/mtkpp/src/MM/Makefile.in amber11/A= mberTools/src/mtkpp/src/MM/Makefile.in +--- amber11.orig/AmberTools/src/mtkpp/src/MM/Makefile.in 2011-04-14 15:3= 0: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 =3D @top_builddir@ + top_srcdir =3D @top_srcdir@ + xerces_path =3D @xerces_path@ +-DIAGNOSTICS_LD =3D -L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD =3D -L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB =3D -lDiagnostics +-LOG_LD =3D -L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD =3D -L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB =3D -lLog + INCLUDES =3D -I@boost_inc@ -I$(srcdir)/.. + lib_LTLIBRARIES =3D libMM.la +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/atomType.h ambe= r11/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:0= 3:01.402032570 +0200 +@@ -74,6 +74,9 @@ +=20 + //! + double evalue; ++ ++ //! Atomic polarizability in A**3 ++ double atomPolarizability; + }; +=20 + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +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-0= 4-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 =3D this->itsMoleculeList.begin(); + m !=3D this->itsMoleculeList.end(); m++) { + pMolecule =3D *m; ++ ++ if (pMolecule->getName() =3D=3D "Reference") { ++ continue; =20 ++ } ++ + std::vector subMolList =3D pMolecule->getSubMolecul= eList(); + for (sMolIterator c =3D subMolList.begin(); c !=3D subMolList.end= (); c++) { + pSubMolecule =3D *c; +@@ -3408,7 +3413,10 @@ + } + errMessage +=3D 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 =3D " + d2= s(localBond->size) +"\n"; +=20 + // Angles +@@ -3488,7 +3496,8 @@ + std::vector stdGrpList =3D this->pStdLibrary->getStd= GroupList(); +=20 + for (unsigned int i =3D 0; i < stdGrpList.size(); i++) { +-//std::cout << i << " " << stdGrpList.size() << " " << stdGrpList[i]->g= etName() << " " << 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 =3D stdGrpList[i]; +@@ -3515,6 +3524,7 @@ +=20 + // create new molecule + molecule* pNewMolecule =3D this->addMolecule(); ++ std::vector atomList; +=20 + // copy residues + std::vector metCens =3D itsMetalGroups[j]->= getMetalCenters(); +@@ -3536,6 +3546,10 @@ + addedResidues.push_back(primShellAtoms[l]->getParen= t()); + submolecule* pNewSubmolecule =3D pNewMolecule->addS= ubMolecule(); + pNewSubmolecule->copy(primShellAtoms[l]->getParent(= )); ++ std::vector atomListTmp =3D primShellAtoms[l= ]->getParent()->getAtomList(); ++ for (unsigned int i =3D 0 ; i < atomListTmp.size();= i++) { ++ atomList.push_back(atomListTmp[i]); ++ } + /* + std::cout << "Primary Shell " << primShellAtoms[l]->getParent()->getNam= e() << " " + << primShellAtoms[l]->getParent()->getSubMolId() << " " +@@ -3556,6 +3570,11 @@ + addedResidues.push_back(secShellAtoms[l]->getParent= ()); + submolecule* pNewSubmolecule =3D pNewMolecule->addS= ubMolecule(); + pNewSubmolecule->copy(secShellAtoms[l]->getParent()= ); ++ ++ std::vector atomListTmp =3D secShellAtoms[l]= ->getParent()->getAtomList(); ++ for (unsigned int i =3D 0 ; i < atomListTmp.size();= i++) { ++ atomList.push_back(atomListTmp[i]); ++ } + /* + std::cout << "Secondary Shell " << secShellAtoms[l]->getParent()->getNa= me() << " " + << secShellAtoms[l]->getParent()->getSubMolId() +@@ -3573,6 +3592,12 @@ + addedResidues.push_back(metalAtom->getParent()); + submolecule* pNewSubmolecule =3D pNewMolecule->addSub= Molecule(); + pNewSubmolecule->copy(metalAtom->getParent()); ++ ++ std::vector atomListTmp =3D metalAtom->getPa= rent()->getAtomList(); ++ for (unsigned int i =3D 0 ; i < atomListTmp.size();= i++) { ++ atomList.push_back(atomListTmp[i]); ++ } ++ + /* + std::cout << "Metal Atom " << metalAtom->getParent()->getName() << " " + << metalAtom->getParent()->getSubMolId() +@@ -3582,7 +3607,7 @@ + } + } +=20 +-//std::cout << " \n\n NEW MOLECULE \n"; ++//std::cout << "NEW MOLECULE \n"; +=20 + // Copy bonds + if (pNewMolecule) { +@@ -3646,16 +3671,26 @@ + } + } + } ++ ++//std::cout << " After copy " << std::endl; ++ + int nAtomsA =3D pStdMolecule->getNumAtoms(); + int nAtomsB =3D pNewMolecule->getNumAtoms(); ++ ++ int nBondsA =3D pStdMolecule->getNumBonds(); ++ int nBondsB =3D pNewMolecule->getNumBonds(); ++ + int nHeavyAtomsA =3D pStdMolecule->getNumHeavyAtoms(); + int nHeavyAtomsB =3D pNewMolecule->getNumHeavyAtoms(); +=20 ++//std::cout << "CHECK " << nAtomsA << " " << nAtomsB << " " << nBondsA = << " " << nBondsB << "\n"; + int w =3D 0; + if (nAtomsA !=3D nAtomsB) w++; + int h =3D 0; + if (nHeavyAtomsA !=3D nHeavyAtomsB) h++; +=20 ++//std::cout << " w =3D " << w << " h =3D " << h << std::endl; ++ + if (w or h) { + std::string eMes =3D " " + stdGrpList[i]->getName() + "= is not a match \n"; + eMes +=3D " std mol nAtoms: " + i2s(nAtomsA) + +@@ -3671,8 +3706,17 @@ + // Determine corresponences between two molecules + std::vector > correspondenceMatrices= ; + //int cor =3D 0; ++//std::cout << " superimpose " << std::endl; + superimpose* pSuperImpose =3D new superimpose(); +- int f =3D pSuperImpose->initializeCorrespondences(pSt= dMolecule, pNewMolecule, 3, correspondenceMatrices); ++ int f =3D 0; ++ try { ++ f =3D pSuperImpose->initializeCorrespondences(pStdM= olecule, pNewMolecule, 3, correspondenceMatrices); ++ } ++ catch (...) { ++ f =3D 1; ++ } ++ ++//std::cout << " after superimpose " << std::endl; +=20 + if (f !=3D 0) { + std::string eMes =3D " Error initializing correspon= dences\n " + stdGrpList[i]->getName() + " is not a match \n"; +@@ -3689,6 +3733,8 @@ + pNewMolecule->getCoordinates(CoordsB); + int cor =3D 0; +=20 ++//std::cout << " f =3D 0 " << std::endl; ++ + double dRMSD =3D pSuperImpose->rmsd(pStdMolecule, C= oordsB, correspondenceMatrices, cor); + std::string eMes =3D " " + stdGrpList[i]->getName()= + " is a match with rmsd of " + d2s(dRMSD) + "\n"; + MTKpp::errorLogger.throwError("collection::assignMe= talParameters", eMes, INFO); +@@ -3703,38 +3749,52 @@ + for (int t =3D 0; t < nHeavyAtoms; t++) { + for (int t2 =3D 0; t2 < nHeavyAtoms; t2++) { + if (correspondenceMatrices[cor][t*nHeavyAtoms= +t2]) { +-//std::cout << t+1 << ":" << t2+1 << "; |"; +- + atom* pA1 =3D molHeavyAtoms1[t]; + atom* pA2 =3D molHeavyAtoms2[t2]; +=20 + if (pA1 and pA2) { +-//atom* collection::getAtom(int number, bool atomIndex, bool fileId, bo= ol atomColIndex) +- ++ // getAtom(int number, bool atomIndex, bo= ol fileId, bool atomColIndex) + atom* pOrgAtom =3D this->getAtom(pA2->get= FileID(), 0, 1, 0); +-/* +-std::cout << pA1->getName() << "|" << pA2->getName() << "|" << pOrgAtom= ->getName() << " " +- << pA1->getParent()->getName() << "|" << pA2->getParent()->ge= tName() << "|" << pOrgAtom->getParent()->getName() << " |" +- << pA1->getFileID() << "|" << pA2->getFileID() << "|" << pOrg= Atom->getFileID() << "|" +- << pA1->getColIndex() << "|" << pA2->getColIndex() << "|" << = pOrgAtom->getColIndex()=20 +- << " |\n"; +-*/ +- pOrgAtom->getParent()->setName(pA1->getPa= rent()->getName()); ++ // atom* pOrgAtom =3D this->getAtom(pA2->= getColIndex(), 0, 0, 1); ++ ++ ++//std::cout << pA1->getName() << "|" << pA2->getName() << "|" << pOrgAt= om->getName() << " " ++// << pA1->getParent()->getName() << "|" << pA2->getParent()->= getName() << "|" << pOrgAtom->getParent()->getName() << " |" ++// << pA1->getFileID() << "|" << pA2->getFileID() << "|" << pO= rgAtom->getFileID() << "|" ++// << pA1->getColIndex() << "|" << pA2->getColIndex() << "|" <= < pOrgAtom->getColIndex()=20 ++// << " |\n"; ++ ++ //pOrgAtom->getParent()->setName(pA1->get= Parent()->getName()); ++ =20 ++ for (unsigned int i =3D 0 ; i < atomList.= size(); i++) { ++ if (atomList[i]->getFileID() =3D=3D p= A2->getFileID()) { ++ //std::cout << "setting " << atomL= ist[i]->getParent()->getName() << " to "=20 ++ // << pA1->getParent()->ge= tName() << "\n"; ++ atomList[i]->getParent()->setName(p= A1->getParent()->getName()); ++ } + } ++//std::cout << pOrgAtom->getParent() << " " << pOrgAtom->getParent()->= getName() << " "=20 ++//<< pA2->getFileID() ++// << " " << pOrgAtom->getParent()->getColIndex() << "\n"; + } + } + } + } ++ ++ } + } + } + } ++ + // delete new molecule ++ if (pNewMolecule) { + this->delMolecule(pNewMolecule); + } + } + } + } + } ++ } +=20 + ///////////////////////////////////////////////////////////////////////= //////// + ///////////////////////////////////////////////////////////////////////= //////// +@@ -4377,6 +4437,7 @@ + } + std::cout << " TOTAL CHARGE =3D " << localTotalCharge << std:= :endl; + */ ++ + } +=20 + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/hydrophobize.cp= p 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-0= 3 20:03:01.404032569 +0200 +@@ -315,7 +315,7 @@ + if (!vertices[i]->isVisited()) { + graph* subGraph =3D new graph(); +=20 +- std::cout << "\n " << vertices[i]->getIndex() << " "; ++// std::cout << "\n " << vertices[i]->getIndex() << " "; + molGraph->dfs(vertices[i]); +=20 + for (unsigned int j =3D 0; j < vertices.size(); j++) { +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/Makefile.am amb= er11/AmberTools/src/mtkpp/src/Molecule/Makefile.am +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/Makefile.am 2011-04-1= 4 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=3D-L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD=3D-L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB=3D-lDiagnostics +-GRAPH_LD=3D-L$(top_builddir)/src/Graph/$(SRCDIR) ++GRAPH_LD=3D-L$(abs_top_builddir)/src/Graph/$(SRCDIR) + GRAPH_LIB=3D-lGraph +-LOG_LD=3D-L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD=3D-L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB=3D-lLog +=20 + INCLUDES =3D -I@boost_inc@ -I$(srcdir)/.. -I$(top_srcdir)/src/eigen3b2 +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/Makefile.in amb= er11/AmberTools/src/mtkpp/src/Molecule/Makefile.in +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/Makefile.in 2011-04-1= 4 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 =3D @top_builddir@ + top_srcdir =3D @top_srcdir@ + xerces_path =3D @xerces_path@ +-DIAGNOSTICS_LD =3D -L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD =3D -L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB =3D -lDiagnostics +-GRAPH_LD =3D -L$(top_builddir)/src/Graph/$(SRCDIR) ++GRAPH_LD =3D -L$(abs_top_builddir)/src/Graph/$(SRCDIR) + GRAPH_LIB =3D -lGraph +-LOG_LD =3D -L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD =3D -L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB =3D -lLog + INCLUDES =3D -I@boost_inc@ -I$(srcdir)/.. -I$(top_srcdir)/src/eigen3b2 + lib_LTLIBRARIES =3D 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-0= 4-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 =3D ""; + pAtomType->rvalue =3D 0.0; + pAtomType->evalue =3D 0.0; ++ pAtomType->atomPolarizability =3D 0.0; + pAtomType->groupName =3D ""; + pAtomType->optimize =3D false; + this->itsTypeList.push_back(pAtomType); +@@ -184,6 +185,7 @@ + pAtomType->description =3D a->description; + pAtomType->rvalue =3D a->rvalue; + pAtomType->evalue =3D a->evalue; ++ pAtomType->atomPolarizability =3D a->atomPolarizability; + pAtomType->groupName =3D g; + pAtomType->optimize =3D a->optimize; +=20 +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/parameters.h am= ber11/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; +=20 ++ //! Atomic polarizability in A**3 ++ double atomPolarizability; ++ + //! group name + std::string groupName; +=20 +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/stdFrag.cpp amb= er11/AmberTools/src/mtkpp/src/Molecule/stdFrag.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Molecule/stdFrag.cpp 2011-04-1= 4 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 =3D symbol; + } + else { +- std::cout << " Length of Fragment Symbol =3D " << symbol.size() ++ std::cout << " Length of Fragment Symbol (" << symbol=20 ++ << ") =3D " << symbol.size() + << " --> Must be 3." << std::endl; + } + } +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/stdGroup.cpp am= ber11/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" +=20 + #include "molecule.h" ++#include "submolecule.h" +=20 + namespace MTKpp + { +@@ -258,5 +259,24 @@ + } + } +=20 ++// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ++// Function : getCharge() ++// ------------------------------------------------------------ ++//=20 ++// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D ++double stdGroup::getCharge() ++{ ++ double d =3D 0.0; ++ if (pMolecule) { ++ std::vector sList =3D this->pMolecule->getSubMolecu= leList(); ++ for (unsigned int p =3D 0; p < sList.size(); p++) { ++ this->pStdFrag =3D this->getStdFrag(sList[p]->getName()); ++ d +=3D this->pStdFrag->getCharge(); ++ //std::cout << this->pStdFrag->getSymbol() << " " << this->pStd= Frag->getCharge() << std::endl; ++ } ++ } ++ return d; ++} ++ + } // MTKpp namespace +=20 +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Molecule/stdGroup.h ambe= r11/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:0= 3:01.406032569 +0200 +@@ -160,6 +160,12 @@ + */ + molecule* getStdMolecule(); +=20 ++ /*! ++ \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 =3D false; + bBOND =3D false; + bANGLE =3D false; +@@ -105,118 +106,311 @@ + bIMPROPER =3D false; + bNONBON =3D false; +=20 ++ if ( (fileline.size() > 0) and (stripString(fileline, " ") !=3D "= ") ) { ++ std::vector splitstring; ++ splitString(fileline, " ", splitstring, 0); ++ ++ if (splitstring[0] =3D=3D "MASS") bMASS =3D true; ++ if (splitstring[0] =3D=3D "BOND") bBOND =3D true; ++ if (splitstring[0] =3D=3D "ANGL" or splitstring[0] =3D=3D "ANGL= E") bANGLE =3D true; ++ if (splitstring[0] =3D=3D "DIHE" or splitstring[0] =3D=3D "DIHE= DRAL") bDIHE =3D true; ++ if (splitstring[0] =3D=3D "IMPROP" or splitstring[0] =3D=3D "I= MPROPER") bIMPROPER =3D true; ++ if (splitstring[0] =3D=3D "NONB" or splitstring[0] =3D=3D "NONB= ON") bNONBON =3D true; ++ } ++/* ++ try { + if (fileline.substr(0,4) =3D=3D "MASS") bMASS =3D true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range MAS " << std::endl; ++ } ++ ++ try { + if (fileline.substr(0,4) =3D=3D "BOND") bBOND =3D true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range BOND " << std::endl; ++ } ++ ++ try { + if (fileline.substr(0,5) =3D=3D "ANGLE") bANGLE =3D true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range ANG" << std::endl; ++ } ++ ++ try { + if (fileline.substr(0,4) =3D=3D "DIHE") bDIHE =3D true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range DIHE " << std::endl; ++ } ++ ++ try { + if (fileline.substr(0,8) =3D=3D "IMPROPER") bIMPROPER =3D true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range IMP " << std::endl; ++ } ++ ++ try { + if (fileline.substr(0,6) =3D=3D "NONBON") bNONBON =3D true; ++ } ++ catch (std::out_of_range) { ++ std::cout << " out_of_range NONB" << std::endl; ++ } ++*/ +=20 + if (bMASS) { + getline(ifrcmod,fileline); +- while (fileline !=3D "") { ++ while (stripString(fileline, " ") !=3D "") { ++ //while (GetAlphaChar(fileline, 0) !=3D "0") { ++ std::vector splitLine; ++ splitString(fileline, " ", splitLine, 0); ++ if (splitLine.size() >=3D 2) { ++ for (unsigned int i =3D 0; i < 2; i++) { ++ splitLine[i] =3D stripString(splitLine[i], " "); ++ } + pAtomType =3D pParameters->addAtomType(); ++ pAtomType->name =3D splitLine[0]; + pAtomType->groupName =3D this->groupName; +- pAtomType->mass =3D strtod(fileline.substr(3,5).c_str(), 0); ++ pAtomType->mass =3D string2Double(splitLine[1]); //strtod(f= ileline.substr(3,5).c_str(), 0); ++ ++ if (splitLine.size() > 2) { ++ char *end; ++ double ret_double =3D strtod(splitLine[2].c_str(), &end); ++ if (!*end) { ++ pAtomType->atomPolarizability =3D ret_double; ++ } ++//std::cout << splitLine[2] << " " << ret_double << std::endl; ++ } ++ + getline(ifrcmod,fileline); + } + } ++ } +=20 + if (bBOND) { + getline(ifrcmod,fileline); +- while (fileline !=3D "") { +- std::string atomNames =3D fileline.substr(0,5); ++ //while (fileline !=3D "") { ++ while (stripString(fileline, " ") !=3D "") { ++ //std::string atomNames =3D fileline.substr(0,5); + std::vector splitLine; +- splitString(atomNames, "-", splitLine, 0); +- if (splitLine.size() =3D=3D 2) { +- for (unsigned int i =3D 0; i < 2; i++) { +- splitLine[i] =3D stripString(splitLine[i]," "); +- } ++ splitString(fileline, "-", splitLine, 0); ++ ++ std::vector splitLine2; ++ splitString(splitLine[1], " ", splitLine2, 0); ++ ++ //if (splitLine.size() =3D=3D 2) { ++ //for (unsigned int i =3D 0; i < 2; i++) { ++ // splitLine[i] =3D stripString(splitLine[i]," "); ++ //} + pBondParam =3D pParameters->addBondParam(); + pBondParam->groupName =3D this->groupName; +- pBondParam->atomType1 =3D std::string(splitLine[0]); +- pBondParam->atomType2 =3D std::string(splitLine[1]); +- pBondParam->keq =3D strtod(fileline.substr(7,5).c_str(), 0)= ; +- pBondParam->req =3D strtod(fileline.substr(16,5).c_str(), 0= ); ++ pBondParam->atomType1 =3D stripString(splitLine[0], " "); ++ pBondParam->atomType2 =3D stripString(splitLine2[0], " "); ++//std::cout << "|" << pBondParam->atomType1 << "|" << pBondParam->atomT= ype2 << "|" << std::endl; ++ pBondParam->keq =3D string2Double(splitLine2[1]); ++ pBondParam->req =3D string2Double(splitLine2[2]); ++ ++// pBondParam->keq =3D strtod(fileline.substr(7,5).c_str(), = 0); ++// pBondParam->req =3D 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::end= l; ++//std::cout << " BOND " << fileline.substr(7,5) << " " << fileline.sub= str(16,5) < splitLine; +- splitString(atomNames, "-", splitLine, 0); +- if (splitLine.size() =3D=3D 3) { +- for (unsigned int i =3D 0; i < 3; i++) { +- splitLine[i] =3D stripString(splitLine[i]," "); +- } ++ splitString(fileline, "-", splitLine, 0); ++ ++ std::vector splitLine2; ++ splitString(splitLine[2], " ", splitLine2, 0); ++ ++ //std::vector splitLine; ++ //splitString(atomNames, "-", splitLine, 0); ++ ++ //std::vector splitLine2; ++ //splitString(fileline, " ", splitLine2, 0); ++ ++ //if (splitLine.size() =3D=3D 3) { ++ //for (unsigned int i =3D 0; i < 3; i++) { ++ // splitLine[i] =3D stripString(splitLine[i]," "); ++ //} + pAngleParam =3D pParameters->addAngleParam(); + pAngleParam->groupName =3D this->groupName; +- pAngleParam->atomType1 =3D std::string(splitLine[0]); +- pAngleParam->atomType2 =3D std::string(splitLine[1]); +- pAngleParam->atomType3 =3D std::string(splitLine[2]); +- pAngleParam->keq =3D strtod(fileline.substr(11,7).c_str(), = 0); +- pAngleParam->req =3D strtod(fileline.substr(20,8).c_str(), = 0) * DEG2RAD; ++ pAngleParam->atomType1 =3D stripString(splitLine[0], " "); ++ pAngleParam->atomType2 =3D stripString(splitLine[1], " "); ++ pAngleParam->atomType3 =3D stripString(splitLine2[0], " "); ++//std::cout << "|" << pAngleParam->atomType1 << "|" << pAngleParam->ato= mType2 << "|" << pAngleParam->atomType3 << "|" << std::endl; ++ ++ pAngleParam->keq =3D string2Double(splitLine2[1]); ++ pAngleParam->req =3D string2Double(splitLine2[2]) * DEG2RAD= ; ++ ++ //pAngleParam->keq =3D strtod(fileline.substr(11,7).c_str()= , 0); ++ //pAngleParam->req =3D strtod(fileline.substr(20,8).c_str()= , 0) * DEG2RAD; ++ ++//std::cout << "\n " << fileline << std::endl; ++//std::cout << " ANGLE " << pAngleParam->atomType1 << " " << pAnglePara= m->atomType2 << " " << pAngleParam->atomType3 << " " << pAngleParam->keq = << " " << string2Double(splitLine2[2]) << std::endl; ++ + getline(ifrcmod,fileline); +- } ++ //} + } + } +=20 + if (bDIHE) { + getline(ifrcmod,fileline); +- while (fileline !=3D "") { +- std::string atomNames =3D fileline.substr(0,11); ++ //while (fileline !=3D "") { ++ while (stripString(fileline, " ") !=3D "") { ++ ++//std::cout << "\n " << fileline << std::endl; ++ ++//std::cout << fileline.substr(0,12) << std::endl; ++ ++// snip =3D str.substr(0,12);=20 ++//(3) erase the substring of 0..where str.erase(0,where);=20 ++ ++ std::string atTypes =3D fileline.substr(0,12); + std::vector splitLine; +- splitString(atomNames, "-", splitLine, 0); +- if (splitLine.size() =3D=3D 4) { +- for (unsigned int i =3D 0; i < 4; i++) { +- splitLine[i] =3D stripString(splitLine[i]," "); +- } ++ splitString(atTypes, "-", splitLine, 0); ++ ++/*for (unsigned int i =3D 0; i < splitLine.size(); i++) { ++ std::cout << splitLine[i] << std::endl; ++}*/ ++ ++ fileline.erase(0,12); ++ ++ std::vector splitLine2; ++ splitString(fileline, " ", splitLine2, 0); ++/* ++for (unsigned int i =3D 0; i < splitLine2.size(); i++) { ++ std::cout << splitLine2[i] << std::endl; ++}*/ ++ ++ //std::string atomNames =3D fileline.substr(0,11); ++ //std::vector splitLine; ++ //splitString(atomNames, "-", splitLine, 0); ++ ++ //if (splitLine.size() =3D=3D 4) { ++ //for (unsigned int i =3D 0; i < 4; i++) { ++ //splitLine[i] =3D stripString(splitLine[i], " "); ++ //} + pTorsionParam =3D pParameters->addTorsionParam(); + pTorsionParam->groupName =3D this->groupName; +- pTorsionParam->atomType1 =3D std::string(splitLine[0]); +- pTorsionParam->atomType2 =3D std::string(splitLine[1]); +- pTorsionParam->atomType3 =3D std::string(splitLine[2]); +- pTorsionParam->atomType4 =3D std::string(splitLine[3]); +- pTorsionParam->npth =3D atoi(fileline.substr(11,4).c_str())= ; +- pTorsionParam->Vn =3D strtod(fileline.substr(18,8).c_str(),= 0); +- pTorsionParam->gamma =3D strtod(fileline.substr(31,8).c_str= (), 0) * DEG2RAD; +- pTorsionParam->Nt =3D strtod(fileline.substr(42,12).c_str()= , 0); ++ pTorsionParam->atomType1 =3D stripString(splitLine[0], " ")= ; ++ pTorsionParam->atomType2 =3D stripString(splitLine[1], " ")= ; ++ pTorsionParam->atomType3 =3D stripString(splitLine[2], " ")= ; ++ pTorsionParam->atomType4 =3D stripString(splitLine[3], " ")= ; ++ ++ pTorsionParam->npth =3D string2Int(splitLine2[0]); ++ pTorsionParam->Vn =3D string2Double(splitLine2[1]); ++ pTorsionParam->gamma =3D string2Double(splitLine2[2]) * DEG= 2RAD; ++ pTorsionParam->Nt =3D string2Double(splitLine2[3]); ++ ++ //pTorsionParam->npth =3D atoi(fileline.substr(11,4).c_str(= )); ++ //pTorsionParam->Vn =3D strtod(fileline.substr(18,8).c_str(= ), 0); ++ //pTorsionParam->gamma =3D strtod(fileline.substr(31,8).c_s= tr(), 0) * DEG2RAD; ++ //pTorsionParam->Nt =3D strtod(fileline.substr(42,12).c_str= (), 0); ++ ++//std::cout << " DIHE " << pTorsionParam->atomType1 << " " << pTorsionP= aram->atomType2 << " " << pTorsionParam->atomType3 << " " << pTorsionPara= m->atomType4 << " " << pTorsionParam->npth << " " << pTorsionParam->Vn <= < " " << string2Double(splitLine2[2]) << " " << pTorsionParam->Nt << std:= :endl; ++=20 + getline(ifrcmod,fileline); +- } ++//std::cout << " DIHE LINE: " << fileline << std::endl; ++ //} + } + } +=20 + if (bIMPROPER) { + getline(ifrcmod,fileline); +- while (fileline !=3D "") { +- std::string atomNames =3D fileline.substr(0,11); ++ //while (fileline !=3D "") { ++ while (stripString(fileline, " ") !=3D "") { ++ ++ std::string atTypes =3D fileline.substr(0,12); + std::vector splitLine; +- splitString(atomNames, "-", splitLine, 0); +- if (splitLine.size() =3D=3D 4) { +- for (unsigned int i =3D 0; i < 4; i++) { +- splitLine[i] =3D stripString(splitLine[i]," "); +- } ++ splitString(atTypes, "-", splitLine, 0); ++ ++ fileline.erase(0,12); ++ ++ std::vector splitLine2; ++ splitString(fileline, " ", splitLine2, 0); ++ ++// std::vector splitLine; ++// splitString(fileline, "-", splitLine, 0); ++ ++// std::vector splitLine2; ++// splitString(splitLine[3], " ", splitLine2, 0); ++ ++ //std::string atomNames =3D fileline.substr(0,11); ++ //std::vector splitLine; ++ //splitString(atomNames, "-", splitLine, 0); ++ //if (splitLine.size() =3D=3D 4) { ++ //for (unsigned int i =3D 0; i < 4; i++) { ++ //splitLine[i] =3D stripString(splitLine[i]," "); ++ //} + pImproperParam =3D pParameters->addImproperParam(); + pImproperParam->groupName =3D this->groupName; +- pImproperParam->atomType1 =3D std::string(splitLine[0]); +- pImproperParam->atomType2 =3D std::string(splitLine[1]); +- pImproperParam->atomType3 =3D std::string(splitLine[2]); +- pImproperParam->atomType4 =3D std::string(splitLine[3]); +- pImproperParam->Vn =3D strtod(fileline.substr(18,8).c_str()= , 0); +- pImproperParam->gamma =3D strtod(fileline.substr(31,8).c_st= r(), 0) * DEG2RAD; +- pImproperParam->Nt =3D strtod(fileline.substr(42,12).c_str(= ), 0); ++ pImproperParam->atomType1 =3D stripString(splitLine[0], " "= ); ++ pImproperParam->atomType2 =3D stripString(splitLine[1], " "= ); ++ pImproperParam->atomType3 =3D stripString(splitLine[2], " "= ); ++ pImproperParam->atomType4 =3D stripString(splitLine[3], " "= ); ++ ++ pImproperParam->Vn =3D string2Double(splitLine2[0]); ++ pImproperParam->gamma =3D string2Double(splitLine2[1]) * DE= G2RAD; ++ pImproperParam->Nt =3D string2Double(splitLine2[2]); ++ ++ //pImproperParam->Vn =3D strtod(fileline.substr(18,8).c_str= (), 0); ++ //pImproperParam->gamma =3D strtod(fileline.substr(31,8).c_= str(), 0) * DEG2RAD; ++ //pImproperParam->Nt =3D strtod(fileline.substr(42,12).c_st= r(), 0); ++ ++//std::cout << "\n " << fileline << std::endl; ++//std::cout << " IMPR " << pImproperParam->atomType1 << " " << pImprope= rParam->atomType2 << " " << pImproperParam->atomType3 << " " << pImproper= Param->atomType4 << " " << pImproperParam->Vn << " " << string2Double(spl= itLine2[1]) << " " << pImproperParam->Nt << std::endl; ++ + getline(ifrcmod,fileline); +- } ++ //} + } + } + if (bNONBON) { ++ getline(ifrcmod,fileline); ++//std::cout << fileline << std::endl; ++ //while (fileline !=3D "") { ++ while (stripString(fileline, " ") !=3D "") { ++ std::vector splitLine; ++ splitString(fileline, " ", splitLine, 0); ++ if (splitLine.size() >=3D 3) { ++ for (unsigned int i =3D 0; i < 3; i++) { ++ splitLine[i] =3D stripString(splitLine[i], " "); ++ } ++//std::cout << " |" << splitLine[0] << "|" << std::endl; ++ ++//std::cout << "\n " << fileline << std::endl; ++ ++ pAtomType =3D pParameters->getAtomType(stripString(splitLin= e[0], " ")); ++ if (pAtomType) { ++ pAtomType->rvalue =3D string2Double(splitLine[1]); ++ pAtomType->evalue =3D string2Double(splitLine[2]); +=20 ++//std::cout << pAtomType->name << " " << pAtomType->rvalue << " " << pA= tomType->evalue << std::endl; ++ ++ } ++ else { ++ std::cout << " Can't find atom type " << std::endl; ++ } ++ getline(ifrcmod,fileline); ++ } ++ } + } + } ++ + ifrcmod.close(); + } +=20 +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/gaussianParser.c= pp amber11/AmberTools/src/mtkpp/src/Parsers/gaussianParser.cpp +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/gaussianParser.cpp 201= 1-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 @@ +=20 + this->bMem =3D 0; +=20 +- this->bnProc =3D 0; ++ this->bNProc =3D 0; +=20 + this->bWriteInternalCoords =3D true; + this->bWriteCartCoords =3D false; +@@ -168,7 +168,7 @@ + while (igau) { + getline(igau,fileline); +=20 +- if (containsSubStr(fileline, "modredundant")) { ++ if (containsSubStr(fileline, "ModRedundant")) { + bModRedundant =3D true; + } + if (fileline.substr(0,59) =3D=3D " Redundant internal coordinates= taken from checkpoint file:") { +@@ -626,6 +626,7 @@ + void gaussianParser::Write(const std::string &gaussfile, molecule* pMol= ecule, + std::vector< vector3d > &coordinates) + { ++ std::string routecard; + std::ofstream ogauss; + ogauss.open(gaussfile.c_str()); +=20 +@@ -643,52 +644,64 @@ + return; + } +=20 +- ogauss << "$rungauss" << std::endl; ++ ogauss << "$RunGauss" << std::endl; +=20 + if (bChkPt) { +- ogauss << "%chk=3D" << this->itsChkPtFile << std::endl; ++ ogauss << "%Chk=3D" << this->itsChkPtFile << std::endl; + } + if (bMem) { +- ogauss << "%mem=3D" << this->itsMem << std::endl; ++ ogauss << "%Mem=3D" << this->itsMem << std::endl; + } +- if (bnProc) { +- ogauss << "%nproc=3D" << this->itsnProc << std::endl; ++ if (bNProc) { ++ ogauss << "%NProcShared=3D" << this->itsNProc << std::endl; + } +=20 +- ogauss << "#" << this->itsVerbosity << " " << this->itsTheory << "/= " << this->itsBasisSet << " "; ++ routecard =3D "#" + this->itsVerbosity + " " + this->itsTheory + "/" = + this->itsBasisSet; +=20 + if (!itsCommandOptions.empty()) { + for (mapIterator p =3D itsCommandOptions.begin(); p !=3D itsComma= ndOptions.end(); p++) { + std::string c =3D p->first; + std::vector o =3D p->second; ++ std::string opts =3D ""; + if (o.size() =3D=3D 1) { +- if ( p->second[0] =3D=3D "NONE") { +- ogauss << p->first << " "; +- } +- else { +- ogauss << p->first << "=3D" << p->second[0] << " "; ++ if ( p->second[0] !=3D "NONE") { ++ opts =3D "=3D" + p->second[0]; + } + } + else { +- ogauss << p->first << "("; ++ opts =3D "("; + for (unsigned int i =3D 0; i < o.size(); i++) { +- if (i =3D=3D o.size()-1) { +- ogauss << o[i]; ++ opts =3D opts + o[i]; ++ if (i !=3D o.size()-1) { ++ opts =3D opts + ","; + } +- else { +- ogauss << o[i] << ","; + } ++ opts =3D opts + ")"; + } +- ogauss << ")" << " "; ++ =09 ++ if (routecard.length() + c.length() + opts.length() < 72) { ++ routecard =3D routecard + " " + c + opts; ++ } else { ++ if (routecard.length() !=3D 0) { ++ ogauss << routecard << std::endl; ++ } ++ routecard =3D c + opts; + } + } + } + for (unsigned int i =3D 0; i < this->iops.size(); i++) { +- ogauss << this->iops[i] << " "; ++ if (routecard.length() + this->iops[i].length() < 72) { ++ routecard =3D routecard + " " + this->iops[i]; ++ } else { ++ if (routecard.length() !=3D 0) { ++ ogauss << routecard << std::endl; ++ } ++ routecard =3D this->iops[i]; ++ } + } +=20 + // Flush command block and follow with a blank line +- ogauss << "\n" << std::endl; ++ ogauss << routecard << "\n" << std::endl; +=20 + // Write name (if required) and follow with a blank line + if (bWriteMoleculeName) { +@@ -740,11 +753,11 @@ + ogauss << std::endl; + } +=20 +- std::vector optOptions =3D this->getCommandOption("opt= "); ++ std::vector optOptions =3D this->getCommandOption("Opt")= ; + if (optOptions.size() > 0) { + bool bMD =3D 0; + for (unsigned int x =3D 0; x < optOptions.size(); x++) { +- if (optOptions[x] =3D=3D "modredundant") { ++ if (optOptions[x] =3D=3D "ModRedundant") { + bMD =3D 1; + } + } +@@ -766,13 +779,13 @@ + } + } +=20 +- if (this->itsBasisSet.substr(0,3) =3D=3D "GEN") { ++ if (this->itsBasisSet.substr(0,3) =3D=3D "Gen") { + std::ifstream iBSFile; + iBSFile.open(this->itsBasisSetFile.c_str()); +=20 + if (!iBSFile) { + std::cout << "\nERROR!" +- << "\nBasis set \"GEN\" requires a custom file." ++ << "\nBasis set \"Gen\" requires a custom file." + << "\nFile \"" << this->itsBasisSetFile << "\" is mis= sing or unreadable." + << "\nPlease choose another file. For instructions, c= onsult your program's" + << "\ndocumentation." +@@ -789,13 +802,13 @@ + } +=20 + // +BPR +- if (this->getCommandOption("pseudo").size() > 0) { ++ if (this->getCommandOption("Pseudo").size() > 0) { + std::ifstream iPseudoFile; + iPseudoFile.open(this->itsPseudoPotentialFile.c_str()); +=20 + if (!iPseudoFile) { + std::cout << "\nERROR!" +- << "\npseudo=3Dread or pseudo=3Dcards requires a cust= om file." ++ << "\nPseudo=3DRead or Pseudo=3DCards requires a custom file." + << "\nFile \"" << this->itsPseudoPotentialFile << "\"= is missing or unreadable." + << "\nPlease choose another file. For instructions, c= onsult your program's" + << "\ndocumentation." +@@ -812,7 +825,7 @@ + } + // -BPR +=20 +- if (this->getCommandOption("pop").size() > 0) { ++ if (this->getCommandOption("Pop").size() > 0) { + if (!itsMKRadii.empty()) { + for (dMapIterator p =3D itsMKRadii.begin(); p !=3D itsMKRadii.e= nd(); p++) { + ogauss << p->first << "=3D" << p->second << "\n"; +@@ -1037,14 +1050,14 @@ + } +=20 + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +-// Function : setnProc ++ // Function : setNProc + // ------------------------------------------------------------ + // + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +-void gaussianParser::setnProc(const std::string &n) ++ void gaussianParser::setNProc(const std::string &n) + { +- this->bnProc =3D 1; +- this->itsnProc =3D n; ++ this->bNProc =3D 1; ++ this->itsNProc =3D n; + } +=20 + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +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 @@ +=20 + /*! + \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); +=20 + /*! + \brief Set level of theory +@@ -354,10 +354,10 @@ + bool bMem; +=20 + //! number of processors +- std::string itsnProc; ++ std::string itsNProc; +=20 +- //! Turn on mem +- bool bnProc; ++ //! Turn on number of processors ++ bool bNProc; +=20 + //! Use internal or cartesian coordinates + bool bWriteInternalCoords; +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/Makefile.am ambe= r11/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:0= 3:01.406032569 +0200 +@@ -1,15 +1,15 @@ +-DIAGNOSTICS_LD=3D-L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD=3D-L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB=3D-lDiagnostics +-MOLECULE_LD=3D-L$(top_builddir)/src/Molecule/$(SRCDIR) ++MOLECULE_LD=3D-L$(abs_top_builddir)/src/Molecule/$(SRCDIR) + MOLECULE_LIB=3D-lMolecule +-GA_LD=3D-L$(top_builddir)/src/GA/$(SRCDIR) ++GA_LD=3D-L$(abs_top_builddir)/src/GA/$(SRCDIR) + GA_LIB=3D-lGA +-LOG_LD=3D-L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD=3D-L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB=3D-lLog +-STATS_LD=3D-L$(top_builddir)/src/Statistics/$(SRCDIR) ++STATS_LD=3D-L$(abs_top_builddir)/src/Statistics/$(SRCDIR) + STATS_LIB=3D-lStatistics +=20 +-TINYXML_LD=3D-L$(top_builddir)/src/tinyxml/$(SRCDIR) ++TINYXML_LD=3D-L$(abs_top_builddir)/src/tinyxml/$(SRCDIR) + TINYXML_LIB=3D-ltinyxml +=20 + if USE_XERCES +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/Makefile.in ambe= r11/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:0= 3:01.407032569 +0200 +@@ -267,17 +267,17 @@ + top_builddir =3D @top_builddir@ + top_srcdir =3D @top_srcdir@ + xerces_path =3D @xerces_path@ +-DIAGNOSTICS_LD =3D -L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD =3D -L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB =3D -lDiagnostics +-MOLECULE_LD =3D -L$(top_builddir)/src/Molecule/$(SRCDIR) ++MOLECULE_LD =3D -L$(abs_top_builddir)/src/Molecule/$(SRCDIR) + MOLECULE_LIB =3D -lMolecule +-GA_LD =3D -L$(top_builddir)/src/GA/$(SRCDIR) ++GA_LD =3D -L$(abs_top_builddir)/src/GA/$(SRCDIR) + GA_LIB =3D -lGA +-LOG_LD =3D -L$(top_builddir)/src/Log/$(SRCDIR) ++LOG_LD =3D -L$(abs_top_builddir)/src/Log/$(SRCDIR) + LOG_LIB =3D -lLog +-STATS_LD =3D -L$(top_builddir)/src/Statistics/$(SRCDIR) ++STATS_LD =3D -L$(abs_top_builddir)/src/Statistics/$(SRCDIR) + STATS_LIB =3D -lStatistics +-TINYXML_LD =3D -L$(top_builddir)/src/tinyxml/$(SRCDIR) ++TINYXML_LD =3D -L$(abs_top_builddir)/src/tinyxml/$(SRCDIR) + TINYXML_LIB =3D -ltinyxml + @USE_XERCES_TRUE@XERCES_LD =3D -L@xerces_path@/lib/ + @USE_XERCES_TRUE@XERCES_LIB =3D -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-0= 4-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->getFormalC= harge())); +=20 ++ // Coordinates ++ TiXmlElement* coordElem =3D 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 atomDMap =3D pAtom->getPropertyMap(); + std::map atomIMap =3D pAtom->getIntPropertyMap(); +=20 +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-0= 4-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 =3D string2Double(element->Attribute("pot= entialWellDepth")); + } +=20 ++ if (element->Attribute("atomPolarizability")) { ++ pAtomType->atomPolarizability =3D string2Double(element->At= tribute("atomPolarizability")); ++ } ++ + if (element->Attribute("element")) { + pAtomType->element =3D 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(pAtomT= ype->evalue).c_str()); ++ entry->SetAttribute("atomPolarizability" , double2String(pAtomT= ype->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(pAtomTy= pe->mass).c_str())); + typeElem->setAttribute(X("vdwRadius"), X(double2String(pA= tomType->rvalue).c_str())); + typeElem->setAttribute(X("potentialWellDepth"), X(double2= String(pAtomType->evalue).c_str())); ++ typeElem->setAttribute(X("atomPolarizability"), X(double2= String(pAtomType->atomPolarizability).c_str())); + typeElem->setAttribute(X("element"), X(pAtomType->element= .c_str())); + typeElem->setAttribute(X("hybridization"), X(pAtomType->h= ybridization.c_str())); + typeElem->setAttribute(X("groupName"), X(pAtomType->group= Name.c_str())); +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/pdbParser.cpp am= ber11/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 =3D atomList.begin(); a !=3D atomList.end(); a+= +) { + pAtom =3D *a; + pSubMolecule =3D pAtom->getParent(); ++ //std::cout << pSubMolecule->getColIndex() << std::endl; + char temp[100]; +=20 + char tmp_element[3]; +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/prepParser.cpp a= mber11/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 2= 0:03:01.411032567 +0200 +@@ -66,71 +66,106 @@ + prepParser::~prepParser() {} +=20 + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D +-// Function : Read +-// --------------------------------------------------------- +-// parsers a prep file +-// --------------------------------------------------------- +-// Format : +-// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D +-void prepParser::Read(const std::string &prepfile, stdGroup* pStdGroup) +-{ +- std::string errorMessage =3D " Reading " + prepfile + " " + +- pStdGroup->getName() + " ... implement "= ; +- errorLogger.throwError("prepParser", errorMessage, 1); +-} +- +-// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D +-// Function : Read ++// Function : openFile + // --------------------------------------------------------- +-// parsers a prep file ++// open a prep file + // --------------------------------------------------------- + // Format : + // =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D +-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()); +=20 ++ //std::cout << "\n\n prepParser::openFile " << prepfile << std::en= dl; + if (!iprep) { + setError(1); + std::string errorMessage =3D " Error, Can't Find " + prepfile; + setErrorMessage(errorMessage); + errorLogger.throwError("prepParser::Read", errorMessage, 1); +- return; ++ return 1; + } +=20 + std::string fileline; +- std::string title; +- std::string atom; +- std::string buffer(80,'*'); +=20 + // SKIP FIRST TWO LINES + getline(iprep,fileline); + getline(iprep,fileline); ++ ++ return 0; ++} ++ ++// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D ++// Function : read fragment header section ++// --------------------------------------------------------- ++//=20 ++// --------------------------------------------------------- ++// Format : ++// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D ++int prepParser::readHeader(std::string &name, std::string &symbol, doub= le &charge) ++{ ++ std::string fileline; ++ + getline(iprep,fileline); +- //std::string name =3D stripString(fileline," "); +- //pStdFrag->setName(fileline); ++ if (stripString(fileline, " ") =3D=3D "STOP") return 1; ++ ++ name =3D stripString(fileline," "); ++ ++ // blank line + getline(iprep,fileline); ++ ++ // symbol + getline(iprep,fileline); + std::vector splitLine; + splitString(fileline, " ", splitLine, 0); +- pStdFrag->setSymbol(splitLine[0]); ++ symbol =3D splitLine[0]; ++ ++ //=20 + getline(iprep,fileline); ++ ++ // charge + getline(iprep,fileline); +- //pStdFrag->setCharge(splitLine[0]); ++ charge =3D string2Double(stripString(fileline, " ")); ++ ++ return 0; ++} ++ ++// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D ++// Function : read fragment main section ++// --------------------------------------------------------- ++//=20 ++// --------------------------------------------------------- ++// Format : ++// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D ++void prepParser::readFragment(stdFrag* pStdFrag) ++{ ++ std::string fileline; ++ ++ std::vector todos; +=20 + while (iprep) { + getline(iprep,fileline); +- if (fileline =3D=3D "") break; ++ ++ std::string filelineTest =3D stripString(fileline, " "); ++ if (filelineTest =3D=3D "") break; ++ ++//std::cout << "|" << fileline << "|" << std::endl; +=20 + std::vector splitstring; + splitString(fileline, " ", splitstring, 0); + if (atoi(splitstring[0].c_str()) > 3) { + stdAtom* pStdAtom =3D pStdFrag->addStdAtom(); + int atIndex =3D atoi(splitstring[0].c_str()) - 3; +- std::string atomName =3D fileline.substr(6,4); ++ ++//////// ++ //std::string atomName =3D fileline.substr(6,4); ++ std::string atomName =3D splitstring[1]; ++ if (atomName.size() =3D=3D 1) atomName =3D " " + atomName + " = "; ++ else if (atomName.size() =3D=3D 2) atomName =3D " " + atomName = + " "; ++ else if (atomName.size() =3D=3D 3) atomName =3D " " + atomName; ++ ++//std::cout << "|" << atomName << "|" << std::endl; ++///////// ++ + std::string atomType =3D splitstring[2]; + std::string atomChain =3D splitstring[3]; +=20 +@@ -170,32 +205,54 @@ + pStdBond->atom1 =3D pStdAtom->index; + pStdBond->atom2 =3D pStdAtom->bond12; + pStdBond->type =3D 1; ++ + if (pStdAtom->atSymbol =3D=3D "H") { + if (pStdAtom->bond12 > 0) { + stdAtom* pStdBondedAtom =3D pStdFrag->getStdAtom(pStdAtom->= bond12); ++ ++ if (pStdBondedAtom) { + std::string bondedAtomSymbol =3D pStdBondedAtom->atSymbol; + if (bondedAtomSymbol =3D=3D "N" or bondedAtomSymbol =3D=3D = "O" or bondedAtomSymbol =3D=3D "S") { + pStdBond->kind =3D 1; + } + } ++ else { ++ todos.push_back(pStdBond); ++ } ++ } + } + else { + pStdBond->kind =3D 0; + } ++ + pStdBond->topology =3D 2; + pStdBond->stereo =3D 0; + pStdBond->length =3D pStdAtom->bondLength; + } + } +=20 ++ for (unsigned int x =3D 0; x < todos.size(); x++) { ++ stdAtom* pStdBondedAtom1 =3D pStdFrag->getStdAtom(todos[x]->atom1= ); ++ stdAtom* pStdBondedAtom2 =3D pStdFrag->getStdAtom(todos[x]->atom2= ); ++ if (pStdBondedAtom1 and pStdBondedAtom2) { ++ std::string bondedAtomSymbol =3D pStdBondedAtom2->atSymbol; ++ if (bondedAtomSymbol =3D=3D "N" or bondedAtomSymbol =3D=3D "O" = or bondedAtomSymbol =3D=3D "S") { ++ todos[x]->kind =3D 1; ++ } ++ } ++ } ++ + // Read charge, alias, loop, and improper data + while (iprep) { + getline(iprep,fileline); ++//std::cout << "!" << fileline << "!" << std::endl; + if (fileline !=3D "") { + if (fileline.substr(0,6) =3D=3D "CHARGE") { + while (iprep) { + getline(iprep,fileline); +- if (fileline =3D=3D "") break; ++ ++ std::string filelineTest =3D stripString(fileline, " "); ++ if (filelineTest =3D=3D "") break; + } + } + else if (fileline.substr(0,5) =3D=3D "ALIAS") { +@@ -252,7 +309,7 @@ + else { + std::string errorMessage =3D " ALIAS Tag Error ... exiti= ng "; + 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) =3D=3D "LOOP") { + while (iprep) { + getline(iprep,fileline); +- if (fileline =3D=3D "") break; ++ ++ std::string filelineTest =3D stripString(fileline, " "); ++ if (filelineTest =3D=3D "") break; ++ ++ //if (fileline =3D=3D "") break; +=20 + std::vector atomNames; + splitString(fileline, " ", atomNames, 0); +- ++/* ++for (unsigned int x =3D 0; x print(); ++*/ + std::vector< std::vector > possibleNames; + for (int d =3D 0; d < 2; d++) { + int atNameSize =3D atomNames[d].size(); +@@ -315,17 +381,22 @@ + else { + std::string errorMessage =3D " LOOP Tag Error ... exitin= g "; + 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) =3D=3D "DONE") { ++ break; ++ } + else if (fileline.substr(0,8) =3D=3D "IMPROPER") { + while (iprep) { + getline(iprep,fileline); ++ ++ std::string filelineTest =3D stripString(fileline, " "); ++ if (filelineTest =3D=3D "") break; ++ + if (fileline =3D=3D "") break; +=20 + std::vector atomNames; +@@ -424,7 +495,6 @@ + else { + std::string errorMessage =3D " IMPROPER Tag Error ... = exiting "; + errorLogger.throwError("prepParser::Read", errorMessage= , 1); +- //exit(0); +=20 + std::stringstream ss; + ss << "prepParser::Read" << errorMessage; +@@ -642,8 +712,112 @@ + } + // QBio end + } +- + errorLogger.throwError("prepParser::Read", eMessage, INFO); ++} ++ ++// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D ++// Function : Read ++// --------------------------------------------------------- ++// parsers a prep file ++// --------------------------------------------------------- ++// Format : ++// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D ++void prepParser::Read(const std::string &prepfile, stdGroup* pStdGroup) ++{ ++ int r =3D openFile(prepfile); ++ if (r =3D=3D 1) return; ++ ++ while(iprep) { ++ std::string name =3D ""; ++ std::string symbol =3D ""; ++ double charge =3D 0.0; ++ int h =3D readHeader(name, symbol, charge); ++ if (h =3D=3D 1) break; ++ ++ stdFrag* pStdFrag =3D pStdGroup->addStdFrag(); ++ if (!pStdFrag) { ++ setError(1); ++ std::string errorMessage =3D " Error creating fragment "; ++ setErrorMessage(errorMessage); ++ errorLogger.throwError("prepParser::Read", errorMessage, 1); ++ return; ++ } ++ ++ if (symbol.size() =3D=3D 1) symbol =3D symbol + " "; ++ if (symbol.size() =3D=3D 2) symbol =3D symbol + " "; ++ if (symbol.size() > 3) symbol =3D 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 " << cha= rge << " symbol " << symbol << std::endl; ++ readFragment(pStdFrag); ++ } ++ ++ iprep.close(); ++ ++ return; ++} ++ ++// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D ++// Function : Read ++// --------------------------------------------------------- ++// parsers a prep file ++// --------------------------------------------------------- ++// Format : ++// =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D ++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 =3D " Error, Can't Find " + prepfile; ++ setErrorMessage(errorMessage); ++ errorLogger.throwError("prepParser::Read", errorMessage, 1); ++ return; ++ } ++*/ ++ ++ int r =3D openFile(prepfile); ++ if (r =3D=3D 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 =3D stripString(fileline," "); ++ //pStdFrag->setName(fileline); ++ getline(iprep,fileline); ++ getline(iprep,fileline); ++ std::vector splitLine; ++ splitString(fileline, " ", splitLine, 0); ++ pStdFrag->setSymbol(splitLine[0]); ++ getline(iprep,fileline); ++ getline(iprep,fileline); ++ //pStdFrag->setCharge(splitLine[0]); ++*/ ++ ++ std::string name =3D ""; ++ std::string symbol =3D ""; ++ double charge =3D 0.0; ++ readHeader(name, symbol, charge); ++ ++ pStdFrag->setSymbol(symbol); ++ ++ readFragment(pStdFrag); +=20 + iprep.close(); + } +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Parsers/prepParser.h amb= er11/AmberTools/src/mtkpp/src/Parsers/prepParser.h +--- amber11.orig/AmberTools/src/mtkpp/src/Parsers/prepParser.h 2011-04-1= 4 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(); +=20 + /*! ++ \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, do= uble &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 @@ +=20 + //! atom pointer + atom* pAtom; ++ ++ //! file handler ++ std::ifstream iprep; + }; +=20 + } // 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 =3D " Writing " + fileName; + errorLogger.throwError("stdLibParser", errMessage, INFO); +@@ -3512,6 +3512,7 @@ + TiXmlElement* impElem =3D new TiXmlElement("improper"); + frag->LinkEndChild(impElem); +=20 ++ /* + if (improperList[k]->atom1 =3D=3D -1) { + impElem->SetAttribute("Atom1", "p1"); + } +@@ -3520,7 +3521,8 @@ + } + else { + impElem->SetAttribute("Atom1", int2String(improperList[k]->atom= 1)); +- } ++ }*/ ++ 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 a= mber11/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 2= 0:03:01.413032567 +0200 +@@ -1,4 +1,4 @@ +-DIAGNOSTICS_LD=3D-L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD=3D-L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB=3D-lDiagnostics +=20 + INCLUDES =3D -I@boost_inc@ -I$(srcdir)/.. -I$(top_srcdir)/src/eigen3b2 +diff -urN amber11.orig/AmberTools/src/mtkpp/src/Statistics/Makefile.in a= mber11/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 2= 0:03:01.413032567 +0200 +@@ -241,7 +241,7 @@ + top_builddir =3D @top_builddir@ + top_srcdir =3D @top_srcdir@ + xerces_path =3D @xerces_path@ +-DIAGNOSTICS_LD =3D -L$(top_builddir)/src/Diagnostics/$(SRCDIR) ++DIAGNOSTICS_LD =3D -L$(abs_top_builddir)/src/Diagnostics/$(SRCDIR) + DIAGNOSTICS_LIB =3D -lDiagnostics + INCLUDES =3D -I@boost_inc@ -I$(srcdir)/.. -I$(top_srcdir)/src/eigen3b2 + lib_LTLIBRARIES =3D libStatistics.la +diff -urN amber11.orig/AmberTools/src/mtkpp/tests/Makefile.am amber11/Am= berTools/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.4= 14032567 +0200 +@@ -42,25 +42,25 @@ + LAPACK_LIB=3D-llapack -lblas -lg2c + endif +=20 +-MOLECULE_LD=3D-L$(top_builddir)/src/Molecule ++MOLECULE_LD=3D-L$(abs_top_builddir)/src/Molecule + MOLECULE_LIB=3D-lMolecule +-DIAGNOSTICS_LD=3D-L$(top_builddir)/src/Diagnostics ++DIAGNOSTICS_LD=3D-L$(abs_top_builddir)/src/Diagnostics + DIAGNOSTICS_LIB=3D-lDiagnostics +-LOG_LD=3D-L$(top_builddir)/src/Log ++LOG_LD=3D-L$(abs_top_builddir)/src/Log + LOG_LIB=3D-lLog +-GRAPH_LD=3D-L$(top_builddir)/src/Graph ++GRAPH_LD=3D-L$(abs_top_builddir)/src/Graph + GRAPH_LIB=3D-lGraph +-GA_LD=3D-L$(top_builddir)/src/GA ++GA_LD=3D-L$(abs_top_builddir)/src/GA + GA_LIB=3D-lGA +-MM_LD=3D-L$(top_builddir)/src/MM ++MM_LD=3D-L$(abs_top_builddir)/src/MM + MM_LIB=3D-lMM +-MINIMIZERS_LD=3D-L$(top_builddir)/src/Minimizers ++MINIMIZERS_LD=3D-L$(abs_top_builddir)/src/Minimizers + MINIMIZERS_LIB=3D-lMinimizers +-PARSERS_LD=3D-L$(top_builddir)/src/Parsers ++PARSERS_LD=3D-L$(abs_top_builddir)/src/Parsers + PARSERS_LIB=3D-lParsers +-STATS_LD=3D-L$(top_builddir)/src/Statistics ++STATS_LD=3D-L$(abs_top_builddir)/src/Statistics + STATS_LIB=3D-lStatistics +-TINYXML_LD=3D-L$(top_builddir)/src/tinyxml ++TINYXML_LD=3D-L$(abs_top_builddir)/src/tinyxml + TINYXML_LIB=3D-ltinyxml +=20 + # INCLUDES =3D -I@boost_inc@ -I@xerces_path@/include -I$(top_srcdir)/s= rc -I$(top_srcdir)/include -I$(top_srcdir)/src/tinyxml -I$(top_srcdir)/sr= c/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/Am= berTools/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.4= 14032567 +0200 +@@ -303,25 +303,25 @@ + @USE_QT_TRUE@tmpQT_LIBS =3D $(QT_LIBS) + @IS_LINUX_TRUE@LAPACK_LD =3D -L/usr/lib64 + @IS_LINUX_TRUE@LAPACK_LIB =3D -llapack -lblas -lg2c +-MOLECULE_LD =3D -L$(top_builddir)/src/Molecule ++MOLECULE_LD =3D -L$(abs_top_builddir)/src/Molecule + MOLECULE_LIB =3D -lMolecule +-DIAGNOSTICS_LD =3D -L$(top_builddir)/src/Diagnostics ++DIAGNOSTICS_LD =3D -L$(abs_top_builddir)/src/Diagnostics + DIAGNOSTICS_LIB =3D -lDiagnostics +-LOG_LD =3D -L$(top_builddir)/src/Log ++LOG_LD =3D -L$(abs_top_builddir)/src/Log + LOG_LIB =3D -lLog +-GRAPH_LD =3D -L$(top_builddir)/src/Graph ++GRAPH_LD =3D -L$(abs_top_builddir)/src/Graph + GRAPH_LIB =3D -lGraph +-GA_LD =3D -L$(top_builddir)/src/GA ++GA_LD =3D -L$(abs_top_builddir)/src/GA + GA_LIB =3D -lGA +-MM_LD =3D -L$(top_builddir)/src/MM ++MM_LD =3D -L$(abs_top_builddir)/src/MM + MM_LIB =3D -lMM +-MINIMIZERS_LD =3D -L$(top_builddir)/src/Minimizers ++MINIMIZERS_LD =3D -L$(abs_top_builddir)/src/Minimizers + MINIMIZERS_LIB =3D -lMinimizers +-PARSERS_LD =3D -L$(top_builddir)/src/Parsers ++PARSERS_LD =3D -L$(abs_top_builddir)/src/Parsers + PARSERS_LIB =3D -lParsers +-STATS_LD =3D -L$(top_builddir)/src/Statistics ++STATS_LD =3D -L$(abs_top_builddir)/src/Statistics + STATS_LIB =3D -lStatistics +-TINYXML_LD =3D -L$(top_builddir)/src/tinyxml ++TINYXML_LD =3D -L$(abs_top_builddir)/src/tinyxml + TINYXML_LIB =3D -ltinyxml +=20 + # INCLUDES =3D -I@boost_inc@ -I@xerces_path@/include -I$(top_srcdir)/s= rc -I$(top_srcdir)/include -I$(top_srcdir)/src/tinyxml -I$(top_srcdir)/sr= c/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/Am= berTools/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.4= 17032565 +0200 +@@ -25,7 +25,7 @@ + tmpQT_LIBS =3D $(QT_LIBS) + endif +=20 +-DIAGNOSTICS_LD =3D -L$(top_builddir)/src/Diagnostics ++DIAGNOSTICS_LD =3D -L$(abs_top_builddir)/src/Diagnostics + DIAGNOSTICS_LIB =3D -lDiagnostics + MOLECULE_LD =3D -L$(top_builddir)/src/Molecule + MOLECULE_LIB =3D -lMolecule +diff -urN amber11.orig/AmberTools/src/mtkpp/tools/Makefile.in amber11/Am= berTools/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.4= 17032565 +0200 +@@ -392,7 +392,7 @@ + @USE_XERCES_TRUE@XERCES_LIB =3D -lxerces-c + @USE_QT_TRUE@tmpQT_INCPATH =3D $(QT_INCPATH) + @USE_QT_TRUE@tmpQT_LIBS =3D $(QT_LIBS) +-DIAGNOSTICS_LD =3D -L$(top_builddir)/src/Diagnostics ++DIAGNOSTICS_LD =3D -L$(abs_top_builddir)/src/Diagnostics + DIAGNOSTICS_LIB =3D -lDiagnostics + MOLECULE_LD =3D -L$(top_builddir)/src/Molecule + MOLECULE_LIB =3D -lMolecule +diff -urN amber11.orig/AmberTools/src/mtkpp/tools/MCPB.cpp amber11/Amber= Tools/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.4160= 32566 +0200 +@@ -67,6 +67,7 @@ + #include "Parsers/mtkppParser.h" + #include "Parsers/dMParser.h" + #include "Parsers/commLineOptions.h" ++#include "Parsers/StringManip.h" +=20 + // - Log + #include "Log/errorHandler.h" +@@ -84,6 +85,12 @@ +=20 + using namespace MTKpp; +=20 ++std::string getEnvVar(std::string const& key) ++{ ++ char const* val =3D getenv(key.c_str());=20 ++ return val =3D=3D NULL ? std::string() : std::string(val); ++} ++ + void printFunctionList() + { + std::string functionList =3D "\n MCPB Functions:\n"; +@@ -181,32 +188,32 @@ + functionList +=3D " Find all metal centers in the collection\n= "; + functionList +=3D " syntax: findMetalCenters\n"; + functionList +=3D "\n"; +- functionList +=3D " g03Charges\n"; ++ functionList +=3D " gaussianCharges\n"; + functionList +=3D " Generate a Gaussian input file for partial= -charge computation\n"; + functionList +=3D " Optional: set the Gaussian job file name\n= "; +- functionList +=3D " syntax: g03Charges //cuCYM4 cuCYM4.com\n"; ++ functionList +=3D " syntax: gaussianCharges //cuCYM4 cuCYM4.com\n= "; + functionList +=3D "\n"; +- functionList +=3D " g03Mem\n"; +- functionList +=3D " Set amount of memory requested for g03\n"; +- functionList +=3D " syntax: g03Mem 3600MB\n"; ++ functionList +=3D " gaussianMem\n"; ++ functionList +=3D " Set amount of memory requested for Gaussian\n= "; ++ functionList +=3D " syntax: gaussianMem 3600MB\n"; + functionList +=3D "\n"; +- functionList +=3D " g03MoldenFormat\n"; ++ functionList +=3D " gaussianMoldenFormat\n"; + functionList +=3D " Request Gaussian log files formatted for v= iewing in Molden\n"; +- functionList +=3D " (adds the GFINPUT and IOP(6/7=3D3) keyword= s)\n"; +- functionList +=3D " syntax: g03MoldenFormat\n"; ++ functionList +=3D " (adds the GFInput and IOp(6/7=3D3) keywords)\= n"; ++ functionList +=3D " syntax: gaussianMoldenFormat\n"; + functionList +=3D "\n"; +- functionList +=3D " g03nProc\n"; +- functionList +=3D " Set number of processors requested for g03= \n"; +- functionList +=3D " syntax: g03nProc 2\n"; ++ functionList +=3D " gaussianNProc\n"; ++ functionList +=3D " Set number of processors requested for Gaussi= an\n"; ++ functionList +=3D " syntax: gaussianNProc 2\n"; + functionList +=3D "\n"; +- functionList +=3D " g03OptAndFC\n"; ++ functionList +=3D " gaussianOptAndFC\n"; + functionList +=3D " Generate Gaussian input files for optimisa= tion and force constants\n"; + functionList +=3D " Optional: set the Gaussian job file name\n= "; +- functionList +=3D " syntax: g03OptAndFC //cuCYM4 cuCYM4.com\n"= ; ++ functionList +=3D " syntax: gaussianOptAndFC //cuCYM4 cuCYM4.com\= n"; + functionList +=3D "\n"; +- functionList +=3D " g03Verbosity\n"; ++ functionList +=3D " gaussianVerbosity\n"; + functionList +=3D " Set the verbosity of Gaussian output ([T]e= rse, [N]ormal, [P]rolix)\n"; +- functionList +=3D " syntax: g03Verbosity [T|N|P]\n"; ++ functionList +=3D " syntax: gaussianVerbosity [T|N|P]\n"; + functionList +=3D "\n"; + functionList +=3D " levelOfTheory\n"; + functionList +=3D " Set Gaussian Theory Level\n"; +@@ -256,9 +263,9 @@ + functionList +=3D " Read Formatted Checkpoint file\n"; + functionList +=3D " syntax: readFormattedChkPtFile file.fchk\n= "; + functionList +=3D "\n"; +- functionList +=3D " readG03Output\n"; +- functionList +=3D " Read G03 Output\n"; +- functionList +=3D " syntax: readG03Output cuCYM4.log\n"; ++ functionList +=3D " readGaussianOutput\n"; ++ functionList +=3D " Read Gaussian Output\n"; ++ functionList +=3D " syntax: readGaussianOutput cuCYM4.log\n"; + functionList +=3D "\n"; + functionList +=3D " readMolZmatMapping\n"; + functionList +=3D " 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; + } +=20 +@@ -515,7 +522,9 @@ + std::string errorMessage =3D ""; +=20 + std::vector > inputFileContents; ++ + int failure =3D readInputFile(inputFile, inputFileContents); ++ + if (failure) { + printHeader(std::cout, prog_name, authors); + clo->printUsage(); +@@ -660,7 +669,7 @@ + std::vector > sourceInputFileCon= tents; + failure =3D readInputFile(cur[1], sourceInputFileContents= ); + if (failure) { +- errorMessage =3D " Error Reading File " + cur[1]; ++ errorMessage =3D " Error reading file " + cur[1]; + MTKpp::errorLogger.throwError("MCPB::source", errorMess= age, 1); + exit(1); + } +@@ -668,7 +677,7 @@ + sourceInputFileContents.end= ()); + } + else { +- errorMessage =3D " Error Reading File " + cur[1]; ++ errorMessage =3D " Error reading file " + cur[1]; + MTKpp::errorLogger.throwError("MCPB::source", errorMessag= e, 1); + exit(1); + } +@@ -742,6 +751,20 @@ + \endcode + */ + if ((inputFileContents[i].size() =3D=3D 3)) { ++ //std::cout << "SET COMMAND " << inputFileContents[i][2= ] << std::endl; ++ if (inputFileContents[i][2].compare(0,1,"$") =3D=3D 0) = { =20 ++ std::string envVariable =3D ""; ++ std::string tVar =3D inputFileContents[i][2]; ++ envVariable =3D getEnvVar(tVar.substr(1,tVar.size()-1= )); ++ if (envVariable =3D=3D "") { ++ std::cout << " Environment variable " << tVar.sub= str(1,tVar.size()-1) ++ << " is unset " << std::endl; ++ exit(1); ++ } ++ //std::cout << "Environment variable =3D " << envVari= able << std::endl; ++ inputFileContents[i][2] =3D envVariable; ++ } ++ + variableMap[inputFileContents[i][1]] =3D inputFileContents[i]= [2]; + for (unsigned int j =3D i+1; j < inputFileContents.size(); j+= +) { + bool bReplaced =3D false; +@@ -813,6 +836,115 @@ + } + } +=20 ++ else if (inputFileContents[i][0] =3D=3D "printGroupCharge") { ++ /*! ++ @ingroup MCPB_commands ++ \code ++ Function: printFrag ++ ++ Description: Print fragment details ++ ++ syntax: printGroupCharge Zn-CCCC ++ ++ \endcode ++ */ ++ if ((inputFileContents[i].size() !=3D 2) or (!pCollection)) { ++ MTKpp::errorLogger.throwError("MCPB::printGroupCharge", " Incorrect= use of printGroupCharge ... exiting", MTK_ERROR); ++ exit(1); ++ } ++ else { ++ stdLibrary* pStdLibrary =3D pCollection->getStdLibrary(); ++ if (pStdLibrary) { ++ stdGroup* pStdGroup =3D pStdLibrary->getStdGroup(inputFileContent= s[i][1]); ++ std::cout << " Group " << pStdGroup->getName() << "\n"; ++ if (pStdGroup) { ++ molecule* pM =3D pStdGroup->getStdMolecule(); ++ if (pM) { ++ double groupCharge =3D 0.0; ++ std::vector pSM =3D pM->getSubMoleculeList(); ++ //std::cout << " Number of submolecules =3D " << pSM.size() << = "\n"; ++ for (unsigned int x =3D 0; x < pSM.size(); x++) { ++ stdFrag* pSF =3D pStdGroup->getStdFrag(pSM[x]->getName()); ++ if (pSF) { ++ std::cout << " " << pSF->getSymbol() << "\n"; ++ double fCharge =3D 0.0; ++ std::vector pA =3D pSM[x]->getAtomList(); ++ for (unsigned int y =3D 0; y < pA.size(); y++) { ++ stdAtom* pSA =3D pA[y]->getStdAtom(); ++ if (pSA) { ++ fCharge +=3D pSA->atmCharge; ++ std::cout << " |" << pSA->identity << "| " << pSA->atm= Charge << "\n"; ++ } ++ else { ++ std::cout << " Error find std atom " << std::endl; ++ exit(1); ++ } ++ } ++ groupCharge +=3D fCharge; ++ std::cout << " Total Fragment Charge " << pSF->getCharge()= << "\n"; ++ } ++ } ++ /*std::vector pL =3D pStdGroup->getStdFragList(); ++ for (unsigned int x =3D 0; x < pL.size(); x++) { ++ std::cout << " Fragment " << pL[x]->getSymbol() << "\n"; ++ std::vector pL2 =3D pL[x]->getStdAtomList(); ++ double fCharge =3D 0.0; ++ for (unsigned int y =3D 0; y < pL2.size(); y++) { ++ fCharge +=3D pL2[y]->atmCharge; ++ std::cout << " Atom " << pL2[y]->identity << " " << pL2[= y]->atmCharge << "\n"; ++ } ++ groupCharge +=3D fCharge; ++ //groupCharge +=3D pL[x]->getCharge(); ++ std::cout << " Fragment Charge " << pL[x]->getCharge() << "\n= "; ++ } ++ */ ++ ++ std::cout << " Total Charge =3D " << groupCharge << "\n" << s= td::endl; ++ } ++ } ++ } ++ } ++ } ++ ++ else if (inputFileContents[i][0] =3D=3D "printFrag") { ++ /*! ++ @ingroup MCPB_commands ++ \code ++ Function: printFrag ++ ++ Description: Print fragment details ++ ++ syntax: printFrag Zn-CCCC CY1 ++ ++ \endcode ++ */ ++ if ((inputFileContents[i].size() !=3D 3) or (!pCollection)) { ++ MTKpp::errorLogger.throwError("MCPB::printFrag", " Incorrect use of= printFrag ... exiting", MTK_ERROR); ++ exit(1); ++ } ++ else { ++ stdLibrary* pStdLibrary =3D pCollection->getStdLibrary(); ++ if (pStdLibrary) { ++ stdGroup* pStdGroup =3D pStdLibrary->getStdGroup(inp= utFileContents[i][1]); ++ ++ double groupCharge =3D 0.0; ++ std::vector pL =3D pStdGroup->getStdFragLis= t(); ++ for (unsigned int x =3D 0; x < pL.size(); x++) { ++ groupCharge +=3D pL[x]->getCharge(); ++ ++ } ++ std::cout << " Group " << inputFileContents[i][1] << = " charge =3D " ++ << groupCharge << std::endl; ++ =20 ++ stdFrag* pStdFrag =3D pStdGroup->getStdFrag(inputFile= Contents[i][2]); ++ if (pStdFrag) { ++ std::cout << " Fragment " << inputFileContents[i]= [2] << " charge =3D " ++ << pStdFrag->getCharge() << std::endl; ++ } ++ } ++ } ++ } ++=09 + else if (inputFileContents[i][0] =3D=3D "readPdb") { + /*! + @ingroup MCPB_commands +@@ -2227,7 +2359,8 @@ + double resCharge =3D 0.0; + for (unsigned int y =3D 0; y < residueAtoms.size(); y++) = { + stdAtom* pLStdAtom =3D residueAtoms[y]->getStdAtom(); +- std::cout << " " << residueAtoms[y]->getName() <<= " " << residueAtoms[y]->getFileID() ++ std::cout << " " =09 ++ << residueAtoms[y]->getName() << " " << residueAtoms[y]->getFil= eID() + << " " << residueAtoms[y]->getType() << " " <= < residueAtoms[y]->getValence() + << " " << residueAtoms[y]->getHybridization()= << " "; + if (pLStdAtom) { +@@ -2437,6 +2570,11 @@ + molecule* selMol =3D pSel->getMol(); + pPdbParser->Write(inputFileContents[i][2], selMol); + } ++ else { ++ MTKpp::errorLogger.throwError("MCPB::writePdb", ++ " Error molecule was not selected ... exiting ", MTK_ERRO= R); ++ exit(1); ++ } + } + } +=20 +@@ -2674,7 +2812,6 @@ +=20 + syntax: basisSet GEN bs.txt + syntax: basisSet GEN.6D.7F bs.txt +- syntax: basisSet GENECP bs.txt pseudo.txt + \endcode + */ + if (inputFileContents[i].size() =3D=3D 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); ++ } + } + =20 + else if (inputFileContents[i][0] =3D=3D "pseudoPotentials") { +@@ -2698,8 +2840,15 @@ + syntax: pseudoPotential pseudo.txt + \endcode + */ +- pGParser->addCommandOption("pseudo","read"); ++ if (inputFileContents[i].size() =3D=3D 2) { ++ pGParser->addCommandOption("Pseudo","Read"); + pGParser->setPseudoPotentialFile(inputFileContents[i][1]); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::pseudoPotentials", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } ++ + } +=20 + else if (inputFileContents[i][0] =3D=3D "modRedundant") { +@@ -2713,8 +2862,14 @@ + syntax: modRedundant modred.txt + \endcode + */ +- pGParser->addCommandOption("opt","modredundant"); ++ if (inputFileContents[i].size() =3D=3D 2) { ++ pGParser->addCommandOption("Opt","ModRedundant"); + pGParser->setModRedundantFile(inputFileContents[i][1]); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::modRedundant", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } + } +=20 + else if (inputFileContents[i][0] =3D=3D "clusterCharge") { +@@ -2728,7 +2883,13 @@ + syntax: clusterCharge cuCYM4 -3 + \endcode + */ ++ if (inputFileContents[i].size() =3D=3D 3) { + pGParser->setCharge(atoi(inputFileContents[i][2].c_str())); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::clusterCharge", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } + } +=20 + else if (inputFileContents[i][0] =3D=3D "clusterSpin") { +@@ -2742,76 +2903,94 @@ + syntax: clusterSpin 0 + \endcode + */ ++ if (inputFileContents[i].size() =3D=3D 2) { + pGParser->setMultiplicity(atoi(inputFileContents[i][1].c_str())= ); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::clusterSpin", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } + } +=20 +- else if (inputFileContents[i][0] =3D=3D "g03MoldenFormat") { ++ else if (inputFileContents[i][0] =3D=3D "gaussianMoldenFormat") { + /*! + @ingroup MCPB_commands + \code +- Function: g03MoldenFormat ++ Function: gaussianMoldenFormat +=20 + Description: Use Molden formatted output in log file. Print = out + details of the basis set and the molecular orbitals. +=20 +- syntax: g03MoldenFormat (bare word) ++ syntax: gaussianMoldenFormat (bare word) + \endcode + */ +- pGParser->addCommandOption("gfinput"); +- pGParser->addIop("iop(6/7=3D3)"); ++ pGParser->addCommandOption("GFInput"); ++ pGParser->addIop("IOp(6/7=3D3)"); + } + =20 +- else if (inputFileContents[i][0] =3D=3D "g03Verbosity") { ++ else if (inputFileContents[i][0] =3D=3D "gaussianVerbosity") { + if (inputFileContents[i].size() =3D=3D 2) { + pGParser->setVerbosity(inputFileContents[i][1]); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::gaussianVerbosity", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); + } + } +=20 +- else if (inputFileContents[i][0] =3D=3D "g03Mem") { ++ else if (inputFileContents[i][0] =3D=3D "gaussianMem") { + /*! + @ingroup MCPB_commands + \code +- Function: g03Mem ++ Function: gaussianMem +=20 +- Description: Set amount of memory requested for g03 ++ Description: Set amount of memory requested for Gaussian +=20 +- syntax: g03Mem 3600MB ++ syntax: gaussianMem 3600MB + \endcode + */ + if (inputFileContents[i].size() =3D=3D 2) { + pGParser->setMem(inputFileContents[i][1]); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::gaussianMem", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); + } + } +=20 +- else if (inputFileContents[i][0] =3D=3D "g03nProc") { ++ else if (inputFileContents[i][0] =3D=3D "gaussianNProc") { + /*! + @ingroup MCPB_commands + \code +- Function: g03nProc ++ Function: gaussianNProc +=20 +- Description: Set number of processors requested for g03 ++ Description: Set number of processors requested for Gaussian +=20 +- syntax: g03nProc 2 ++ syntax: gaussianNProc 2 + \endcode + */ + if (inputFileContents[i].size() =3D=3D 2) { +- pGParser->setnProc(inputFileContents[i][1]); ++ pGParser->setNProc(inputFileContents[i][1]); ++ } else { ++ MTKpp::errorLogger.throwError("MCPB::gaussianNProc", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); + } + } +=20 +- else if (inputFileContents[i][0] =3D=3D "g03OptAndFC") { ++ else if (inputFileContents[i][0] =3D=3D "gaussianOptAndFC") { + /*! + @ingroup MCPB_commands + \code +- Function: g03OptAndFC ++ Function: gaussianOptAndFC +=20 + Description: Set Gaussian input name +=20 +- syntax: g03OptAndFC //cuCYM4 cuCYM4.com ++ syntax: gaussianOptAndFC //cuCYM4 cuCYM4.com + \endcode + */ + if ((inputFileContents[i].size() !=3D 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 =3D new selection(pCollection); + failure =3D pSel->parse(inputFileContents[i][1]); + if (failure) { +- MTKpp::errorLogger.throwError("MCPB::g03OptAndFC", ++ MTKpp::errorLogger.throwError("MCPB::gaussianOptAndFC", + " Error in selection parsing ... exiting ", MTK_ER= ROR); + exit(1); + } +@@ -2833,17 +3012,17 @@ + pGParser->setCartesian(1); + pGParser->setWriteMoleculeName(1); + pGParser->setWriteChargeAndMult(1); +- pGParser->addCommandOption("integral(Grid=3DUltraFine)"); ++ pGParser->addCommandOption("Integral", "(Grid=3DUltraFine)"); + =20 +- std::vector optOptions =3D pGParser->getComman= dOption("opt"); ++ std::vector optOptions =3D pGParser->getCommandOption= ("Opt"); + if (optOptions.size() =3D=3D 0) { +- pGParser->addCommandOption("opt"); ++ pGParser->addCommandOption("Opt"); + } +=20 +- 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"); +=20 + // 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=3D1)"); ++ pGParser->addCommandOption("Freq", "NoRaman"); ++ pGParser->addCommandOption("Geom", "AllCheckpoint"); ++ pGParser->addCommandOption("Guess", "Read"); ++ pGParser->addIop("IOp(7/33=3D1)"); + pGParser->Write(fileNameBase+"_fc.com", pSelMol); + pGParser->clearIop(); +=20 + /* + // optimization +- pGParser->addCommandOption("opt", "z-matrix"); ++ pGParser->addCommandOption("Opt", "Z-Matrix"); + pGParser->generateZMatrix(pSelMol); + // [molecule index] =3D 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"); + */ + } + } + } +=20 +- else if (inputFileContents[i][0] =3D=3D "g03Charges") { ++ else if (inputFileContents[i][0] =3D=3D "gaussianCharges") { + /*! + @ingroup MCPB_commands + \code +- Function: g03Charges ++ Function: gaussianCharges +=20 + Description: Set Gaussian input name +=20 +- syntax: g03Charges //cuCYM4 cuCYM4.com ++ syntax: gaussianCharges //cuCYM4 cuCYM4.com + \endcode + */ + if ((inputFileContents[i].size() !=3D 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 =3D new selection(pCollection); + failure =3D pSel->parse(inputFileContents[i][1]); + if (failure) { +- MTKpp::errorLogger.throwError("MCPB::g03Charges", ++ MTKpp::errorLogger.throwError("MCPB::gaussianCharges", + " Error in selection parsing ... exiting ", MTK_ER= ROR); + exit(1); + } +@@ -2907,14 +3086,14 @@ +=20 + // q's + std::vector popOptions; +- popOptions.push_back("mk"); +- popOptions.push_back("readradii"); +- pGParser->addCommandOption("pop", popOptions); +- pGParser->removeCommandOption("freq"); +- pGParser->addIop("iop(6/33=3D2)"); ++ popOptions.push_back("MK"); ++ popOptions.push_back("ReadRadii"); ++ pGParser->addCommandOption("Pop", popOptions); ++ pGParser->removeCommandOption("Freq"); ++ pGParser->addIop("IOp(6/33=3D2)"); +=20 +- pGParser->addCommandOption("integral(Grid=3DUltraFine)"); +- pGParser->addCommandOption("scf", "xqc"); ++ pGParser->addCommandOption("Integral", "(Grid=3DUltraFine)"); ++ pGParser->addCommandOption("SCF", "XQC"); +=20 + pGParser->Write(fileNameBase+"_mk.com", pSelMol); +=20 +@@ -3053,7 +3232,8 @@ + result =3D find(bbb.begin(), bbb.end(), dd); +=20 + if (result !=3D bbb.end()) { +- freezingAtoms +=3D "\n BBB " + submols[s]->get= Name() + " " + int2String(submols[s]->getSubMolId()) + " " + dd; ++ freezingAtoms +=3D "\n BBB " + submols[s]->getName() + " " ++ + int2String(submols[s]->getSubMolId()) + " " = + dd; + sprintf(temp,"%5d%10.5f", 1, pStdAtom_a->atmCha= rge); + 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 @@ + } + } +=20 +- else if (inputFileContents[i][0] =3D=3D "readG03Output") { ++ else if (inputFileContents[i][0] =3D=3D "readGaussianOutput") { + /*! + @ingroup MCPB_commands + \code +- Function: readG03Output ++ Function: readGaussianOutput +=20 +- Description: Read G03 Output ++ Description: Read Gaussian Output +=20 +- syntax: readG03Output cuCYM4.log ++ syntax: readGaussianOutput cuCYM4.log + \endcode + */ + if ((inputFileContents[i].size() =3D=3D 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=3D1)"); ++ pGParser->addCommandOption("Freq", "NoRaman"); ++ pGParser->addIop("IOp(7/33=3D1)"); + pGParser->Write(inputFileContents[i][2], pSelMol); + pGParser->writeMappingFile(inputFileContents[i][2]+".map"); + } +@@ -3826,6 +4005,7 @@ + if (pStdFrag) { + bool doIt =3D pStdGroup->hasStdFrag(pStdFrag->getSymbol= ()); + if (doIt) { ++ //std::cout << " " << pStdFrag->getSymbol() << "\n"; + //submolecule* pStdSubmol =3D pStdMolecule->addSubMol= ecule(); + //pStdSubmol->copy(submolList[t]); + std::vector lAtomList =3D submolList[t]->getAt= omList(); +@@ -3834,7 +4014,8 @@ + if (pStdAtom) { + //std::cout << " |" << lAtomList[r]->getName() <<= "| " << lAtomList[r]->getZcharge() << "\n"; + pStdAtom->atmCharge =3D lAtomList[r]->getZcharge(= ); +- groupCharge +=3D lAtomList[r]->getZcharge(); ++ //groupCharge +=3D lAtomList[r]->getZcharge(); ++ groupCharge +=3D pStdAtom->atmCharge; + } + } + } +@@ -3861,11 +4042,398 @@ + */ + } + updateRespChargesMessage +=3D " Charge: " + double2String(gro= upCharge, 2); ++ //std::cout << " Group charge =3D " << double2String(groupCharge, 2= ) << "\n"; + MTKpp::errorLogger.throwError("MCPB::updateRespCharges", + updateRespChargesMessage, INFO); + } + } +=20 ++ else if (inputFileContents[i][0] =3D=3D "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() !=3D 4) or (!pCollection)) { ++ MTKpp::errorLogger.throwError("MCPB::respgen", ++ " Incorrect use ... exiting ", MTK_ERROR); ++ exit(1); ++ } ++ else { ++ selection* pSel =3D new selection(pCollection); ++ failure =3D pSel->parse(inputFileContents[i][1]); ++ if (failure) { ++ MTKpp::errorLogger.throwError("MCPB::respgen", ++ " Error in selection parsing ... exiting ", MTK_ERROR); ++ exit(1); ++ } ++ ++ stdLibrary* pStdLibrary =3D pCollection->getStdLibrary(); ++ stdGroup* pStdGroup =3D 0; ++ if (pStdLibrary) { ++ pStdGroup =3D 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() =3D=3D 1) { ++ molecule* pSelMol =3D pSel->getMol(); ++ if (!pSelMol) { ++ std::cout << " Error in respgen selection \n"; ++ exit(1); ++ } ++ ++ std::vector::iterator result; ++ ++ acParser* pAcParser =3D new acParser(); ++ pAcParser->Write(inputFileContents[i][3]+".ac", pCollection); ++ delete pAcParser; ++ ++ std::string bb0FileResp1 =3D inputFileContents[i][3] + "_bb0.resp1"= ; ++ std::string bb0FileResp2 =3D inputFileContents[i][3] + "_bb0.resp2"= ; ++ std::ofstream obb0FileResp1; ++ std::ofstream obb0FileResp2; ++ obb0FileResp1.open(bb0FileResp1.c_str()); ++ obb0FileResp2.open(bb0FileResp2.c_str()); ++ ++ std::string bb1FileResp1 =3D inputFileContents[i][3] + "_bb1.resp1"= ; ++ std::string bb1FileResp2 =3D inputFileContents[i][3] + "_bb1.resp2"= ; ++ std::ofstream obb1FileResp1; ++ std::ofstream obb1FileResp2; ++ obb1FileResp1.open(bb1FileResp1.c_str()); ++ obb1FileResp2.open(bb1FileResp2.c_str()); ++ ++ std::string bb2FileResp1 =3D inputFileContents[i][3] + "_bb2.resp1"= ; ++ std::string bb2FileResp2 =3D inputFileContents[i][3] + "_bb2.resp2"= ; ++ std::ofstream obb2FileResp1; ++ std::ofstream obb2FileResp2; ++ obb2FileResp1.open(bb2FileResp1.c_str()); ++ obb2FileResp2.open(bb2FileResp2.c_str()); ++ ++ std::string bb3FileResp1 =3D inputFileContents[i][3] + "_bb3.resp1"= ; ++ std::string bb3FileResp2 =3D 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 !obb1File= Resp2 or ++ !obb2FileResp1 or !obb2FileResp2 or !obb3FileResp1 or !obb3File= Resp2) { ++ MTKpp::errorLogger.throwError("MCPB::respgen", ++ " Unable to open RESP files ... exiting ", MTK_ERROR); ++ exit(1); ++ } ++ ++ std::vector molList =3D pCollection->getMoleculeList(); ++ ++ std::string terminalFrags =3D ""; ++ char temp[100]; ++ bool bFirst =3D true; ++ for (unsigned int m =3D 0; m < molList.size(); m++) { ++ molecule* pMol =3D molList[m]; ++ std::vector submols =3D pMol->getSubMoleculeList(); ++ for (unsigned int s =3D 0; s < submols.size(); s++) { ++ if (submols[s]->hasStdFrag()) { ++ stdFrag* pStdFrag =3D submols[s]->getStdFrag(); ++ if (pStdFrag->getParent()->getName() !=3D inputFileContents[i][2= ]) { ++ if (bFirst) { ++ sprintf(temp,"%5d%10.5f\n", pStdFrag->numStdAtoms(), 0.0); ++ bFirst =3D false; ++ } ++ else { ++ sprintf(temp,"\n%5d%10.5f\n", pStdFrag->numStdAtoms(), 0.0); ++ } ++ =09 ++ terminalFrags +=3D std::string(temp); ++ std::vector atomList =3D submols[s]->getAtomList(); ++ char temp2[80]; ++ int counter =3D 0; ++ for (unsigned int a =3D 0; a < atomList.size(); a++) { ++ if (counter > 7) { // was 6 ++ terminalFrags +=3D "\n"; ++ counter =3D 0; ++ } ++ sprintf(temp2,"%5d%5d", 1, atomList[a]->getIndex()); ++ terminalFrags +=3D std::string(temp2); ++ counter++; ++ } ++ //terminalFrags +=3D "\n"; ++ } ++ } ++ } ++ } ++ //std::cout << terminalFrags << std::endl; ++ ++ std::string bb0 =3D terminalFrags + "\n"; ++ std::string bb1 =3D terminalFrags + "\n"; ++ std::string bb2 =3D terminalFrags + "\n"; ++ std::string bb3 =3D terminalFrags + "\n"; ++ ++ int lInd =3D 0; ++ for (unsigned int m =3D 0; m < molList.size(); m++) { ++ molecule* pMol =3D molList[m]; ++ ++ if (pMol->getName() =3D=3D "Reference") continue; ++ ++ std::vector submols =3D pMol->getSubMoleculeList(); ++ for (unsigned int s =3D 0; s < submols.size(); s++) { ++ if (submols[s]->hasStdFrag()) { ++ stdFrag* pStdFrag =3D submols[s]->getStdFrag(); ++ //std::cout << " respgen " << pStdFrag->getParent()->getName() = << " " << inputFileContents[i][2] << " \n "; ++ if (pStdFrag->getParent()->getName() !=3D inputFileContents[i][2= ]) continue; ++ std::vector subAtoms =3D submols[s]->getAtomList(); ++ for (unsigned int a =3D 0; a < subAtoms.size(); a++) { ++ stdAtom* pStdAtom_a =3D subAtoms[a]->getStdAtom(); ++ lInd++; ++ // iBB =3D=3D 1 ++ if (pStdAtom_a) { ++ std::string dd =3D pStdAtom_a->identity + ":" + pStdAtom_a->ty= pe; ++ =09 ++ //result =3D find(bb_heavy.begin(), bb_heavy.end(), subAtoms[a= ]->getName()); ++ //result =3D find(bb_heavy.begin(), bb_heavy.end(), pStdAtom_a= ->identity); ++ result =3D find(bb_heavy.begin(), bb_heavy.end(), dd); ++ ++ if (result !=3D bb_heavy.end()) { ++ sprintf(temp,"%5d%10.5f\n", 1, pStdAtom_a->atmCharge); ++ //freezingAtoms +=3D "\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 +=3D std::string(temp); ++ sprintf(temp,"%5d%5d\n", 1, subAtoms[a]->getIndex()); ++ //orespAdd << temp << std::endl; ++ bb1 +=3D std::string(temp); ++ } ++ ++ // iBB =3D=3D 2 ++ dd =3D pStdAtom_a->identity + ":" + pStdAtom_a->type; ++ ++ //result =3D find(bb.begin(), bb.end(), subAtoms[a]->getName()= ); ++ result =3D find(bb.begin(), bb.end(), dd); ++ ++ if (result !=3D bb.end()) { ++ //freezingAtoms +=3D "\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 +=3D std::string(temp); ++ sprintf(temp,"%5d%5d\n", 1, subAtoms[a]->getIndex()); ++ //orespAdd << temp << std::endl; ++ bb2 +=3D std::string(temp); ++ } ++ // iBB =3D=3D 3=20 ++ dd =3D pStdAtom_a->identity + ":" + pStdAtom_a->type; ++ ++ //result =3D find(bbb.begin(), bbb.end(), subAtoms[a]->getName= ()); ++ result =3D find(bbb.begin(), bbb.end(), dd); ++ ++ if (result !=3D bbb.end()) { ++ //freezingAtoms +=3D "\n BBB " + submols[s]->getName() + " " ++ // + int2String(submols[s]->getSubMolId()) + " "= + dd; ++ sprintf(temp,"%5d%10.5f\n", 1, pStdAtom_a->atmCharge); ++ bb3 +=3D std::string(temp); ++ //orespAdd << temp << std::endl; ++ sprintf(temp,"%5d%5d\n", 1, subAtoms[a]->getIndex()); ++ bb3 +=3D std::string(temp); ++ //orespAdd << temp << std::endl; ++ } ++ } ++ else { ++ MTKpp::errorLogger.throwError("MCPB::respgen", ++ " Unknown option ... exiting ", MTK_ERROR); ++ } ++ } ++ } ++ } ++ } ++ ++ std::string resp1 =3D ""; ++ resp1 +=3D "Resp charges for organic molecule\n"; ++ resp1 +=3D "\n"; ++ resp1 +=3D " &cntrl\n"; ++ resp1 +=3D "\n"; ++ resp1 +=3D " nmol =3D 1,\n"; ++ resp1 +=3D " ihfree =3D 1,\n"; ++ resp1 +=3D " ioutopt =3D 1,\n"; ++ resp1 +=3D "\n"; ++ resp1 +=3D " &end\n"; ++ resp1 +=3D " 1.0\n"; ++ resp1 +=3D "Resp charges for organic molecule\n"; ++ ++ //std::cout << pStdGroup->getCharge() << " " << pSelMol->getNumAtom= s() << std::endl; ++ sprintf(temp,"%5d%5d\n", int(pStdGroup->getCharge()), pSelMol->get= NumAtoms()); ++ resp1 +=3D std::string(temp); ++ ++ std::vector sList =3D pSelMol->getSubMoleculeList(); ++ typedef std::map::iterator mapIterator; ++ ++ std::map lMap; ++ int ind =3D 0; ++ for (unsigned int p =3D 0; p < sList.size(); p++) { ++ std::vector aList =3D sList[p]->getAtomList(); ++ for (unsigned int a =3D 0; a < aList.size(); a++) { ++ if (!aList[a]->getStdAtom()) { ++ std::cout << " Error ... exiting()\n"; ++ exit(1); ++ } ++ int elNum =3D aList[a]->getAtomicNum(); ++ std::string key =3D ""; ++ if (elNum =3D=3D 1) { ++ std::vector hBondedAtoms =3D aList[a]->getBondedAtoms(); ++ if (hBondedAtoms.size() =3D=3D 1) { ++ key =3D aList[a]->getParent()->getName() + ":" + hBondedAtoms[0= ]->getName() + ":" + aList[a]->getStdAtom()->type; ++ } ++ else { ++ key =3D aList[a]->getParent()->getName() + ":" + aList[a]->getS= tdAtom()->type; ++ } ++ } ++ else { ++ key =3D aList[a]->getParent()->getName() + ":" + aList[a]->getNa= me(); ++ } ++ ++ mapIterator mi =3D lMap.find(key); ++ ++ int fg =3D 0; ++ if (mi !=3D lMap.end()){ ++ fg =3D lMap[key]+1; ++ } ++ else { ++ lMap[key] =3D 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 +=3D std::string(temp); ++ ind++; ++ } ++ } ++ ++ std::string resp2 =3D ""; ++ ++ resp2 +=3D "Resp charges for organic molecule\n"; ++ resp2 +=3D "\n"; ++ resp2 +=3D " &cntrl\n"; ++ resp2 +=3D "\n"; ++ resp2 +=3D " nmol =3D 1,\n"; ++ resp2 +=3D " ihfree =3D 1,\n"; ++ resp2 +=3D " ioutopt =3D 1,\n"; ++ resp2 +=3D " iqopt =3D 2,\n"; ++ resp2 +=3D " qwt =3D 0.001,\n"; ++ resp2 +=3D "\n"; ++ resp2 +=3D " &end\n"; ++ resp2 +=3D " 1.0\n"; ++ resp2 +=3D "Resp charges for organic molecule\n"; ++ ++ sprintf(temp,"%5d%5d\n", int(pStdGroup->getCharge()), pSelMol->get= NumAtoms()); ++ resp2 +=3D std::string(temp); ++ ++ ind =3D 0; ++ std::map lMap2; ++ ++ for (unsigned int p =3D 0; p < sList.size(); p++) { ++ std::vector aList =3D sList[p]->getAtomList(); ++ for (unsigned int a =3D 0; a < aList.size(); a++) { ++ ++ if (!aList[a]->getStdAtom()) { ++ std::cout << " Error ... exiting()\n"; ++ exit(1); ++ } ++ int elNum =3D aList[a]->getAtomicNum(); ++ std::string key =3D ""; ++ if (elNum =3D=3D 1) { ++ std::vector hBondedAtoms =3D aList[a]->getBondedAtoms(); ++ if (hBondedAtoms.size() =3D=3D 1) { ++ key =3D aList[a]->getParent()->getName() + ":" + hBondedAtoms[0= ]->getName() + ":" +=20 ++ aList[a]->getStdAtom()->type; ++ } ++ else { ++ key =3D aList[a]->getParent()->getName() + ":" + aList[a]->getS= tdAtom()->type; ++ } ++ } ++ else { ++ key =3D aList[a]->getParent()->getName() + ":" + aList[a]->getNa= me(); ++ } ++ ++ mapIterator mi =3D lMap2.find(key); ++ ++ int fg =3D 0; ++ if (mi !=3D lMap2.end()){ ++ fg =3D lMap2[key]+1; ++ } ++ else { ++ lMap2[key] =3D ind; ++ } ++ std::string atName =3D aList[a]->getName(); ++ std::string atType =3D aList[a]->getStdAtom()->type; ++ int atNum =3D aList[a]->getAtomicNum(); ++ ++ if (atName =3D=3D " CH3" or atName =3D=3D " CB " or containsSubSt= r(key, " CB :H1") or ++ containsSubStr(key, " CB :HC") or=20 ++ containsSubStr(key, " CH3:HC") or containsSubStr(key, " CH3:H1")= or ++ containsSubStr(key, "GLY: CA ")) {// or (atNum > 16)) { ++ //if (atName =3D=3D " CH3" or atName =3D=3D " CB " or atType =3D= =3D "H1" or atType =3D=3D "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 +=3D std::string(temp); ++ ++ ind++; ++ } ++ } ++ ++ std::string twoBlankLine =3D "\n\n"; ++ bb0 +=3D twoBlankLine; ++ bb1 +=3D twoBlankLine; ++ bb2 +=3D twoBlankLine; ++ bb3 +=3D 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] =3D=3D "addStdMol") { + /*! + @ingroup MCPB_commands +@@ -4496,63 +5064,63 @@ + table* nmodeEVectors =3D pSheet->getTable("NMode Eige= nVectors"); + ublas::matrix &nmodeEVectorsMatrixT =3D nmodeEVectors= ->getMatrix(); +=20 +- table* g03EValues =3D pSheet->getTable("Gaussian Eige= nValues"); +- ublas::matrix &g03EValuesMatrix =3D g03EValues->getMa= trix(); ++ table* gaussianEValues =3D pSheet->getTable("Gaussian Eige= nValues"); ++ ublas::matrix &gaussianEValuesMatrix =3D gaussianEValues->= getMatrix(); +=20 +- table* g03EVectors =3D pSheet->getTable("Gaussian Eig= enVectors"); +- ublas::matrix &g03EVectorsMatrixT =3D g03EVectors->ge= tMatrix(); ++ table* gaussianEVectors =3D pSheet->getTable("Gaussian Eig= enVectors"); ++ ublas::matrix &gaussianEVectorsMatrixT =3D gaussianEVector= s->getMatrix(); +=20 + int nRowsNMode =3D nmodeEValues->getNumRows(); +- int nRowsG03 =3D g03EValues->getNumRows(); ++ int nRowsGaussian =3D gaussianEValues->getNumRows(); +=20 + int nColsNMode =3D nmodeEVectors->getNumColumns(); +- int nColsG03 =3D g03EVectors->getNumColumns(); ++ int nColsGaussian =3D gaussianEVectors->getNumColumns(); +=20 +- if (nRowsNMode !=3D nRowsG03 and nColsNMode !=3D nColsG03) { ++ if (nRowsNMode !=3D nRowsGaussian and nColsNMode !=3D nColsGaussia= n) { + std::cout << " PROBLEM " << std::endl; + } + else { + std::cout << " EIGENVALUES " << std::endl; + for (int z =3D 0; z < nRowsNMode; z++) { +- std::cout << nmodeEValuesMatrix(z, 0) << " " << g03EValue= sMatrix(z, 0) << std::endl; ++ std::cout << nmodeEValuesMatrix(z, 0) << " " << gaussianEValuesMat= rix(z, 0) << std::endl; + } +=20 + //std::cout << " NMODE " << std::endl; + //nmodeEVectors->printMatrix(); +=20 +- //std::cout << " G03 " << std::endl; +- //g03EVectors->printMatrix(); ++ //std::cout << " Gaussian " << std::endl; ++ //gaussianEVectors->printMatrix(); + //std::cout << " \n\n " << std::endl; +=20 + // Normalize Eigenvector matrices + for (int zi =3D 0; zi < nRowsNMode; zi++) { + double normNMode =3D 0.0; +- double normG03 =3D 0.0; ++ double normGaussian =3D 0.0; + for (int zk =3D 0; zk < nColsNMode; zk++) { + normNMode +=3D (nmodeEVectorsMatrixT(zi, zk) * nmodeEVe= ctorsMatrixT(zi, zk)); +- normG03 +=3D (g03EVectorsMatrixT(zi, zk) * g03EVectorsM= atrixT(zi, zk)); ++ normGaussian +=3D (gaussianEVectorsMatrixT(zi, zk) * gaussianEVect= orsMatrixT(zi, zk)); + } + normNMode =3D sqrt(normNMode); +- normG03 =3D sqrt(normG03); ++ normGaussian =3D sqrt(normGaussian); + for (int zk =3D 0; zk < nColsNMode; zk++) { +- //std::cout << g03EVectorsMatrixT(zi, zk) << " " << nor= mG03 << " " +- // << g03EVectorsMatrixT(zi, zk) / normG03 << = " "; ++ //std::cout << gaussianEVectorsMatrixT(zi, zk) << " " << normGauss= ian << " " ++ // << gaussianEVectorsMatrixT(zi, zk) / normGaussian << "= "; + double newValue1 =3D nmodeEVectorsMatrixT(zi, zk) / nor= mNMode; +- double newValue2 =3D g03EVectorsMatrixT(zi, zk) / normG= 03; ++ double newValue2 =3D gaussianEVectorsMatrixT(zi, zk) / normGaussia= n; + 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= ; + } + } +=20 + ublas::matrix &nmodeEVectorsMatrix =3D nmodeEVector= s->getMatrix(); +- ublas::matrix &g03EVectorsMatrix =3D g03EVectors->g= etMatrix(); ++ ublas::matrix &gaussianEVectorsMatrix =3D gaussianEVectors= ->getMatrix(); +=20 + //std::cout << " NMODE " << std::endl; + //nmodeEVectors->printMatrix(); +=20 +- //std::cout << " G03 " << std::endl; +- //g03EVectors->printMatrix(); ++ //std::cout << " Gaussian " << std::endl; ++ //gaussianEVectors->printMatrix(); + //std::cout << " \n\n " << std::endl; +=20 + // dot product +@@ -4563,12 +5131,12 @@ + double eN2 =3D 0.0; + double dff =3D 0.0; + for (int zi =3D 0; zi < nRowsNMode; zi++) { // NMode +- for (int zj =3D 0; zj < nRowsNMode; zj++) { // G03 ++ for (int zj =3D 0; zj < nRowsNMode; zj++) { // Gaussian + for (int zk =3D 0; zk < nColsNMode; zk++) { // Loop ove= r coordinates in Eigenvector +- //std::cout << nmodeEVectorsMatrix(zi, zk) << " " << = g03EVectorsMatrix(zj, zk) << " "; ++ //std::cout << nmodeEVectorsMatrix(zi, zk) << " " << gaussianEVec= torsMatrix(zj, zk) << " "; + eN +=3D (nmodeEVectorsMatrix(zi, zk) * nmodeEVectorsM= atrix(zi, zk)); +- eN2 +=3D (g03EVectorsMatrix(zj, zk) * g03EVectorsMatr= ix(zj, zk)); +- dotProduct +=3D (nmodeEVectorsMatrix(zi, zk) * g03EVe= ctorsMatrix(zj, zk)); ++ eN2 +=3D (gaussianEVectorsMatrix(zj, zk) * gaussianEVectorsMatrix(= zj, zk)); ++ dotProduct +=3D (nmodeEVectorsMatrix(zi, zk) * gaussianEVectorsMat= rix(zj, zk)); + } + //std::cout << " eN =3D " << sqrt(eN) << " eN2 =3D " <<= sqrt(eN2) << " "; + std::cout << zi << " - " << zj << " " << dotProduct <<= " " << dotProductMax << std::endl; +@@ -4582,11 +5150,11 @@ + } + dotProduct =3D 0.0; + } +- double dffL =3D nmodeEValuesMatrix(zi, 0) - g03EValuesMat= rix(dotProductMaxIndex, 0); ++ double dffL =3D nmodeEValuesMatrix(zi, 0) - gaussianEValuesMatrix(= dotProductMaxIndex, 0); + dffL *=3D dffL; + std::cout << " nmode index =3D " << zi << " BestMa= tch =3D " << dotProductMaxIndex + << " =3D> dotProduct =3D" << dotProductMax << "= EVALUES: " +- << " " << nmodeEValuesMatrix(zi, 0) << " " << g= 03EValuesMatrix(dotProductMaxIndex, 0) << " " ++ << " " << nmodeEValuesMatrix(zi, 0) << " " << gaussianEValuesMatri= x(dotProductMaxIndex, 0) << " " + << dffL + << std::endl; +=20 +@@ -4617,7 +5185,7 @@ + } +=20 + else { +- std::string unknownCommand =3D " Unknown command " + inputFileC= ontents[i][0]; ++ std::string unknownCommand =3D " Unknown command: \"" + inputFileCon= tents[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/A= mberTools/src/mtkpp/tools/prep2xml.cpp +--- amber11.orig/AmberTools/src/mtkpp/tools/prep2xml.cpp 2011-04-14 15:3= 0: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" ); +=20 + // 4. SET THE OPTION STRINGS/CHARACTERS +@@ -97,6 +98,7 @@ + clo->setOption( "hyb", 'l' ); + clo->setOption( "log", 'a' ); +=20 ++ clo->setFlag ( "convert", 'c' ); + clo->setFlag ( "help", 'h' ); +=20 + // 5. PROVIDE THE COMMANDLINE=20 +@@ -117,6 +119,11 @@ + std::string fragName =3D ""; + std::string molName =3D ""; + std::string logFile =3D ""; ++ bool bConvertOnly =3D 0; ++ ++ if ( clo->getFlag( "convert" ) || clo->getFlag( 'c' ) ) { ++ bConvertOnly =3D 1; ++ } +=20 + std::string AMBERHOME =3D getenv("AMBERHOME"); + std::string parametersFile =3D AMBERHOME + "/dat/mtkpp/hybridize/la= bute.txt"; +@@ -166,13 +173,13 @@ + else if ( clo->getValue( "frag" ) !=3D 0 ) { + fragName =3D 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" ) !=3D 0 ) { + parametersFile =3D clo->getValue( "l" ); + } +@@ -186,13 +193,14 @@ + else if ( clo->getValue( "mol" ) !=3D 0 ) { + molName =3D 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" ) !=3D 0 ) { + logFile =3D clo->getValue( "a" ); + } +@@ -307,6 +315,22 @@ + std::cout << " Incorrect use of prep2xml " << std::endl; + exit(1); + } ++ ++ ///////// ++ if (fragName =3D=3D "") { ++ prepParser* pPrepParser =3D new prepParser(); ++ pPrepParser->Read(prepFile, pStdGroup); ++ delete pPrepParser; ++ ++ pStdLibParser->Write(libXmlFile, groupName); ++ delete pStdLibParser; ++ ++ // - Clean up - // ++ delete pCollection; ++ return 0; ++ } ++ /////////// ++ + stdFrag* pStdFrag =3D pStdGroup->addStdFrag(); + if (!pStdFrag) { + std::cout << " Incorrect use of prep2xml " << std::endl; +@@ -322,6 +346,15 @@ + pPrepParser->Read(prepFile, pStdFrag); + delete pPrepParser; +=20 ++ if (bConvertOnly) { ++ pStdLibParser->Write(libXmlFile, groupName); ++ delete pStdLibParser; ++ ++ // - Clean up - // ++ delete pCollection; ++ return 0; ++ } ++ + int f =3D pStdFrag->generateCoordinates(); + if (f) { + std::cout << " Incorrect use of prep2xml " << std::endl; +@@ -443,7 +476,7 @@ + // atoms + for (unsigned int i =3D 0; i < atomList.size(); i++) { + stdAtoms[i]->kind =3D atomList[i]->getType(); +- std::cout << atomList[i]->getIndex() << " " << atomList[i]->getNa= me() << " " << atomList[i]->getType() << std::endl; ++ //std::cout << atomList[i]->getIndex() << " " << atomList[i]->get= Name() << " " << atomList[i]->getType() << std::endl; + } +=20 + // 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:0= 1.418032565 +0200 +@@ -42,6 +42,9 @@ + // - COMMAND LINE OPTIONS + #include "Parsers/commLineOptions.h" +=20 ++// - Log ++#include "Log/errorHandler.h" ++ + // temp + #include "time.h" +=20 +@@ -174,7 +177,7 @@ + } +=20 + // Set errorLog stream to the log file +- //MTKpp::errorLogger.setStream(&oLog); ++ MTKpp::errorLogger.setStream(&oLog); +=20 + // 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.00000= 0000 +0300 ++++ amber11/AmberTools/src/pbsa/pb_list.f 2012-03-03 20:02:55.131034376 = +0200 +@@ -949,7 +949,7 @@ + ymin =3D=3D ZERO .and. ymax =3D=3D ZERO .and. & + zmin =3D=3D ZERO .and. zmax =3D=3D ZERO ) newbox =3D .true. +=20 +- if ( newbox ) then ++ if ( .not. ligand ) then + if ( ifcap =3D=3D 0 .or. ifcap =3D=3D 5 ) then + xmin =3D 9999.0; ymin =3D 9999.0; zmin =3D 9999.0 + xmax =3D -9999.0; ymax =3D -9999.0; zmax =3D -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.98677= 7264 +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 =3D 1024**1 +=20 +- type(memTracker),private :: totalMem ++ type(memTracker),save,private :: totalMem +=20 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!= !!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!= !!!!!!!