Upload
others
View
12
Download
0
Embed Size (px)
Citation preview
Visualization, Summer Term 2002 23.07.2003
1
Visualization, Summer Term 03 VIS, University of Stuttgart1
7. Vector Field Visualization
• Vector data set• Represent direction and magnitude• Given by a n-tupel (f1,...,fn) with fk=fk(x1,...,xn ), n ≥ 2 and 1≤ k ≤ n• Specific transformation properties • Typically n = k = 2 or n = k = 3
Visualization, Summer Term 03 VIS, University of Stuttgart2
7. Vector Field Visualization
• Main application of vector field visualization is flow visualization• Motion of fluids (gas, liquids) • Geometric boundary condititions• Velocity (flow) field v(x,t)• Pressure p• Temperature T• Vorticity ∇×v• Density ρ• Conservation of mass, energy, and momentum• Navier-Stokes equations• CFD (Computational Fluid Dynamics)
Visualization, Summer Term 2002 23.07.2003
2
Visualization, Summer Term 03 VIS, University of Stuttgart3
7. Vector Field Visualization
Flow visualizationbased on CFD data
Visualization, Summer Term 03 VIS, University of Stuttgart4
7. Vector Field Visualization
• Flow visualization – classification• Dimension (2D or 3D)• Time-dependency: stationary (steady) vs. instationary (unsteady)• Grid type• Compressible vs. incompressible fluids
• In most cases numerical methods required for flow visualization
Visualization, Summer Term 2002 23.07.2003
3
Visualization, Summer Term 03 VIS, University of Stuttgart5
7.1. Vector Calculus
• Review of basics of vector calculus• Deals with vector fields and various kinds of derivatives• Flat (Cartesian) manifolds only• Cartesian coordinates only• 3D only
Visualization, Summer Term 03 VIS, University of Stuttgart6
7.1. Vector Calculus
• Scalar function ρ(x,t)
• Gradient
• Gradient points into direction of maximum change of ρ(x,t)
• Laplace
( )( )( )( )
( )t,t,t,t,
t,
z
y
x
z
y
x
xxxx
x ρρρρ
ρ
=
=∇
∂∂
∂∂
∂∂
∂∂
∂∂
∂∂
( ) ( )( ) ( ) ( )t,t,t,
t,t,
222 zyxxxx
xxρρρ
ρρ
∂∂
∂∂
∂∂ ++=
∇•∇=∆222
Visualization, Summer Term 2002 23.07.2003
4
Visualization, Summer Term 03 VIS, University of Stuttgart7
7.1. Vector Calculus
• Vector function v(x,t)
• Jacobi matrix(“Gradient tensor”)
• Divergence
( )
=∇=
∂∂
∂∂∂∂
∂∂
∂∂
∂∂
∂∂
∂∂∂∂
zz
yz
xz
zy
yy
xy
zx
yx
xx
t,vvv
vvv
vvv
xvJ
( ) ( ) ( ) ( ) ( )t,t,t,t,t, zzyyxx xvxvxvxvxv ∂∂
∂∂
∂∂ ++=⋅∇=div
Visualization, Summer Term 03 VIS, University of Stuttgart8
7.1. Vector Calculus
• Gauss theorem (divergence theorem)
∫∫ ⋅=⋅∇SV
ddV Avv
v
volume V
surface S
Visualization, Summer Term 2002 23.07.2003
5
Visualization, Summer Term 03 VIS, University of Stuttgart9
7.1. Vector Calculus
• Properties of divergence:• div v is a scalar• div v(x0) > 0: v has a source in x0
• div v(x0) < 0: v has a sink in x0
• div v(x0) = 0: v is source-free in x0
• Describes flow into/out of a region
x
y
x
y
Visualization, Summer Term 03 VIS, University of Stuttgart10
7.1. Vector Calculus
• Continuity equation • Flow of mass into a volume V with surface S
• Change of mass inside the volume
• Conservation of mass
∫ ⋅−S
dAvρ
∫∫ ∂∂
=∂∂
VV
dVt
dVt
ρρ
∫∫ ⋅−=∂∂
SV
ddVt
Avρρ
Visualization, Summer Term 2002 23.07.2003
6
Visualization, Summer Term 03 VIS, University of Stuttgart11
7.1. Vector Calculus
• Continuity equation (cont.)• Application of Gauss theorem
• Above equation must be met for any volume element• Yields
( )∫∫∫ =
⋅∇+
∂∂
=⋅+∂∂
VSV
0dVt
ddVt
vAv ρρρρ
( ) 0t
=⋅∇+∂∂ vρρ
continuity equationin differential form
vj ρ=current
Visualization, Summer Term 03 VIS, University of Stuttgart12
7.1. Vector Calculus
• Curl
• Stokes theorem
( ) ( )( ) ( )( ) ( )( ) ( )
−−−
=×∇=
∂∂
∂∂
∂∂
∂∂
∂∂
∂∂
t,t,t,t,t,t,
t,t,
xyyx
zxxz
yzzy
xvxvxvxvxvxv
xvxvcurl
∫∫ ⋅=⋅×∇CS
dd svAv
closed curve C
surface S v
Visualization, Summer Term 2002 23.07.2003
7
Visualization, Summer Term 03 VIS, University of Stuttgart13
7.1. Vector Calculus
• Properties of curl:• Describes vortex characteristics in the
flow• From non-curl free flow
can follow that
and
• Vorticity
x
y
0≠×∇ v
0≠⋅×∇∫S
dAv
0≠⋅∫C
dsv
v×∇
Visualization, Summer Term 03 VIS, University of Stuttgart14
7.1. Vector Calculus
• Decomposition of a vector field (Helmholtz theorem)• Divergence-free (transversal) part• Curl-free (longitudinal) part
• Decomposition:
with
and
• Other way round: v is uniquely determined by divergence-free and curl-free parts (if v vanishes at boundary / infinity)
)()()( xvxvxv dc +=
0)( =×∇ xvc
0)( =•∇ xvd
Visualization, Summer Term 2002 23.07.2003
8
Visualization, Summer Term 03 VIS, University of Stuttgart15
7.1. Vector Calculus
• Decomposition of a vector field (cont.)• Suppose we have a representation of v by the Poisson equation
• Curl-free part written as a gradient:
with
• Divergence-free part written as a curl
with
)()( xzxv ∆−=
)()( xxv uc −∇=
)()( xzx •∇=u (scalar) potential u
)()( xwxv ×∇=d
)()( xzxw ×∇= vector potential w
Visualization, Summer Term 03 VIS, University of Stuttgart16
7.2. Characteristic Lines
• Types of characteristic lines in a vector field:• Stream lines: tangential to the vector field• Path lines: trajectories of massless particles in the flow• Streak lines: trace of dye that is released into the flow at a fixed position• Time lines (time surfaces): propagation of a line (surface) of massless
elements in time
Visualization, Summer Term 2002 23.07.2003
9
Visualization, Summer Term 03 VIS, University of Stuttgart17
7.2. Characteristic Lines
• Stream lines• Tangential to the vector field• Vector field at an arbitrary, yet fixed time t• Stream line is a solution to the initial value problem of an ordinary
differential equation:
• Stream line is curve L(u) with the parameter u
( ) ( ) ( )( )tuudud0 0 ,, LvLxL ==
initial value(seed point x0)
ordinary differential equation
Visualization, Summer Term 03 VIS, University of Stuttgart18
7.2. Characteristic Lines
• Path lines• Trajectories of massless particles in the flow• Vector field can be time-dependent (unsteady)• Path line is a solution to the initial value problem of an ordinary differential
equation:
( ) ( ) ( )( )uuudud0 0 ,, LvLxL ==
Visualization, Summer Term 2002 23.07.2003
10
Visualization, Summer Term 03 VIS, University of Stuttgart19
7.2. Characteristic Lines
• Streak lines• Trace of dye that is released into the flow at a fixed position• Connect all particles that passed through a certain position
• Time lines (time surfaces)• Propagation of a line (surface) of massless elements in time• Idea: “consists” of many point-like particles that are traced• Connect particles that were released simultaneously
Visualization, Summer Term 03 VIS, University of Stuttgart20
7.2. Characteristic Lines
• Comparison of path lines, streak lines, and stream lines
• Path lines, streak lines, and stream lines are identical for steady flows
t0 t1 t2 t3
path line streak line stream line for t3
Visualization, Summer Term 2002 23.07.2003
11
Visualization, Summer Term 03 VIS, University of Stuttgart21
7.2. Characteristic Lines
• Difference between Eulerian and Lagrangian point of view• Lagrangian:
• Individual particles• Can be identified• Attached are position, velocity, and other properties• Explicit position• Standard approach for particle tracing
• Eulerian:• No individual particles• Properties given on a grid• Position is implicit
Visualization, Summer Term 03 VIS, University of Stuttgart22
7.3. Arrows and Glyphs
• Visualize local features of the vector field:• Vector itself• Vorticity• Extern data: temperature, pressure, etc.
• Important elements of a vector:• Direction• Magnitude• Not: components of a vector
• Approaches:• Arrow plots• Glyphs
Visualization, Summer Term 2002 23.07.2003
12
Visualization, Summer Term 03 VIS, University of Stuttgart23
7.3. Arrows and Glyphs
• Arrows visualize• Direction of vector field• Orientation• Magnitude:
• Length of arrows• Color coding
Visualization, Summer Term 03 VIS, University of Stuttgart24
7.3. Arrows and Glyphs
• Arrows
Visualization, Summer Term 2002 23.07.2003
13
Visualization, Summer Term 03 VIS, University of Stuttgart25
7.3. Arrows and Glyphs
• Glyphs• Can visualize more features of the vector field (flow field)
Visualization, Summer Term 03 VIS, University of Stuttgart26
7.3. Arrows and Glyphs
• Advantages and disadvantages of glyphs and arrows:+ Simple+ 3D effects- Heavy load in the graphics subsystem- Inherent occlusion effects- Poor results if magnitude of velocity changes rapidly
(Use arrows of constant length and color code magnitude)
Visualization, Summer Term 2002 23.07.2003
14
Visualization, Summer Term 03 VIS, University of Stuttgart27
7.4. Mapping Methods Based on Particle Tracing
• Basic idea: trace particles• Characteristic lines• Global methods• Mapping approaches:
• Lines• Surfaces• Individual particles• Sometimes animated
Visualization, Summer Term 03 VIS, University of Stuttgart28
7.4. Mapping Methods Based on Particle Tracing
• Path lines
Visualization, Summer Term 2002 23.07.2003
15
Visualization, Summer Term 03 VIS, University of Stuttgart29
7.4. Mapping Methods Based on Particle Tracing
• Stream balls• Encode additional scalar value by radius
Visualization, Summer Term 03 VIS, University of Stuttgart30
7.4. Mapping Methods Based on Particle Tracing
• Streak lines
Visualization, Summer Term 2002 23.07.2003
16
Visualization, Summer Term 03 VIS, University of Stuttgart31
7.4. Mapping Methods Based on Particle Tracing
• Stream ribbons• Trace two close-by particles• Keep distance constant
Visualization, Summer Term 03 VIS, University of Stuttgart32
7.4. Mapping Methods Based on Particle Tracing
• Stream tubes• Specify contour, e.g. triangle
or circle, and trace it through the flow
Visualization, Summer Term 2002 23.07.2003
17
Visualization, Summer Term 03 VIS, University of Stuttgart33
7.4. Mapping Methods Based on Particle Tracing
• Motion of individual particles
Visualization, Summer Term 03 VIS, University of Stuttgart34
7.4. Mapping Methods Based on Particle Tracing
• LIC (Line Integral Convolution)
Visualization, Summer Term 2002 23.07.2003
18
Visualization, Summer Term 03 VIS, University of Stuttgart35
7.4. Mapping Methods Based on Particle Tracing
• Texture advection• Animation
Visualization, Summer Term 03 VIS, University of Stuttgart36
7.5. Numerical Integration of Ordinary Differential Equations
• Typical example of particle tracing problem (path line):
• Initial value problem for ordinary differential equations (ODE)• What kind of numerical solver?
( ) ( ) ( )( )uuudud0 0 ,, LvLxL ==
Visualization, Summer Term 2002 23.07.2003
19
Visualization, Summer Term 03 VIS, University of Stuttgart37
7.5. Numerical Integration of Ordinary Differential Equations
• Rewrite ODE in generic form• Initial value problem for:
• Most simple (naive) approach: Euler method
• Based on Taylor expansion
• First order method• Higher accuracy with smaller step size
),()( tt xfx =&
),()()( ttttt xfxx ∆+=∆+
)()()()( 2tOttttt ∆+∆+=∆+ xxx &
Visualization, Summer Term 03 VIS, University of Stuttgart38
7.5. Numerical Integration of Ordinary Differential Equations
• Problem of Euler method
• Inaccurate
• Unstable
• Example:
ktexkxf−=
−=divergence for ∆t > 2/k
Visualization, Summer Term 2002 23.07.2003
20
Visualization, Summer Term 03 VIS, University of Stuttgart39
7.5. Numerical Integration of Ordinary Differential Equations
• Midpoint method
1. Euler step
2. Evaluation of f at midpoint
3. Complete step with value at midpoint
• Method of second order
),( tt xfx ∆=∆
∆
+∆
+=2
,2mid
ttxxff
mid)( fx ttt ∆=∆+
Visualization, Summer Term 03 VIS, University of Stuttgart40
7.5. Numerical Integration of Ordinary Differential Equations
• Runge-Kutta of fourth order
( )
( )54321
34
23
12
1
6336)(
,2
,2
2,
2
),(
tOtt
ttt
ttt
ttt
tt
∆+++++=∆+
∆++∆=
∆
++∆=
∆
++∆=
∆=
kkkkxx
kxfk
kxfk
kxfk
xfk
Visualization, Summer Term 2002 23.07.2003
21
Visualization, Summer Term 03 VIS, University of Stuttgart41
7.5. Numerical Integration of Ordinary Differential Equations
• Adaptive stepsize control• Change step size according to the error• Decrease/increase step size depending on whether the actual local error
is high/low• Higher integration speed in “simple” regions• Good error control
• Approaches:• Stepsize doubling• Embedded Runge-Kutta schemes
• Further reading: • WH Press, SA Teukolsky, WT Vetterling, BP Flannery: Numerical Recipes
Visualization, Summer Term 03 VIS, University of Stuttgart42
7.5. Numerical Integration of Ordinary Differential Equations
• Stepsize doubling• Estimating the error based on two way (one big step vs two small steps)
• Indication of truncation error:
• If error ∆ is larger than a given tolerance level τ, the step is redone with a new step size ∆t
• Otherwise the step is taken and ∆t’ is estimated for the next integration step:
( )( )( ) ( ) ( ) ( )
( ) ( )
∆+∆+∆+∆+
=∆+⇒∆∆
∆==
652
651
2
1
tOtxtOtxttx
ttxtx
xx
φφ
222
,,2,
RK4RK4RK4
12 xx −=∆
1 factorsafety with, <⋅⋅∆=∆ ∆ ρρ τ5tt'
Visualization, Summer Term 2002 23.07.2003
22
Visualization, Summer Term 03 VIS, University of Stuttgart43
7.5. Numerical Integration of Ordinary Differential Equations
• Embedded Runge-Kutta• Originally invented by Fehlberg• Comparison between results from two steps taken with schemes of
different order
• Typical example: x is computed with fifth order, x* with fourth order RK• Main idea: Reuse function evaluations from higher-order scheme to speed
up the evaluation of lower-order scheme• Example with fourth-order RK embedded in fifth-order RK:
Fourth-order RK needs only the (six) function evaluations from fifth-order RK and no further evaluations!
*xx −=∆
Visualization, Summer Term 03 VIS, University of Stuttgart44
7.5. Numerical Integration of Ordinary Differential Equations
• Embedded Runge-Kutta (cont.)• Practical choice for new stepsize for 4th / 5th embedded RK
• Choice for safety factor, e.g., ρ = 0.9
∆<⋅⋅∆
∆≥⋅⋅∆=∆
∆
∆
τρτρ
τ
τ
if if
4
5
tt
t'
Visualization, Summer Term 2002 23.07.2003
23
Visualization, Summer Term 03 VIS, University of Stuttgart45
7.5. Numerical Integration of Ordinary Differential Equations
• So far only explicit methods• Stability problem can be solved by implicit methods
• Implicit Euler method
• „Reversing“ the explicit Euler integration step• Taylor expansion around t + ∆t instead of t• Solving the system of non-linear equations to determine x(t + ∆t)• Using implicit methods allows larger time steps
( )ttttftttt ∆+∆+∆=−∆+ ),()()( xxx
Visualization, Summer Term 03 VIS, University of Stuttgart46
7.6. Particle Tracing on Grids
• Vector field given on a grid• Solve
for the path line• Incremental integration• Discretized path of the particle
( ) ( ) ( )( )tttdtd0 0 ,, LvLxL ==
Visualization, Summer Term 2002 23.07.2003
24
Visualization, Summer Term 03 VIS, University of Stuttgart47
7.6. Particle Tracing on Grids
• Most simple case: Cartesian grid for the path line
• Basic algorithm:
Select start point (seed point)
Find cell that contains start point point locationWhile (particle in domain) do
Interpolate vector field at current position interpolation
Integrate to new position integrationFind new cell point locationDraw line segment between latest particle positions
Endwhile
Visualization, Summer Term 03 VIS, University of Stuttgart48
7.6. Particle Tracing on Grids
• Point location (cell search) on Cartesian grids:• Indices of cell directly from position (x, y, z)• For example: ix = (x – x0) / ∆x• Simple and fast
• Interpolation on Cartesian grids:• Bilinear (in 2D) or trilinear (in 3D) interpolation• Required to compute the vector field (= velocity) inside a cell• Component-wise interpolation• Based on offsets (= local coordinates within cell)
Visualization, Summer Term 2002 23.07.2003
25
Visualization, Summer Term 03 VIS, University of Stuttgart49
7.6. Particle Tracing on Grids
• How are curvilinear grids handled?• C-space (computational space) vs. P-space (physical space)
s
r00r
0,1
0,0 1,0
x
x
p
q
C-spaceP-space
Visualization, Summer Term 03 VIS, University of Stuttgart50
7.6. Particle Tracing on Grids
• Particle tracing can either be done in C-space or P-space• Transformation of
• Points by Φ• Vectors by J
Φ or J
Φ-1 or J-1
s00r
0,1
0,0 1,0
x
p
q
C-spaceP-space
r
x
Visualization, Summer Term 2002 23.07.2003
26
Visualization, Summer Term 03 VIS, University of Stuttgart51
7.6. Particle Tracing on Grids
• Transformation of points:• From C-space to P-space: r = Φ(s)• From P-space to C-space: s = Φ-1(r)
• Transformation of vectors:• From C-space to P-space: v = J ⋅ u• From P-space to C-space: u = J-1 ⋅ v• J is Jacobi matrix:
∂∂
∂∂
∂∂
∂∂
=
qp
qpyy
xx
ΦΦ
ΦΦ
J
(2D case)
Visualization, Summer Term 03 VIS, University of Stuttgart52
7.6. Particle Tracing on Grids
• Particle tracing in C-space• Algorithm
Select start point r in P-space (seed point)
Find P-space cell point locationTransform start point to C-space sWhile (particle in domain) do
Transform v → u at vertices (P → C)
Interpolate u in C-space interpolationIntegrate to new position s in C-space integrationIf outside current cell then
Clipping
Find new cell point locationEndifTransform to P-space s → r (C → P)Draw line segment between latest particle positions
Endwhile
Visualization, Summer Term 2002 23.07.2003
27
Visualization, Summer Term 03 VIS, University of Stuttgart53
7.6. Particle Tracing on Grids
• Transformation of points from C-space to P-space: r = Φ(s):• Bilinear (in 2D) or trilinear (in 3D) interpolation between coordinates of the
cell’s vertices• Transformation of vectors from P-space to C-space: u = J-1 ⋅ v
• Needs inverse of the Jacobian• Numerical computation of elements of the Jacobi matrix:
• Backward differences (bd)• Forward differences (fd)• Central differences (cd)
j
i
j
i
j
i
J1
J2
J2
J1
J1
J2
fd, fd fd, bd cd
Visualization, Summer Term 03 VIS, University of Stuttgart54
7.6. Particle Tracing on Grids
• Choices for attaching Jacobi matrix on curvilinear grids:• Once per cell (central differences): fast, inaccurate• Once per vertex (central differences): slower, higher accuracy• 4 (in 2D) or 8 (in 3D) per vertex (backward and forward differences):
very time-consuming, completely compatible with bi / trilinear interpolation,accurate
Jcd
Jfdfd
Jcd
Jcd
JcdJcd
Jfdbd
Jbdbd
Jbdfd
Once per cell Once per vertex 4 per vertex
Visualization, Summer Term 2002 23.07.2003
28
Visualization, Summer Term 03 VIS, University of Stuttgart55
7.6. Particle Tracing on Grids
• Particle tracing in P-Space• Algorithm
Select start point r in P-space (seed point)
Find P-space cell and local coords point locationWhile (particle in domain) do
Interpolate v in P-space interpolationIntegrate to new position r in P-space integrationFind new position point locationDraw line segment between latest particle positions
Endwhile
Visualization, Summer Term 03 VIS, University of Stuttgart56
7.6. Particle Tracing on Grids
• Main problem: Point location / local coordinates in cell• Given is point r in P-space• What is corresponding position s in C-space?• Coordinates s are needed for interpolating v
• Solution: Stencil-walk algorithm [Bunnig ’89]• Iterative technique• Needs Jacobi matrices
Visualization, Summer Term 2002 23.07.2003
29
Visualization, Summer Term 03 VIS, University of Stuttgart57
7.6. Particle Tracing on Grids
• Stencil-walk on curvilinear grids • Given: rold, rnew, sold , Φ(sold) = rold
• Determine snew
Φ or Jolds00r
0,1
0,0 1,0
x
p
q
C-spaceP-spacex
news
Φ-1 or J-1
oldr
x
newr
x
Visualization, Summer Term 03 VIS, University of Stuttgart58
7.6. Particle Tracing on Grids
• Stencil-walk on curvilinear grids (cont.)• Transformation of distances ∆s = snew – sold and ∆r = rnew – rold
• Taylor expansion:
• Therefore
K+∆⋅=Φ−Φ=−=∆ Φ )()()( ssJssrrr oldoldnewoldnew
rsJs ∆≈∆ −Φ
1)]([ old
Φ or Jolds00r
0,1
0,0 1,0
x
p
q
C-spaceP-spacex
news
Φ-1 or J-1
∆r
∆s
oldr
x
newr
x
Visualization, Summer Term 2002 23.07.2003
30
Visualization, Summer Term 03 VIS, University of Stuttgart59
7.6. Particle Tracing on Grids
• Idea of stencil-walk:• Guess start point in C-space• Compute difference between corresponding position and target position in
P-space• Improve position in C-space• Iterate
Φ or Jolds00r
0,1
0,0 1,0
x
p
q
C-spaceP-spacex
news
Φ-1 or J-1
∆s
∆r
oldr
x
newr
x
Visualization, Summer Term 03 VIS, University of Stuttgart60
7.6. Particle Tracing on Grids
• Stencil-walk algorithm
Given: target position rtarget in P-space
required accuracy ε in C-spaceGuess start point s in C-spaceDo
Transformation to P-space r = Φ(s)Difference in P-space ∆r = rtarget – rTransformation to C-space ∆s = J-1 ∆rIf (|∆s| < ε) then exits = s + ∆sIf (s outside current cell) then
Set s = midpoint of corresponding neighboring cellEndif
Repeat
Visualization, Summer Term 2002 23.07.2003
31
Visualization, Summer Term 03 VIS, University of Stuttgart61
7.6. Particle Tracing on Grids
• High convergence speed of stencil walk• Typically 3-5 iteration steps in a cell
• Interpolation of velocity in P-space approach:• Bi / trilinear within cell, based on local coordinates s• Alternative method: inverse distance weighting → no stencil walk needed
Visualization, Summer Term 03 VIS, University of Stuttgart62
7.6. Particle Tracing on Grids
• Important properties of C-space integration:+ Simple incremental cell search+ Simple interpolation- Complicated transformation of velocities / vectors
• Important properties of P-space integration:+ No transformation of velocities / vectors- Complicated point location (stencil walk) for bi / trilinear interpolation
Visualization, Summer Term 2002 23.07.2003
32
Visualization, Summer Term 03 VIS, University of Stuttgart63
7.6. Particle Tracing on Grids
• Remarks on P–space and C–space algorithms• C–space algorithm with one Jacobian per cell is fastest• C–space algorithms with one Jacobian per cell or per node might give
incorrect results• Accuracy of C–space algorithm depends strongly on the deformation of
the grid• The best C–space algorithm can be as good as P–space algorithms• In general, however, P-space algorithms are more accurate and even
faster than C-space algorithms• Only if stencil walk implementation is not considered
• Choice of method depends on:• Required accuracy• Data set• Interpolation method
Visualization, Summer Term 03 VIS, University of Stuttgart64
7.7. Line Integral Convolution
• Line Integral Convolution (LIC)• Visualize dense flow fields by imaging its integral curves• Cover domain with a random texture (so called ‚input texture‘, usually
stationary white noise)• Blur (convolve) the input texture along the path lines using a specified filter
kernel• Look of 2D LIC images
• Intensity distribution along path lines shows high correlation• No correlation between neighboring path lines
Visualization, Summer Term 2002 23.07.2003
33
Visualization, Summer Term 03 VIS, University of Stuttgart65
7.7. Line Integral Convolution
• Idea of Line Integral Convolution (LIC)• Global visualization technique• Start with random texture• Smear out along stream lines
Visualization, Summer Term 03 VIS, University of Stuttgart66
7.7. Line Integral Convolution
• Algorithm for 2D LIC• Let t → Φ0(t) be the path line containing the point (x0,y0)• T(x,y) is the randomly generated input texture• Compute the pixel intensity as:
• Kernel:• Finite support [-L,L] • Normalized • Often simple box filter• Often symmetric (isotropic)
dttTtkyxIL
L))(()(),( 000 φ⋅= ∫−
L-L
1kernelk(t)
( ) 1dttkL
L-=∫
convolution withkernel
Visualization, Summer Term 2002 23.07.2003
34
Visualization, Summer Term 03 VIS, University of Stuttgart67
7.7. Line Integral Convolution
• Algorithm for 2D LIC• Convolve a random
texture along the stream lines
Visualization, Summer Term 03 VIS, University of Stuttgart68
7.7. Line Integral Convolution
L-L
1kernelk(t)
( ) 1dttkL
L-=∫
Convolution
Input noise Vector field
Final image
Visualization, Summer Term 2002 23.07.2003
35
Visualization, Summer Term 03 VIS, University of Stuttgart69
7.7. Line Integral Convolution
• Fast LIC • Problems with LIC
• New stream line is computed at each pixel• Convolution (integral) is computed at each pixel• Slow
• Idea:• Compute very long stream lines• Reuse these stream lines for many different pixels• Incremental computation of the convolution integral
Visualization, Summer Term 03 VIS, University of Stuttgart70
7.7. Line Integral Convolution
• Fast LIC: incremental integration• Discretization of convolution integral• Summation
x0
xn
x-m
T0
Tn
T-m
xL
x-L
∑=
+=L
-Lii12L
10 TI
Assumption: box filter
( ) 12L1tk +=
TL
T-L
Visualization, Summer Term 2002 23.07.2003
36
Visualization, Summer Term 03 VIS, University of Stuttgart71
7.7. Line Integral Convolution
• Fast LIC: incremental integration• Next position I1
x0
xn
x-m
T0
Tn
T-m
xL
x-L
∑=
+=L
-Lii12L
10 TI( ) 12L
1tk +=
TL
T-L( ) )12/( +−+= ++ LTTII 1L-1L01
Assumption: box filter
Visualization, Summer Term 03 VIS, University of Stuttgart72
7.7. Line Integral Convolution
• Fast LIC: incremental integration for constant kernel• Stream line x-m,..., x0,..., xn with m,n ≥ L• Given texture values T-m,...,T0,...,Tn
• What are results of convolution: I-m+L,..., I0,..., In-L?
• For box filter (constant kernel):
• Incremental integration:
∑=
+=L
-Lii12L
10 TI
( ) ( )jL-1jL12L1
L
-Liji1ji12L
1j1j TTTTII ++++
=+++++ −=−=− ∑
Visualization, Summer Term 2002 23.07.2003
37
Visualization, Summer Term 03 VIS, University of Stuttgart73
7.7. Line Integral Convolution
• Fast LIC: incremental integration for polynomial kernels• Assumption: polynomial kernel (monom representation)
• Value
with
( ) ∑=
⋅=d
0p
pp iik α
∑ = + ⋅=L
-Lip
ijpj iTI
∑=
⋅=d
0p
pjpj II α
Visualization, Summer Term 03 VIS, University of Stuttgart74
7.7. Line Integral Convolution
• Fast LIC: incremental integration for polynomial kernels
• Incremental update for
( )∑ = ++++ ⋅−=−L
-Lip
iji1jpj
p1j iTTII
( )( ) ( )44444 844444 76
p1j
pLj
p1Lj
L
-Lipp
ij 1L-TLTi1iT
+Λ
−++= + −⋅−⋅+−−⋅= ∑( )( ) p
1j1-p
0qq-pp
jI1 +=Λ+−= ∑
pjI
Visualization, Summer Term 2002 23.07.2003
38
Visualization, Summer Term 03 VIS, University of Stuttgart75
7.7. Line Integral Convolution
• Fast LIC: Algorithm• Data structure for output: Luminance/Alpha image
• Luminance = gray-scale output • Alpha = number of streamline passing through that pixel
For each pixel p in output imageIf (Alpha(p) < #min) Then
Initialize streamline computation with x0 = center of pCompute convolution I(x0)Add result to pixel pFor m = 1 to Limit M
Incremental convolution for I(xm) and I(x-m)Add results to pixels containing xm and x-m
End forEnd if
End forNormalize all pixels according to Alpha
Visualization, Summer Term 03 VIS, University of Stuttgart76
7.7. Line Integral Convolution
• Oriented LIC (OLIC):• Visualizes orientation (in addition to direction)• Sparse texture• Anisotropic convolution kernel• Acceleration: integrate individual drops and compose them to final image
l-l
1 anisotropicconvolution kernel
Visualization, Summer Term 2002 23.07.2003
39
Visualization, Summer Term 03 VIS, University of Stuttgart77
7.7. Line Integral Convolution
• Oriented LIC (OLIC)
Visualization, Summer Term 03 VIS, University of Stuttgart78
7.7. Line Integral Convolution
• Summary:• Dense representation of flow fields• Convolution along stream lines → correlation along stream lines• For 2D and 3D flows• Stationary flows• Extensions:
• Unsteady flows• Animation• Texture advection
Visualization, Summer Term 2002 23.07.2003
40
Visualization, Summer Term 03 VIS, University of Stuttgart79
7.8. Vector Field Topology
• Idea: Do not draw “all” streamlines, but only the “important” streamlines
• Show only topological skeletons• Important points in the vector field: critical points• Critical points:
• Points where the vector field vanishes: v = 0• Points where the vector magnitude goes to zero and the vector direction is
undefined• Sources, sinks, …
• The critical points are connected to divide the flow into regions with similar properties
Visualization, Summer Term 03 VIS, University of Stuttgart80
7.8. Vector Field Topology
• Taylor expansion for the velocity field around a critical point rc:
• Divide Jacobian into symmetric and anti-symmetric parts
J = Js + Ja = ((J + JT) + (J - JT))/2
Js = (J + JT)/2Ja = (J - JT)/2
)()()()()( 2
c
ccc OrrJ
rrrrvrvrv−⋅≈
−+−⋅∇+=
Visualization, Summer Term 2002 23.07.2003
41
Visualization, Summer Term 03 VIS, University of Stuttgart81
7.8. Vector Field Topology
• The symmetric part can be solved to give real eigenvalues R and real eigenvectors
• Eigenvectors rs are an orthonormal set of vectors• Describes change of size along eigenvectors• Describes flow into or out of region around critical point
321 ,, RRRR =sss R rrJ =
Visualization, Summer Term 03 VIS, University of Stuttgart82
7.8. Vector Field Topology
• Anti-symmetric part
• Describes rotation of difference vector d = (r - rc)• The anti-symmetric part can be solved to give imaginary eigenvalues I
( )
( ) dd
dJJdJ
××∇=⋅
−−
−
−
−−
=⋅−=⋅
∂∂
∂∂
∂∂
∂∂
∂∂
∂∂
∂∂
∂∂
∂∂
∂∂
∂∂
∂∂ vvv
vv
vv
vv
vv
vv21
yz
xz
zy
xy
zx
yx21
T21
00
0zy
zx
yz
yx
xz
xy
a
321 ,, IIII =aaa IrrJ =
Visualization, Summer Term 2002 23.07.2003
42
Visualization, Summer Term 03 VIS, University of Stuttgart83
7.8. Vector Field Topology
• 2D structure: eigenvalues are (R1, R2) and (I1,I2)
Repelling nodeR1, R2 > 0I1,I2 = 0
Repelling focusR1, R2 > 0I1,I2 ≠ 0
Saddle pointR1 * R2 < 0I1,I2 = 0
Visualization, Summer Term 03 VIS, University of Stuttgart84
7.8. Vector Field Topology
• 2D structure: eigenvalues are (R1, R2) and (I1,I2)
Attracting nodeR1, R2 < 0I1,I2 = 0
Attracting focusR1, R2 < 0I1,I2 ≠ 0
CenterR1, R2 = 0I1,I2 ≠ 0
Visualization, Summer Term 2002 23.07.2003
43
Visualization, Summer Term 03 VIS, University of Stuttgart85
7.8. Vector Field Topology
• Also in 3D• Some examples
Attracting nodeR1, R2 , R3 < 0I1,I 2,I3 = 0
CenterR1, R2 = 0, R3 > 0 I1,I2 ≠ 0, ,I3 = 0
Visualization, Summer Term 03 VIS, University of Stuttgart86
7.8. Vector Field Topology
• Mapping to graphical primitives: streamlines• Start streamlines close to critical points• Initial direction along the eigenvectors
• End particle tracing at• Other “real” critical points• Interior boundaries: attachment or detachment points• Boundaries of the computational domain
Visualization, Summer Term 2002 23.07.2003
44
Visualization, Summer Term 03 VIS, University of Stuttgart87
7.8. Vector Field Topology
• How to find critical points• Cell search (for cells which contain critical points):
• Mark vertices by (+,+), (–, –), (+, –) or (–,+), depending on the signs of vx andvy
• Determine cells that have vertices where the sign changes in both components –> these are the cells that contain critical points
• How to find critical points within a (quad) cell ?• Find the critical points by interpolation• Determine the intersection of the isolines (c=0) of the two components, • Two bilinear equations to be solved• Critical points are the solutions within
the cell boundaries (+,+) (+,+) (+,+)
(–,–) (+,–) (+,–)
vx=0vy=0
Visualization, Summer Term 03 VIS, University of Stuttgart88
7.8. Vector Field Topology
• How to find critical points (cont.)• How to find critical points within simplex?
• Based on barycentric interpolation• Solve analytically
• Alternative method: • Iterative approach based on 2D / 3D nested intervals• Recursive subdivision into 4 / 8 subregions if critical point is contained in cell
Visualization, Summer Term 2002 23.07.2003
45
Visualization, Summer Term 03 VIS, University of Stuttgart89
7.8. Vector Field Topology
• Example of a topological graph of 2D flow field
Visualization, Summer Term 03 VIS, University of Stuttgart90
7.8. Vector Field Topology
• Further examples of topology-guided streamline positioning
Visualization, Summer Term 2002 23.07.2003
46
Visualization, Summer Term 03 VIS, University of Stuttgart91
7.8. Vector Field Topology
• Summary:• Draw only relevant streamlines (topological skeleton)• Partition domain in regions with similar flow features• Based on critical points• Good for 2D stationary flows• Instationary flows?• 3D?
Visualization, Summer Term 03 VIS, University of Stuttgart92
7.9. 3D Vector Fields
• Most algorithms can be applied to 2D and 3D vector fields• Main problem in 3D: effective mapping to graphical primitives• Main aspects:
• Occlusion• Amount of (visual) data• Depth perception
Visualization, Summer Term 2002 23.07.2003
47
Visualization, Summer Term 03 VIS, University of Stuttgart93
7.9. 3D Vector Fields
• Approaches to occlusion issue:• Sparse representations• Animation• Color differences to distinguish separate objects• Continuity
• Reduction of visual data:• Sparse representations• Clipping• Importance of semi-transparency
Visualization, Summer Term 03 VIS, University of Stuttgart94
7.9. 3D Vector Fields
• Missing continuity
Visualization, Summer Term 2002 23.07.2003
48
Visualization, Summer Term 03 VIS, University of Stuttgart95
7.9. 3D Vector Fields
• Color differences to identify connected structures
Visualization, Summer Term 03 VIS, University of Stuttgart96
7.9. 3D Vector Fields
• Animation
Visualization, Summer Term 2002 23.07.2003
49
Visualization, Summer Term 03 VIS, University of Stuttgart97
7.9. 3D Vector Fields
• Reduction of visual data• 3D LIC
Visualization, Summer Term 03 VIS, University of Stuttgart98
7.9. 3D Vector Fields
• Improving spatial perception:• Depth cues
• Perspective• Occlusion• Motion parallax• Stereo disparity• Color (atmospheric, fogging)
• Halos• Orientation of structures by shading (highlights)
Visualization, Summer Term 2002 23.07.2003
50
Visualization, Summer Term 03 VIS, University of Stuttgart99
7.9. 3D Vector Fields
• Illumination
Visualization, Summer Term 03 VIS, University of Stuttgart100
7.9. 3D Vector Fields
• Illuminated streamlines [Zöckler et al. 1996]• Model: streamline is made of thin cylinders• Problem
• No distinct normal vector on surface• Normal vector in plane perpendicular to tangent: normal space • Cone of reflection vectors
Visualization, Summer Term 2002 23.07.2003
51
Visualization, Summer Term 03 VIS, University of Stuttgart101
7.9. 3D Vector Fields
• Illuminated streamlines (cont.)• Light vector is split in tangential and normal parts
• Idea: Represent f() by 2D texture
( ) ( )
( ))(),()(1)(1))((
))(())(()()(
22
TVTLTVTLTVTL
NVNLTVTLNNLTTLVLLVRV
⋅⋅=
⋅−⋅−−⋅⋅=
⋅⋅−⋅⋅=⋅−⋅⋅=−⋅=⋅
f
NT
Visualization, Summer Term 03 VIS, University of Stuttgart102
7.9. 3D Vector Fields
• Illuminated streamlines (cont.)• Phong model
• Compute L•T and V•T per vertex (e.g. texture matrix or vertex program)
• Both L•N and V•R can be expressed in terms of L•T and V•T
• Represent Phong model by 2D texture with texture coordinates L•Tand V•T
( )nkkk
IIII
RVNL ⋅+⋅+=
++=
sda
speculardiffuseambient
Visualization, Summer Term 2002 23.07.2003
52
Visualization, Summer Term 03 VIS, University of Stuttgart103
7.9. 3D Vector Fields
• Halos
Without halos With halos
Visualization, Summer Term 03 VIS, University of Stuttgart104
7.9. 3D Vector Fields
• Flow Visualizationis a combinationof all vector/scalarvis techniques