From: Axel Kohlmeyer (akohlmey_at_gmail.com)
Date: Mon Mar 11 2013 - 23:30:27 CDT

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.