This page is basically a formatted email from Hank Childs to Paul Fischer.

Simple differencing between two time slices

This is done with expressions. Since your mesh has a fixed connectivity and the points are at fixed locations, you can use a simple "conn_cmfe". I've commented that the interface is horrible here. Apologies for that ... we want to improve it.

Example: difference with the previous time slice

To look at differences in z_velocity with the previous time slice:

  1. Go to Controls->Expressions
  2. Click "New" (in the lower left of the window)
  3. Change the name (in the upper right) to be z_velocity_diff
    • It can actually be anything. You can leave it as unnamed1 if you like.
  4. Make the definition be:
    • z_velocity - conn_cmfe(<[-1]id:z_velocity>, mesh)
  5. Click Apply.
  6. Now you have a new scalar variable named z_velocity_diff.
    • For example, you could contour by this, pseudocolor, etc.

After making the expression, your Expressions window should look like this: Expr window.png

Arguments explained

The conn_cmfe has an embarassingly complex interface. Here's an explanation of the arguments:

  • "mesh"
    • This is the name of the mesh to evaluate the expression onto.
    • Some files have multiple meshes and that makes this argument necessary.
    • For Nek data, there is only one mesh, so that makes this extra argument unnecessary. But VisIt isn't that smart, so you still have to add it.
  • <[-1]id:z_velocity>
    • The "z_velocity" part is obvious. That is variable to take from the other time slice. You can put any variable name in its place.
    • [N] (in this case N = -1) says what time slice to access.
    • "id" is actually two arguments: 'i' and 'd'
      • 'i' means that we are referencing a time slice index
        • Valid numbers are from 0 to NTIMESLICES-1
      • 'd' stands for "delta".
        • This means take the current time slice and add N (-1) to it.
    • Here are some other examples, for clarity:
      • <[0]i:pressure> = pressure from time slice 0
      • <[1]id:pressure> = pressure from the next time slice


If you are always doing the same type of differencing over and over (e.g. looking backward one time slice or always comparing to time slice 0), then I can build these expressions into the file reader and you won't have to set up expressions manually.