From chemistry-request@server.ccl.net Thu Mar 14 00:16:50 2002
Received: from hybrid.fi ([195.170.158.34])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2E5Gnp28415
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 00:16:49 -0500
Received: (from localhost user: 'markku', uid#1889) by hybrid.fi with ESMTP
	id <S542206AbSCNFQW>; Thu, 14 Mar 2002 07:16:22 +0200
Date:   Thu, 14 Mar 2002 07:16:21 +0200 (EET)
Sender: Markku Laukkanen <markku@hybrid.fi>
From: Markku Laukkanen <markku@hybrid.fi>
X-Sender: markku@moon
To: Mark Thompson <mark@planaria-software.com>
cc: Krzysztof Radacki <K.Radacki@ic.ac.uk>, CCL <chemistry@ccl.net>
Subject: Re: CCL:small linux/c++ question.
In-Reply-To: <000701c1caa4$3ae3a7d0$0300a8c0@attbi.com>
Message-ID: <Pine.GSO.4.10.10203140713310.11974-100000@moon>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


And same in c++ & any base, no reverse needed :-)

	PKY


#include <stdio.h>
#include <stdlib.h>
#include <iostream.h>
#include <string.h>

#include <string>

using namespace std;

#define MAX_SIZE_OF_OUTPUT_BUF 1024

char * convertToBase(int number, int base) {
  char buf[MAX_SIZE_OF_OUTPUT_BUF];
  char* tp = buf + sizeof buf;
  *--tp = '\0';
  
  bool neg = false;
  if (number < 0) {
    neg = true;
    number = -number;
  }
  
  int j = 0;
  do {
    if (j++ % 4 == 3) {
      ++j;
    }
    int num = number % base;
    if ((base <= 10) || num < 10) {
      *--tp = '0' + num;
    } else {
      char start = 'A' + base - 10;
      *--tp = start + num - base;
    }
    number /= base;
  } while (number);
  	
  char* sp = (char*)malloc(MAX_SIZE_OF_OUTPUT_BUF);
  if (neg) *sp++ = '-';
  
  strcpy(sp,tp);
  if (neg) {
    return --sp;
  } else {     return sp;
  }
}

string i2String(int value) {
  char* val = convertToBase(value,10);
  string retVal = val;
  free(val);
  return retVal;
}

On Wed, 13 Mar 2002, Mark Thompson wrote:

> 
> Dear Krzysztof,
> 
> I've appended an implementation that I've used in the past.  It creates the
> string in inverted order and reverses it at the end.  All the usual caveats
> about making sure the argument s[] is big enough apply...
> 
> Mark
> 
> =================================
> Mark Thompson, Ph.D.
> Planaria Software
> Seattle, WA.
> http://www.arguslab.com
> =================================
> 
> 
> void Itoa (int n, char s[])
> {
>   int   i, j, c, sign;
> 
>   if ((sign = n) < 0) {n = -n;}
> 
>   i = 0;
> 
>   do
>   {
>     s[i++] = (n % 10) + '0';
>   } while ((n /= 10) > 0);
> 
> 
>   if (sign < 0) {s[i++] = '-';}
> 
>   s[i] = '\0';
> 
>   for (i = 0, j = strlen(s) - 1;  i < j; i++, j--)
>   {
>     c    = s[i];
>     s[i] = s[j];
>     s[j] = c;
>   }
> }
> 
> 
> > -----Original Message-----
> > From: Computational Chemistry List [mailto:chemistry-request@ccl.net]On
> > Behalf Of Krzysztof Radacki
> > Sent: Wednesday, March 13, 2002 3:43 AM
> > To: CCL
> > Subject: CCL:small linux/c++ question.
> >
> >
> > Dear CCL'ers
> > I have a little bit out of topic question.
> > Currently I'm translating my program from Borland C++
> > to gcc and I can't find a function itoa in gcc (it
> > converts integer to string).
> > I would be quite happy if someone could explaine me how
> > to do it in gcc.
> >
> > MfG
> > Krzysztof
> >
> > p.s.
> > because it's realy out-of-topic maybe better if answer
> > would be addressed directly to my e-mail not to ccl.
> >
> >
> > --
> > Dr. K.Radacki
> > Department of Chemistry
> > Catalysis and Advanced Materials Section
> > Imperial College, London
> >
> > CHEMISTRY@ccl.net -- To Everybody  | CHEMISTRY-REQUEST@ccl.net --
> > To Admins
> > CHEMISTRY-SEARCH@ccl.net -- archive search    |    Gopher:
> > gopher.ccl.net 70
> > Ftp: ftp.ccl.net  |  WWW: http://www.ccl.net/chemistry/   | Jan:
> > jkl@ccl.net
> >
> >
> >
> >
> >
> >
> 
> 
> -= This is automatically added to each message by mailing script =-
> CHEMISTRY@ccl.net -- To Everybody  | CHEMISTRY-REQUEST@ccl.net -- To Admins
> MAILSERV@ccl.net -- HELP CHEMISTRY or HELP SEARCH
> CHEMISTRY-SEARCH@ccl.net -- archive search    |    Gopher: gopher.ccl.net 70
> Ftp: ftp.ccl.net  |  WWW: http://www.ccl.net/chemistry/   | Jan: jkl@ccl.net
> 
> 
> 
> 
> 


From chemistry-request@server.ccl.net Wed Mar 13 23:32:02 2002
Received: from mserve1.acs.ucalgary.ca ([136.159.34.51])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2E4W1p27046
	for <chemistry@ccl.net>; Wed, 13 Mar 2002 23:32:01 -0500
Received: from ucalgary.ca (mserve2.acs.ucalgary.ca [136.159.34.55])
	by mserve1.acs.ucalgary.ca (Postfix) with ESMTP
	id 9ED051315; Wed, 13 Mar 2002 21:32:29 -0700 (MST)
Received: from zinc14.chem.ucalgary.ca(136.159.82.218) by mserve2.acs.ucalgary.ca via smap (V2.0)
	id ZZ534046; Wed, 13 Mar 2002 21:31:40 -0700
Mime-Version: 1.0
X-Sender: senn@s.imap.ucalgary.ca (Unverified)
Message-Id: <a05100304b8b5d21bc36c@[136.159.82.218]>
In-Reply-To: <Pine.SOL.4.10.10203132121290.15440-100000@eidfjord>
References: <Pine.SOL.4.10.10203132121290.15440-100000@eidfjord>
Date: Wed, 13 Mar 2002 21:31:41 -0700
To: chemistry@ccl.net
From: Hans Martin Senn <senn@ucalgary.ca>
Subject: Re: CCL:Electrostatic solvation model
Cc: Andrew Horsfield <horsfield@fecit.co.uk>
Content-Type: multipart/alternative; boundary="============_-1196042192==_ma============"


--============_-1196042192==_ma============
Content-Type: text/plain; charset="iso-8859-1" ; format="flowed"
Content-Transfer-Encoding: quoted-printable

At 17:22 Uhr +0000 13.3.2002, Andrew Horsfield wrote:

>Can anyone point me to a proof of the following equation for the
>electrostatic contribution to the solvation energy:
>
>   U =3D 1/2 \sum_{ij} Q_i q_j / r_{ij}
>
>where Q_i is a charge on the solute, and q_j is an induced charge on the
>solute/solvent interface.


At 21:33 Uhr +0100 13.3.2002, Andreas Bender wrote:
>d) But - now you counted each interaction twice! Divide by 2, and you have
>the equation you mentioned.


This is not about double-counting; the Q and the q are different entities.

The factor 1/2 comes from the polarization of the dielectric (or the 
destabilizing interaction between the induced charges q, if you wish) 
that consumes exactly 1/2 of the stabilizing interaction between the 
solute charges and the induced charges. So the net gain in energy, U, 
is only half the interaction energy.
The underlying assumption here is that the dielectric is homogeneous, 
isotropic, and linear. That is, the polarization of the dielectric 
depends linearly on the electric field.

This goes all under the label "electrostatics of polarizable media". 
The ultimate reference is
	C. J. F. B=F6ttcher, Theory of Electric Polarization, 2nd ed.,
	Elsevier, Amsterdam, 1973, Vol. 1.
But Jackson (i.e., J. D. Jackson, Classical Electrodynamics, 3rd ed., 
Wiley, New York, 1999) should also give a derivation. I think a clear 
and simple explanation in terms of a charging process is given in
	http://gilsonlab.umbi.umd.edu/ce_www1a.pdf.


Cheers,

Hans


-- 
=2E.......................................................
Dr. Hans Martin Senn            Phone  +1 403 220 8204
University of Calgary           Fax    +1 403 289 9488
Department of Chemistry         E-Mail senn@ucalgary.ca
2500 University Drive N.W.
Calgary, Alberta
Canada, T2N 1N4
--============_-1196042192==_ma============
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!doctype html public "-//W3C//DTD W3 HTML//EN">
<html><head><style type=3D"text/css"><!--
blockquote, dl, ul, ol, li { padding-top: 0 ; padding-bottom: 0 }
 --></style><title>Re: CCL:Electrostatic solvation
model</title></head><body>
<div>At 17:22 Uhr +0000 13.3.2002, Andrew Horsfield wrote:</div>
<div><br></div>
<blockquote type=3D"cite" cite>Can anyone point me to a proof of the
following equation for the<br>
electrostatic contribution to the solvation energy:<br>
<br>
&nbsp; U =3D 1/2 \sum_{ij} Q_i q_j / r_{ij}<br>
<br>
where Q_i is a charge on the solute, and q_j is an induced charge on
the</blockquote>
<blockquote type=3D"cite" cite>solute/solvent interface.</blockquote>
<div><br></div>
<div><br></div>
<div>At 21:33 Uhr +0100 13.3.2002, Andreas Bender wrote:</div>
<blockquote type=3D"cite" cite>d) But - now you counted each interaction
twice! Divide by 2, and you have</blockquote>
<blockquote type=3D"cite" cite>the equation you mentioned.</blockquote>
<div><br></div>
<div><br></div>
<div>This is not about double-counting; the Q and the q are different
entities.</div>
<div><br></div>
<div>The factor 1/2 comes from the polarization of the dielectric (or
the destabilizing interaction between the induced charges q, if you
wish) that consumes exactly 1/2 of the stabilizing interaction between
the solute charges and the induced charges. So the net gain in energy,
U, is only half the interaction energy.</div>
<div>The underlying assumption here is that the dielectric is
homogeneous, isotropic, and linear. That is, the polarization of the
dielectric depends linearly on the electric field.</div>
<div><br></div>
<div>This goes all under the label &quot;electrostatics of polarizable
media&quot;. The ultimate reference is</div>
<div><font
color=3D"#000000"><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>C. J. F. B=F6ttcher,<i> Theory of Electric Polarization</i>,
2nd ed.,</font></div>
<div><font
color=3D"#000000"><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>Elsevier, Amsterdam, 1973, Vol. 1.</font></div>
<div>But Jackson (i.e.,<font color=3D"#000000"> J. D. Jackson,<i>
Classical Electrodynamics</i>, 3rd ed., Wiley, New York, 1999) should
also give a derivation. I think a clear and simple explanation in
terms of a charging process is given in</font></div>
<div><x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</x-tab>http://gilsonlab.umbi.umd.edu/ce_www1a.pdf.</div>
<div><br></div>
<div><br></div>
<div>Cheers,</div>
<div><br></div>
<div>Hans</div>
<div><br></div>
<div><br></div>
<x-sigsep><pre>-- 
</pre></x-sigsep>
<div>........................................................<br>
Dr. Hans Martin
Senn&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Phone&nbsp; +1 403 220 8204<br>
University of
Calgary&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
=46ax&nbsp;&nbsp;&nbsp; +1 403 289 9488<br>
Department of Chemistry&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
E-Mail senn@ucalgary.ca<br>
2500 University Drive N.W.<br>
Calgary, Alberta<br>
Canada, T2N 1N4</div>
</body>
</html>
--============_-1196042192==_ma============--


From chemistry-request@server.ccl.net Thu Mar 14 01:22:27 2002
Received: from boron.cem.uct.ac.za ([137.158.164.149])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2E6MPp30580
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 01:22:26 -0500
Received: from localhost (csimpson@localhost)
	by boron.cem.uct.ac.za (8.11.0/8.11.0) with ESMTP id g2EAYFp22083;
	Thu, 14 Mar 2002 08:34:17 -0200
X-Authentication-Warning: boron.cem.uct.ac.za: csimpson owned process doing -bs
Date: Thu, 14 Mar 2002 08:34:14 -0200 (GMT+2)
From: Chas Simpson <csimpson@hydrogen.cem.uct.ac.za>
X-Sender: csimpson@boron.cem.uct.ac.za
To: Markku Laukkanen <markku@hybrid.fi>
cc: Mark Thompson <mark@planaria-software.com>,
   Krzysztof Radacki <K.Radacki@ic.ac.uk>, CCL <chemistry@ccl.net>
Subject: Re: CCL:small linux/c++ question.
In-Reply-To: <Pine.GSO.4.10.10203140713310.11974-100000@moon>
Message-ID: <Pine.LNX.4.21.0203140813290.9982-100000@boron.cem.uct.ac.za>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hi

Just a suggestion, try stay away from malloc, free, realloc and calloc.
They're pre ANSI C++. Rather use the new and delete operators, ie:

char *sp = new char[MAX_SIZE_OF_OUTPUT_BUF];

and 

delete [] val;

Even better, try out the standard template library structures, such as
vectors or valarrays. It takes a bit of getting used to though.

Cheers

Chas




On Thu, 14 Mar 2002, Markku Laukkanen wrote:

> 
> And same in c++ & any base, no reverse needed :-)
> 
> 	PKY
> 
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <iostream.h>
> #include <string.h>
> 
> #include <string>
> 
> using namespace std;
> 
> #define MAX_SIZE_OF_OUTPUT_BUF 1024
> 
> char * convertToBase(int number, int base) {
>   char buf[MAX_SIZE_OF_OUTPUT_BUF];
>   char* tp = buf + sizeof buf;
>   *--tp = '\0';
>   
>   bool neg = false;
>   if (number < 0) {
>     neg = true;
>     number = -number;
>   }
>   
>   int j = 0;
>   do {
>     if (j++ % 4 == 3) {
>       ++j;
>     }
>     int num = number % base;
>     if ((base <= 10) || num < 10) {
>       *--tp = '0' + num;
>     } else {
>       char start = 'A' + base - 10;
>       *--tp = start + num - base;
>     }
>     number /= base;
>   } while (number);
>   	
>   char* sp = (char*)malloc(MAX_SIZE_OF_OUTPUT_BUF);
>   if (neg) *sp++ = '-';
>   
>   strcpy(sp,tp);
>   if (neg) {
>     return --sp;
>   } else {     return sp;
>   }
> }
> 
> string i2String(int value) {
>   char* val = convertToBase(value,10);
>   string retVal = val;
>   free(val);
>   return retVal;
> }
> 
> On Wed, 13 Mar 2002, Mark Thompson wrote:
> 
> > 
> > Dear Krzysztof,
> > 
> > I've appended an implementation that I've used in the past.  It creates the
> > string in inverted order and reverses it at the end.  All the usual caveats
> > about making sure the argument s[] is big enough apply...
> > 
> > Mark
> > 
> > =================================
> > Mark Thompson, Ph.D.
> > Planaria Software
> > Seattle, WA.
> > http://www.arguslab.com
> > =================================
> > 
> > 
> > void Itoa (int n, char s[])
> > {
> >   int   i, j, c, sign;
> > 
> >   if ((sign = n) < 0) {n = -n;}
> > 
> >   i = 0;
> > 
> >   do
> >   {
> >     s[i++] = (n % 10) + '0';
> >   } while ((n /= 10) > 0);
> > 
> > 
> >   if (sign < 0) {s[i++] = '-';}
> > 
> >   s[i] = '\0';
> > 
> >   for (i = 0, j = strlen(s) - 1;  i < j; i++, j--)
> >   {
> >     c    = s[i];
> >     s[i] = s[j];
> >     s[j] = c;
> >   }
> > }
> > 
> > 
> > > -----Original Message-----
> > > From: Computational Chemistry List [mailto:chemistry-request@ccl.net]On
> > > Behalf Of Krzysztof Radacki
> > > Sent: Wednesday, March 13, 2002 3:43 AM
> > > To: CCL
> > > Subject: CCL:small linux/c++ question.
> > >
> > >
> > > Dear CCL'ers
> > > I have a little bit out of topic question.
> > > Currently I'm translating my program from Borland C++
> > > to gcc and I can't find a function itoa in gcc (it
> > > converts integer to string).
> > > I would be quite happy if someone could explaine me how
> > > to do it in gcc.
> > >
> > > MfG
> > > Krzysztof
> > >
> > > p.s.
> > > because it's realy out-of-topic maybe better if answer
> > > would be addressed directly to my e-mail not to ccl.
> > >
> > >
> > > --
> > > Dr. K.Radacki
> > > Department of Chemistry
> > > Catalysis and Advanced Materials Section
> > > Imperial College, London
> > >
> > > CHEMISTRY@ccl.net -- To Everybody  | CHEMISTRY-REQUEST@ccl.net --
> > > To Admins
> > > CHEMISTRY-SEARCH@ccl.net -- archive search    |    Gopher:
> > > gopher.ccl.net 70
> > > Ftp: ftp.ccl.net  |  WWW: http://www.ccl.net/chemistry/   | Jan:
> > > jkl@ccl.net
> > >
> > >
> > >
> > >
> > >
> > >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> -= This is automatically added to each message by mailing script =-
> CHEMISTRY@ccl.net -- To Everybody  | CHEMISTRY-REQUEST@ccl.net -- To Admins
> MAILSERV@ccl.net -- HELP CHEMISTRY or HELP SEARCH
> CHEMISTRY-SEARCH@ccl.net -- archive search    |    Gopher: gopher.ccl.net 70
> Ftp: ftp.ccl.net  |  WWW: http://www.ccl.net/chemistry/   | Jan: jkl@ccl.net
> 
> 
> 
> 
> 

-- 
_______________________________________________
Chas Simpson
Computational Chemistry
University of Cape Town
South Africa
e-mail: csimpson@hydrogen.cem.uct.ac.za
http://hydrogen.cem.uct.ac.za/compchem/
_______________________________________________




From chemistry-request@server.ccl.net Thu Mar 14 04:42:58 2002
Received: from ciril.fr ([193.50.27.66])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2E9grp04598
	for <CHEMISTRY@ccl.net>; Thu, 14 Mar 2002 04:42:57 -0500
Received: from host20.lctn.uhp-nancy.fr (host20.lctn.uhp-nancy.fr [193.50.239.24])
	by ciril.fr (8.12.2/8.12.2/Guy-23-01-2002) with ESMTP id g2E9gnTj010280
	for <CHEMISTRY@ccl.net>; Thu, 14 Mar 2002 10:42:49 +0100 (MET)
Received: from lctn.uhp-nancy.fr (host23.lctn.uhp-nancy.fr [193.50.239.30])
	by host20.lctn.uhp-nancy.fr (AIX4.3/8.9.3/8.9.3) with ESMTP id KAA27886
	for <CHEMISTRY@ccl.net>; Thu, 14 Mar 2002 10:44:02 +0100
Sender: assfeld@host20.lctn.uhp-nancy.fr
Message-ID: <3C906E3B.F276EB01@lctn.uhp-nancy.fr>
Date: Thu, 14 Mar 2002 10:32:43 +0100
From: Xavier ASSFELD <Xavier.Assfeld@lctn.uhp-nancy.fr>
Organization: Chimie Theorique
X-Mailer: Mozilla 4.51i [en] (X11; I; AIX 4.3)
X-Accept-Language: en
MIME-Version: 1.0
To: CCL <CHEMISTRY@ccl.net>
Subject: Yaehmop without overlap
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: by amavisd-milter (http://amavis.org/)

Hey,

does someone knows if it is possible with YAEHMOP to
request the diagonalization of the Hamiltonian matrix
directly (i.e. in the nonorthogonal basis). I would like
to do so for teaching purpose, to show that antibonding
destabilization is equal to bonding stabilization if the
overlap is neglected.
Thanx.
 
-- 

                                      ...Xav

Ast. Pr. Xavier Assfeld             Xavier.Assfeld@lctn.uhp-nancy.fr
Laboratoire de Chimie theorique     (T) 33 3 83 91 21 49
Universite Henri Poincare           (F) 33 3 83 91 25 30
F-54506 Nancy BP 239                http://www.lctn.uhp-nancy.fr

From chemistry-request@server.ccl.net Thu Mar 14 05:47:18 2002
Received: from myamlak.ch.uj.edu.pl ([149.156.71.18])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EAlHp05431
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 05:47:17 -0500
Received: from localhost (makowskm@localhost)
	by myamlak.ch.uj.edu.pl (8.9.3/8.9.3) with ESMTP id LAA27966
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 11:44:15 +0100 (MET)
Date: Thu, 14 Mar 2002 11:44:15 +0100 (MET)
From: Marcin Makowski <makowskm@chemia.uj.edu.pl>
X-Sender: makowskm@myamlak.ch.uj.edu.pl
To: chemistry@ccl.net
Subject: Gaussian98-units of IR intensities
Message-ID: <Pine.OSF.4.10.10203141141470.29360-100000@myamlak.ch.uj.edu.pl>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

I cannot guess what are KM/mole units used by Gaussian98 for IR
intensities. I would be grateful if somebody could help me with that.

Marcin Makowski
Ph.D. - student in Theoretical Chemistry
makowskm@chemia.uj.edu.pl



From chemistry-request@server.ccl.net Thu Mar 14 08:52:53 2002
Received: from soul.helsinki.fi ([128.214.3.1])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EDqqp09121
	for <CHEMISTRY@ccl.net>; Thu, 14 Mar 2002 08:52:52 -0500
Received: from localhost (sundius@localhost)
	by soul.helsinki.fi (8.9.3/8.9.3) with ESMTP id PAA13246;
	Thu, 14 Mar 2002 15:52:41 +0200 (EET)
X-Authentication-Warning: soul.helsinki.fi: sundius owned process doing -bs
Date: Thu, 14 Mar 2002 15:52:41 +0200 (EET)
From: Tom Sundius <sundius@pcu.helsinki.fi>
X-Sender:  <sundius@soul.helsinki.fi>
To: Marcin Makowski <makowskm@chemia.uj.edu.pl>
cc: <CHEMISTRY@ccl.net>
Subject: Re: CCL:Gaussian98-units of IR intensities
In-Reply-To: <Pine.OSF.4.10.10203141141470.29360-100000@myamlak.ch.uj.edu.pl>
Message-ID: <Pine.OSF.4.30.0203141543330.11457-100000@soul.helsinki.fi>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Thu, 14 Mar 2002, Marcin Makowski wrote:

> I cannot guess what are KM/mole units used by Gaussian98 for IR
> intensities. I would be grateful if somebody could help me with that.
>
> Marcin Makowski
> Ph.D. - student in Theoretical Chemistry
> makowskm@chemia.uj.edu.pl
>
It is km/mole - this unit is described, for instance, in
W.B. Person and J.H. Newton, J. Chem. Phys. 61 (1974) 1040
K. Kim and W.T. King, J. Chem. Phys. 80 (1984) 969
Some conversion factors can be found in an appendix to the paper
I.G. John, G.B. Bacskay and N.S. Hush, Chem. Phys. 51 (1980) 49-60
In the Gaussian user's guide is given another conversion factor:
42.2547 km/mole = 1 debye^2/(angstrom^2*AMU)

    Hope this helps,

         Tom S.


Tom Sundius
University of Helsinki, Dept of Physical Sciences   phone +358-9-191 50672
P.O.Box 64, FIN-00014 Helsinki, Finland             fax   +358-9-191 50610


From chemistry-request@server.ccl.net Thu Mar 14 09:45:23 2002
Received: from resu1.ulb.ac.be ([164.15.59.200])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EEjNp10845
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 09:45:23 -0500
Received: from mach.vub.ac.be (mach.ulb.ac.be [164.15.128.3]) by resu1.ulb.ac.be (8.8.8/3.17.1.ap (resu))
        id PAA01213; Thu, 14 Mar 2002 15:42:35 +0100 (MET) for <chemistry@ccl.net>
Received: from ultr.vub.ac.be (ultr11.vub.ac.be [134.184.42.11]) by mach.vub.ac.be (8.9.3/3.13.3.ap (mach))
        id PAA25687; Thu, 14 Mar 2002 15:45:15 +0100 (MET) for <chemistry@ccl.net>
Sender: lieven@ultr.vub.ac.be
Message-ID: <3C90B6F1.BBD869B4@ultr.vub.ac.be>
Date: Thu, 14 Mar 2002 15:42:58 +0100
From: Lieven Buts <lieven@ultr.vub.ac.be>
Organization: Vrije Universiteit Brussel (VUB)
X-Mailer: Mozilla 4.78C-SGI [en] (X11; U; IRIX 6.5 IP32)
X-Accept-Language: nl, nl-BE, en
MIME-Version: 1.0
To: chemistry@ccl.net
Subject: Lennard-Jones parameters for Mn2+
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

  Last week I asked about Lennard-Jones parameters for
divalent manganese ions. Marcel Swart suggested using the
parameters from the MM3 force field. These parameters are
(sigma,epsilon) or (s,e) pairs for the potential

  V(r) = 4*e*( (s/r)**12 - (s/r)**6 )

.

  Matching this with the potential as defined by GROMACS (

  V(r) = C12/(r**12) - C6/(r**6)

) I figure that C6 = 4*e*r**6 and C12 = 4*e*r**12 .

  To make the comparison I did the calculation for calcium
(using 1 cal = 4.184 J and standard GROMACS MD units):
 
    MM3:  s = 2.77 angstrom = 0.277 nm
          e = 0.134 kcal/mol = 0.561 kJ/mol

    ---> C6 = 1.013e-3 kJ.(nm**6)/mol
        C12 = 4.576e-7 kJ.(nm**12)/mol

    GROMACS: C6 = 0.10052E-02 = 1.0052e-3 ...
            C12 = 0.49800E-06 = 4.9800e-7 ...

  This matches pretty well, I think.


  Making the calculations for Mn2+ I get:

     MM3:  s = 2.20 angstrom = 0.22 nm
           e = 0.308 kcal/mol = 1.289 kJ/mol

     --->  C6 = 5.844e-4 kJ.nm**6/mol
          C12 = 6.626e-8 kJ.nm**12/mol


  Do these values seem reasonable?

-- 
Lieven Buts
Department of Ultrastructure
Vrije Universiteit Brussel
http://ultr.vub.ac.be/~lieven

From chemistry-request@server.ccl.net Thu Mar 14 10:09:26 2002
Received: from gandalf.cber.nih.gov ([128.231.52.5])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EF9Qp11543
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 10:09:26 -0500
Received: from localhost (rvenable@localhost) by gandalf.cber.nih.gov (980427.SGI.8.8.8/980728.SGI.AUTOCF) via ESMTP id KAA03967; Thu, 14 Mar 2002 10:03:25 -0500 (EST)
Date: Thu, 14 Mar 2002 10:03:25 -0500
From: Rick Venable <rvenable@gandalf.cber.nih.gov>
To: Markku Laukkanen <markku@hybrid.fi>
cc: Mark Thompson <mark@planaria-software.com>,
   Krzysztof Radacki <K.Radacki@ic.ac.uk>, CCL <chemistry@ccl.net>
Subject: Re: CCL:small linux/c++ question.
In-Reply-To: <Pine.GSO.4.10.10203140713310.11974-100000@moon>
Message-ID: <Pine.SGI.4.21.0203141001330.3963-100000@gandalf.cber.nih.gov>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII



Gee, and it's a one liner in Fortran:

	character *80  str
	integer i

	write (str,'(I12)') i


On Thu, 14 Mar 2002, Markku Laukkanen wrote:

> 
> And same in c++ & any base, no reverse needed :-)
> 
> 	PKY
> 
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <iostream.h>
> #include <string.h>
> 
> #include <string>
> 
> using namespace std;
> 
> #define MAX_SIZE_OF_OUTPUT_BUF 1024
> 
> char * convertToBase(int number, int base) {
>   char buf[MAX_SIZE_OF_OUTPUT_BUF];
>   char* tp = buf + sizeof buf;
>   *--tp = '\0';
>   
>   bool neg = false;
>   if (number < 0) {
>     neg = true;
>     number = -number;
>   }
>   
>   int j = 0;
>   do {
>     if (j++ % 4 == 3) {
>       ++j;
>     }
>     int num = number % base;
>     if ((base <= 10) || num < 10) {
>       *--tp = '0' + num;
>     } else {
>       char start = 'A' + base - 10;
>       *--tp = start + num - base;
>     }
>     number /= base;
>   } while (number);
>   	
>   char* sp = (char*)malloc(MAX_SIZE_OF_OUTPUT_BUF);
>   if (neg) *sp++ = '-';
>   
>   strcpy(sp,tp);
>   if (neg) {
>     return --sp;
>   } else {     return sp;
>   }
> }
> 
> string i2String(int value) {
>   char* val = convertToBase(value,10);
>   string retVal = val;
>   free(val);
>   return retVal;
> }
> 
> On Wed, 13 Mar 2002, Mark Thompson wrote:
> 
> > 
> > Dear Krzysztof,
> > 
> > I've appended an implementation that I've used in the past.  It creates the
> > string in inverted order and reverses it at the end.  All the usual caveats
> > about making sure the argument s[] is big enough apply...
> > 
> > Mark
> > 
> > =================================
> > Mark Thompson, Ph.D.
> > Planaria Software
> > Seattle, WA.
> > http://www.arguslab.com
> > =================================
> > 
> > 
> > void Itoa (int n, char s[])
> > {
> >   int   i, j, c, sign;
> > 
> >   if ((sign = n) < 0) {n = -n;}
> > 
> >   i = 0;
> > 
> >   do
> >   {
> >     s[i++] = (n % 10) + '0';
> >   } while ((n /= 10) > 0);
> > 
> > 
> >   if (sign < 0) {s[i++] = '-';}
> > 
> >   s[i] = '\0';
> > 
> >   for (i = 0, j = strlen(s) - 1;  i < j; i++, j--)
> >   {
> >     c    = s[i];
> >     s[i] = s[j];
> >     s[j] = c;
> >   }
> > }
> > 
> > 
> > > -----Original Message-----
> > > From: Computational Chemistry List [mailto:chemistry-request@ccl.net]On
> > > Behalf Of Krzysztof Radacki
> > > Sent: Wednesday, March 13, 2002 3:43 AM
> > > To: CCL
> > > Subject: CCL:small linux/c++ question.
> > >
> > >
> > > Dear CCL'ers
> > > I have a little bit out of topic question.
> > > Currently I'm translating my program from Borland C++
> > > to gcc and I can't find a function itoa in gcc (it
> > > converts integer to string).
> > > I would be quite happy if someone could explaine me how
> > > to do it in gcc.
> > >
> > > MfG
> > > Krzysztof
> > >
> > > p.s.
> > > because it's realy out-of-topic maybe better if answer
> > > would be addressed directly to my e-mail not to ccl.
> > >
> > >
> > > --
> > > Dr. K.Radacki
> > > Department of Chemistry
> > > Catalysis and Advanced Materials Section
> > > Imperial College, London
> > >
> > > CHEMISTRY@ccl.net -- To Everybody  | CHEMISTRY-REQUEST@ccl.net --
> > > To Admins
> > > CHEMISTRY-SEARCH@ccl.net -- archive search    |    Gopher:
> > > gopher.ccl.net 70
> > > Ftp: ftp.ccl.net  |  WWW: http://www.ccl.net/chemistry/   | Jan:
> > > jkl@ccl.net
> > >
> > >
> > >
> > >
> > >
> > >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> 
> 
> -= This is automatically added to each message by mailing script =-
> CHEMISTRY@ccl.net -- To Everybody  | CHEMISTRY-REQUEST@ccl.net -- To Admins
> MAILSERV@ccl.net -- HELP CHEMISTRY or HELP SEARCH
> CHEMISTRY-SEARCH@ccl.net -- archive search    |    Gopher: gopher.ccl.net 70
> Ftp: ftp.ccl.net  |  WWW: http://www.ccl.net/chemistry/   | Jan: jkl@ccl.net
> 
> 
> 
> 
> 


=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
Rick Venable           29/500
FDA/CBER/OVRR Biophysics Lab
1401 Rockville Pike    HFM-419
Rockville, MD  20852-1448  U.S.A.
(301) 496-1905   Rick_Venable@nih.gov
ALT email:  rvenable@speakeasy.org
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=



From chemistry-request@server.ccl.net Thu Mar 14 10:31:01 2002
Received: from smtp2.ruc.dk ([130.225.220.70])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EFV1p12260
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 10:31:01 -0500
Received: by smtp2.ruc.dk (Postfix, from userid 504)
	id A01321C0986; Thu, 14 Mar 2002 16:31:00 +0100 (CET)
Received: from smtprelay.ruc.dk (smtprelay.ruc.dk [130.225.220.22])
	by smtp2.ruc.dk (Postfix) with ESMTP
	id D0E091C0983; Thu, 14 Mar 2002 16:30:59 +0100 (CET)
Received: from virgil.ruc.dk (virgil.ruc.dk [130.225.220.110])
	by smtprelay.ruc.dk (8.9.3+Sun/8.9.3) with ESMTP id QAA17486;
	Thu, 14 Mar 2002 16:00:56 +0100 (MET)
Received: from VIRGIL/SpoolDir by virgil.ruc.dk (Mercury 1.47);
    14 Mar 02 16:30:57 +0100
Received: from SpoolDir by VIRGIL (Mercury 1.47); 14 Mar 02 16:30:46 +0100
From: "Jens Spanget-Larsen" <spanget@virgil.ruc.dk>
Organization: Roskilde Universitetscenter
To: Marcin Makowski <makowskm@chemia.uj.edu.pl>
Date: Thu, 14 Mar 2002 16:30:43 +0100
Subject: Re: CCL:Gaussian98-units of IR intensities
Reply-To: spanget@ruc.dk
Cc: chemistry@ccl.net
Priority: normal
X-mailer: Pegasus Mail for Windows (v2.23)
Message-ID: <86F07B02C7F@virgil.ruc.dk>

Marcin Makowski:

> I cannot guess what are KM/mole units used by Gaussian98 for IR
> intensities. I would be grateful if somebody could help me with
> that.


Dear Marcin:

In vibrational spectroscopy, integrated band intensity is usually 
defined by

A = (1/C) Integral,

where C is the concentration in mol/L = mol/(1000 cm^3) and the 
integral is over the absorption coefficient a(nu) as a function of 
wavenumber nu (the quantity a(nu)/C is frequently called the 
absorptivity). The absorption coefficient a(nu) is related to the 
decadic molar extinction coefficient eps(nu) through the relation  
a(nu) = ln(10) eps(nu) C, and has traditionally the units cm^(-1). 
Also wavenumbers are traditionally given in units of cm^(-1) and the 
integral thus produces a quantity in the units cm^(-2). Finally, 
multiplication with 1/C yields a result in the units 

(L/mol) cm^(-2) = (1000 cm^3/mol) cm(^-2) = 1000 cm/mol = 10 m/mol

However, chemists prefer the units 1000 m/mol = km/mol.

OK?

Yours, Jens >--<

NB! Please note new mail address: <spanget@ruc.dk>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
JENS SPANGET-LARSEN         Office:         +45 4674 2710
Department of Chemistry     Fax:            +45 4674 3011
Roskilde University (RUC)   Mobile:         +45 2320 6246
P.O.Box 260                 E-Mail:        spanget@ruc.dk
DK-4000 Roskilde, Denmark   http://virgil.ruc.dk/~spanget
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

From chemistry-request@server.ccl.net Thu Mar 14 11:17:35 2002
Received: from aspirine.u-strasbg.fr (IDENT:root@[130.79.84.250])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EGHZp13633
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 11:17:35 -0500
Received: from hit4 (lead2.u-strasbg.fr [130.79.85.21])
	by aspirine.u-strasbg.fr (8.10.2/8.10.2) with ESMTP id g2EFoDA20222
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 16:50:13 +0100
From: "Logean Antoine" <alogean@aspirine.u-strasbg.fr>
To: <chemistry@ccl.net>
Subject: trasformation from z-matrix (or internal coordinates) to Cartesian coordinates
Date: Thu, 14 Mar 2002 17:10:33 +0100
Message-ID: <002301c1cb72$c841cbb0$2d554f82@hit4>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook, Build 10.0.2627
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2526.0000

Two or three weeks ago I posted a "geometrical problem" : 

> Taken a residue in a PDB file, how can I calculate the Cartesian 
> coordinates of CB when I know the coordinates of N, CA and C, the 
> angle N-CA-CB, C-CA-CB and the bond length CA-CB ?

I received a lot of answers (15 !) and so by solving a system of 3
equations (thank you Maple V !), 2 equations of cones (angles N-CA-CB
and C-CA-CB) and one equation of sphere (length CA-CB), I could find the
solutions : 2 points corresponding to the respective R and S amino acid
configuration. 
So thank you all (Andrew Horsfield, Daquan Gao, Ingo Brunberg, Jim
Phillips, John, Lakshmi Devi Kesavan, Michael Jakusch, Michel PETITJEAN,
Paynes, Richard and Sigismondo Boschi ) for your help.

But now I have an other similar geometrical problem concerning the
dihedral angle :

> Taken a residue in a PDB file, how can I calculate the Cartesian 
> coordinates of CG when I know the coordinates of N, CA and CB as well
as 
> the angle N-CA-CB, CA-CB-CG, the dihedral angle N-CA-CB-CG and of 
> course the bond length CB-CG ?
  
In fact this two calculations are nothing else (thank you Sigismondo !)
as a transformation of internal coordinates, represented by a Z-matrix,
to Cartesian coordinates.

Do you know how can I solve the second geometrical problem ?

Until know the only solution I have is extremely complicated : 

1) 	calculation of an Dummy atom CG' ("projection" of CG on the plan
N-
	CA-CB)
2)	translation of CA-CB-CG' to the referential, CA becoming (0,0,0)

3)	rotation around Z and Y axis to align the axis CA-CB to the
X-axis
4)	rotation around the X-axis of the value of the dihedral angle
5)	reverse transformations 2, 3, 4 and 5 to put back all the things


I am sure there is a better way to solve this problem.

I am also interested in finding a general mathematical description of
"transformation of internal coordinates to Cartesian coordinates".

Thank you all for your help ... I am waiting for answers ... 

Antoine

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOGEAN Antoine                              
Bioinformatics group of Dr. Rognan
UMR CNRS-ULP 7081
74, route de Rhin - B.P. 24
F-67401 Illkirch, France
                         
phone   : 0033 - (0)6 87 01 57 32
e-mail  : antoine.logean@pharma.u-strasbg.fr
www     : http://med-chem.u-strasbg.fr/~tony/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



From chemistry-request@server.ccl.net Thu Mar 14 12:15:20 2002
Received: from icd-gmbh.de ([194.8.210.108])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EHFFp15386
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 12:15:19 -0500
Received: from pc62 [192.6.2.62]
	by icd-gmbh.de [10.0.1.99]
	with SMTP (MDaemon.Standard.v4.0.5.R)
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 18:14:29 +0100
Message-ID: <015601c1cb7b$b499aa70$3e0206c0@icdgmbh.de>
From: "Michael Harig" <mharig@icd-gmbh.de>
To: <chemistry@ccl.net>
References: <Pine.SGI.4.21.0203141001330.3963-100000@gandalf.cber.nih.gov>
Subject: Re: CCL:small linux/c++ question.
Date: Thu, 14 Mar 2002 18:14:24 +0100
Organization: iCD. GmbH
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2600.0000
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
X-MDRemoteIP: 192.6.2.62
X-Return-Path: mharig@icd-gmbh.de
X-MDaemon-Deliver-To: chemistry@ccl.net

>
>
> Gee, and it's a one liner in Fortran:
>
in c++ too (more or less):

#include <iomanip>
#include <sstream>

ostringstream    os;
int i=666;
os << i;

if you want the c++ string from the stream:

#include <string>
string aStr=os.str();

if you want a char * (tststs!) from the stream:

const char *aStr=os.str().c_str();        // i think there's a shorter
possibillity here, but i don't remember

if you want base, precision and width:

os << setbase(16) << setprecision(5) << setwidth(21) << i;

(o.k. valid base values are only 8,10 and 16, i guess)


regards,

    Michael





From chemistry-request@server.ccl.net Thu Mar 14 14:05:19 2002
Received: from MAIL.AD.Berry.edu ([66.20.28.66])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EJ5Gp17953
	for <CHEMISTRY@ccl.net>; Thu, 14 Mar 2002 14:05:19 -0500
Received: from [10.16.232.24] ([10.16.232.24]) by MAIL.AD.Berry.edu with Microsoft SMTPSVC(5.0.2195.4453);
	 Thu, 14 Mar 2002 14:06:42 -0500
User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022
Date: Thu, 14 Mar 2002 14:05:12 -0500
Subject: A couple of questions about AIM analysis
From: Gary Breton <gbreton@berry.edu>
To: <CHEMISTRY@ccl.net>
Message-ID: <B8B65E97.3335%gbreton@berry.edu>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit
X-OriginalArrivalTime: 14 Mar 2002 19:06:42.0437 (UTC) FILETIME=[60953B50:01C1CB8B]

Hello all,

I have implemented AIM analysis from with Gaussian98W successfully many
times.  The keywords I use are: SCF(conver=8) density=current
AIM=bondorders.  The level of theory in all cases has been
RB3LYP/6-311+G(2d,p) which is the same level of theory as the other
calculations involving these molecules (e.g., minimizations, frequency
calculations, NBO analysis).

However,when attempting the same calculation on one particular structure,
the calculation fails.  I am given the information below:

 WARNING: RMS ERROR HAS INCREASED
 WARNING: RMS ERROR HAS INCREASED
 WARNING: RMS ERROR HAS INCREASED
 WARNING: RMS ERROR HAS INCREASED
 NEWTON STEP FAILED FOR SURFACE SHEET  16
 Error termination via Lnk1e in C:\G98W\l609.exe.
 Job cpu time:  0 days  4 hours 16 minutes  8.0 seconds.
 File lengths (MBytes):  RWF=   48 Int=    0 D2E=    0 Chk=    2 Scr=    1

The Gaussian User's Reference suggests that the AIM code will fail at times
and cites the particular instance when the message NEWTON-RAPHSON STEP
FAILED is due to a molecule with rings that has an unusual topology (which
may well be the case).  Is there any cure for this problem?  Am I able to
tweak something to get the calculation to go to completion?

Many thanks for your help in advance,

Gary W. Breton
Chair and Associate Professor
Department of Chemistry
Berry College
PO Box 495016
Mount Berry, GA 30149

"There's a light at the
end of the tunnel, but it
may be an oncoming train"



From chemistry-request@server.ccl.net Thu Mar 14 10:05:11 2002
Received: from adenine.cgl.ucsf.edu ([128.218.27.3])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EF5Bp11382
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 10:05:11 -0500
Received: from adenine.cgl.ucsf.edu (socrates.cgl.ucsf.edu [128.218.27.3])
	by adenine.cgl.ucsf.edu (8.12.2/8.12.2/GSC1.13) with ESMTP id g2EF4sa81022675;
	Thu, 14 Mar 2002 07:04:54 -0800 (PST)
Message-Id: <200203141504.g2EF4sa81022675@adenine.cgl.ucsf.edu>
To: Chas Simpson <csimpson@hydrogen.cem.uct.ac.za>
cc: Markku Laukkanen <markku@hybrid.fi>,
   Mark Thompson <mark@planaria-software.com>,
   Krzysztof Radacki <K.Radacki@ic.ac.uk>, CCL <chemistry@ccl.net>,
   dek@cgl.ucsf.EDU
Subject: Re: CCL:small linux/c++ question. 
In-Reply-To: Your message of "Thu, 14 Mar 2002 08:34:14 -0200."
             <Pine.LNX.4.21.0203140813290.9982-100000@boron.cem.uct.ac.za> 
Date: Thu, 14 Mar 2002 07:04:54 -0800
From: "David Konerding, Ph.D." <dek@cgl.ucsf.EDU>

Chas Simpson writes:
>Hi
>
>Just a suggestion, try stay away from malloc, free, realloc and calloc.
>They're pre ANSI C++. Rather use the new and delete operators, ie:
>
>char *sp = new char[MAX_SIZE_OF_OUTPUT_BUF];
>
>and 
>
>delete [] val;
>
>Even better, try out the standard template library structures, such as
>vectors or valarrays. It takes a bit of getting used to though.

This is getting rapidly off-topic, but...  original poster wanted an "itoa"
function like Borland C++ (a non-standard function, but since Borland C++ has
so many users, questions like this are common).

As others suggested, using snprintf is the simple C way to do it, highly portable,
although the difficulty is doing the the character buffer size allocation properly.

In C++, no vectors or valarrays are needed.  You can avoid the STL entirely and
use the standard C++ library.  This won't compile on many Linuces out-of-the-box
since they don't all support the full standard C++ library yet.    But it should work with
gcc-2.95.3/STLport or gcc-3.0.4/libstdc++.

#include <sstream>
#include <ostream>

int main(void) {
        double f=5.05;
        std::stringstream s;
        s << f;
        std::string s2;
        s2 = s.str();
        std::cout << s2;
}
 



From chemistry-request@server.ccl.net Thu Mar 14 17:00:02 2002
Received: from soul.helsinki.fi ([128.214.3.1])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EM01p21121
	for <chemistry@ccl.net>; Thu, 14 Mar 2002 17:00:01 -0500
Received: from localhost (sundius@localhost)
	by soul.helsinki.fi (8.9.3/8.9.3) with ESMTP id XAA28943;
	Thu, 14 Mar 2002 23:59:57 +0200 (EET)
X-Authentication-Warning: soul.helsinki.fi: sundius owned process doing -bs
Date: Thu, 14 Mar 2002 23:59:57 +0200 (EET)
From: Tom Sundius <sundius@pcu.helsinki.fi>
X-Sender:  <sundius@soul.helsinki.fi>
To: Rick Venable <rvenable@gandalf.cber.nih.gov>
cc: <chemistry@ccl.net>
Subject: Re: CCL:small linux/c++ question.
In-Reply-To: <Pine.SGI.4.21.0203141001330.3963-100000@gandalf.cber.nih.gov>
Message-ID: <Pine.OSF.4.30.0203142349330.15036-100000@soul.helsinki.fi>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

On Thu, 14 Mar 2002, Rick Venable wrote:

>
>
> Gee, and it's a one liner in Fortran:
>
> 	character *80  str
> 	integer i
>
> 	write (str,'(I12)') i
>

If you want a more general routine, it is not that easy. See R.K. Jones and T. Crabtree:
"Fortran tools for VAX/VMS and MS-DOS", p. 84 (itoa function). This book gives also
the Fortran equivalents of atoi, atof, ftoa, itoh and htoi. As you said it is of course
much easier to use internal files, but the executable programs are slightly smaller
if you are not using FORTRAN I/O (this is perhaps not an issue any longer, but the above
mentioned book was written in 1988, so...)

    Greetings,

       Tom S.

Tom Sundius
University of Helsinki, Dept of Physical Sciences   phone +358-9-191 50672
P.O.Box 64, FIN-00014 Helsinki, Finland             fax   +358-9-191 50610



From chemistry-request@server.ccl.net Thu Mar 14 11:15:51 2002
Received: from argyle.richmond.edu ([141.166.188.18])
	by server.ccl.net (8.11.6/8.11.0) with ESMTP id g2EGFpp13535
	for <CHEMISTRY@ccl.net>; Thu, 14 Mar 2002 11:15:51 -0500
Received: from sabrash.richmond.edu (lfa221037.richmond.edu [141.166.221.37])
	by argyle.richmond.edu (8.11.6/8.11.6) with ESMTP id g2EG31p23814
	for <CHEMISTRY@ccl.net>; Thu, 14 Mar 2002 11:03:01 -0500
Message-Id: <5.1.0.14.0.20020314110838.02cf7260@facstaff.richmond.edu>
X-Sender: sabrash@facstaff.richmond.edu
X-Mailer: QUALCOMM Windows Eudora Version 5.1
Date: Thu, 14 Mar 2002 11:14:59 -0500
To: CHEMISTRY@ccl.net
From: "Samuel A. Abrash" <sabrash@richmond.edu>
Subject: CCL:  Summary on Front End Programs for Gaussian
Mime-Version: 1.0
Content-Type: multipart/alternative;
	boundary="=====================_1836852==_.ALT"

--=====================_1836852==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

Folks,
         Here's the summary for my request that people send me evaluations 
of front-end programs for Gaussian.
1) Hi,
take a look at Molekel:
http://www.cscs.ch/molekel/
This is for free in binary form, runs on many platforms, probably also
on Sun. Not a builder, but capable of reading gaussian log and cube
files. Can make nice pictures. The developers are always willing to
help. I am using it because it runs on most platforms, does not cost
anything (unlike spartan and gaussview) and can do really nice
representations (check out the screenshot section of their web page).
Please summarize the results.
Best regards,
Chris Klein

2) Sam,

Regarding the front end program: I use both GaussView and Spartan. I
personally believe that Spartan is considerably easier to use in this
regard. Breaking and creating bonds between available valences is a
one-step action in Spartan, while for GaussView it requires bringing up a
dialog box. I also find that I sometimes inadvertently stick a rogue atom
into GaussView while model building and its not till my calculation is
taking much too long do I realize that the atom is there but outside of my
viewing window (of course, that's a reflection of my own carelessness)!
I've never had this problem with Spartan. I often use Spartan for structure
building, save it in PDB format, and open it in GaussView to create the job.
Hope this helps.

Gary W. Breton
Chair and Associate Professor
Department of Chemistry
Berry College
PO Box 495016
Mount Berry, GA 30149

3) Dear Prof. Abrash,
I am a faculty member at Virginia Tech doing research in quantum chemical
methods development. With regards to you post to CCL, you might like
to consider the WebMO program (www.webmo.net). I used this program as a
front-end to Gaussian with my graduate-level quantum chemistry class this
past Fall. In my opinion, the WebMO interface is very well designed.
It was perfect for my class because it enabled me to introduce the
students to modern quantum chemical calculations without having to teach
them non-transferable technical skills such as the UNIX operating system,
text editors, and z-matrix construction, or have to provide access (either
network or physical) to the computers in my laboratory. Armed only with
a decent web browser, the students were free to apply the theoretical
methods about which they had learned in lecture to homework problems and
independent projects. In the end, the class ran over 3000 calculations
in a four-week period.
I'm also thinking about trying to connect the interface to my own quantum
chemical package as it would make set up for large calculations very
convenient.
Sincerely,
-Daniel
-- 
T. Daniel Crawford Department of Chemistry
crawdad@vt.edu Virginia Tech
www.chem.vt.edu/chem-dept/crawford Voice: 540-231-7760 FAX: 540-231-3255

4) Sam,
At 08:44 AM 1/22/02, you wrote:

We have used WebMO (www.webmo.net) as the front/back end for Gaussian in
our Chemistry 347 course, Molecular Modeling, at Hope College during the
last two years. Because of the familiar web-based interface, students get
up-and-running on it with about 30 minutes of instruction. WebMO supports
almost all of the exercises that are given Foresman & Frisch's "Exploring
Chemistry with Electronic Structure Methods", which we use as a textbook
for the course.
WebMO differs architecturally from Spartan and GaussView in that it is a
web-based interface to Gaussian, rather than a single-user program for
Gaussian. The advantages for the students/users are:
* a familiar web-based interface
* the ability to access the program from anywhere, e.g., their dorm room
computers.
The advantages for the faculty/administrators are:
* the ability to share computing resources among multiple users
* only installed once, so far less maintenance
* WebMO is free, so there is no financial risk in trying it out.
Although I can't tell from your email, it sounds like you might have
multiple Suns, each with their own copy of Gaussian. In this case, WebMO
Pro might make sense, as it supports multiple remote servers. That is, you
can install one copy of WebMO Pro on one Sun that operates as a web-server,
and it then queues and submits computational requests to servers that are
free. In this way, one student can be simultaneously running jobs on
multiple CPU's. Single-user interfaces like Spartan and GaussView do not
have this capability, by definition.
You might also contact Matt Elrod at Oberlin College
(matthew.elrod@oberlin.edu) and Daniel Crawford at Virginia Tech
(crawdad@vt.edu), who have also both used WebMO in their classes. Daniel
used it a graduate course on computational chemistry, and his students ran
over 3,000 jobs using WebMO as the front end!
Please summarize the responses you receive to CCL!
Thanks,
Will Polik (polik@hope.edu)




Samuel A. Abrash
Associate Professor
Department of Chemistry
University of Richmond
Richmond, VA 23173
Phone: (804) 289-8248
Fax: (804) 287-1897
E-mail: sabrash@richmond.edu
http://www.richmond.edu/~sabrash
"Research is to teaching as sin is to confession - if you don't participate 
in one you don't have anything to say at the other."
--=====================_1836852==_.ALT
Content-Type: text/html; charset="us-ascii"

<html>
Folks,<br>
<x-tab>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</x-tab>Here's the
summary for my request that people send me evaluations of front-end
programs for Gaussian.<br>
1) Hi, <br>
take a look at Molekel:<br>
<font color="#0000FF"><u><a href="http://www.cscs.ch/molekel/" eudora="autourl">http://www.cscs.ch/molekel/<br>
</a></u></font>This is for free in binary form, runs on many platforms,
probably also <br>
on Sun. Not a builder, but capable of reading gaussian log and cube 
<br>
files. Can make nice pictures. The developers are always willing to 
<br>
help. I am using it because it runs on most platforms, does not cost
<br>
anything (unlike spartan and gaussview) and can do really nice <br>
representations (check out the screenshot section of their web page).
<br>
Please summarize the results. <br>
Best regards, <br>
Chris Klein<br><br>
2) Sam, <br><br>
Regarding the front end program: I use both GaussView and Spartan. I
<br>
personally believe that Spartan is considerably easier to use in this
<br>
regard. Breaking and creating bonds between available valences is a 
<br>
one-step action in Spartan, while for GaussView it requires bringing up a
<br>
dialog box. I also find that I sometimes inadvertently stick a rogue atom
<br>
into GaussView while model building and its not till my calculation is
<br>
taking much too long do I realize that the atom is there but outside of
my <br>
viewing window (of course, that's a reflection of my own carelessness)!
<br>
I've never had this problem with Spartan. I often use Spartan for
structure <br>
building, save it in PDB format, and open it in GaussView to create the
job.<br>
Hope this helps.<br><br>
Gary W. Breton <br>
Chair and Associate Professor <br>
Department of Chemistry <br>
Berry College <br>
PO Box 495016 <br>
Mount Berry, GA 30149<br><br>
3) Dear Prof. Abrash,<br>
I am a faculty member at Virginia Tech doing research in quantum chemical
<br>
methods development. With regards to you post to CCL, you might like
<br>
to consider the WebMO program
(<a href="http://www.webmo.net/" eudora="autourl"><font color="#0000FF"><u>www.webmo.net</a></u></font>).
I used this program as a <br>
front-end to Gaussian with my graduate-level quantum chemistry class this
<br>
past Fall. In my opinion, the WebMO interface is very well designed.
<br>
It was perfect for my class because it enabled me to introduce the <br>
students to modern quantum chemical calculations without having to teach
<br>
them non-transferable technical skills such as the UNIX operating system,
<br>
text editors, and z-matrix construction, or have to provide access
(either <br>
network or physical) to the computers in my laboratory. Armed only with
<br>
a decent web browser, the students were free to apply the theoretical
<br>
methods about which they had learned in lecture to homework problems and
<br>
independent projects. In the end, the class ran over 3000 calculations
<br>
in a four-week period.<br>
I'm also thinking about trying to connect the interface to my own quantum
<br>
chemical package as it would make set up for large calculations very
<br>
convenient.<br>
Sincerely,<br>
-Daniel<br>
-- <br>
T. Daniel Crawford Department of Chemistry <br>
crawdad@vt.edu Virginia Tech <br>
<font color="#0000FF"><u><a href="http://www.chem.vt.edu/chem-dept/crawford" eudora="autourl">www.chem.vt.edu/chem-dept/crawford</a></u></font>
Voice: 540-231-7760 FAX: 540-231-3255<br><br>
4) Sam,<br>
At 08:44 AM 1/22/02, you wrote: <br><br>
We have used WebMO (<a href="http://www.webmo.net/" eudora="autourl"><font color="#0000FF"><u>www.webmo.net</a></u></font>) as the front/back end for Gaussian in <br>
our Chemistry 347 course, Molecular Modeling, at Hope College during the <br>
last two years. Because of the familiar web-based interface, students get <br>
up-and-running on it with about 30 minutes of instruction. WebMO supports <br>
almost all of the exercises that are given Foresman &amp; Frisch's &quot;Exploring <br>
Chemistry with Electronic Structure Methods&quot;, which we use as a textbook <br>
for the course.<br>
WebMO differs architecturally from Spartan and GaussView in that it is a <br>
web-based interface to Gaussian, rather than a single-user program for <br>
Gaussian. The advantages for the students/users are: <br>
* a familiar web-based interface <br>
* the ability to access the program from anywhere, e.g., their dorm room <br>
computers. <br>
The advantages for the faculty/administrators are: <br>
* the ability to share computing resources among multiple users <br>
* only installed once, so far less maintenance <br>
* WebMO is free, so there is no financial risk in trying it out.<br>
Although I can't tell from your email, it sounds like you might have <br>
multiple Suns, each with their own copy of Gaussian. In this case, WebMO <br>
Pro might make sense, as it supports multiple remote servers. That is, you <br>
can install one copy of WebMO Pro on one Sun that operates as a web-server, <br>
and it then queues and submits computational requests to servers that are <br>
free. In this way, one student can be simultaneously running jobs on <br>
multiple CPU's. Single-user interfaces like Spartan and GaussView do not <br>
have this capability, by definition.<br>
You might also contact Matt Elrod at Oberlin College <br>
(matthew.elrod@oberlin.edu) and Daniel Crawford at Virginia Tech <br>
(crawdad@vt.edu), who have also both used WebMO in their classes. Daniel <br>
used it a graduate course on computational chemistry, and his students ran <br>
over 3,000 jobs using WebMO as the front end!<br>
Please summarize the responses you receive to CCL!<br>
Thanks,<br>
Will Polik (polik@hope.edu)<br><br>
<br><br>
<x-sigsep><p></x-sigsep>
Samuel A. Abrash<br>
Associate Professor<br>
Department of Chemistry <br>
University of Richmond<br>
Richmond, VA 23173<br>
Phone: (804) 289-8248<br>
Fax: (804) 287-1897<br>
E-mail: sabrash@richmond.edu<br>
<a href="http://www.richmond.edu/~sabrash" eudora="autourl">http://www.richmond.edu/~sabrash<br>
</a>&quot;Research is to teaching as sin is to confession - if you don't participate in one you don't have anything to say at the other.&quot;</html>

--=====================_1836852==_.ALT--



