LLNL-tutorial-VisIt-basics
Contents
- 1 Starting VisIt
- 2 Working with files
- 3 Making a plot
- 4 Modifying the Plot attributes
- 5 Applying an operator
- 6 VisIt interaction modes
- 7 Applying different operators to different plots
- 8 Other plots
- 9 Other operators
- 10 Saving an image
- 11 Saving a database
- 12 Subsetting
- 13 Running in client / server mode
- 14 Running in an mxterm
Starting VisIt
The way you start VisIt depends on the platform you are on:
- On Windows, double click on the VisIt desktop icon
- On Mac, double click on the VisIt icon where you installed it (generally in the /Applications folder).
- On Unix, invoke: /path/to/visit/bin/visit
- Most people ultimately put /path/to/visit/bin in their $PATH and then just say "visit".
Working with files
There are two interfaces for working with files: The legacy interface, which is the default on LLNL systems, and the new interface. The advantage to the new interface is that it is streamlined and it leaves more room for the plot list and notepad. The new interface also allows you to specify file open properties when opening a file. We recommend using the new interface. You can switch to the new interface by toggling the Show selected files toggle in the Preferences window.
Changing the file selection interface
- Bring up the Preferences window (Options->Preferences…) and toggle the Show selected files toggle button in the File panel properties.
- To make the change permanent, dismiss the Preferences window and save the settings (Options->Save Settings).
Using the new interface
- Bring up the File open window (using the Open button) and open the file you want to work with.
- All the currently open files will show up in the Active source selection. To change the active source, just select it from the list.
Opening a file
- Select the file from the Files list and press the Ok button to open a file. You can also double click on the file to open it as well.
- By default, VisIt tries to group files into a time series if a group of alphabetically sequential files match one of the naming conventions it recognizes. In rare instances you may want to turn this off. To do so, change the File grouping option to Off.
- VisIt tries to automatically determine the type of a file using file extensions and file naming conventions. If the file name doesn’t have the right extension you can manually specify the type of file. To do so, change the Open file as type option to the correct file type.
- Some file readers have options that specify optional properties about a file that VisIt can’t automatically determine. To specify those, first specify the file type using the Open file as type option and then press the Set default open options… button. The Set default open options… button will be greyed out if the file format doesn’t have any options.
Making a plot
- Click on the Add button to access various plots. This is located about half way down in the Main window.
- Select Pseudocolor->hardyglobal to add a Pseudocolor plot.
- After adding a plot, you will see a green entry added to the plot list, which is located half way down the gui.
- This means VisIt will draw this plot after you click Draw
- Click Draw.
- You should see a plot appear in the visualization window.
- Go to Add->Mesh->Mesh
- Click Draw.
- You should now see both a Pseudocolor and plot mesh.
- Highlight the Pseudocolor plot in the active plots list.
- Click the Hide/Show button.
- (This will hide the Pseudocolor plot ... you should now see only the mesh plot.)
- Highlight the Mesh plot and click Delete.
- You should now have an empty vis window.
- The Pseudocolor plot should now be selected.
- Click Hide/Show.
- The Pseudocolor plot should reappear.
Modifying the Plot attributes
Each plot has a default set of values that are choosen to be appropriate in most situations. There are many situations where these settings may not be appropriate or could be improved upon. For example, for a Pseudocolor plot:
- It might be useful to set the color bar scaling to a log scale if the data is logrithmic in nature or ranges over several orders of magnitude.
- It might be useful to manually set the minimum and maximum values used to map data to color when looking at data from a time series and you want to have a specific color map to a fixed value as you change the time state. Another situation where it is useful to manually set the minimum and maximum is when you are comparing two data sets and they have slightly different data extrema.
Let's go through some examples of setting the Pseudocolor plot attributes.
- Go to Plot Attributes->Pseudocolor.
- This should bring up a window for modifying the plot.
- Change the scale from Linear to Log.
- Click Apply.
- (The colors changed)
- Click Minimum on and change the minimum to 3.
- Click Maximum on and change the maximum to 4.
- Click Apply.
- (The colors change again.)
- Change the Opacity mode to Constant.
- Change the opacity slider to 50%.
- Click Apply.
- (You can now see through the plot. Note that you only see the external faces. If you want to see the data from the whole volume, that will be with the volume plot.)
- Change back the scale, limits, and opacity back to their original settings and click Apply.
- Dismiss the Pseudocolor plots window.
Applying an operator
- Go to Operators->Slicing->Slice.
- Operators is located next to Plots.
- Click Draw.
- You are now looking at a 2D slice.
- Go to Operator Attributes->Slicing->Slice.
- There are many controls for setting the slice plane ... play with them.
- Operators can be removed by clicking on an expansion arrow in the plot list, then clicking on the red X icon next to an operator.
VisIt interaction modes
There are six basic interaction modes:
You always start in Navigate. Navigate allows you to pan and rotate the data set.
- Put the cursor in the visualization window from the viewer.
- Left click (or single click if you do not have a 3 button mouse) and move the mouse.
- The data set will pan with the mouse.
- In 3D, the data set rotates.
- The interaction mode is controlled by the toolbar, which is located at the top of the visualization window.
- The five interaction modes are all located together on the toolbar, towards the bottom.
- Click on the magnifying glass
, which corresponds to zoom.
- Go to the visualization window and left click (single click) and HOLD IT DOWN.
- Move the mouse a bit.
- You should see a rubber band.
- Lift up the mouse button.
- You should now be zoomed in so that the viewport matches what was previously inside the rubber band.
- Find the icon of a camera that has a green "X" around it. (The camera is mostly obscured by the X)
- Click it.
- This will reset your view.
- Click the icon next to the magnifying glass, which has red, blue, and black lines.
- This is for lineout.
- Put the cursor over the data and left click (single click) and HOLD IT DOWN.
- Move the mouse a bit.
- You should see a single line moving around.
- Lift up the mouse button.
- The window layout changes. You now have two windows. The first window is the same, but the second now contains a Lineout, which has temp as a function of distance over the line.
- On the window that has the curve, find the icon on the toolbar of the window with a red circle with a line through it.
- Click this button.
- The new window should disappear.
Pick
You should only have one window now.
- Click on the icon that has a '+' with a small Z.
This is "zone-pick".
- Put the cursor over the data set and left click (single click).
- This will bring up a new window ... the Pick window.
- The pick window contains information about the zone (i.e. cell or element) that you just picked in.
- The pick contains variable information, intersection location, zone ID, and IDs of incident nodes (i.e. point or vertex).
Pick can return a lot more information than it did if you use the Pick window.
- Go to the Variables drop down and select Scalars\hardyglobal.
- Turn on Physical Coords under For Nodes.
- Turn on Domain-Logical Coords under For Zones.
- Click Apply.
- Make another pick.
- You get info about hardyglobal, the coordinates of each node, and the logical coordinates for the zone.
Applying different operators to different plots
The default behavior is to apply the same operators and operator attributes to all the plots in the plot list. This makes it convenient to create a pseudocolor plot and mesh plot and slice both of them, as well as change the slice location for both of them at the same time. It doesn't allow you to create two plots that are sliced in different locations or to apply an operator to one plot and not another. This is where the Apply operators to all plots setting comes in.
- Delete all the existing plots and get rid of the pick window.
- Toggle the Apply operators to all plots setting.
- Create a Pseudocolor plot of hardyglobal.
- Add the Slice operator.
- Create a Pseudocolor plot of radial.
- Add the Slice operator.
- Add the Reflect operator (Operators->Transforms->Reflect).
- Expand both plots in the plot list.
- Double click on the Reflect operator in the plot list to bring up the Reflect attributes.
- Change the attributes to show the portion reflected about the minimum X boundary.
- Click Draw.
- You should see the variable radial on the left and the variable hardyglobal on the right.
- The same principle works for subset selections. You can apply different subset selections to different plots by toggling the Apply subset selections to all plots setting and setting different subset selections for the different plots.
Other plots
- We will experiment with the Contour, Filled Boundary, Label, Vector and Volume plots.
Other operators
- We will experiment with the Clip and Threshold operators.
Saving an image
- With a current plot, go to File->Save Window.
- This saves an image to the filesystem.
On windows, the default location for saved images is in Documents\VisIt\My images.
Saving a database
VisIt can be part of a larger tool chain.
- If you do not already have one, make a Pseudocolor plot of temp from the noise.silo database.
- Apply the Threshold operator and change the range to be 3->max.
- Click Draw.
- Go to File->Export Database.
- Change the file type to VTK.
- Be sure to set the output directory or the exported file will be written to the working directory (on Windows that would be the directory where VisIt is installed).
- Export.
- A file named visit_ex_db.vtk has been saved to the file system.
Subsetting
Normally, all of the data in a data set will be displayed. Sometimes it is useful to display only a portion of your data. For example:
- Simulations typically break down a model into parts or materials. In those situations you may want to display only specific parts or materials.
- Simulations are typically run in parallel and they may partition the model into domains that are simulated on different processors. If you are interested in seeing how the data was partitioned onto processors, you may want to display the data on only a subset of the processors.
Selecting the portions of your data to display is accomplished with Subset selection.
Let's turn on and off some sets using the Subset selection window.
- Delete any plots in your window.
- Open the file multi_ucd3d.silo.
- Make a Subset plot of domains(mesh1).
- The plot is colored by domains, which normally correspond to a simulation's processors.
- In the plots list, find the overlapping transparent black and white ovals (like a Venn diagram) and click on it.
- This will bring up the Subset window.
- Turn off some domains and click Apply.
- You will see some of the domains disappear.
- (Subsetting works with any plot type.)
- Turn all the domains back on.
- Turn off materials 1 and 3.
-
You will see material 2 only, colored by domain.
This mechanism is used to expose subsetting for materials, domains, AMR levels, and other custom subsettable parts.
Running in client / server mode
Running in client / server mode has the advantage that you can better leverage the graphics rendering capabilities of your desktop session. It may also get you around issues with displaying graphics back to a Mac or Windows system.
- Select another host from the Host text box.
- You may be prompted for a password if you do not have password-less ssh set up between your desktop machine and the remote machine. If your user name is not the same between your desktop and the remote machine you will need to change your user name first.
- If you are logging in through a gateway node (such as any machine on the RZ) you will have to have password-less ssh set up between the gateway node and the remote machine your connecting to (such as between rzgw and rzmerl).
- If you have problems getting this to work you should contact a VisIt developer, since getting this to work can be quite complicated if things don’t work right away.
- Once you are logged onto the remote system, you can browser the remote file system do everything else like normal.
Running in an mxterm
Running in an mxterm allows you to grab a bunch of nodes for the entire day and if your compute engine crashes you can start your engine again without having to wait for a new batch submission.
- Start your mxterm term like you normally would do.
- Once you mxterm is up and running start VisIt in the mxterm as you would normally do. This means that you will need to display back via X11 as opposed to running client/server.
- When it is time to select the launch options to use for launching your engine, select the parallel mxterm profile and set the number of processors to match what you used in the mxterm.
mxterm 1 16 240 -q pbatch -A wbronze