Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Visualizing Output with ICE"

(Selecting Initial Plot Data)
(Added a tutorial for using Plot Editors and the Project Explorer for visualization.)
Line 12: Line 12:
 
=== Prerequisites ===
 
=== Prerequisites ===
  
To use the ''VisIt Tools'', ICE requires the installation of [https://wci.llnl.gov/simulation/computer-codes/visit/ VisIt] (minimum version 2.8.2) developed by Lawrence Livermore National Laboratory, either locally or on a remote machine.
+
To use the ''VisIt Tools'', ICE requires the installation of [https://wci.llnl.gov/simulation/computer-codes/visit/ VisIt] (minimum version 2.8.2) developed by Lawrence Livermore National Laboratory, either locally or on a remote machine. There are two ways to interact with VisIt through ICE. The first, through the Project Explorer, is easier to use and does not require the user to manually connect to VisIt in each session, but the second, through the Visualization Perspective, allows for the sending of Python commands to the VisIt client.  
  
The ''CSV Plotting Tools'' require no additonal software to be installed.
+
The ''CSV Plotting Tools'' require no additional software to be installed.
 +
 
 +
=== Project Explorer ===
 +
 
 +
To open a plot editor, first the file must be placed in the ''Project Explorer''. This view lists files imported into ICE. To access the ''Project Explorer'', use the the main menu bar at the top of the window and navigate to:
 +
 
 +
''Window'' > ''Show View'' > ''Project Explorer''
 +
 
 +
By default, the ''Project Explorer'' should automatically import the ICEFiles/default and ICEFiles/itemDB folders. If it does not, or it you want to import a different folder into ICE, right click in the ''Project Explorer'' and select ''Import...'' from the context menu. Then select ''General'' -> ''File System'' from the tree and press the ''Next'' button. You can then select directories and/or files to import into the Project Explorer.
 +
 
 +
[[File:ProjectExplorerImportFilesDialog_ICE.png]]
 +
 
 +
For .csv files, you can simply double click them in the ''Project Explorer'' and they will open. Similarly, VisIt files can be opened by double clicking, but you must first establish a connection to VisIt.
 +
 
 +
You can set up a default connection to VisIt in the ICE preference page. After creating a default connection, ICE will automatically connect to VisIt every time it is opened. To set the connection, select ''Window'' > ''Preferences'' in ICE's toolbar, then ''Visualization'' > ''VisIt'' in the tree of the
 +
Preferences page.
 +
 
 +
[[File:VisItPreferencePage_ICE.png]]
 +
 
 +
Press the new row button, the button with a "+" symbol in the upper right, highlighted in the image above. You can then click on each of the cells of the new row to edit them. The default values automatically supplied by ICE should be fine for most users. However, two fields may need to be changed:
 +
 
 +
'''Host:''' The default value of "localhost" is for connections to local installations of VisIt on your computer. If you want to launch a remote VisIt connection, you must change this to the hostname of the machine to connect to.
 +
 
 +
'''Path:''' You need to put the full path to the VisIt folder here. The path should end with the folder containing the VisIt executable. For example, C:\Users\r8s\AppData\Local\Programs\LLNL\VisIt 2.9.1.
 +
 
 +
Once finished, press ''Apply'', then ''OK''. ICE will then open VisIt and connect to it.
 +
 
 +
Once open, the Plot Editor will display the contents of the file. For .csv files, right clicking or using the ''Select series...'' button in the upper left allows you to add or remove data series from the graph. Similarly, a VisIt plot editor will allow you to choose the mesh and scalar to model, as well as the model's representation. VisIt Plot editors also feature a slider at the bottom, allowing the user to interact with time data.
 +
 
 +
[[File:TimeSliderWidget_ICE.png]]
 +
 
 +
The arrow buttons move to the previous or next time step, and the triangle button causes the Plot Editor to play the simulation automatically. The final button displays playback options. The current time is displayed, and you can manually drag the slider along the timeline to choose a specific time step to display.  
  
 
=== Visualization Perspective ===
 
=== Visualization Perspective ===

Revision as of 11:22, 27 August 2015

Currently, ICE features two plugins for visualizing and plotting simulation output data:

  • VisIt Tools - An interactive 3D visualization tool for rendering meshes, scalar plots, contour plots, and more.
  • CSV Plotting Tools - A customizable, 2D data plotting utility for data from .csv files.

ICE's VisIt tool for 3D visualzation ICE's CSV plotter for 2D graphing

Installation and Configuration

Prerequisites

To use the VisIt Tools, ICE requires the installation of VisIt (minimum version 2.8.2) developed by Lawrence Livermore National Laboratory, either locally or on a remote machine. There are two ways to interact with VisIt through ICE. The first, through the Project Explorer, is easier to use and does not require the user to manually connect to VisIt in each session, but the second, through the Visualization Perspective, allows for the sending of Python commands to the VisIt client.

The CSV Plotting Tools require no additional software to be installed.

Project Explorer

To open a plot editor, first the file must be placed in the Project Explorer. This view lists files imported into ICE. To access the Project Explorer, use the the main menu bar at the top of the window and navigate to:

Window > Show View > Project Explorer

By default, the Project Explorer should automatically import the ICEFiles/default and ICEFiles/itemDB folders. If it does not, or it you want to import a different folder into ICE, right click in the Project Explorer and select Import... from the context menu. Then select General -> File System from the tree and press the Next button. You can then select directories and/or files to import into the Project Explorer.

ProjectExplorerImportFilesDialog ICE.png

For .csv files, you can simply double click them in the Project Explorer and they will open. Similarly, VisIt files can be opened by double clicking, but you must first establish a connection to VisIt.

You can set up a default connection to VisIt in the ICE preference page. After creating a default connection, ICE will automatically connect to VisIt every time it is opened. To set the connection, select Window > Preferences in ICE's toolbar, then Visualization > VisIt in the tree of the Preferences page.

VisItPreferencePage ICE.png

Press the new row button, the button with a "+" symbol in the upper right, highlighted in the image above. You can then click on each of the cells of the new row to edit them. The default values automatically supplied by ICE should be fine for most users. However, two fields may need to be changed:

Host: The default value of "localhost" is for connections to local installations of VisIt on your computer. If you want to launch a remote VisIt connection, you must change this to the hostname of the machine to connect to.

Path: You need to put the full path to the VisIt folder here. The path should end with the folder containing the VisIt executable. For example, C:\Users\r8s\AppData\Local\Programs\LLNL\VisIt 2.9.1.

Once finished, press Apply, then OK. ICE will then open VisIt and connect to it.

Once open, the Plot Editor will display the contents of the file. For .csv files, right clicking or using the Select series... button in the upper left allows you to add or remove data series from the graph. Similarly, a VisIt plot editor will allow you to choose the mesh and scalar to model, as well as the model's representation. VisIt Plot editors also feature a slider at the bottom, allowing the user to interact with time data.

TimeSliderWidget ICE.png

The arrow buttons move to the previous or next time step, and the triangle button causes the Plot Editor to play the simulation automatically. The final button displays playback options. The current time is displayed, and you can manually drag the slider along the timeline to choose a specific time step to display.

Visualization Perspective

To use ICE's visualization tools, you first must switch to the Visualization Perspective. This perspective includes various UI components necessary for visualization that are not exposed in the default ICE perspective. To access the Visualization Perspective, use the the main menu bar at the top of the window and navigate to:

Window > Open Perspective > Other...

Select Visualization in the dialog that pops up and click OK. Alternatively, you can also access the same pop-up dialog by clicking the Open Perspective button in the main toolbar in the upper right-hand corner of the ICE workbench.

ICE OpenPerspective.png

Once the Visualization Perspective opens, you should notice the workbench contains some new UI components. Make note of the following panels, as we will be referring to them in the following sections.

ICE VisualizationPerspective.png

Visualizing Output

VisIt

Connecting to VisIt

Once you switch to the Visualization Perspective, the first step necessary is to connect to your VisIt installation through ICE. To do this, click on the Launch VisIt button located in the ICE toolbar near the top.

ICE VisItLaunchButton.png

A dialog will pop up offering you three options for connecting to VisIt:

ICE VisItLaunchOptions.png

  1. Launch VisIt locally
    If you installed VisIt on your local machine, use the Browse button to direct ICE to your local installation directory. Using this method of connecting will launch a new VisIt session. Optionally, you can also set a port number (default 9600) and--if you want to share your VisIt session with another user--a password.
  2. Launch VisIt remotely
    If you installed VisIt on a remote machine, specify the hostname and full path to the VisIt installation directory. Using this method of connecting will launch a new VisIt session. Optionally, you can specify a port number (default 9600) and--if you want to share your VisIt session with another user--a password. If you need or want to use an external gateway or proxy to access the remote VisIt installation, you may specify its URL and port number as well.
  3. Connect to VisIt
    If you would like to connect to session of VisIt already running somewhere else, specify the hostname, port number, and password set on the VisIt session; you will need to obtain this information from the person who initially launched the VisIt session. If you need or want to use an external gateway or proxy to access the remote VisIt installation, you may specify its URL and port number as well.
Idea.png
If you need to find the VisIt installation in Windows, find a shortcut to VisIt either on your desktop or in the start menu. Right-click the shortcut and open its Properties. The path to the VisIt executable's directory will be shown next to Target.


Regardless of which method you choose to connect to VisIt, enter a Connection name at the bottom of the pop-up dialog. This will allow you to re-use this connection information in the future.

If you are connecting to an existing session, specify a Window ID between 1 and 16. Which Window ID you use depends on how you would like to connect to VisIt. If multiple users connect using the same Window ID, they will all see and be able to interact with the same VisIt view. However, if you would like multiple users to each have their own unique session each with its own controls, assign a unique Window ID to each user. The VisIt installation can support up to 16 unique window IDs at a time.

Once you are done, click the Finish button at the bottom, and ICE should begin connecting to VisIt.

Adding/Removing Files

To open a file, find the green "+" icon in the Visualization File Viewer. Clicking directly on the green "+" icon will prompt a local file browser to pop up. However, if your file is located on a remote machine, or if you would like to add a file set, click on the drop-down button next to the green "+" icon.

ICE VisItAddFileButton.png

This will offer you four ways to open file(s):

  • Open a local file
  • Open a remote file
  • Open a local file set
  • Open a local SILO set

Once you have selected your file(s), they should appear in the Visualization File Viewer.

Lastly, if you would like to remove a file from the Visualization File Viewer list, select it, and click the red "X" button.

Warning2.png
When using the VisIt utilities, you currently cannot open local files with remote VisIt sessions or remote files with local VisIt sessions.


Adding/Removing Plots

To begin adding plots, select your file in the Visualization File Viewer and click the green "+" icon in the VisIt Plot Viewer.

ICE VisItAddPlotButton.png

If there is any plottable data in your file, a dialog will pop up with a list of options to choose from. This can include mesh plots, scalar plots, vector plots, material block plots, and so forth. If there are multiple plots of each type available, you can select them all by checking off the entire category, or expand it to check off only selected plots.

ICE VisItPlotSelection.png

When you are done selecting your plot(s), click OK. The selected plots should be added to the list in the VisIt Plot Viewer.

Lastly, if you would like to remove a plot from the VisIt Plot Viewer list, select it and click the red "X" button.

Rendering Plots

To render a plot, double click it in the VisIt Plot Viewer, and it will appear in the main VisIt Editor.

The VisIt Plot Viewer contains a drop-down menu with a list of plotting styles available for the currently selected plot. Depending on your selected plot, this can include mesh, pseudo-color, contour, volume, and so forth. Use this drop-down menu to select the plotting style you prefer, and the VisIt Editor will update in real time.

ICE VisItPlotStyleMenu.png

The VisIt Editor is also interactive in that you can move your plot around by clicking and dragging the canvas or zoom by using the mouse wheel. This may not necessarily be useful for 2D plots but enables a fully rotatable look at 3D plots as in the example below.

ICE VisIt3DNoise.png

Lastly, if there is any time series data associated to your plot, you can manually walk through the time steps, or play them continuously as a short video, using the playback buttons located in the VisIt Plot Viewer.

ICE VisItPlaybackButtons.png

Executing Python Commands

While many of VisIt's features are already accessible in ICE, work to enable a more robust feature set is on-going. In the meantime, features not yet integrated into ICE can still be accessed via Python commands by clicking the Python script button located in the VisIt Plot Viewer.

ICE VisItPythonScriptButton.png

Writing Python scripts for VisIt is beyond the scope of this tutorial. However, you are welcome to refer to the VisIt Python Interface Manual provided by the VisIt development team at Lawrence Livermore National Laboratory.

CSV Plot Viewer

ICE includes, out of the box, basic CSV data plotting utilities for fast and easy x/y graph visualizations. This section describes how to open your CSV data using the CSV Plot Viewer in the Visualization Perspective.

Adding/Removing Files

To open a file, find the green "+" icon in the Visualization File Viewer. Clicking directly on the green "+" icon will prompt a local file browser to pop up. You can also access this option by clicking on the drop-down button next to the green "+" icon.

ICE VisItAddFileButton.png

This will offer you four ways to open file(s):

  • Open a local file
  • Open a remote file
  • Open a local file set
  • Open a local SILO set
Note.png
ICE's CSV Plot Viewer can only open local files, so when opening CSV files for plotting, you need only click the green "+" button to select and add local files.


Once you have selected your file(s), they should appear in the Visualization File Viewer.

Lastly, if you would like to remove a file from the Visualization File Viewer list, select it, and click the red "X" button.

Adding/Removing Plots

Adding Plots

To begin adding plots, select your file in the Visualization File Viewer and click the green "+" icon in the CSV Plot Viewer.

ICE CSVAddPlotButton.png

Selecting Initial Plot Data

If the data in your CSV file is properly formatted, then a dialog will appear. This dialog gives you a list of variables from your data file.

Note.png
The CSV Plot Viewer requires data to be in an [m x n] format, meaning that files that contain rows with empty values cannot be plotted. Furthermore, the first row is expected to include column headers—the variable names—while each subsequent row should include the numerical data in columns.


ICE CSVAddPlotDialog-XAxisVariables.png

In this first dialog, you select independent variables from your CSV file. Independent variables are those whose values determine the x-coordinates of plotted series. You can select multiple data as independent variables by holding the CTRL key while clicking values in the dialog's list. When you are finished selecting independent variables from the list, click OK or press Enter.

A second dialog allowing you to select the plot type will appear. The default plot type is Line, which when used means the xy-coordinates of added series will be connected by a line. The plot type selected from this dialog will be used for all series generated from this sequence of dialogs.

ICE CSVAddPlotDialog-PlotTypes.png

Once you have chosen your desired plot type, click OK or press Enter.

A third dialog allowing you to select the features that will actually be plotted will appear.

ICE CSVAddPlotDialog-Features.png

The list on the left includes the independent variables selected in one of the previous dialogs. You must select at least one of these independent variables, as they provide the x-coordinates of series generated from the dialog.

The list on the right includes all features available in the file. You must select at least one of these features, as they provide the y-coordinates of series generated from the dialog.

You can also select multiple variables from either list by holding the CTRL key while clicking variables, although you should note that every combination of selected independent (x) and feature (y) variables will be plotted.

Once you have selected your desired x- and y-axis variables, click OK or press Enter. A new plot will be added to the list in the CSV Plot Viewer. To open this plot, simply click it, and it will open in a new CSV Plot Editor.

ICE CSVPlotEditor.png

Showing/Moving Plots

To re-open an existing plot, click its item in the CSV Plot Viewer, which is usually located on the left. The associated CSV Plot Editor in the main workbench space will be brought to the top or activated. You can also click on the associated CSV Plot Editor's tab to open it, or you can click and drag its tab to move it to another spot in your workbench.

ICE CSVPlotEditor-Moved.png

Removing Plots

Lastly, if you would like to remove a plot from the CSV Plot Viewer list, select it and click the red "X" button. To permanently remove it from view, you will also need to close the CSV Plot Editor in the main workbench space.

Adding Series to a Plot

To add more series to an existing CSV Plot Editor, you must first select the desired plot in the CSV Plot Viewer. Locate the green "+" button in the CSV Plot Viewer and click on the drop-down button next to it. Select Add a series.

You will then be prompted with the same sequence of dialogs as in the section on Selecting Initial Plot Data.

When you have finished selecting plot data as described in that section, the new data will be added to your selected plot as new series.

Plot Toolbar

The plotting widget used by ICE's CSV Plot Editor includes a toolbar with helpful utilities for navigating your plotted data or customizing the plot's appearance. You can hover the mouse cursor over each button to view a tool tip describing what the button does.

Clicking the first button will open a dialog that allows you to customize the appearance of the plot or individual series on the plot, including titles, scales, grids, colors, and fonts. The last button allows you to save the current appearance of the plot to a .png image file. Feel free to try out the different utilities available in this toolbar.

Back to the top