Python version | Matlab version |
Vector field topology (VFT) [Ref. 1, 2] is an intuitive visualization technique of vector fields. It is a representation of the global topology based on an analysis of the critical points and their connections. For a complex vector field, it can be difficult to understand the field properties by plotting streamlines or field lines (quiver). By showing only the critical points and key integral lines connecting those points, the VFT technique produces a minimalistic intuitive representation of the field.
VFT methods have been used in many fields including fluid flow analysis, computer vision and photonics.
The algorithm was initially implemented in MATLAB. A python version has been added since. The two versions are not equivalent. The python implementation contains more upgraded algorithms for identifying the critical points.
Please cite the papers mentioned in the reference section and this github repository if you use the code for your research/work.
For a test vector filed ux = sin(X+Y)exp(-0.5X2 - 0.3Y2), uy = cos(X-Y)exp(-0.5X2 - 0.3Y2), the calculated vector field topology is shown below (with quiver lines and without quiver lines):
The colors on the integral lines correspond to the magnitude of the field.
For a test vector filed ux = -X2 + Y2, uy = X2 + Y2 - 2, the calculated vector field topology is shown below (with quiver lines and without quiver lines):
The integral lines follow the direction of the vector field, denoted here by u = [ux uy]T. For simplicity, we will assume that u is normalized. Let's consider a point on the integral line denoted by the coordinates (x0, y0). Considering the locus of the integral line is formed by a discrete set of points (x0, y0), (x1, y1), (x2, y2), ..., (xn, yn). Then,
x1 = x0 + ux(x0,y0) Δx
x2 = x1 + ux(x1,y1) Δx = x0 + ux(x0,y0) Δx + ux(x1,y1) Δx
. .
xn = x0 + ∑i=0n-1 ux(xi,yi) Δx
In the continuous limit, x = x0 + ∫ ux dx'
- J. Helman, and L. Hesselink. "Representation and display of vector field topology in fluid flow data sets." Computer, vol. 22, pp. 27-36, August 1989.
- J. Helman, and L. Hesselink. "Visualizing vector field topology in fluid flows." IEEE Computer Graphics and Applications, vol. 11, pp. 36-46, May/June 1991.