1 Introduction

A wide range of problems in science and engineering involves some kind of transport, modeled prevalently by means of vector fields. Analysis of the resulting fields is, however, nontrivial. While for 2D vector fields, dense visualization using arrows, integral curves, or textures can provide insight, they fail at guiding the attention to relevant structures. Further, they are unfeasible in 3D, due to occlusion and visual clutter. A powerful alternative is to employ feature extraction techniques to extract prominent structures, such as vortex core lines and attachment lines. A vortex core line represents the (typically bent) axis of a vortex, i.e., a curve around which the flow is swirling. Such a core line can be visualized directly to convey the location and overall shape of a vortex. However, it cannot provide insight into the dynamics of a vortex, since that would require to include the flow in its volumetric neighborhood. Therefore, a widely employed approach is to utilize feature lines for seeding integral curves in their vicinity to reveal relevant flow dynamics (see, e.g., Fig. 10b). Although such feature-based visualization provides a good view on the overall dynamics in such a region, it does not do a good job in revealing the dynamics in relation to the feature itself. Imagine, for example, a bent vortex with low “twist” around its core line but with a high tangential velocity along it, as is the case in certain turbines (Roth and Peikert 1996), where streamlines exhibit less than a single revolution around a vortex core. The more bent such a vortex is, the more difficult it becomes to observe the twist, i.e., to mentally separate the rotation around the core line from the overall bent motion (see, e.g., Fig. 12a).

The above observations motivate us to unbend feature lines for an “undistorted view” on the dynamics of interest, i.e., to deform space such that a selected feature becomes straight. To provide guidance and quantitative context, this deformation should be realized as a smooth animation from the original (reference) state to the deformed state. To enable exploration, the animation should be interactive, i.e., one should be able to navigate the deformation process. For continuity in space, our objective is to deform space, such that the vicinity of the feature deforms together with the feature. At the same time, we want to maintain spatial context, by avoiding self-intersection of the deformed space, and by avoiding excessive distortion, which could result if the original feature passed a region multiple times. This necessitates to “tear apart” the space along manifolds during deformation, which we include in our visualization for context (e.g., orange dots in Fig. 10c). All of this leads to the statement of requirements for the deformation process, which guarantee that certain geometric properties are preserved (cf. Sects. 3 and 4), some specific to certain feature types.

While this preservation of properties generally allows for interpretation in deformed space, not all properties can be preserved at the same time. Particularly when dealing with solutions stemming from Navier–Stokes or other differential equations, physical properties are affected and lost. However, important geometric properties are preserved and thus, in a Lagrangian scope, the feature and its relative neighborhood remain intact. Hence, our method still allows for qualitative insight on the deformed feature line and its surrounding, while quantitative information is limited to the preserved properties. Because of this, we see our approach as a complementary strategy and not as a replacement, where visualizations in the original and the deformed space could be analyzed side-by-side. This ensures that physical properties can be observed from the original data, while mostly qualitative information can be retrieved from the deformed vector field. Please note that most importantly, as basis for flow analysis, the feature itself is still provided together with its neighborhood. As a conclusion, explaining flow relative to certain features can be made more intuitive when employing our method, e.g., for observing the windings of streamlines around a vortex core line (cf. Sect. 4.2). In this regard, our method could, for example, be used for teaching features in flow visualization, or to qualitatively evaluate feature extraction algorithms.

Our contributions include:

  • feature-based deformation for flow visualization,

  • a spline-based realization of this concept with guarantees, and

  • interactive exploration of the resulting deformation space.

2 Related work

In flow visualization, many approaches are based on streamlines and pathlines. Particularly in three-dimensional space, densely seeded, large, and curved integral lines often lead to visual clutter and occlusion. Techniques to improve their usefulness mostly rely on seeding strategies (Li et al. 2008; Spencer et al. 2009; Yu et al. 2012), often combined with similarity measures for filtering (McLoughlin et al. 2013), or opacity optimization (Günther et al. 2014, 2017). The achieved goal is to show only few, representative lines, which still depict the overall flow pattern, or reduce the opacity of less relevant lines. Further, view-dependent methods (Marchesin et al. 2010) can be employed to allow for interactive exploration. By combining ideas from human–computer interaction with flow visualization, the user can be kept in the loop. Here, the user can differentiate into regions of interest and context (Tao et al. 2014; Tong et al. 2016). Many of these approaches use the idea of expanding space to move surrounding lines away from the point of interest but at the same time keeping them visible for context (Correa et al. 2007; Li et al. 2017). While these approaches deform space directly, our method does so in a feature-driven manner.

For the deformation of space, the focus in research is predominantly on mesh deformation and animation. Therefore, methods are often cage-based (Lipman et al. 2008; Ben-Chen et al. 2009), require a surface mesh (Yoshizawa et al. 2003), or are shape-aware (Jacobson et al. 2011). Thus, they are not applicable to feature line-based deformation. Due to their generality, point-deforming methods (Schaefer et al. 2006) better fit our requirements, especially when limited to translational and rotational deformation (Huang et al. 2014). Our deformation approach thus follows a skinning concept (Jacobson et al. 2012), i.e., spline skinning (Forstmann et al. 2007).

Similar to our approach are the papers by Daae Lampe et al. (2009), and Angelelli and Hauser (2011) on curve-centric volume reformation. In their works, they share our goal of straightening a line, and by this deforming its surrounding space. However, the work of Daae Lampe et al. is designed for scalar fields, and is limited to cases where a user-defined up vector is not orthogonal to the center line. Angelelli and Hauser extend this approach, but restrict themselves to straightening tubular domains. There, they rely on explicitly defined planes, i.e., a user-defined sampling along a center line, assuming linearity for the space between two planes. In our method, we overcome these limitations by modeling the feature line as an at least \(C^1\) continuous curve. Because of this, our approach can be seen as an improvement of their work, as well as a generalization applicable to a wider range of feature lines and arbitrarily formed grids. Further, much work has been done on space deformation for comparative visualization in medical applications, e.g., by flattening structures captured by medical imaging, such as colons using a finite element approach (Haker et al. 2000). Other applications include flattening to untangle vascular structures (Kanitsar et al. 2003), or use the third dimension for temporal visualization of flattened mitral valves (Eulzer et al. 2020). An exhaustive overview of such applications is provided by Kreiser et al. (2018).

In other approaches to deform fluid flow, the vector field is manipulated directly (Sato et al. 2014, 2015), instead of deforming the geometry or the underlying grid. However, in contrast to our work, their goal is to alter the fluid simulation, in order to create new artistic fluid animations, while preserving physical behavior. While some works provide approaches for changing frames of reference, e.g., in a Galilean invariant or objective manner (Hadwiger et al. 2019; Rautek et al. 2021), our work focuses on the preservation of (specific) geometric properties. Still, our approach is comparable to their works with respect to interpretability of deformed spaces. Although our main contribution is on space deformation, the deformation itself is governed by the straightening of feature lines, such as vortex core lines (Theisel et al. 2005; Günther and Theisel 2020), bifurcation lines (Roth 2000; Machado et al. 2013), or attachment and separation lines (Kenwright et al. 1999).

3 Method

We seek a mapping \(\varvec{\phi }(\textbf{x}, \tau )\) (our deformation) to transform a point

$$\begin{aligned} \textbf{x} = \varvec{\phi }(\textbf{x}, \tau = 0) \in \varOmega \end{aligned}$$
(1)

of the original domain \(\varOmega \subseteq {\mathbb {R}}^n\) to its deformed position

$$\begin{aligned} \tilde{\textbf{x}} = \varvec{\phi }(\textbf{x}, \tau = 1) \in \widetilde{\varOmega }\end{aligned}$$
(2)

in the deformed domain \(\widetilde{\varOmega }\subseteq {\mathbb {R}}^n\), as a function of “deformation animation time” \(\tau \in [0,1]\). That is, we obtain deformation animation by continuously varying \(\tau\) from 0 to 1 and applying \(\varvec{\phi }(\textbf{x},\tau )\) to all points \(\textbf{x}\) of our objects of interest. For simplified notation, we write, e.g., \(\varvec{\phi }\) for \(\varvec{\phi }(\cdot , \cdot )\), if unambiguous.

Since most flow visualization techniques operate on vector fields discretized into nodes and cells, we could apply \(\varvec{\phi }\) to all nodes of such a grid to obtain its deformed representation, and apply the visualization techniques to the deformed grid. This would, however, introduce inaccuracies, because most visualization algorithms assume straight grid edges, whereas application of \(\varvec{\phi }\) would lead to (higher-order) deformed cells. This would lead to exponential error growth when integrating, for example, streamlines. Therefore, we favor application of visualization techniques to the original grid, and instead deform their geometrical result using \(\varvec{\phi }\). Techniques that do not generate geometrical results, e.g., texture-based techniques such as line integral convolution (LIC) (Cabral and Leedom 1993), need to be applied on the deformed grid. However, the typical locality of such approaches, e.g., rather short streamlines for LIC or glyph-based visualization, avoids or limits error growth. Both approaches—applying the deformation on the geometry, i.e., on streamlines, or applying the computation of streamlines on the deformed vector field—should lead to results in a Lagrangian scope. This means that the relative neighborhood should be preserved.

Summarizing our requirements, \(\varvec{\phi }\) should:

  1. R1

    deform a feature line given at \(\tau =0\) to a straight line at \(\tau =1\),

  2. R2

    be continuous in \(\tau\) to enable animations,

  3. R3

    be continuous in space, except for permissible “tears”,

  4. R4

    avoid self-intersection of \(\widetilde{\varOmega }\), to prevent penetration of objects,

  5. R5

    avoid deformation that obscures feature dynamics, and

  6. R6

    be efficient to compute, to enable interactive exploration.

Requirement R1 is a hard constraint to define \(\varvec{\phi }\). Thus, we first need to define a transformation \(\varvec{\vartheta }\) that deforms the feature line

$$\begin{aligned} {\mathcal {L}}= ({\textbf{y}_{i}^{}})_{i=1,\dots ,m} \,, \end{aligned}$$
(3)

which in our approach is given as a polyline consisting of m vertices \({\textbf{y}_{i}^{}}\), to a straight line. To satisfy Requirement R2, this transformation needs to be parametrized with animation time \(\tau\). This motivates an iterative formulation of \(\varvec{\vartheta }\), which we derive in Sect. 3.1. Based on \(\varvec{\vartheta }\), we then obtain the space deformation \(\varvec{\phi }\) in Sect. 3.2.

3.1 Line deformation \(\varvec{\vartheta }\)

A straightforward approach to straighten a line would be to connect its endpoints to create a straight line, and additionally preserving its arc-length parametrization. However, in configurations where the endpoints of a bent line are close to each other (e.g., Fig. 1j), the resulting line would be very short (Fig. 1k). Furthermore, this would not enable animation of the deformation, as demanded by Requirement R2. Thus, a natural strategy is to gradually smooth the line until it becomes straight, i.e., to apply Laplacian smoothing (Taubin 1995), whose iterative approach lends itself well for this purpose. An issue, however, is that the geometry may shrink during the smoothing process (Fig. 2). Fixing the positions of the line’s endpoints would help in some cases (Fig. 1h), but would fail in others, where the endpoints are already close initially (Fig. 1k). Nevertheless, since curvature is generally reduced by the smoothing, the endpoints tend to move apart during the first phase (Fig. 2a, b) of Laplacian smoothing in such configurations, and they start to approach each other only later (Fig. 2b, c). This motivates us to define our line straightening deformation \(\varvec{\vartheta }\) as follows: We employ Laplacian smoothing to the entire curve as long as its endpoints move apart. Once they stopped moving apart, we fix the position of the endpoints, i.e., employ Laplacian smoothing only to the inner vertices. For robustness, the endpoints are fixed once their distance drops below 90% of the maximum distance from earlier iterations.

Fig. 1
figure 1

Left column: original, undeformed grid (with marked corners) and feature line (green). Center column: deformation with fixed endpoints. Right column: deformation allowing endpoints to move apart. Grid lines serve as context, and orange dots indicate tearing of the grid

Fig. 2
figure 2

Open circle in different stages of Laplacian smoothing. a Original circle cut open on its right side, b, c smoothed “circle” after an increasing number of iterations. Observe the initial separation of the endpoints, the reduction of curvature, and the overall shrinking of the smoothed line

That is, during the first phase, we transform all feature line vertices \({\textbf{y}_{i}^{k}}\) (with \(i \in 1,\dots ,m\)) from smoothing iteration k to iteration \(k+1\) according to

$$\begin{aligned} {\textbf{y}_{i}^{k+1}} = {\textbf{y}_{i}^{k}} + \lambda \frac{\sum _{j \in \mathcal {N}({\textbf{y}_{i}^{k}})} ~ w_{ij} \left( {\textbf{y}_{j}^{k}}-{\textbf{y}_{i}^{k}} \right) }{\sum _{j \in \mathcal {N}({\textbf{y}_{i}^{k}})} ~ w_{ij}} \,, \end{aligned}$$
(4)

with \(\lambda\) being a smoothing parameter, \(\mathcal {N}({\textbf{y}_{i}^{k}})\) the polyline vertex neighbors of vertex \({\textbf{y}_{i}^{k}}\), and respective weights \(w_{ij} = \left|\left|{\textbf{y}_{i}^{k}} - {\textbf{y}_{j}^{k}}\right|\right|^{-1}\). Please note that we employ implicit Laplacian smoothing (Desbrun et al. 1999) to avoid excessive number of iterations, but keep the explicit notation for simplicity. During the second phase, we employ Eq. 4 to all inner points \({\textbf{y}_{i}^{}}\) with \(1< i < m\), but do not update the endpoints, i.e.,

$$\begin{aligned} {\textbf{y}_{1}^{k+1}}={\textbf{y}_{1}^{k}} \quad \text {and} \quad {\textbf{y}_{m}^{k+1}}={\textbf{y}_{m}^{k}} \,. \end{aligned}$$
(5)

In total, for an original feature line vertex \({\textbf{y}_{i}^{}}={\textbf{y}_{i}^{0}}\), our line deformation is

$$\begin{aligned} \varvec{\vartheta }({\textbf{y}_{i}^{}},\tau ) :={\textbf{y}_{i}^{\lfloor \tau / \varDelta \tau \rfloor }} \,, \end{aligned}$$
(6)

with \(\varDelta \tau = 1 / s\), and \(s\) the number of smoothing iterations. Notice that depending on the frame rate, not every smoothing iteration results in a frame of the animation. This is necessary to achieve smooth animations, for which we map the frames nonlinearly to \(\tau\). This is motivated by the observation that in Laplacian smoothing, early smoothing steps (close to \(\tau =0\)) have a larger influence than later steps (close to \(\tau =1\)), exhibiting logarithmic decay (see Fig. 3). As demonstrated with our Circular Segment example (Fig. 1), our two-phase approach maintains reasonable line lengths, leading to better \(\varvec{\phi }\).

Fig. 3
figure 3

Displacement from Laplacian smoothing plotted over the iteration, showing logarithmic decay. Please note the logarithmic scale of the y-axis

Finally, in cases where the input line exhibits “zigzag perturbations”, slight pre-smoothing should be applied for aesthetic reasons and a more smooth resulting \(\varvec{\phi }\). Such perturbations can arise, e.g., due to inaccuracy of local extraction approaches, such as the parallel vectors operator (Peikert and Roth 1999). We limit these corrections to be smaller than the size of a grid cell, and thus to a permissible range regarding the involved accuracy of line feature extraction algorithms. We employed such pre-smoothing in our vortex core lines examples (cf. Sect. 6.2).

3.2 Space deformation \(\varvec{\phi }\)

Now that we have defined the line deformation \(\varvec{\vartheta }\) for the vertices of \({\mathcal {L}}\), we need to “transfer” that deformation to the entire domain \(\varOmega\), considering Requirement R3 (continuity) and Requirement R4.

Particularly to prevent self-intersection of the domain (Requirement R4) and for visual demarcation of areas of strong local deformation, we introduce the concept of “tears”. This means that a large part of necessary strong distortion should be concentrated within thin regions resembling codimension-1 manifolds, along which space is torn apart under the action of \(\varvec{\phi }\). Those strongly distorted parts are “removed” from the visualization, leading to ruptures (tears). This tearing is implemented by imposing a maximum edge length for the grid cells. If deformation results in a too long edge, incident cells are removed and markers inserted at their nodes for respective depiction (orange regions in Fig. 1 and Fig. 4a, b). If there are several separate components of tearing, we assign each a different color to provide better context (Fig. 4c–g). Essentially, these tears separate regions that are influenced by different parts of \({\mathcal {L}}\) in analogy to Voronoi cells under a nearest neighbor relation on \(\varvec{\phi }\).

Fig. 4
figure 4

Deformation process with tearing of the grid. a Spiral dataset with tear regions marked by orange dots, and b zoom-in on the grid after deformation and tearing. Note that, although much smaller, the individual cells retain a good, convex shape. c, f 2D and 3D cosine dataset with tear regions in different colors. Each color indicates initially connected grid points, which in the process of deformation move apart. e, g Grids with torn boundaries or holes, and d without. Please see also the supplemental video

At the same time, the space deformation \(\varvec{\phi }\) should be continuous in space (Requirement R3), except at the tears. Since \(\varvec{\vartheta }\) carries over to \(\varvec{\phi }\), our second basic ingredient is therefore to model the polyline \({\mathcal {L}}\) as a continuous curve \({\bar{\mathcal{L}}}\). We achieve this by interpreting \({\mathcal {L}}\) as the control polygon of a B-spline, which provides us with the smooth feature spline \({\bar{\mathcal{L}}}\). Thus, by using the (\(\tau\)-deformed) feature line vertices \(\varvec{\vartheta }({\textbf{y}_{i}^{}},\tau )\) as de Boor points, we define the (\(\tau\)-deformed) feature B-spline

$$\begin{aligned} {\bar{\mathcal{L}}}^{\tau }(u) :=\sum _{i=1}^{m} \varvec{\vartheta }({\textbf{y}_{i}^{}},\tau ) N_{i}^{d}(u) \,, \end{aligned}$$
(7)

with degree \(d\), spline parameter \(u\), and B-spline basis functions

$$\begin{aligned} N_{i}^{r}(u) :=\frac{u-u_i}{u_{i+r}-u_{i}} N_{i}^{r-1}(u) + \frac{u_{i+1+r}-u}{u_{i+1+r}-u_{i+1}} N_{i+1}^{r-1}(u) \,, \end{aligned}$$
(8)

for \(1 \le r\le d\), and

$$\begin{aligned} N_{i}^{0}(u) :={\left\{ \begin{array}{ll} 1 &{} \text {if } u_i \le u< u_{i+1}\\ 0 &{} \text {otherwise} \end{array}\right. } \,. \end{aligned}$$
(9)

Notice that the B-spline \({\bar{\mathcal{L}}^0}\) does not strictly follow the polyline \({\mathcal {L}}\), but since \({\mathcal {L}}\) is typically sampled at least at grid resolution, and since we use rather low B-spline degree (we use \(d= 3\)), \({\bar{\mathcal{L}}^0}\) is a good approximation to \({\mathcal {L}}\) (represents a spline interpolation). In our approach, we visualize \({\bar{\mathcal{L}}}^{\tau }\) instead of \(\varvec{\vartheta }({\mathcal {L}},\tau )\) for consistency during animation, and for better shape perception.

Fig. 5
figure 5

B-spline approach. a First, point \(\textbf{x}\) is mapped onto the closest position \(\varvec{\gamma }_{\min }^0\) (red square) on the B-spline \({\bar{\mathcal{L}}^0}\), at \(\tau = 0\). b The vector (red) from this position to the corresponding position on the B-spline \({\bar{\mathcal{L}}}^{\tau }\) at \(\tau\) provides the translation. The respective tangents (orange arrows) define the rotation

To now define the deformation \(\varvec{\phi }\) for a point \(\textbf{x} \in \varOmega\), we need to relate it to \({\bar{\mathcal{L}}^0}\). As our approach follows the idea of spline skinning, the deformation of \(\textbf{x}\) only depends on the transformation at \(\varvec{\gamma }_{\min }^0\) (red in Fig. 5a), the point on \({\bar{\mathcal{L}}^0}\) closest to \(\textbf{x}\):

$$\begin{aligned} \varvec{\gamma }_{\min }^0 :={\bar{\mathcal{L}}}^{0}(u_{\min }^0) \end{aligned}$$
(10)

with

$$\begin{aligned} u_{\min }^0 :={\mathop {\mathrm{arg\,min}}\limits _{u}}\, \left\| {\bar{\mathcal{L}}}^{0}(u) - \textbf{x} \right\| \,. \end{aligned}$$
(11)

We obtain this point using binary subdivision on the B-spline, according to Forstmann et al. (2007). If there is more than one such point, it is safe to take the first one. Consequently,

$$\begin{aligned} {\varvec{\gamma }^{\tau } :={\bar{\mathcal{L}}}^{\tau }(u_{\min }^0)} \end{aligned}$$
(12)

provides the point (cf. Fig. 5b) on \({\bar{\mathcal{L}}}^{\tau }\), where \(\varvec{\gamma }_{\min }^0\) is deformed to at time \(\tau\). In other words,

$$\begin{aligned} \varvec{\phi }(\varvec{\gamma }_{\min }^0, \tau ) \equiv \varvec{\gamma }^{\tau } \,. \end{aligned}$$
(13)

The only remaining task, is to “transfer” the deformation \({\varvec{\phi }(\varvec{\gamma }_{\min }^0,\tau )}\) from \({\varvec{\gamma }_{\min }^0}\) to \(\textbf{x} \in \varOmega\). For spline skinning methods, this is typically achieved by matching the Frenet–Serret frame of \({\bar{\mathcal{L}}^0}\) at \(\varvec{\gamma }_{\min }^0\) to the corresponding frame of \({\bar{\mathcal{L}}}^{\tau }\) at \(\varvec{\gamma }^{\tau }\), and applying this transformation to \(\textbf{x}\). However, this could obscure, e.g., the dynamics of vortex core lines, as the winding number of the surrounding streamlines could be altered, thus violating Requirement R5 (see also Sect. 4.2). Therefore, we constrain the transformation to the translation \(\varvec{\gamma }^{\tau } - \varvec{\gamma }_{\min }^0\) (light red arrow in Fig. 5b), and the minimum rotation required to match the B-spline tangent \(\varvec{t}^0_{min}\) to \(\varvec{t}^\tau\) (orange arrows in Fig. 5b). Hence, the rotation axis is given by \(\varvec{t}^0_{min} \times \varvec{t}^\tau\), which, together with angle \({\measuredangle \left( \varvec{t}^0_{min}, \varvec{t}^\tau \right) }\), defines the required rotation matrix \(R_{\varvec{t}^0_{\min },\varvec{t}^{\tau }}\). Thus, we get for point \(\textbf{x}\):

$$\begin{aligned} \varvec{\phi }(\textbf{x},\tau ) &:=\left( R_{\varvec{t}^0_{\min },\varvec{t}^{\tau }} \cdot \left( \textbf{x} - \varvec{\gamma }_{\min }^0 \right) + \varvec{\gamma }_{\min }^0 \right) + \left( \varvec{\gamma }^{\tau } - \varvec{\gamma }_{\min }^0 \right) \nonumber \\ & = R_{\varvec{t}^0_{\min },\varvec{t}^{\tau }} \cdot \left( \textbf{x} - \varvec{\gamma }_{\min }^0 \right) + \varvec{\gamma }^{\tau }. \end{aligned}$$
(14)

With the resulting deformation \(\varvec{\phi }\), we can now deform any geometry, such as the geometry of the underlying grid, or the streamlines obtained from the original vector field in \(\varOmega\). This also includes the straightening of tubular domains in medical applications, as mentioned in Sect. 2. However, as motivated in the introduction, to be able to employ, e.g., texture-based flow visualization, it is necessary to also transform the vector field. This is achieved by multiplying its vectors with \(\nabla \varvec{\phi }\), using analytic derivatives of Eq. 14. To preserve divergence, we additionally divide the resulting vector field by the determinant \(\det \nabla \varvec{\phi }\).

4 Deformation properties

Fig. 6
figure 6

Swirling Helix example for comparison between our B-spline approach and inverse distance weighting. a, e Synthetic dataset of a helix swirling around another helix. b, f Result from our B-spline approach, while c, g inverse distance weighting, and d, h our B-spline approach without considering rotation, lead to unwanted distortion

Before we discuss the geometric properties of our deformation \(\varvec{\phi }\), let us briefly discuss simpler alternative approaches, which, however, do not meet the identified requirements and hence do provide a motivation for our approach. First, inverse distance weighting, would map each point \(\textbf{x} \in \varOmega\) to its deformed state \(\tilde{\textbf{x}} \in \widetilde{\varOmega }\), by applying a weighted average of the translations that move the feature line vertices \({\textbf{y}_{i}^{0}}\) to their deformed positions \({\textbf{y}_{i}^{\tau }}\). However, the global influence would cause regions close to \({\mathcal {L}}\) to be affected by strong and “contradicting” transformations (Requirement R5, cf. Fig. 6c, g), leading to strong distortions and self-intersection of \(\widetilde{\varOmega }\) (Requirement R4). Beyond that, only the vertices of \({\mathcal {L}}\) would influence the deformation of space, i.e., the segments between the vertices would have no influence. Similarly, transferring only the translation \(\varvec{\gamma }^{\tau } - \varvec{\gamma }_{\min }^0\) in the B-spline approach produces undesired deformations as well (see Fig. 6d, h).

4.1 Requirements

As per definition of our approach for straightening the feature line, Requirements R1 and R2—straight line at \(\tau =1\), and continuous transition from \(\tau =0\)—are already met. This leaves us with the discussion on the requirements for space deformation (Requirements R3, R4 and R5), and for its efficient computation (Requirement R6). The latter is achieved by moving costly calculations to a preprocessing step, and employing the GPU (cf. Sect. 5).

The continuity of the feature spline (\(d>1\) for \({\bar{\mathcal{L}}}^{\tau }\)), the continuity of its deformation \(\varvec{\vartheta }\), and the continuity of the mapping of a point in space to the closest point on the spline, cause the space deformation \(\varvec{\phi }\) to be also continuous. Therefore, Requirement R3 is met, except at the tearing manifolds, as stated in the requirement. Figure 7 shows the continuity of the closest-point mapping for two examples, and that discontinuities only occur at tearing manifolds.

Fig. 7
figure 7

B-spline parameter \(u_{\min }^0\) from closest-point mapping, with increasing values from gray to blue, for a 2D cosine and b spiral dataset. Tearing manifolds marked by colored circles coincide with discontinuity in \(u_{\min }^0\). Note that blending at discontinuities is caused by piecewise linear depiction

Fig. 8
figure 8

Parametrization of 2D space by one-dimensional subspaces (black) for a original space \(\varOmega\), and b deformed space \(\widetilde{\varOmega }\) with straightened feature line (green). Arrows represent closest-point mapping and show that all points in a subspace are mapped to the same point on the feature line. Dashed lines indicate that subspaces are infinite in the corresponding direction, whereas dots (orange and blue) indicate tearing manifolds. Regions beyond the feature line (gray) are areas where deformation results in rigid body transformation, as all points are mapped to the feature line endpoints. Numbers indicate correspondence between original and deformed space. Note that all subspaces are perpendicular to the feature line

To show that our method satisfies Requirement R4 (no self-intersection), we could parametrize our three-dimensional space \(\varOmega\) by an infinite number of two-dimensional (possibly bounded) subspaces, each of these planes (black lines in Fig. 8a) being perpendicular to the feature line \({\bar{\mathcal{L}}^0}\) (green), i.e., their normals are parallel to the feature line tangent \(\varvec{t}^0_{\min }\) at their intersection \({\varvec{\gamma }^0_{\min }}\). Thus, these subspaces can be defined as

$$\begin{aligned} {\mathcal {P}}_{\varvec{\gamma }^{0}_{\min }} :=\left\{ \textbf{x} ~\Bigg |~ \varvec{t}^{0}_{min} \cdot \left( \textbf{x} - \varvec{\gamma }^{0}_{\min } \right) = 0 \right\} . \end{aligned}$$
(15)

Every plane \({\mathcal {P}}_{\varvec{\gamma }^0_{\min }}\) then spans a two-dimensional local coordinate system, bounded by the intersection with other planes (orange and blue tearing markers in Fig. 8a). After deformation \(\varvec{\phi }\), planes in \(\widetilde{\varOmega }\) (black lines in Fig. 8b) are still perpendicular to the feature. This means that (I) a point on a plane \({{\mathcal {P}}_{\varvec{\gamma }^0_{\min }}}\) in the original space \(\varOmega\) stays on this plane \({{\mathcal {P}}_{\varvec{\gamma }^\tau _{\min }}}\) in deformed space \(\widetilde{\varOmega }\) after transformation. Further, (II) any two points on the same plane retain their relative position to each other and to the feature line, i.e., their polar coordinates in plane space do not change. Our approach can therefore be described in terms of rigid body transformations of subspaces. Because all planes are parallel in \(\widetilde{\varOmega }\) for \(\tau =1\), i.e., they do not intersect each other, self-intersection of cells, non-convex cells, or degenerate cells cannot occur, hence satisfying Requirement R4. Another property of our approach is that beyond the endpoints of a feature line, all points are transformed in a volumetric rigid body manner, as they all map to feature endpoints (gray arrows in Fig. 8).

4.2 Application to vortex core lines

In order to meet Requirement R5, that is, to avoid \(\varvec{\phi }\) to contain deformation that would obscure feature-related dynamics, i.e., dynamics related to vortex core lines, we want to keep the deformation small and constrained, and preserve properties that describe the characteristic flow behavior in a vortex neighborhood. Due to the swirling property of a vortex, a straightforward step is thus to additionally preserve the winding number of the flow. This winding number is defined for two-dimensional domains as a number that counts how often a streamline does a full revolution around a specific point in space. Similarly, we can define the winding number in 3D space, akin to Sujudi and Haimes (1995), as swirling motion projected onto planes, which are perpendicular to the vortex core line. For this, our approach already preserves the winding number, as the rotation induced by our deformation minimizes to \({R_{\varvec{t}^0_{\min },\varvec{t}^{\tau }}}\), which exhibits no rotation around the feature line tangent. This is illustrated in Fig. 9 for two simple examples that exhibit the same number of “crossings” before and after deformation. Note that for other line features, adjustments to our method could be made in order to preserve their specific properties.

Fig. 9
figure 9

Feature helix (dark green), surrounded by a second helix (light green) winding around the feature. Winding numbers around original features a, c are preserved for straightened features b, d, indicated by crossings in front (dashes) and behind (dots) the feature line

5 Implementation

Our approach is implemented as a ParaView (Ayachit 2015) plugin written in C++. The input of our plugin consists of the feature lines, the vector field grid, and any geometry from the ParaView pipeline, such as streamlines. As our technique should be interactive, we employ a caching strategy for every step of the algorithm. For this, we define every step as a sub-algorithm. Thus—following the leitmotif of VTK algorithms—a step is only repeated if its input has changed, or else returns the cached result. We especially designed sub-algorithms for the precomputation steps that only have to be executed once before interaction. This entails the mapping of points \(\textbf{x} \in \varOmega\) onto \({\bar{\mathcal{L}}}^{0}\), and identifying tears.

To achieve interactivity, we employ CUDA (Nickolls et al. 2008) for parallel computations on the GPU. Because the deformation \(\varvec{\phi }\) is embarrassingly parallelizable, it is performed on the GPU. Further, uploads to, and downloads from GPU memory are reduced to a minimum. Because (1) Laplacian smoothing is efficient to compute, (2) displacement computation on the GPU is embarrassingly parallelizable, and (3) the analytical solution of a B-spline of fixed degree can be computed efficiently, Requirement R6 is met. Still, the main bottleneck for seamless animation is the output of the computed results, due to the conversion of data to VTK objects. Therefore, rendering the data directly on the GPU without creating explicit geometry could be addressed as future work.

The complete code for the ParaView plugin is available on GitHub under the MIT license (https://github.com/UniStuttgart-VISUS/feature-deformation).

6 Results

In the following, we apply our approach to synthetic and simulated flow field examples for different types of feature lines. Our results have been obtained by deforming geometry (not the field), employing third-order B-splines, using ten binary search iterations for determining the nearest point on the spline, and removing cells if they become two times larger than the original cell diagonal.

6.1 Attracting features

For two-dimensional vector fields, occlusion and visual inspection of streamlines near feature lines is generally not an issue. However, assessing the attracting behavior of such features becomes hard if they are curved. Our method can mitigate this issue and bring insight on the qualitative aspect of attraction.

Fig. 10
figure 10

Feature-based deformation for the Attracting 2D Periodic Orbit example. a Line integral convolution with extracted periodic orbit feature line (green curve) shows overall structure. b Original (undeformed) data grid and forward streamlines (black) seeded in the vicinity of the periodic orbit show transport and attraction toward it, but make it hard to judge the quality of attraction, i.e., if attraction is stronger from the inside or outside. c Deformed grid and streamlines for straightened feature line reveal that attraction is equal on both sides of the orbit. Orange dots indicate tearing, and corner marks help interpreting overall deformation

Figure 10 shows the Attracting 2D Periodic Orbit dataset with a radially symmetric vector field that contains an attracting periodic orbit. First, the closed feature line needs to be opened by cutting a segment. This leads to the tearing manifold marked by the orange dots in Fig. 10b. Because of the strong local deformation caused by the circular shape of the feature line, tearing is unavoidable. The resulting deformed configuration in Fig. 10c exhibits a very regular pattern, with decreasing cell size from left (originally inside the periodic orbit) to right (outside the orbit). Additionally, one can observe that in Fig. 10b, the incident angles of the streamlines onto the periodic orbit appear to be different from its inside and outside. However, our method reveals in Fig. 10c that the dynamics are the same on both sides of the periodic orbit. This is in line with the definition of the synthetic vector field, which was designed to exhibit the same attraction on both sides. Please also see our user study in Appendix A, assessing the visual perception of convergence to a straightened or circular feature line.

Fig. 11
figure 11

Oscillating Attachment Line example. a LIC reveals sine-like oscillations of an attachment line (green). Flow in its vicinity visualized by streamlines (black) for the original b and deformed vector field c. Colored manifolds indicate separate tearing regions. d Logarithmic mapping to magnitude of deformation by encoding the Frobenius norm of \(\nabla \varvec{\phi }\) (beige to red)

Unlike in the previous example, looking at the streamlines in Fig. 11b for the synthetic Oscillating Attachment Line example, one assumes that their incident angles are different on either side. This time, the impression is confirmed when consulting the straightened configuration (Fig. 11c). We identify a recurring pattern on both sides, which seems to correlate with the curvature of the original attachment line. While this observation can be made already from Fig. 11b, our approach confirms it and provides an explicit view on its angular configuration. Because the grid is not deformed as strongly as in the previous example, due to the shape of the feature line, there are only small tears. To further highlight that by tearing the grid (and thus removing strongly deformed cells) we gain an indication for where deformed streamlines are reliable, we show the magnitude of deformation in Fig. 11d. For this, we map \(|| \nabla \varvec{\phi }||\) to color. It is clearly observable that, with our grid tearing approach, regions of strong local deformation are removed (cf. Fig. 11c). Thus, such color coding is not necessary, as the tearing of the grid already provides us with this information.

6.2 Vortex core lines

As discussed in Sect. 4.2, deforming vortex core lines is a target application of our approach, in the sense that essential geometric properties, as well as the winding number of streamlines around the core lines are preserved. Thus, it enables dedicated visual analysis of datasets exhibiting curved vortex cores.

Fig. 12
figure 12

Synthetic Spiral Vortex example. Vortex core line (dark green) and streamlines nearby (light green) for the original a, and for the deformed space b. The latter was partly torn apart, vortex core line and streamlines remaining enclosed by the grid. Please also notice the windings of the red streamline around the feature

In the introduction, we argued that the winding of the streamlines around a bent vortex with low “twist” around its core but with high tangential velocity is difficult to observe. Figure 12 shows such flow of the synthetic Spiral Vortex dataset. There, the streamlines close to the vortex core line exhibit no apparent swirling motion about the core line. Only at the bottom part of the spiral, such swirling is observable from the original configuration (Fig. 12a). Straightening the feature line and deforming its surrounding streamlines (Fig. 12b), however, clearly reveals the swirling motion around the vortex core line. To further highlight this, a streamline is highlighted (red). Notice that the number of crossings—the streamline either crosses in front or behind the feature line—matches for the original and the deformed space. While this shows that the winding number is preserved, it is easier to observe in the deformed space, especially when visualizing multiple streamlines. Thus, this enables visual denomination of the winding number and provides better insight into the flow dynamics close to the vortex core line. Particularly, the change in swirling motion along the vortex stands out, with stronger swirling motion at the bottom of the domain and reduced swirling at the top. While some parts of the grid are torn, the feature line and its surroundings are well preserved.

Fig. 13
figure 13

Flow in the Tornado (Crawfis 2003) dataset with vortex core line (dark green) and streamlines (light green). Additionally, a streamline close to the vortex core line is highlighted (red) to show the difference in deformation between close streamlines and the ones farther away. a Original space, b, c deformed space, and d deformed space with view along the straightened feature line. Comparison between b deformed streamlines, i.e., deformed geometry, and c streamlines seeded in the deformed vector field

The synthetic Tornado dataset (Crawfis 2003) shows a near opposite behavior as the Spiral Vortex dataset, with low tangential velocity and a large winding number due to strong swirling motion. Here, the extracted vortex core line can be interpreted as the “eye of the storm”. A very peculiar behavior of the tornado is the apparent motion visualized by the streamlines in Fig. 13a, which is mainly horizontal. Hence, the streamlines seem to behave independently from the curvature of the feature line. Further, an upward motion can barely be seen for the streamlines farther away from the feature. Only for the streamline very close to the vortex core (red in Fig. 13), such a trend can be observed. The horizontal motion of the streamlines, together with the curved vortex core line, therefore leads to askew-looking streamlines in the deformed configuration (Fig. 13b). This is an interesting behavior, which originates from the used mathematical model to create the vector field, whereas in physical models, motion relative to the vortex core line is typically regular and dependent of the shape of the vortex core line. To additionally show that there is no significant difference between deformed streamlines (Fig. 13b) and streamlines computed on the deformed vector field (Fig. 13c), we visualize both for comparison. One can observe that close to the feature line there is no apparent difference. Farther outside, however, the accumulated error increases, as cells far away from the feature are generally more deformed, and thus more prone to numerical inaccuracy.

Fig. 14
figure 14

Convective Heat Flow with two vortex core lines (dark green), surrounding streamlines (light green) and selected streamline (red) in the undeformed configuration a. Zoom-in on the deformed configuration after b straightening the lower vortex core line, and c straightening the selected streamline, respectively. Note that after deformation in c, other streamlines and the lower vortex core line are swirling around the straightened streamline

Our approach is not only able to straighten locally defined feature lines, but lines in general. To exploit this for further analysis of the flow in a vortex region, we can, e.g., straighten arbitrary streamlines as well. In Fig. 14, showing a time step from a convective heat flow simulation with two vortex core lines, the space is deformed by straightening the lower vortex core line (Fig. 14b) or an arbitrary streamline (Fig. 14c). While for the deformation of the vortex core line, we get again insight into the flow relative to it, we can see that by deforming the streamline instead, the lower vortex core line now swirls around that streamline. This is expected, as by defining the respective other line as reference, the swirling still has to be present. However, other neighboring streamlines also rotate around our feature streamline. This is an interesting observation, which is not obvious, and not visible in the original dataset, demonstrating that considering streamlines as features can provide insight into flow dynamics, meriting further investigation.

Fig. 15
figure 15

Flow within the Centrifugal Pump, whose geometry—casing (transparent gray) and blades (blue)—is shown. a, b Original space and undeformed geometry, containing a vortex core line (dark green), a selected feature streamline (red), and surrounding streamlines (light green). Deformed space and geometry after straightening the vortex core line c, or the feature streamline d, respectively

Fig. 16
figure 16

Blunt Fin dataset with attachment and separation lines (dark green). a LIC and b streamlines between the two feature lines in the undeformed space. c LIC for the deformed grid and d respective streamlines. Integration time is color-coded to provide the flow direction (from red to yellow)

Another benefit, by generally deforming the space and not only the vector field, is that we can deform arbitrary geometry. The Centrifugal Pump dataset (Lucius and Brenner 2010), provided in the scope of the 2011 SciVis Contest, consists of the flow field and the geometry of a pump. The original, undeformed geometry, together with a vortex core line and surrounding streamlines, is depicted in Fig. 15a, b. It shows not only the flow lines, but also the casing of the pump and its blades. Thus, additional to the streamlines, the pump itself is deformed using our approach. This way, the pump can still be visualized for context, as shown in Fig. 15c, d. Straightening the vortex core line (Fig. 15c) shows again the swirling motion of the streamlines around it. Similarly, vortex cores in turbines often exhibit low numbers of revolution (cf. Roth and Peikert 1996), which constitutes a good application case for our method. Again straightening a selected streamline allows to observe the motion of the vortex core line and the other streamlines in its vicinity (Fig. 15d). Like in the previous example, the other streamlines exhibit swirling motion around our feature streamline.

6.3 Attachment and separation lines

The Blunt Fin dataset shown in Fig. 16 represents an air flow simulation around a fin, defined on a curvilinear grid. The fin causes the formation of attachment and separation lines along the surface, between which swirling motion is present. In the original space in Fig. 16b, the overall impression is that the streamlines “pass by” the two feature lines. In our deformed representation in Fig. 16d, which was obtained by straightening the lower separation line, attachment and separation flow behavior can be seen much clearer. Additionally, the swirling behavior between the two feature lines can now be better observed by looking along its swirling path. As, in this case, there is flow on a surface, line integral convolution can be employed for visualization. For this, we deform the grid and corresponding vector field, demonstrating that our method can readily be used in such situations. Here, the original (Fig. 16a) and the deformed configurations (Fig. 16c) are shown, respectively.

6.4 Bifurcation lines

Taylor–Couette flow is induced by two nested cylinders rotating at different velocities. This leads to oscillating bifurcation lines (Roth 2000), as can be seen in Fig. 17a. Visualizing the flow close to the bifurcation lines, as in Fig. 17b and for a zoomed-in region in Fig. 17d, does not reveal much detail about separating flow behavior. Deforming one of the feature lines, however, reveals the expected saddle-like behavior. This is shown in Fig. 17c, and in Fig. 17e for a view along the straightened bifurcation line. As before, preserving certain geometric properties is of vital interest. Among those is the “plane property”, as described in Sect. 4.2. Contrary to vortex core lines, however, here we are not interested in preserving the winding number. To observe the flow relative to a bifurcation line, we would rather restrict the flow close to the feature to single flat (stream-)planes. This alignment would then provide us with a local view on the saddle behavior. To this end, an approach could be to additionally “twist” the space along the feature by rotating the already transformed planes \({{\mathcal {P}}_{\varvec{\gamma }^\tau }}\) around their normal, i.e., around the feature line tangent \({\varvec{t}^\tau }\).

Fig. 17
figure 17

Taylor–Couette flow between two rotating cylinders, with a two oscillating bifurcation lines (dark green) near the wall of the inner cylinder. b Original streamlines (light green), d close-up, and c, e deformed

7 Discussion

In the previous section, we showed that our method can be readily applied to vector fields for flow analysis. Qualitative interpretation of such vector fields is directly possible when visualizing the deformed geometry, i.e., the straightened feature line and its deformed neighborhood. Additionally, for preserved geometric properties, quantitative interpretation is applicable as well. Examples presented are the number of windings for vortex core lines, but also more generally the distances of the streamlines to the feature, and relative point positions in subspaces \({{\mathcal {P}}_{\varvec{\gamma }^0_{\min }}}\). In cases where properties are to be analyzed that are not preserved, such as physical properties, we recommend to employ visualizations of the original and the deformed space for complimentary analysis.

While closed feature lines, such as periodic orbits (cf. Sect. 6.1), are natural limitations of our line straightening approach, we encourage to just “cut open” the line for straightening. Similarly, applying appropriate preprocessing to the feature line, it is possible to, e.g., only straighten parts of the feature. This can done by cropping the line and feeding our algorithm only the relevant part as input. Finally, due to the fact that line straightening and space deformation parts can be easily exchanged in our modular approach, easy adaptation to other feature line types is possible, or to map an input feature line to a predefined target feature line instead of applying regular smoothing.

In general, only cases where the user is interested in regions that are affected by strong distortion and possibly tearing, our approach has its limitation. Such features might include, but are not limited to, knots. Because of their narrow winding, only very limited space is not affected by said distortion and thus may not yield useful results. This is due to the Voronoi-like property of our point mapping. Otherwise, the complexity of a feature line does not negatively affect the capabilities and usefulness of our method.

Because smoothing and deformation is currently not constrained to the spatial domain in unsteady flow, our method would result in space-time deformation. While this impedes interpretation, our method could be applied to time-dependent datasets to analyze the temporal evolution of vortex core lines by applying line straightening and deformation to the core line and its surrounding streamlines (neglecting time). This way, by mapping the vortex core line always to the same straight target line, similar to the idea of registration, streamlines could easily be compared between time steps side-by-side.

8 Conclusion

We presented the concept of interactive straightening of line-type flow features for improved inspection of the dynamics that cause them. For that, we introduced a new spline-based deformation scheme, which employs “tears” to enable strong local deformations but keep distortion low. We discussed the properties of the deformation, with emphasis on the deformation of vortex core lines for which our approach is well suited in the sense that it preserves the characteristics (winding) of vortical flow. To enable interactive rates, we implemented our approach on the GPU, and integrated it into the visualization platform ParaView for improved usability and availability. We evaluated our approach using various synthetic and simulated fields, as well as for different line features, such as attachment/separation lines, vortex core lines, and bifurcation lines. The overall approach allows one to observe and assess the flow—its behavior and patterns, and related phenomena—relative to the feature line. As such, it can be used in scenarios where mostly qualitative analysis is required, e.g., when teaching features in flow visualization to students or non-experts.

As future work, we propose to conduct a study to evaluate and discuss our method with domain experts. Further, we would like to provide specialized deformations for other feature lines, and extend the approach to surface features. This would enable the investigation of flow relative to separation surfaces and stream surfaces, but also to three-dimensional Lagrangian coherent structures. Because the application to unsteady flow leads to space-time deformation, we would like to constrain our approach to spatial deformation.