We use a prismatic decomposition P of space-time, and compute the Jacobi curve for the Prism interpolant using the algorithm described in Chapter 6. Recall that this algorithm sweeps each edge e of P by moving the slice Pt forward in time. It
maintains the link of the vertex u = e∩Pt to detect the time interval for which u is
critical. A vertexv enters or leaves the link of vertexuat distinct times at which edgee
interchanges with a neighboring edge that contains vertexv. I implement the sweep by processing events in increasing order of interchange times. I describe a data-structure to represent an interchange time, and provide a sub-routine to compare two interchange times.
The Time data-structure. The time of interchange is given by Equation 6.2. We restate it here with Figure 7.3 for convenience. In order to simulate simplicity [EM90] we perturb the function value at each vertex with indexi, as ˆfi =fi+²2
i The interchange time is given by tx =t+ fˆi−fˆj ( ˆfi−fˆj)−( ˆfl−fˆk) j i k l s f time t t+1
Figure 7.3: The projection of two line segments onto the function-time plane, intersect at an interchange.
We represent the interchange time using 7 real numbers: the base time t, two function differencesA=fi−fj and B =fl−fk, and the four indicesi, j, k, andl. We
can compare two interchange times,txandtx0 by determining the sign of the expression for the discriminant ∆ = tx −tx0 used in the proof of the Interchange lemma. The comparison is straightforward when t6=t0 or A0B −AB0 6= 0. It becomes complicated otherwise, because we have to evaluate a symbolic expression in ² [EM90]. In this case, we can compare interchange times by sorting their indices and comparing them lexicographically according to the expression for the discriminant.
There is a pictorial interpretation of the perturbation that yields a simpler imple- mentation. We need the properties I1 and I2, restated below.
I1: The indicesi, j, k, l are distinct.
I2: Each of{i, j} is smaller than each of {k, l}.
Property I2 implies that the perturbation applied to vertices at timet is always larger than that applied to the vertices at timet+1. By our particular choice of perturbation, the vertex with the smallest index among a set of vertices gets perturbed the most; the other vertices are considered unperturbed. Therefore, for two interchange points with t=t0 and A0B−AB0 = 0 we use the vertex with the smallest index at time t to determine the sign of ∆.
I illustrate possible cases in Figure 7.4, where the edge connected to the vertex with smallest index is dotted.
89 k l=l’ j’ j k’ i=i’ k=k’ l’ i l i’ j=j’ l’ i’ j k l i k’ j’
Figure 7.4: Comparing interchange times. The edge connected to a vertex with maximum perturbation is shown dotted. Left, all edges are distinct. If the smallest index is one of i or j0 (both are perturbed in the picture), then tx > tx0, else tx < tx0. Middle and right, the interchanging pair of edges share a common edge. If the smallest index belongs to the shared vertex, then the order is determined by comparing ˆfk and ˆfk0 for the middle case,
and by comparing ˆfi and ˆfi0 for the right case. The casesi0 =j, ori=j0 are handled similar
to the distinct edge case.
If all edges in the two interchanges are distinct we have the case at left. The relative time order is determined by computing the smallest index among i, i0, j and j0. If this index is one of i or j0 then t
x >tx0, else tx <tx0. I show edges connected to i or j0 as
dotted to illustrate both cases in the same figure.
If the interchanging pairs of edges share a common edge we have the middle case and the last case. If the minimum index does not belong to the common edge I proceed as in the first case. Otherwise, I compare ˆfkand ˆfk0 for the middle case, and ˆfi and ˆfi0 for
the right case to determine the time order. The cases in which i0 =j or i= j0 do not need extra comparisons and are treated like the distinct edge case.
We are now ready to state the time comparison function.
boolean cmpTime(Time tx,Time tx0)
D=A0B−AB0;
if (t=t0 and D= 0)
im =min(i, i0, j, j0);
if (i=i0 andim =i) return fˆk0 <fˆk;
elseif (j =j0 and im =j)return fˆi <fˆi0;
elseif (im =i or im =j0) return false;
else return true;
elseif (t6=t0)return t < t0;
Next, we compute acritical segmentof the Jacobi set. segment connects two points in different times and is a section of an edge inP that contains a critical point for this duration.
Recall that a critical segment is an interval of an edge e in P that has a critical point in the slicePt for every timet in the interval. Note that only edges that connect
points in different times may have critical segments.
Computing critical segments of the Jacobi set. I describe an algorithm to compute the critical segment (if any) on an edge e of P. A critical segment of and edge e is specified by the interval of time for which the vertex u = e∩Pt is critical.
The input is an edge ofP that connect points in different times, and the output is the interval of time (if any) for which that edge is in the Jacobi set. This algorithm computes interchanges between edge e and its neighbors, and processes them in increasing order of time. At each event, it decides if vertex u is critical by examining its lower link.
Saddle Monkey saddle
Minimum Maximum Regular 011001 010101 111000 111111 000000 β0= 0, β1= 0 β0= 1, β1= 1 β0= 2, β1= 0 β0= 3, β1= 0 β0= 1, β1= 0
Figure 7.5: To determine the critical segment of an edge e of P, I look at the link of its vertex in slice Pt, for varying t. This figure shows the link of the center vertex in a slice of
the prismatic decomposition. Lower link vertices and edges are shaded. The link is written, below each case, as a binary string going clockwise from the left vertex with a 0 for a vertex in the lower link, and a 1 for a vertex in the upper link. The Betti numbers β0 (number of components) andβ1 (number of cycles) of the lower link distinguish the different cases; they are shown below each case.
Figure 7.5 shows the link of a vertex when it is a regular point, a maximum, a minimum, a saddle, or a monkey saddle (degenerate). The Betti numbers β0 (number
of components) and β1 (number of cycles) of the lower link distinguish the different
cases; they are shown below each case in Figure 7.5.
I represent the underlying mesh in a Meshdata-structure as a list of arrays of real values; each array stores the function for a single time-step. TheMeshdata-structure provides access to individual vertex function values and also provides the following
91
functions.
GetLnk(E, t) : return the link of vertex lying on edge E at time-slice t as a binary string.
NumX(E, t) : return the number of interchanges with edge E after timet.
NextXedge(E, t) : return the edge that has an interchange with edge E after timet.
NextXtime(E, t) : return the time of the next interchange with edgeE after timet. If P is defined on a regular grid, then each vertex in Pt has a fixed sized link. In this
case, I represent the link by a fixed size binary bit string with a 0 for a vertex in the lower link and 1 for a vertex in the upper link.
I can now present sub-routine criticalSeg which detects when vertex u=e∩Pt
is critical and returns this time interval.
(Time, Time) criticalSeg(EdgeE)
L=GetLnk(E,0); sT =pT = 0; pI =isCritical(L);
while NumX(E, pT)6= 0
F =NextXing(E, pT); pT =NextXtime(E, pT);
FlipBit(L, F);I =isCritical(L);
if (pI =REGULAR and I =CRITICAL)
pI=I; sT =pT;
elseif (pI =CRITICAL and I =REGULAR)
return(sT, pT);
I compute the Jacobi set by invokingcriticalSegfor every edge of P which connects points at different times, and represent it by a collection of critical segments, connected by connector segments, as explained in Section 6.4.