VisIt-tutorial-data-analysis

From VisItusers.org

Jump to: navigation, search

This section describes two important abstractions in VisIt: queries and expressions.

Contents

[edit] Queries

[edit] What are queries

Queries are the mechanism to do data analysis, to pull out a number or curve that describes the data set.

[edit] Experiment with queries

  1. Go to Controls->Query.

[edit] Variable-related

  1. Change the "Display" in the Query window to be "Variable-related"
  2. Go back to the GUI, delete any current plots, open up noise.silo, and make a Pseudocolor plot of hardyglobal and draw.
  3. Highlight MinMax and click "Query".
    • The result will be displayed in the "Query results". It will tell you the minimum, maximum and their locations.
  4. Apply the slice operator to your plot.
  5. Do another MinMax query.
    • It gives you the same results. This is because the Query parameter "Original data" is selected. This means the answer is for what is in the file, not what is on the screen.
  6. Change the query parameter to be "Actual data".
  7. Do another MinMax.
    • This time the answer will be the minimum and maximum constrained to the slice.

  1. Now highlight Variable Sum and click query
    • This will sum up all of the values in the data set.
  2. Now highlight Weighted Variable Sum and click query
    • This will sum up all of the values, but it will weight by area (since you have a slice)
    • For 3D, it will weight by volume
    • For axi-symmetric 2D calculations, it will weight by revolved volume
  3. Note that both queries have options for Time Curves (don't click this because we don't have a time varying data set).
    • This is for time varying data and will produce a curve in a separate window.

  1. Now highlight Lineout.
    • Note that you must have left "project-to-2D" enabled in the Slice operator for this next one to work correctly.
  2. Change the start point to "-5 -5 0" and the end point to "5 5 0".
  3. Click Query
  4. This is a way that you can get exact lineouts.
  5. You can also take 3D lineouts this way.

[edit] Mesh-related

  1. Change the "Display" in the Query window to be "Mesh-related"
  2. Experiment with the "2D area", "SpatialExtents", "NumZones", and "Zone Center" queries
    • For the Zone Center query, you will put the domain as 0.
    • The domain is used for when you have a parallel file, where the data has been "domain decomposed" for parallel processing.

[edit] Pick-related

  1. Change the "Display" in the Query window to be "Pick-related"
  2. Experiment with:
    1. Pick: you give a 3D location and VisIt will tell you about the zone that contains that location.
      • Note that the location is *after* the slice.
      • If this is confusing, then remove the slice operator.
    2. NodePick: you give a 3D location and VisIt will tell you about the closest node to that location.
    3. PickByNode: you give a node identifier and VisIt tells you about that node.
    4. PickByZone: you give a zone identifier and VisIt tells you about that zone.


[edit] Connected-components related

  1. If you haven't already removed the slice operator, do that now, so you have just a Pseudocolor plot of hardyglobal.
  2. Apply the isovolume operator. Change the Lower bound of the Isovolume operator attributes to be "4".
  3. You will now see a bunch of blobs in space.
  4. Perform the Number of Connected Components query.
    • It should tell you that there are 15 components.
  5. Apply the Clip operator with the default settings.
  6. Perform the Number of Connected Components query again.
    • It should now say there are 14 components.
    • (Operators affect queries.)

[edit] Expressions

[edit] What are expressions

Expressions are the mechanism for creating derived quantities in VisIt. It does not cover all types of derived quantities; it only creates the flavors where data are defined on each and every point or cell on the mesh. So if you want to create a new derived quantity such as, "2*pressure", that is an expression. If you want to create a derived quantity such as, "sum of all pressures", that is not an expression, since it is not on the same mesh.

[edit] Experiment with expressions

[edit] Your first expression

  1. Open up noise.silo.
  2. Go to Controls->Expressions
  3. Click on "New" in the bottom left.
  4. This will create an expression named "unnamed1".
    • You can leave this name or change it.
  5. Type in the definition: "abs(hardyglobal-shepardglobal)"
    • TIP: You can spare yourself some typing by using the "Insert Variable" dropdown in the bottom right.
  6. Make a Contour plot of unnamed1.
    • This will show the areas of greatest difference.
  7. Review the expressions
    • The "Insert Function" drop down has a complete listing of all expressions, organized by usage.
    • Focus on the most commonly used: Math, Vector, Mesh, Mesh Quality, & Miscellaneous

[edit] Accessing coordinates in the expressions

<NOTE FROM HANK: this has failed for me twice during the actual tutorial, but I can't reproduce the failure in my office. The error appears to be with the expression getting communicated to the engine correctly.>

  1. Make the following expressions:
    1. (Vector) coord = coord(Mesh)
    2. (Scalar) X=abs(10-coord[0])
    3. (Scalar) dist = X*X*coord[1]*coord[2]
  2. Make a Pseudocolor plot of dist.
  3. Observe that we have created a distance function.
  4. Change the Pseudocolor plot's variable to be "hardyglobal"
  5. Apply the Isosurface operator.
  6. Bring up the Isosurface operator attributes
  7. Change the "Select by" to be "Values" and change the text widget to be "-500 500".
  8. Change the variable to be "dist"
  9. Apply
  10. You will now see a contour based by the distance field, colored by the hardyglobal variable.
Personal tools