1.1.5. Output

The old documentation for this tab is available here: https://www.nextnano.com/dokuwiki/doku.php?id=nnm:output

Visualization

Supported Output Formats

The workflow manager nextnanomat can display the following output formats:

.txt

The file is displayed as a text.

.dat

The file is displayed as a graph, e.g. scalar field f(x) or vector field F(x)

\(x_1\)

\(f(x_1)\)

\(x_2\)

\(f(x_2)\)

\(x_n\)

\(f(x_n)\)

or

\(x_1\)

\(f_1(x_1)\)

\(f_2(x_1)\)

\(f_m(x_1)\)

\(x_2\)

\(f_1(x_2)\)

\(f_2(x_2)\)

\(f_m(x_2)\)

\(x_n\)

\(f_1(x_n)\)

\(f_2(x_n)\)

\(f_m(x_n)\)

.mtx or .mat

Matrix format for e.g. a matrix, a table, a f(x,y) graph. The x and y axes are labeled with integer numbers.

\[ \begin{align}\begin{aligned}\begin{bmatrix} A_{11} & A_{12} & A_{13} & ... & A_{1n}\\ A_{21} & A_{22} & A_{23} & ... & A_{2n}\\ ...\\ A_{m1} & A_{m2} & A_{m3} & ... & A_{mn} \end{bmatrix}\end{aligned}\end{align} \]
.vtr - 2D/3D

VTK data format (rectilinear grid) - scalar field f(x,y,z) or vector field F(x,y,z). They can be viewed using the Paraview software which is a full 3D visualization software while nextnanomat only displays 2D slices of 3D data files.

.fld - 1D/2D/3D

AVS data format (rectilinear grid) - scalar field f(x,y,z) or vector field F(x,y,z)

If a file extension is unknown it is treated as if it were a .txt file.

Text view

If text view is toggled, the content of the selected file is displayed. This view is read-only. For editing, the file can be exported to a custom texteditor. (We do not recommend to edit data files!)

1D View

Within graph view, one-dimensional data is displayed as curves. Whether data values are represented as points or lines is up to the user. Antialiasing can be switched on or off via Output settings. Additionally the line thickness, background color or the usage of a grid can be customized.

If a data file contains multiple columns, each column is represented by its own curve. The list of available columns is shown within the column view panel. Only checked curves will be displayed. Selected curves are highlighted to allow fast recognition of related data.

Helpful features for one-dimensional data visualization are:

2D View

Two-dimensional data is displayed as a heat map, also known as pseudo-coloring. Each value of the two-dimensional grid is mapped to a distinct color. The color difference perceived allows the visual interpretation of value differences. Therefore the change of the color gradient needs to be perceived linearly by the human eye. Some color maps, like the rainbow map, introduce artefacts and have misleading visual perception, which increases the risk for misinterpretaion of scientific data. Find more information about Color maps.

Helpful features for two-dimensional data visualization are:

3D View

Real three-dimensional plots are not supported by nextnanomat. Instead 2D planes of the 3D data are visualized through heat maps, same as for 2D data. An additional panel allows the selection of the displayed plane (xy, xz or yz) and the position of the slice. This panel can be seen in Figure 1.1.5.13. If three-dimensional visualization is aimed for, we recommend exporting data to Paraview.

Helpful features for three-dimensional data visualization are:

Features

Overlay

For the best experience when visually analyzing the results of the simulation, it is sometimes necessary to look at different files at the same time. We call this the Overlay feature.

  1. Select the plots you want to memorize in the column view panel.

  2. Click the Add to Overlay button, see Figure 1.1.5.4. Alternatively, use the keys a (add) or + (Numpad only).

  3. Select another output file.

  4. (optional) add plots of multiple files to the overlay list.

⇒ Your memorized plots will be displayed in gray on top of the currently selected file.

You can check and edit the content of your overlay in the overlay list panel, this panel can be shown or hidden by clicking the Show list of overlays button. Remove selected curves with the Remove from Overlay button, shown in Figure 1.1.5.4, or use the Del/Entf or d (delete) key on your keyboard.

You can also export the overlay graphs to one combined image file, for further information refer to Gnuplot export.

../../../_images/addRemoveOverlay.PNG

Figure 1.1.5.4 Workflow to add or remove files from Overlay.

Hide constant values

Note

Be careful when using this feature. We recommend to always disable it after usage.

This feature hides any parts of the curves where the value does not change within 5 grid points (two to the left and right). Its purpose is for visualizing wave functions and probability densities on top of bandedges. The constant part which represents the energy level will be hidden. This allows to focus on the changing parts as well as for the underlying bandedge to be seen. The influence of this feature can be seen in Figure 1.1.5.5 and Figure 1.1.5.6.

../../../_images/HideConstantV_on1.PNG

Figure 1.1.5.5 Hide constant values on.

../../../_images/HideConstantV_off.PNG

Figure 1.1.5.6 Hide constant values off.

Show differences

Whenever exactly two columns are selected in the column view panel, the value difference between these two curves is shown while the mouse is hovered over the data , see Figure 1.1.5.7.

../../../_images/valueDiff.PNG

Figure 1.1.5.7 Arrow showing value difference of two data curves.

Snap to gridpoints

If snap to grid points button is toggled (default: on) a small cursor cross follows the nearest data curve while the mouse cursor is hovered over the data. The coordinates and value displayed in the upper right corner of nextnanomat match the data values of the curve, see Figure 1.1.5.8.

../../../_images/SnapToGrid.PNG

Figure 1.1.5.8 Snap to grid points feature enabled.

Special fullsize

By using this feature, the view of the output diagram will be matched perfectly to a single graph. Either the selected graph of the column view, or it is iterating through all available columns of the currently displayed file. This feature is useful for example if a file contains multiple columns with a highly different range of values. Displaying all graphs at the same time (normal fullsize mode) can lead to certain curves appearing to be zero. By selecting such curve and clicking the special fullsize button, the y-axis limits are set to its respective minimum and maximum and the curve is displayed correctly. An example for this use-case can be seen in Figure 1.1.5.9.

../../../_images/specialFullsize_ROV.gif

Figure 1.1.5.9 Special fullsize for a diverging range of values.

Furthermore this feature is also useful for any other file containing more than one column. Iterating through the columns and displaying each curve in its optimal frame, allows for fast and convenient data evaluation, see Figure 1.1.5.10. .. example one high number of curves

../../../_images/specialFS_curves2.gif

Figure 1.1.5.10 Special fullsize for a high number of curves.

Auto select color map

If auto selection of a color map is active, a diverging color map is selected for data files spanning from negative to positive values. Else a linear color map is chosen.

Fix middle color to specific value

This feature is aimed for the visualization of diverging data in combination with a diverging color map. It fixes the mapping of the neutral middle color to a specific value and thus ensures a symmetric color representation of diverging data.

Note

To be able to support custom color maps, this feature is not limited to predefined diverging color maps. To avoid unintentional usage we recommend to enable this feature on demand only.

The feature is enabled by checking the corresponding check box. If enabled, it is active whenever a diverging color map is assumed (error prone to enable flexibility) and the data file contains the specified value. Else it is inactive and grayed out. The visual feedback on the activity of the feature can be seen in Figure 1.1.5.11 and Figure 1.1.5.12

Example usage of the feature can be seen in Figure 1.1.5.13.

../../../_images/fm_enabledActive.PNG

Figure 1.1.5.11 Enabled and active

../../../_images/fm_enabledInactive.PNG

Figure 1.1.5.12 Enabled but inactive

../../../_images/Panel3D_fixMiddle.PNG

Figure 1.1.5.13 Visualization of diverging data with fix middle color feature enabled and active.

Export functionality

Most of the export options are available from the context menu (right-click on the visualization). Some specific options can be accessed from the output menu button Export and Open in specific Format. For the latter option the custom defined paths to installed applications are used (with exception of the Gnuplot application). These paths need to be defined in the Output settings.

Gnuplot export

Gnuplot is a free graphing utility, which allows scientists to visualize data interactively. If installed it can be used to export 1D, 2D & 3D nextnano results. Either the currently selected file can be exported (by usage of the context menu) or the contents of the overlay list can be combined (1D) and exported (by usage of the output menu button). An example of such a combined file can be seen in Figure 1.1.5.14. The plot style for Gnuplot exports can be customized in Options: Gnuplot settings.

../../../_images/export_gnuplt1d.jpg

Figure 1.1.5.14 One-dimensional Gnuplot export of bandedge plus probability densities.

In 2D you have some additional options for your gnuplot file, displayed in Figure 1.1.5.15. The plot can be displayed as a color map, analog to the implementation of nextnano, or as a surface plot, which is a pseudo three-dimensional plot (Figure 1.1.5.16). Title and labels are optional and if they aren’t specified they will be taken directly from the file (if provided). If remember settings is checked, the next time the panel will be pre-filled with these settings. If you always use the same settings and don’t want this dialog to be displayed each time, you can chose the Create Gnuplot file - last used (*.plt) option in the context menu.

../../../_images/export_gnuplt23d.jpg

Figure 1.1.5.15 Additional options for more-dimensional Gnuplot export.

../../../_images/hexagon_psi2_ev10.png

Figure 1.1.5.16 Gnuplot surface representation of Figure 1.1.5.15. (Probability density of the 10th wavefunction in a hexagonal structure.)

Gnuplots are interactive, see Figure 1.1.5.17, which makes them suitable to create animations e.g. for presentations. Furthermore they can be saved as vector graphics. To understand the dependency between plot files and their raw data files, please refer to the next section.

../../../_images/record_2017_01_11_08_48_14_78.gif

Figure 1.1.5.17 Interactive surface plot.

Moving plot-files to another device

1D-plots are linked to the original .dat file(s). So if you want to move your plot to another device, you can either save your plot as .pdf/.svg/.png file directly in gnuplot (recommended), or if you want to move the original .plt-file you also have to move all necessary .dat files (the paths can be adjusted when opening the .plt file with a text editor).

Warning

If you move the 1D plot file without data files or without adjusting the paths, it will be broken. (Won’t open when file is double-clicked.)

The data of 2D/3D-plots is directly stored within the .plt file, so there is nothing to consider when moving these files. (So why isn’t this done for 1D-plots alike? Because with the overlay feature you have the possibility to export a nearly unlimited number of .dat files into a single .plt file. If all this data would be duplicated and transferred into the .plt file, it would simply get to big.)

Optimize your Gnuplot Graph

Collection of some useful gnuplot commands. To edit these commands, open the .plt file within a text editor.

Semi-log plot
set logscale x
set logscale y
Change the line thickness (lw 4)
plot 'D:\bandedges.dat' linetype rgb "#FF0000" pt 5 ...
plot 'D:\bandedges.dat' linetype rgb "#FF0000" pt 5 lw 4 ...
Change font size of the x axis (20)
set xlabel "position (nm)" font "sans - serif"
set xlabel "position (nm)" font "sans - serif,20"
Use subscript and superscript (enhanced vs. noenhanced)
plot 'D:\density_hole.dat' using 1:2 title "p (10^{18} cm^{-3})"enhanced ...
plot 'D:\density_hole.dat' using 1:2 title "p (10^18 cm^-3)" noenhanced ...
Change range [\(x_{min}\) , \(x_{max}\) ] and [\(y_{min}\) , \(y_{max}\) ] of the graph
set xrange [-0.3:100.3]
set xrange [0:100]
set yrange [-1.5:2.5]
set yrange [-1.0:0.5]
Set/Remove grid
set grid
unset grid
Change thickness of the border (lw)
set border lw 2
set border lw 3
Set/Remove legend
set key on
set key off
Set/Remove box around legend (box)
set key on ... box
set key on ... nobox
Increase font size in legend
set key on ... font "sans - serif,14"
set key on ... font "sans - serif,18"
Specify the location of legend
set key left top inside ...
set key right bottom outside ...
Remove line from legend (notitle)
plot 'D:\bandedges.dat' using 1:2 title "E_c " ...
plot 'D:\bandedges.dat' using 1:2 notitle "E_c " ...
Add Greek letter to line in legend ("{/Symbol G}" enhanced)
using 1:2 title "{/Symbol G} [eV]" enhanced

produces Γ.

e, l, m, q produce ϵ, λ, μ, θ, respectively.

Add a label to the point \((x,y)\) in the plot
set label "label" at 0.5,1.5
Add an arrow
set arrow from 1.5,0.3 to 4,2
Graph Title
set title "title" font "sans - serif,18"
Generate high quality graphs
  1. In gnuplot window: Click on Export plot to file

  2. Save as SVG files (.svg)

  3. Open the saved .svg file with Inkscape

  4. File ⇒ Export .PNG Image… ⇒ Select Drawing ⇒ Export

Customized

In Options: Data export custom paths to installed applications (e.g. Paraview, notepad++) can be set, to allow convenient export of output files for the purpose of visualization or post-processing.

Paraview export

  1. Install the free software Paraview on your computer

  2. Within nextnanomat:

    1. In Options: Data export, write the path to the Paraview executable in your computer, e.g. C:\Program Files\ParaView 5.6.0-Windows-msvc2015-64bit\bin\paraview.exe

    2. Select a 3D .vtr file of the simulation output folder and click on the Export and open in specific format button. Choose Open File with Paraview ( Paraview will open automatically.)

  3. Within Paraview:

    1. (The selected file should be highlighted automatically.) Click on Apply.

    2. Other settings:

      1. Representation: Surface

      2. Cell/Point Array Status: Choose the array to be displayed. For example, one can display the file bandedges.vtr and choose the array Gamma that corresponds to the Gamma conduction band. Click on Apply.

      3. Coloring: Choose the array to be displayed. (Gamma, for example)

Now you can play with the tool. Rotating, changing opacity and adding filters. Paraview is a very rich tool, hence it requires some time to explore all its capabilities. We recommend investing some time to learn about its filters:

  • First, the file should be highlighted and then click on FilterAlphabetical.

    Some interesting ones are:

    • Edit cells by region

    • Calculator

    • Contour

Using FileSave State, the values of all variables can be stored on your PC. These states can be reloaded, which is useful for the generation of scripts.

For further information, we recommend a good tutorial from TACC.

Python scripts

Custom written python scripts can be called directly from the Output tab. The parent folder of the python script, Path to the currently displayed output file as well as the path to the simulation folder are transferred as system arguments, see Figure 1.1.5.18. (If you need other specific information to be exported, just mail your request to the nextnano support team or use the widget on this website.) By using those system arguments in your python script, individual post-processing of specific output files is reduced to a one-click effort.

../../../_images/callPython.PNG

Figure 1.1.5.18 Example of transferred system arguments when calling a python script.

Further information

References, you might find helpful…

Output settings

Clean up output folder

Color maps