FTLE Operator

From VisItusers.org

Jump to: navigation, search

The analysis of time-dependent dynamical systems can be done with the Finite-time Lyapunov exponents (FTLE) Operator. We direct interested users to the excellent tutorial on Lagrangian Coherent Structures page for more details.

We reproduce here the simple (time-independent) example from section 7 of the LCS tutorial, with Epsilon=0

An input grid is required. We use a trivial 2D Cartesian grid in ASCII VTK format. Simply copy the 7 lines below in a text file called ftle_input.vtk:

# vtk DataFile Version 3.0
vtk output
ASCII
DATASET STRUCTURED_POINTS
DIMENSIONS 101 51 1
SPACING 0.02 0.02 1
ORIGIN 0 0 0

This VTK file represents a grid with Spatial Extents [0, 2, 0, 1] to fit the example's requirements.

We then create a vector field with two components, u and v, defining the following expressions:

DefineVectorExpression("velocity", "{u,v}")
DefineScalarExpression("u", "-3.141592*1*sin(3.141592*coord(mesh)[0])*cos(3.141592*coord(mesh)[1])")
DefineScalarExpression("v", "3.141592*1*cos(3.141592*coord(mesh)[0])*sin(3.141592*coord(mesh)[1])")
DefineScalarExpression("vel_mag", "magnitude(velocity)")

Finally, we plot both the velocity glyphs and the FTLE output with the code:

OpenDatabase("ftle_input.vtk")
AddPlot("Vector", "velocity", 0, 0)
 
AddPlot("Pseudocolor", "velocity")
AddOperator("FTLE", 0)
opAtts = FTLEAttributes()
opAtts.regionType = opAtts.NativeResolutionOfMesh  # NativeResolutionOfMesh, RegularGrid
opAtts.direction = opAtts.Forward  # Forward, Backward
opAtts.flowType = opAtts.Steady  # Unsteady, Steady
SetOperatorOptions(opAtts)
DrawPlots()
 
# Set the view
view = View2DAttributes()
view.windowCoords = (0, 2, 0, 1)
view.viewportCoords = (0.2, 0.95, 0.15, 0.95)
view.fullFrameActivationMode = view.Auto  # On, Off, Auto
view.fullFrameAutoThreshold = 100
view.xScale = view.LINEAR  # LINEAR, LOG
view.yScale = view.LINEAR  # LINEAR, LOG
view.windowValid = 1
SetView2D(view)

[edit] Images

Velocity Vectors FTLE output as a scalar field

Personal tools