[Pw_forum] Format of charge-density.dat
Paul M. Grant
w2agz at pacbell.net
Thu Feb 12 06:04:08 CET 2009
Hey Axel, thanks.
My agenda is really to get rho(r) into an ascii file of size 4xn that I can
load it as an array into APL2 to play around with...I thought the Fortran
description would be more familiar to the PWscf community. I'm playing
around with coding some PP apps in APL2. I'll look into pp.x as you suggest
as a way to get such a file.
It's 9 PM out here in California, which means midnight on your part of the
globe...do you ever sleep?
Paul M. Grant, PhD
Principal, W2AGZ Technologies
Visiting Scholar, Applied Physics, Stanford (2005-2008)
EPRI Science Fellow (Retired)
IBM Research Staff Member Emeritus
w2agz at pacbell.net
http://www.w2agz.com
-----Original Message-----
From: pw_forum-bounces at pwscf.org [mailto:pw_forum-bounces at pwscf.org] On
Behalf Of Axel Kohlmeyer
Sent: Wednesday, February 11, 2009 8:28 PM
To: Paul M. Grant
Cc: 'PWSCF Forum'
Subject: Re: [Pw_forum] Format of charge-density.dat
On Wed, 11 Feb 2009, Paul M. Grant wrote:
PG> I realize charge-density.dat is stored in iotk binary format and the
reasons
PG> why. But is there any documentation illuminating the layout of the
file or
PG> how to access the data stored therein? I've poked around in the source
code
PG> of chden and electrons but it's not terribly obvious how they load the
data,
PG> which I assume is a necessary task somewhere in these two routines.at
least
PG> not in four or five minutes of manual scanning. All I really want to do
is
PG> write a (hopefully small) Fortran routine to load data from
PG> charge-density.dat into a four (x, y, z, rho) by number-of-points array.
PG> Maybe there's even an iotk subroutine someone has laying around to do
just
PG> that.
paul,
there is an example code, qexml.f90 (check out qexml_write/read_rho())
that should demonstrate how to read iotk files. not sure whether it
still works, though. it has not been touched in a while.
if you are more concerned about a fast result rather than performance,
why don't you use pp.x to convert it into (gaussian) .cube format, which
is plain text and easier to read into fortran.
the way it is usually read is that you just have one 3-dim array,
with the grid vector index positions as the indices.
if you give me a hint about what exactly you're after, perhaps
i can give you a more specific suggestion.
PG> BTW, I assume the units are electrons/cubic-au as a function of x, y, z?
right, at least that is what i remember, summing over the indivdual
rho entries and multiplying with the volume of a single voxel should
yield the total number of electrons.
cheers,
axel.
PG>
PG> Best to all, -Paul
PG>
PG> Paul M. Grant, PhD
PG> Principal, W2AGZ Technologies
PG> Visiting Scholar, Applied Physics, Stanford (2005-2008)
PG> EPRI Science Fellow (Retired)
PG> IBM Research Staff Member Emeritus
PG> w2agz at pacbell.net
PG> http://www.w2agz.com <http://www.w2agz.com/>
PG>
PG>
PG>
PG>
PG>
--
=======================================================================
Axel Kohlmeyer akohlmey at cmm.chem.upenn.edu http://www.cmm.upenn.edu
Center for Molecular Modeling -- University of Pennsylvania
Department of Chemistry, 231 S.34th Street, Philadelphia, PA 19104-6323
tel: 1-215-898-1582, fax: 1-215-573-6233, office-tel: 1-215-898-5425
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.
_______________________________________________
Pw_forum mailing list
Pw_forum at pwscf.org
http://www.democritos.it/mailman/listinfo/pw_forum
More information about the users
mailing list