[Pw_forum] Format of charge-density.dat
Axel Kohlmeyer
akohlmey at cmm.chem.upenn.edu
Thu Feb 12 05:27:54 CET 2009
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.
More information about the users
mailing list