From: Edward Lyman (edward.lyman_at_gmail.com)
Date: Tue Mar 12 2013 - 10:35:06 CDT

yeah...after some long hours, I got it backwards, even though I had it
correct. confusing, I know.

z goes on the inside.

E

On Tue, Mar 12, 2013 at 12:30 AM, Axel Kohlmeyer <akohlmey_at_gmail.com> wrote:

>
>
>
> On Tue, Mar 12, 2013 at 2:23 AM, Edward Lyman <edward.lyman_at_gmail.com>wrote:
>
>> and...I figured it out. put the z loop on the outside.
>
>
> really? i'd expect the fastest moving index in the innermost loop. axel.
>
>
>>
>>
>>
>>
>> On Mon, Mar 11, 2013 at 5:41 PM, Edward Lyman <edward.lyman_at_gmail.com>wrote:
>>
>>> Hi all,
>>>
>>> I am trying to figure out how the values are listed in the dx file
>>> written by vmd. Below I copy a reply from Axel from a couple years back to
>>> a similar Q. My question regards the ordering of the values... does
>>>
>>> *ordered z fast, y medium, and x slow
>>>
>>> *mean that as I roll through the values in the dx file, I read first a
>>> row along z, then move one grid point along y and read another row of z,
>>> and repeat until I have read a slice in the first yz plane? Then, move one
>>> grid point in x and read another plane of yz values?
>>>
>>> In other words, if I wanted to read the data into a 3 dim array indexed
>>> by x, y, and z, what should the order of my loops be?
>>>
>>> Best,
>>> Ed
>>>
>>>
>>> *> here is the blurb from the dx file reader in VMD that may be
>>> helpful: *
>>> *> *
>>> *> /* DX potential maps *
>>> *> * *
>>> *> * Format of the file is: *
>>> *> * # Comments *
>>> *> * . *
>>> *> * . *
>>> *> * . *
>>> *> * object 1 class gridpositions counts xn yn zn *
>>> *> * origin xorg yorg zorg *
>>> *> * delta xdel 0 0 *
>>> *> * delta 0 ydel 0 *
>>> *> * delta 0 0 zdel *
>>> *> * object 2 class gridconnections counts xn yn zn *
>>> *> * object 3 class array type double rank 0 items { xn*yn*zn }
>>> [binary] *
>>> *> data follows *
>>> *> * f1 f2 f3 *
>>> *> * f4 f5 f6 f7 f8 f9 *
>>> *> * . *
>>> *> * . *
>>> *> * . *
>>> *> * object "Dataset name" class field *
>>> *> *
>>> *> * Where xn, yn, and zn are the number of data points along each
>>> axis; *
>>> *> * xorg, yorg, and zorg is the origin of the grid, assumed to be in
>>> angstroms; *
>>> *> * xdel, ydel, and zdel are the scaling factors to convert grid
>>> units to *
>>> *> * angstroms. *
>>> *> * *
>>> *> * Grid data follows, with a single or multiple values per line
>>> (maximum *
>>> *> * allowed linelength is hardcoded into the plugin with ~2000
>>> chars), *
>>> *> * ordered z fast, y medium, and x slow. *
>>> *> * *
>>> *> */ *
>>>
>>
>>
>
>
> --
> Dr. Axel Kohlmeyer akohlmey_at_gmail.com http://goo.gl/1wk0
> International Centre for Theoretical Physics, Trieste. Italy.
>