http://www.openpstd.org/wiki/index.php?title=Special:NewPages&feed=atom&hideredirs=1&limit=50&offset=&namespace=0&username=&tagfilter=OpenPSTD - New pages [en]2020-10-26T09:17:32ZFrom OpenPSTDMediaWiki 1.21.1http://www.openpstd.org/wiki/index.php/Import_resulting_data_into_other_applicationsImport resulting data into other applications2016-04-28T13:51:16Z<p>Michiel: </p>
<hr />
<div>Data exported to the HDF5 format can be imported into other applications. <br />
<br />
= Exported HDF5 file =<br />
<br />
The exported file is an HDF5 file. More information about this format can be found [https://www.hdfgroup.org/HDF5/ here].<br />
<br />
The structure of the HDF5 format is a tree-like structure with data elements as leaves, which are called data sets. All the indices start from 0. This structure is as follows:<br />
*''<code>PSTD</code>'' since version 2.1, was ''<code>frame</code>'' in version 2.0<br />
**<domain index><br />
***<frame index><br />
*''<code>DG</code>'' since version 2.1<br />
**<frame index><br />
*''<code>receiver</code>'' since version 2.0<br />
**<receiver index><br />
*''<code>Settings</code>'' since version 2.1<br />
**<setting name><br />
<br />
Version 2.0 used ''<code>/frame</code>'' in place of ''<code>/PSTD</code>''. This change was made to make a difference between the PSTD data and the DG data<br />
<br />
For example if you want frame 100 of domain 4, the 5th domain, the data element is at ''<code>/PSTD/4/100</code>''. Or if you want the data of receiver 6, that is the 7th receiver, then the resulting data is in element ''<code>/receiver/6</code>''.<br />
<br />
= Settings =<br />
In this group are data sets of size 1 that specify a certain calculation setting. These are the settings with which the calculations are done. Settings with the following names are exported:<br />
*RenderTime<br />
*SoundSpeed<br />
*AttenuationOfPMLCells<br />
*MaxFrequency<br />
*DensityOfAir<br />
*PatchError<br />
*FactRK<br />
*GridSpacing<br />
*BandWidth<br />
*WaveLength<br />
*SpectralInterpolation<br />
*PMLCells<br />
<br />
<br />
= Applications =<br />
Here is a list of some of the applications that can import this data.<br />
<br />
==Matlab==<br />
Matlab can import the data. This can be done by the following command:<br />
''<code>h5read(filename,datasetname)</code>'' where file name is the hdf5 file name and the datasetname is the data set name, eg ''<code>/PSTD/4/100</code>'' or ''<code>/receiver/6</code>''. For example to read frame 42 from domain 4 that is in hdf5 file "result.h5", the following matlab command can be used ''<code>h5read('result.h5','/PSTD/4/42')</code>''.<br />
<br />
For more info see [http://mathworks.com/help/matlab/hdf5-files.html Matlab hdf5 reference pages]. There are also functions that can query the file. The file can be queried for which domains are in it, which frames of each domain and which receivers are in it.<br />
<br />
==Mathematica==<br />
More information about import in mathematica can be found at [https://reference.wolfram.com/language/ref/format/HDF5.html Mathematica hdf5 reference pages].<br />
<br />
==Python==<br />
Python has also an interface to HDF5. This interface can be found at [http://www.h5py.org/ h5py.org]<br />
<br />
==R==<br />
R has also an interface to the HDF5 format. This interface can be found at the CRAN repo. [https://cran.r-project.org/web/packages/h5/index.html]</div>Michielhttp://www.openpstd.org/wiki/index.php/GUI_Export_resultsGUI Export results2016-04-28T13:36:31Z<p>Michiel: </p>
<hr />
<div>The application can export the data in 2 different formats HDF5 and images (png, bmp or jpg).<br />
<br />
<br />
= Image =<br />
<br />
The image export function can you find in menu file -> export. <br />
An window will show with the following options:<br />
* '''Directory''' This is where the images will be written to. With browse it is easy to set a directory.<br />
* '''Name(prefix)''' A name prefix for all the file names. This is done that images do not overwrite each other when making multiple export to the same directory.<br />
* '''Start frame''' The first frame that will be exported (inclusive).<br />
* '''Last frame''' The last frame that will be exported (inclusive).<br />
* '''Format''' Wich format will be used, PNG, JPG or BMP.<br />
<br />
The output images file name will have the following format ''<code><name> - <frame number>.<extension></code>''<br />
<br />
= HDF5 =<br />
<br />
This format can be used for importing data to other applications, e.g. Matlab, mathematica and python. The export can be found in the file menu -> export. There are no extra options, only where to put the h5 file. See [[Import resulting data into other applications]] for more information about importing this data.</div>Michielhttp://www.openpstd.org/wiki/index.php/Document_settingsDocument settings2016-04-28T13:14:14Z<p>Michiel: </p>
<hr />
<div>'''This page should be checked for errors since v1.1'''<br />
<br />
The settings described here correspond to the settings in a PSTD document from openPSTD v2.0. <br />
<br />
== General settings ==<br />
<br />
===Grid spacing | Max freq===<br />
The '''Grid spacing''' in metres corresponds to the spacing of the grid points, and is equal in horizontal and vertical direction. The '''Grid spacing''' determines the maximum resolved frequency in openPSTD, i.e. '''Max freq''' <math>f_{max}</math> as follows<br />
<br />
:<math> f_{max}= \frac{c}{2\Delta} </math><br />
<br />
with &Delta; the '''Grid spacing''' in metres and ''c'' the adiabatic speed of sound. When changing '''Grid spacing''', '''Max freq''' automatically changes according to the above equation, and vice versa.<br />
<br />
===Window size | Patch error===<br />
To compute the spatial derivative of the acoustic variables within a subdomain of the drawn geometry, three subdomains are needed, see [[openPSTD v1.0 overview]]. The values of the outer subdomains are windowed by a Gaussian window, see [http://www.sciencedirect.com/science/article/pii/S0021999112001568 Hornikx ''et al.'' 2012]. The window length applied to the outer subdomains is equal to '''Window size'''. This number determines the minimum number of grid points of the subdomains. The window affects the accuracy of the calculation, with the accuracy increasing with the window length. The error introduced by the window is called the '''Patch error''' &epsilon; in dB, and is defined as:<br />
<br />
:<math> <br />
\epsilon = -20\log_{10}\left(\frac{|p|-|p_{ana}|}{|p_{ana}|} \right)<br />
</math><br />
<br />
with ''p'' the pressure value at a certain receiver position at a frequency corresponding to 2.5 points per wavelength and ''p''<sub>ana</sub> the analytical pressure value at this frequency. An &epsilon; value of 50 dB corresponds to a level difference error of 0.03 dB. Note that the accuracy of openPSTD calculations is not only affected by the window error, but also by the initial source function, the time iteration scheme and the PML layer, see [http://www.sciencedirect.com/science/article/pii/S0010465516300443 Hornikx ''et al.'' 2016]. As the error is determined by the maximum error, increasing the window length does not imply that the error is reduced per se. '''Patch error''' automatically changes by increasing the '''Window size''', and vice versa.<br />
<br />
===Render time===<br />
The simulation length of a calculation in openPSTD is denoted by '''Render time''' in s. The calculation is terminated after this time. A calculation can also be stopped manually before this time by pressing '''Stop the current openPSTD simulation'''.<br />
<br />
===Absorption===<br />
When an edge of the constructed geometry is selected, see [[Getting started with OpenPSTD]] how to do this, the acoustic absorption coefficient can be assigned to this edge by setting the '''Absorption''' to a value between 0 and 1. When an edge is selected, the actual value of the absorption coefficient of this edge is written in parenthesis behind the '''Absorption''' setting. In [[openPSTD v1.0 overview]], it is explained how reflections from boundaries are computed in openPSTD.<br />
<br />
== Advanced settings ==<br />
<br />
===Pressure level visualisation scale===<br />
The '''Pressure level visualisation scale''' in dB sets the dynamic range of the relative sound pressure level in the 2D visual animation. This dynamic range is visible in the drawing section of Blender.<br />
<br />
===Number of PML cells | Attenuation of PML cels===<br />
The '''Number of PML cells''' sets the number of grid points in the boundary media that are affected by the perfectly matched layer (PML). The '''Attenuation of PML cells''' corresponds to the number &alpha; in<br />
<br />
:<math> \sigma(x) = \alpha\left( \frac{x-x_{PML}}{D} \right)^4</math><br />
<br />
with &sigma; the PML damping coefficient, ''x-x''<sub>PML</sub> the position of the grid point in the PML layer and D the thickness of the PML layer, see [http://scitation.aip.org/content/asa/journal/jasa/128/4/10.1121/1.3474234 Hornikx ''et al.'' 2010]. The default value of '''Attenuation of PML cells''' is 20000. A larger number of PML cells reduces the error introduced by the PML.<br />
<br />
===Density===<br />
The '''Density''' in kg/m<sup>3</sup> is the density of the propagation medium in the drawn subdomains. In openPSTD, the density is constant throughout the propagation medium.<br />
<br />
===Sound speed===<br />
The adiabatic speed of sound of the propagation medium is denoted by '''Sound speed''' in m/s. Like the density, the adiabatic speed of sound is constant throughout the propagation medium in openPSTD.<br />
<br />
===CFL number RK-scheme===<br />
The stability of the Fourier PSTD method is determined by the stability criteria arising from the used Runge-Kutta method, and is controlled by the '''CFL number RK-scheme'''. The default value of this number for the 2D calculations in openPSTD is 0.5. The sample frequency of the time-domain calculations thereby becomes <br />
:<math> f_{s}= CFL \frac{c}{2 \Delta x} </math></div>Michielhttp://www.openpstd.org/wiki/index.php/OpenPSTD_V2.0_ManualOpenPSTD V2.0 Manual2016-04-28T13:10:03Z<p>Michiel: /* CLI */</p>
<hr />
<div>This is the user manual of the OpenPSTD application version 2. OpenPSTD is an open source initiative to provide an intuitive visual interface for the Pseudo-Spectral Time-Domain method to simulate the propagation of sound within a medium. Use the Navigation menu on the left to view the page of your interest. In version 2 the GUI had a complete overhaul, also the application is ported from Python to C++ (which created a significant performance boost). To start with the application we suggest to read the [[OpenPSTD V2.0 Getting started]] first. This gives you a basic idea for the application.<br />
<br />
=Application=<br />
<br />
The application is divided in 2 parts, the GUI(graphical user interface) and the CLI(command line interface). They have both the same functionality. For most use cases the GUI application is preferred. <br />
<br />
The application uses PSTD files. These files hold the geometry and also the results. This is a single file with the results, which makes managing multiple files quite easy(in contrast to the previous version). Both the GUI as the CLI use the same PSTD files. These files are not directly readable with an external application, but can be exported to the much more supported format (see the advanced section).<br />
<br />
Parts of the documentation that are used in both applications:<br />
<br />
* [[Document settings]]<br />
<br />
==GUI==<br />
<br />
The GUI is used for most use cases. This has easy access to the application, easy edit and create geometries and run simulations.<br />
<br />
* [[GUI Edit actions|Edit actions]]<br />
* [[GUI Running Simulation|Running Simulation]]<br />
* [[GUI Application settings|Application settings]]<br />
* [[GUI Export results|Export results]]<br />
<br />
==CLI==<br />
<br />
The CLI is used from the command line. This application is mostly used on servers with no graphical interface. The CLI has the same capabilities as the GUI. <br />
<br />
The CLI can be used in standard way. ''<code>OpenPSTD-cli <command> [arguments]</code>'' Every command has an extra help that is displayed when an argument ''<code>-h</code>'' or ''<code>--help</code>'' is added. The following list show possible commands: <br />
* ''<code>create</code>''<br />
* ''<code>list</code>''<br />
* ''<code>edit</code>''<br />
* ''<code>run</code>''<br />
* ''<code>export</code>''<br />
<br />
Extra information can be found on these pages.<br />
* [[CLI Create/edit a document|Create/edit a document]]<br />
* [[CLI Running Simulation|Running Simulation]]<br />
* [[CLI Export results|Export results]]<br />
<br />
=Advanced=<br />
<br />
There are some advanced features in the application.<br />
<br />
* [[GPU Acceleration]]<br />
* [[CPU Acceleration]]<br />
* [[Import resulting data into other applications]]</div>Michielhttp://www.openpstd.org/wiki/index.php/OpenPSTD_v1.0OpenPSTD v1.02016-04-28T12:42:16Z<p>Michiel: Created page with "The previous version of OpenPSTD. This is as reference for anyone that wants to use the old version. Getting_started_with_OpenPSTD_v1.1 OpenPSTD_v1.0_overview Ope..."</p>
<hr />
<div>The previous version of OpenPSTD. This is as reference for anyone that wants to use the old version.<br />
<br />
[[Getting_started_with_OpenPSTD_v1.1]]<br />
<br />
[[OpenPSTD_v1.0_overview]]<br />
<br />
[[OpenPSTD_v1.0_settings]]</div>Michielhttp://www.openpstd.org/wiki/index.php/Hornikx_CPCHornikx CPC2015-05-29T13:23:42Z<p>Maarten: </p>
<hr />
<div>Hornikx, M., Krijnen, T. openPSTD: the open source pseudospectral time-domain method for acoustic propagation, ''Computer Physics Communications'', Manuscript submitted for publication, 2015.</div>Maarten