[FLASH-USERS] FLASH and Octave
Aaron Froese
aaron.froese at generalfusion.com
Wed Jan 26 17:17:33 EST 2011
Dear Sam and John,
Sorry, my questions would probably make more sense if you knew what my objective is. I am using FLASH to simulate the compression of spheromaks and FRCs with liquid metal walls. I wish to know the growth/decay rates of the magnetic field for each toroidal and poloidal mode. Finding the toroidal modes just requires converting to cylindrical coordinates and taking the FFT in the azimuthal direction. However, to do the same for the poloidal modes requires integrating along the poloidal flux contour. Rather than reinvent the wheel in C++, I decided that I was better off working with a program that already had the required functionality built in. Based on a cursory glance over the documentation, this seems to be outside the capabilities of yt.
The HDF5 support in Octave is limited to files generated by Octave itself, so it cannot simply import FLASH files. I have not yet found the specifications that would make rewriting the HDF files readable by Octave, so I am somewhat hesitant to attempt that route. I am still looking, but a promising method that preserves the data precision while maintaining portability would be to convert the data to a binary Matlab MAT file.
Aaron
________________________________________
From: Samuel Friedman [friedman at astro.wisc.edu]
Sent: Wednesday, January 26, 2011 1:22 PM
To: Aaron Froese
Subject: Re: [FLASH-USERS] FLASH and Octave
Aaron,
Quickflash is really the only way to extract the data. But why are you
dumping the data into a text file? What are you trying to do besides take
an FFT? You're taking an accuracy hit by porting it into a textfile.
This is going to sound crazy, but I'd suggest writing your data into a new
HDF5 file and then reading that into Octave. You keep you numbers at
double precision and there exist many packages for reading HDF5 data.
Since I know you're coding in C++, the HDF5 C++ interface is not too bad
(not wonderful, but works great even with interlanguage binary reading).
That said, if you use Octave to analyze your data, it looks like Octave
has the ability to easily read HDF5 files. If you want, I can send you
some more code about creating HDF5 files, but it won't be as pretty as
what I previously sent you.
Sam
On Wed, 26 Jan 2011, Aaron Froese wrote:
> Hi all,
>
> In order to analyze FLASH results with Octave, I am currently extracting the HDF5 plot files with Quickflash and loading them into Octave as a formatted text file. Is there a more elegant method of doing this?
>
> Aaron
More information about the flash-users
mailing list