Hodge decomposition of vector fields in Cartesian grids
DOI: https://doi.org/10.1145/3680528.3687602
SA Conference Papers '24: SIGGRAPH Asia 2024 Conference Papers, Tokyo, Japan, December 2024
While explicit representations of shapes such as triangular and tetrahedral meshes are often used for boundary surfaces and 3D volumes bounded by closed surfaces, implicit representations of planar regions and volumetric regions defined by level-set functions have also found widespread applications in geometric modeling and simulations. However, an important computational tool, the L2-orthogonal Hodge decomposition for scalar and vector fields defined on implicit representations under commonly used Dirichlet/Neumann boundary conditions with proper correspondence to the topology presents additional challenges. For instance, the projection to the interior or boundary of the domain is not as straightforward as in the mesh-based frameworks. Thus, we introduce a comprehensive 5-component Hodge decomposition that unifies normal and tangential components in the Cartesian representation. Numerical experiments on various objects, including single-cell RNA velocity, validate the effectiveness of our approach, confirming the expected rigorous L2-orthogonality and the accurate cohomology.
ACM Reference Format:
Zhe Su, Yiying Tong, and Guowei Wei. 2024. Hodge decomposition of vector fields in Cartesian grids. In SIGGRAPH Asia 2024 Conference Papers (SA Conference Papers '24), December 03--06, 2024, Tokyo, Japan. ACM, New York, NY, USA, Article xx, 10 Pages. https://doi.org/10.1145/3680528.3687602
1 Introduction
The Hodge decomposition of vector fields into components with specific properties has a broad range of applications. For instance, it plays a crucial role in computational fluid dynamics [Yang et al. 2021; Yin et al. 2023], flow processing and visualization [Sawhney and Crane 2020], geometric modeling [Wang and Chern 2021], spectral data analysis [Keros and Subr 2023], and machine learning [Su et al. 2024]. As a prototypical example, vector fields on a compact domain in the 2D or 3D Euclidean space can be orthogonally decomposed into divergence-free and curl-free components, as in the Helmholtz-Hodge decomposition. The general form of the decomposition based on Hodge's foundational work [1989] applies to differential forms (covariant antisymmetric tensor fields), which can be regarded as a generalization of scalar and vector fields. It decomposes the space of differential k-forms into a direct sum of L2-orthogonal subspaces.
On closed manifolds, the classical Hodge decomposition [Hodge 1989] involves Laplacians, which are second-order linear operators with finite-dimensional kernels called harmonic spaces. The dimensions of these kernels correspond to the topology of the underlying manifolds, leading to implementations through linear systems with finite rank deficiency. However, on manifolds with boundary, the situation becomes subtle. The spaces of harmonic fields are infinite-dimensional, resulting in linear systems with substantial rank deficiency. To mitigate this issue, specific boundary conditions, such as the normal (Dirichlet) and tangential (Neumann) boundary conditions, have been introduced [Shonkwiler 2009]. Under these conditions, kernels are again finite-dimensional, with correspondences to the topology of the manifold and its boundary.
The domains for vector field processing through finite element type approaches in geometric modeling and computer graphics [Poelke and Polthier 2016; Tong et al. 2003] are frequently represented by simplicial meshes, e.g., the unstructured surface or volume meshes resulting from either Lagrangian or Eulerian formulations of fluid simulation. On the other hand, structured meshes such as Cartesian grids are advantageous in other types of discretization, including finite-volume, finite-difference, and pseudo-spectral methods [Fedkiw et al. 2001; Liu et al. 2015; Stam 2023], as well as
convolutional neural networks on voxelized data. However, for the complete 5-component Hodge decomposition of vector fields on compact domains, the existing methods [Poelke 2017; Razafindrazaka et al. 2019; Zhao et al. 2019] rely exclusively on simplicial mesh discretization frameworks, where the underlying manifolds are modeled either by triangular or tetrahedral meshes. To facilitate the direct application of the 5-component Hodge decomposition on a compact domain defined within a regular Cartesian grid, we propose linear systems directly assembled based on a given level-set function, without resorting to tessellation and data conversion.
1.1 Related work
The Hodge decomposition for smooth manifolds with boundary has been thoroughly discussed in [Schwarz 2006] with up to 4 components. A refinement of the decomposition to five terms is presented in [Shonkwiler 2013], which offers insights on further splitting the cohomology groups (which correspond to the kernels of Laplacians) into portions derived from the interior and boundary of the manifold. An elementary exposition of this 5-component Hodge decomposition for compact domains in $\mathbb {R}^3$ in terms of vector and scalar fields can be found in [Cantarella et al. 2002].
In the discrete case, the Helmholtz-Hodge decomposition (HHD) has been implemented in various methods. In [Polthier and Preuß 2000], a global variational approach was used for HHD of piecewise constant vector fields on triangulated surfaces, by L2-projection to the spaces of curl-free and divergence-free components. It was then extended to the 3D case on tetrahedral meshes [Polthier and Preuß 2003; Tong et al. 2003], and to the 2D case on regular grids [Guo et al. 2005]. A meshless algorithm of HHD was introduced in [Petronetto et al. 2009] for point vectors in $\mathbb {R}^2$. See [Bhatia et al. 2012; De Goes et al. 2016] for a comprehensive discussion on the theory and practice of HHD for 2D and 3D vector fields.
The complete 5-component discrete Hodge decomposition was subsequently introduced for piecewise constant vector fields, for surface triangle meshes [Poelke and Polthier 2016], and for tetrahedral meshes [Poelke 2017]. The framework aligns well with the smooth case, accurately capturing the topological structures. The decomposition can be done more efficiently when using Whitney bases representations for differential forms, such as Nedelec elements on edges, and Raviart-Thomas elements on faces [Razafindrazaka et al. 2019; Zhao et al. 2019].
1.2 Contributions
We aim to fill the gap for the 5-component Hodge decomposition on Cartesian grids with 2D/3D domains defined by level set functions. Unlike existing methods, we do not require an explicit tessellation of the domain into simplicial meshes, eliminating the reliance on high-quality meshing tools and streamlining the decomposition. Moreover, we maintain the pairwise L2-orthogonality among the components while preserving the consistency with the topology.
2 Hodge decomposition in the smooth case
Before describing the discretization, we briefly review the continuous theory. Let M be an m-dimensional smooth, orientable, compact manifold with boundary. In particular, when M is a compact domain in $\mathbb {R}^m, m=2$ or 3 with its metric induced by Euclidean metric, any vector field w on M can be decomposed as w = ∇a + ∇ × b, where a is a scalar field and b is a vector field. The curl-free component ∇a and the divergence-free component ∇ × b are L2-orthogonal with each other under certain boundary conditions detailed later, and the decomposition is unique with certain assumptions on the topology of M.
The generalization of this crucial mathematical tool in scientific computing to higher dimensions and generic manifolds is often through differential k-forms, which can be interpreted as an entity that can be integrated on k-submanifolds, or equivalently an antisymmetric covariant tensor field of rank k defined on M. Specifically, in $\mathbb {R}^2$, a 0-form or a 2-form can be identified with a scalar field and a 1-form can be identified with a vector field, while in $\mathbb {R}^3$, a 0-form or 3-form can be identified with a scalar field and a 1-form or 2-form can be regarded as a vector field.
The space of all differential k-forms on M is denoted as Ωk. The differential d, also called exterior derivative, is the unique $\mathbb {R}$-linear mapping from k-forms to (k + 1)-forms satisfying the Leibniz rule with respect to the wedge product ∧ (antisymmetric tensor product) and the nilpotent property dd = 0. This operator generalizes and unifies several differential operators in vector analysis, including gradient ∇, curl ∇ ×, and divergence ∇ ·, which correspond to d applied to 0-, 1-, and 2-forms in $\mathbb {R}^3$ respectively. The identity dd = 0, corresponds to the vector field analysis identities ∇ · ∇ × =0 and ∇ × ∇ = 0. See [Desbrun et al. 2006] for a comprehensive comparison.
A differential form ω ∈ Ωk is closed if dω = 0 and exact if there is a (k − 1)-form ζ ∈ Ωk − 1 such that ω = dζ. Every exact form is closed due to dd = 0. The integral of an exact form dω over an oriented k + 1-submanifold S ⊂ M with boundary ∂S can be reduced to a boundary integral of ω, according to Stokes’ theorem, a generalization of the Newton-Leibniz rule,
(2.1)
(2.2)
(2.3)
(2.4)
2.1 Hodge decomposition for closed manifolds
The classical Hodge decomposition theorem states that the space of differential k-forms can be decomposed orthogonally as
(2.5)
(2.6)
2.2 Hodge decomposition for manifolds with boundary
2.2.1 Orthogonality. With a nonempty boundary, the orthogonality is not guaranteed unless boundary conditions are imposed to the r.h.s of Eq. 2.6. Two such subspaces can be defined: $\Omega ^k_n$ and $\Omega ^k_t$ for the homogeneous normal and tangential boundary conditions,
(2.7)
(2.8)
2.2.2 Complete decomposition. The solution is to enforce boundary conditions on the harmonic space, and decompose the space $\mathcal {H}^k$ further into three terms [Friedrichs 1955]
(2.9)
(2.10)
(2.11)
(2.12)
Since $\mathcal {H}^k_n$ and $\mathcal {H}^k_t$ are finite-dimensional, hn and ht can be calculated by projecting the form ω onto the spaces $\mathcal {H}^k_n$ and $\mathcal {H}^k_t$ in any orthonormal bases. The last term η can then be calculated by subtracting these four terms from ω.
The 5-component decomposition can also be performed in two steps, by a 3-component decomposition,
(2.13)
(2.14)
(2.15)
2.2.3 Dimensionality of tangential/normal kernels. Each tangential (or normal) harmonic field corresponds to a unique equivalence class in the absolute (or respectively relative) de Rham cohomology, i.e., $\mathcal {H}^{k}_t \cong H^k_{dR}(M)$ and $\mathcal {H}^{k}_n\cong H^k_{dR}(M, \partial M)$ [Friedrichs 1955]. It follows that, for compact manifolds in $\mathbb {R}^m$, the dimensions of these subspaces are given by the Betti numbers $ \dim \mathcal {H}^{k}_n = \beta _{m-k}$ and $ \dim \mathcal {H}^{k}_t = \beta _k$, fully determined by the topology.
3 Discretization of the Hodge decomposition
The generalization of discrete exterior calculus (DEC) [Desbrun et al. 2006; Wang et al. 2023] from simplicial meshes to regular grids is
straightforward (see inset for an example of the boundary operator on a grid face). Our focus is on 2D/3D domains bounded by a level set curve/surface embedded within such grids. In fact, the interpretation of the discrete forms and discrete differential based on boundary operator is particularly intuitive for regular grids. Up to a constant scaling factor, discrete 0- and 3-forms correspond to scalar fields sampled on grid points and on cell centers; discrete 1- and 2-forms correspond to vector fields its components sampled on X, Y, Z grid edges, and those on YZ, ZX, XY grid faces. Discrete differential operator corresponds to grad/curl/div when applied to 0/1/2-forms, e.g., for an XY grid face representing Z-component of ∇ × w, the sum of w over the four edges corresponds to the circulation around the face, or equivalently, $\frac{\partial w_y}{\partial x} - \frac{\partial w_x}{\partial y}$ times the area of the face.
3.1 Discretization on grids
3.1.1 Discrete forms. Let Im be a rectangular m-dim regular Cartesian grid with k-cells oriented according to their alignment with the coordinate axes. With uniform grid spacing l along each axis direction, each k-cell of the grid is a k-dimensional hypercube. With the grid Im treated as a cell complex tessellating a rectangular domain in $\mathbb {R}^m$, a continuous k-form ω can be discretized by its integral value $W^i=\int _{\sigma _i} \omega$ over each k-cell σi [Desbrun et al. 2006]. Let c = ∑iaiσi be a k-chain, given as a formal linear combination of k-cells representing a k-dimensional subdomain. Then the discretization, known as the de Rham map, linearly maps a k-form to a cochain, which is a linear functional that maps the k-chain c to the integral of ω over c, i.e, ∫cω = ∑iWiai.
3.1.2 Discrete differential operator. The discrete differential operator acting on discrete k-forms is represented by a sparse matrix $D^I_k.$ This matrix encodes the signed incidence between (k + 1)-cells and k-cells, as in the simplicial case, i.e., $D^I_k=\partial _{k+1}^T$, the transpose of the cell boundary operator ∂k + 1 on (k + 1)-cells. This is the direct consequence of Stokes’ theorem ∫σdω = ∫∂σω. It follows that $D^I_{k+1}D^I_k = 0,$ since the boundary of a boundary of any cell is a 0 chain (i.e., ∂∂ = 0).
3.1.3 Discrete Hodge star. Treating the centers of m-cells as grid points, we construct a dual grid that is staggered with the primal grid Im. A one-to-one correspondence between discrete k-forms on the primal grid and (m − k)-form on the dual grid can be established by the diagonal discrete Hodge star ⋆k, induced by the continuous Hodge star through local averaging
(3.1)
(3.2)
3.1.4 Discrete Laplacian. The discrete codifferential operator δ can be assembled from the discrete differential and Hodge star operators as $(S^I_{k-1})^{-1}(D^I_{k-1})^TS^I_k$. With the differential and codifferential in Δ = dδ + δd replaced by their discrete counterparts, the resulting matrix is nonsymmetric. Therefore, the discrete Laplacian is defined as the counterpart of ⋆Δ,
(3.3)
3.2 Discrete differential forms and operators on M
For simplicial or polygonal meshes, identifying boundary elements is straightforward, allowing easy implementation of projection matrices to the interior or boundary of the domain M. However, when M is defined by the volume enclosed within a level set surface, enforcing boundary conditions through projection matrices becomes challenging. Instead of tessellating the boundary cells to form new unstructured meshes, e.g., through Marching Cubes, we modify the Hodge star operators. This approach maintains consistent data structures, accommodating evolving level sets and eliminating the need for remeshing.
3.2.1 Compact supports. While we do not cut the boundary cells, we still need to restrict the computation to the relevant cells through the inclusion or exclusion of the entire k-cells, similar to voxelization. However, boundary (primal or dual) k-cells typically intersect the boundary rather than being completely contained within it. As we aim to construct Laplacian operators with rank deficiencies corresponding to the topology of M, we design one rule for each of the two types of boundary conditions. For normal boundary
conditions, we include every cell with at least one vertex inside M, while for tangential boundary conditions, we select every cell with at least one vertex of its dual cells inside M. The set of cells for the former is called the normal support (inset left) and the set of cells for the latter is called the tangential support (inset right). Note that, the normal and tangential supports are typically distinct, and, unlike the mesh case, neither is necessarily a superset of the other.
The 0-1 projection matrices Pk, n and Pk, t map k-chains to the normal and tangential support respectively. They can be derived from the identity matrix by eliminating the rows corresponding to k-cells outside the support. The relevant differential operators are
(3.4)
(3.5)
3.2.2 Modified Hodge stars and Laplacians. Our discretization extends the formulations in [Batty et al. 2007; Liu et al. 2015; Ng et al. 2009; Ribando-Gros et al. 2022] to accommodate the 5-component Hodge decomposition. This complete decomposition necessitates the simultaneous use of both tangential fields and normal fields. One key observation is that dΩn and δΩt are essential to the decompositions (Eqs. (2.13) and (2.10)). Thus, while the forms on normal and tangential supports may be “voxelized,” their differentials and codifferentials, respectively, need to effectively approximate elements of dΩn and dΩt.
To this end, we retain the dual cell volumes while adjusting the primal cell volumes for normal boundary conditions, and do the opposite for tangential boundary conditions: keep the primal cell volumes while modifying the dual cell volumes. For instance, a gradient field ∇fn of a scalar function fn fixed to 0 on the boundary can be repre-
sented by D0, nFn of a normal 0-form Fn. Its value in a boundary cell will be forced to be orthogonal to the boundary as shown in the inset figure. Equivalently, the codifferential of a 3-form with tangential support also satisfies the tangential condition of the resulting 2-form, which also corresponds to a gradient vector field orthogonal to the boundary.
Specifically, for normal (or tangential) boundary conditions, we replace the k-volume of each primal (resp. dual) k-cell. Instead of the full k-volume of lk, where l is the grid spacing, we use the k-volume of its intersection with M. This can be computed as the volume of the convex hull formed by the grid points of a k-cell inside M and the intersection points on the grid edges of that k-cell. For the discrete Hodge star matrix, this modified volume is placed in the denominator (or numerator) while the dual (or primal) cell volumes ln − k are left unchanged in the numerator (or denominator). For numerical stability, we perturb the level set function evaluated at primal/dual gridpoints to have an absolute value above ϵ = 10− 5l, which ensures that fractional k-volumes behave well under double precision. We denote by Sk, n and Sk, t the resulting sparse Hodge star matrices defined on the normal and tangential supports, respectively.
The discrete L2 inner products of the two types of discrete k-forms on the manifold M under these two boundary conditions, namely, the discrete $\Omega ^{k}_n(M)$ and $\Omega ^{k}_t(M)$, are thus
(3.6)
Finally, we assemble the discrete Hodge Laplacians as follows:
(3.7)
(3.8)
3.3 Vector field decomposition
In 2D or 3D, vector fields on M can be represented as discrete 1-forms. Following the typical de Rham map $W^i=\int _{\sigma _i}\omega$, the integral of the vector field along each grid edge is the corresponding primal 1-form (on the normal support). Assume the input vector field is sampled as one vector per grid point in M, and 0 at grid points outside. Then the discrete 1-form on each primal edge in the normal support is the average of the edge direction component of vectors on the inside endpoints of each grid edge, multiplied by the fraction of the primal edge length within the domain. The resulting discrete 1-form is denoted as Wn even though ω is not necessarily normal.
To reconstruct the field at a specific point, e.g., in the 3D case, each component of the vector can be evaluated from bilinear interpolation of the average values on the 4 edges along that direction incident to the containing grid cell. This can be seen as the Whitney map on the Cartesian grid, similar to the one that constructs a continuous field from a discrete 1-form on a simplicial mesh.
In 3D, it is possible to use a discrete 2-form instead. While the DoFs for 1-forms and 2-forms can be drastically different in the simplicial mesh case, in our Cartesian representation, it is strictly equivalent to a discrete 1-form on a grid shifted by (l/2, l/2, l/2). Thus, we limit our discussion to the 1-form representation.
Remark 3.1 More precisely, a vector field v can also be represented as a 2-form on M by averaging the normal components of vectors on inside grid points of each face times the face area inside the domain. The decomposition of the 2-form following (2.8) provides a dual version, where the Laplacians L1, n and L3, t will be used for solving the vector and scalar potentials, respectively. One could use either of these two representations of vector fields for the Hodge decomposition since they are equivalent to one another through the duality between a Cartesian grid and its staggered dual by offsetting each grid point with (l/2, l/2, l/2), so long as M is at least one grid spacing away from the boundary of the grid.
For the tangential representation of the 1-form, we actually follow the discretization of the normal 2-form as described above on the dual grid, except that the average is rescaled by l instead of by the inside part of the face area. This ensures that the tangential 1-form Wt samples the vector field at least at one point within the domain, as at least one of the four neighboring dual cell centers will be inside M. Recall that while Wn and Wt are merely represented in the normal and tangential supports, respectively, neither necessarily satisfy the corresponding boundary conditions.
In the following, we first describe a naive approach for calculating the five components in the Hodge decomposition Eq. (2.11), which converges to orthogonal components only in the continuous limit. Then, we describe a modified computation that achieves discrete L2-orthogonality of the 5 subspaces, mirroring the orthogonality found in mesh-based decomposition.
3.3.1 Direct approach. Similar to the mesh setting, to solve for the scalar potentials An defined on vertices (i.e., 0-cells) and Bt defined on faces (i.e., 2-cells) in the Hodge decomposition Eq. (2.11), we use the discrete equivalents of Eq. (2.12):
(3.9)
The normal Laplacian L0, n is full rank, but the kernel size of L2, t in 3D is β2, as determined by the topology of M. To address the rank deficiency, we add a small positive value to β2 selected diagonal entries to L2, t. Following the computation of the potentials, the first two terms in Hodge decomposition (2.11) are calculated by applying the discrete differential D0, n to An and the discrete codifferential $\delta _{2,t} = S_{1,t}^{-1}D_{1,t}^TS_{2,t}$ to Bt.
To compute the normal harmonic component Nh and the tangential harmonic component Th, we simply project W to the kernels of the discrete Laplacians L1, n and L1, t. As with the mesh-based approach, these two Laplacians correctly capture the cohomology of the underlying manifold: the space of discrete normal harmonic 1-fields is isomorphic to the first relative cohomology group, and the space of discrete tangential harmonic 1-fields isomorphic to the first absolute cohomology group, i.e.,
(3.10)
(3.11)
To compute the final term E in (2.11), it is important to account for the different dimensions between the discrete normal forms D0, nAn, Nh and tangential forms $S_{1,t}^{-1}D_{1,t}^TS_{2,t} B_t, T_h$. This difference in dimensions arrives due to the relation between the normal and tangential support. Consequently, one has to resolve the consistency issue, e.g., by converting all representations to tangential support. To avoid excessive averaging, we construct the linear conversion operator Cn → t as follows: if an edge is in both supports, we simply rescale the normal 1-form value by l2 − mS1, n, otherwise, the vectors at the incident cell centers are reconstructed from the normal 1-form (i.e., Whitney map), then the tangential 1-form discretization procedure is carried out on that edge. With this conversion operator,
(3.12)
3.3.2 Discrete orthogonal decomposition. To achieve a discrete L2-orthogonal decomposition, we first have to choose a consistent L2-inner-product and a consistent functional space. Given that the Hodge duality on regular Cartesian grids is straightforwardly established by shifting the grid by half a grid spacing, we use S1, t and the tangential support for the following discussion without loss of generality.
3.3.3 Tangential decomposition. According to Eq. (2.13), a 3-component discrete orthogonal decomposition containing two of the components we need is
(3.13)
(3.14)
(3.15)
3.3.4 Gradient field decomposition. The 5-component decomposition can be regarded as the 3-component tangential decomposition followed by the decomposition of the gradient field space into 3 subspaces. Accordingly, we further decompose D0, tAt into three components,
(3.16)
To implement this, we build two nested linear subspaces of $\operatorname{Im}D_{0,t}.$ The first subspace, representing the discrete version of ${\operatorname{Im}D_{0,t}\cap \mathcal {H}^1}$, is the space onto which an L2-projection will produce $\tilde{A}_h +\tilde{A}_E$. The second space is a subspace of the first, denoted as $\widetilde{H_{1,n}}$, corresponding to an L2-projection providing $\tilde{A}_h$. The final component can then be computed through $\tilde{A}_n=A_t-(\tilde{A}_h+\tilde{A}_E).$ All these potentials are unique, up to one constant shift per connected component (kernel of L0, t).
As the first linear subspace is the space of harmonic exact 1-forms, we seek to express it through discrete harmonic 0-form potentials, which are determined by its restriction to the boundary. However, in contrast to the mesh-based case, not all boundary grid points are present in the tangential support of 0-forms. Therefore, we establish an extended support for the harmonic potential A, which includes all grid points incident to any grid edge in either tangential or normal support. With the projection PE → T representing the projection from the extended support to the tangential support, $\tilde{A}_E+\tilde{A}_h= P_{E\rightarrow T} A$ is the harmonic potential whose differential leads to $\tilde{E} + \tilde{N}_h$. The linear space is thus defined as {A | L0, EA = 0}, where L0, E is the graph Laplacian for 0-forms in the extended support evaluated on all grid points in the normal support. The graph Laplacian is necessary and sufficient here since we are enforcing neither the tangential nor the normal boundary condition for this component.
The projection to the first linear subspace can be obtained from the linear system resulting from the constrained minimization,
(3.17)
The second subspace is constructed as a subspace of normal harmonic forms, which is a subspace of the space of exact harmonic forms. As the dimension is low (β2), it is efficient to construct its basis. We first find, for the i-th basis 1-form Nh, i for the harmonic normal 1-form space, the closest 1-form $D_{0,t}\bar{A}_{h,i}$ within the tangential support can be obtained by first solving
(3.18)
(3.19)
3.4 Kernel dimensions and L2-orthogonality
3.4.1 Voxelized cell complex. In contrast to the Lagrangian case in [Zhao et al. 2019], the discrete version of de Rham's theorem on the isomorphism between homology and de Rham cohomology is not immediately apparent on the normal/tangential supports of Cartesian grids. However, while the “voxelized” supports do not follow the actual boundary surface, the cohomology ($\ker D/ \operatorname{Im}D$) still exists as DtDt = 0 (DnDn = 0) still holds, and it depends only on Dt (or Dn) but not on St (or resp. Sn). In fact, as the tangential support contains each primal k-cell that has a dual (n − k)-cell with at least one internal dual grid point, it forms a voxelized cell complex mesh. This is due to that any k-cell in the tangential support has each of its (k − 1)-faces also in the tangential support, because the dual (n − k + 1)-cell has at least one internal dual grid point. Thus, $\ker D_{k,t}/ \operatorname{Im}D_{k-1,t}$ is isomorphic to Hk(M), since the voxelized mesh is homeomorphic to M. The cohomology on the normal support $\ker D_{k,n}/ \operatorname{Im}D_{k-1,n}$ likewise corresponds to a voxelized dual cell complex, and is thus isomorphic to Hn − k(M)≅Hk(M, ∂M).
As St and Sn are nonsingular by construction, it then follows that $\ker L_{k,t}\cong H^k(M)$ (and $\ker L_{k,n} \cong H^k(M,\partial M)$), since for either Lk, $\ker L_{k}$ contains one unique representative from every equivalence class [W + DF] in $\ker D_{k}/\operatorname{Im}D_{k-1}$ of the associated D. For instance, if both W and W + D0, tF belong to $\ker L_{1,t}$, then δ1, tD0, tF = 0; so F belongs to the kernel of L0, t (constant functions on each connected component), thus D0, tF = 0.
3.4.2 Orthogonality. The naive approach does not have strict discrete orthogonality among the 5 subspaces, as they are defined on different types of supports with different Hodge stars as inner products. Neither L2-inner product provided strict orthogonality among these components, as confirmed in our experiments. In the following, we show why our projection-based approach establishes the S1, t-orthogonality in the decomposition on the tangential support.
By mimicking the Eq. (2.6) on tangential representations, we show the orthogonality among D0, tA, δ2, tBt and Th as follows
(3.20)
(3.21)
(3.22)
4 Numerical experiments
Our algorithm is implemented in MATLAB and tested on a laptop with 16GB OF memory. The 5 components are pairwise orthogonal, with an L2-inner product of 0 up to the precision of the linear solvers used. Among the examples below, the worst case L2-inner product (normalized by the product of the norms of the two components involved) is below 10− 10. The runtime is within 5 seconds for 100 × 100 grids and 30 × 30 × 30 grids, and within 40 seconds for 50 × 50 × 50 grids. The images were rendered in Blender. To demonstrate the effectiveness, we provide both 2D and 3D examples of Hodge decomposition of vector fields defined on compact domains. These domains are represented by signed distance functions (SDF) on regular Cartesian grids. Denoting by ρ the level set function, the compact domain is
(4.1)
In Fig. 1, the 5-component Hodge decomposition is computed in our approach on a 2D bunny-shaped domain with one hole. Both the normal harmonic space $\mathcal {H}_n$ and the tangential harmonic space $\mathcal {H}_t$ are one-dimensional, since β1 = 1 due to the annulus topology.
In Fig. 2, a vector field on a kitty-shaped domain with a spherical cavity and one handle is decomposed into five components. With β1 = 1 and β2 = 1, all 5 components can be nonzero. Figs. 3 and 4 show the decomposition on topologically modified kettlebell and buddha models, both with nonzero β1 and β2. For the 3D figure-8 model in Fig. 5, β1 = 2 but β2 = 0, thus the space of normal harmonic fields ht vanishes, leaving only four nonzero components. To demonstrate that the algorithm also applies to abstract manifolds, we show in Fig. 6 an RNA velocity field, which captures the cell dynamic information in the biological processes [Su et al. 2024].
5 Conclusion
We have presented a framework to compute the complete 5-component orthogonal decomposition of 2D and 3D vector fields on domains embedded in regular Cartesian grids. We leveraged the correspondence between vector fields and differential forms with certain boundary conditions. The domain boundaries are encoded by isosurfaces of level-set functions. Compared to the methods on simplicial meshes [Razafindrazaka et al. 2019; Zhao et al. 2019], our framework greatly simplifies the data structure and discrete operators by using the vertices, edges, faces, and cells of the grid. This significantly improves the efficiency of our algorithms for potentially evolving level set functions. Our adaptation DEC ensures that the discrete Hodge decomposition preserves the crucial topology structure while conforming to specified boundary conditions. All components can be calculated by solving sparse linear systems with rank efficiency eliminated by accounting for the corresponding spaces of harmonic fields that depend only on the underlying manifold topology. The L2-orthogonality of the decomposed 5 discrete components is also rigorously guaranteed by the linear algebra formulation. This framework has the potential to benefit various downstream applications due to the ubiquity of vector field analysis on domains in Euclidean spaces.
Limitations and future work. Our framework has so far been evaluated only on compact domains in $\mathbb {R}^2$/$\mathbb {R}^3$. Extending it to higher dimensions should be relatively straightforward. However, a limitation lies in the domain representation: it cannot capture sharp features unless the grid resolution is sufficiently fine because the domain is modeled as a region bounded by an isocurve or an isosurface of a level-set function. Periodic domains with obstacles are not implemented either. The geometric details are also constrained by grid resolution. Therefore, one possible future extension is to incorporate adaptive data structures similar to octrees. Moreover, we only considered the Hodge decomposition with each component under just either normal or tangential boundary conditions. Future work could involve generalizing this to mixed boundary conditions as in [Zhao et al. 2019] for the mesh setting. Another interesting variation worth exploring is the implementation of high-order Galerkin-type Hodge stars rather than diagonal ones, and studying their impact on the convergence rate. A possible speedup for the saddle point problem in Eq. (3.17) is through the Schur complement reduction [Benzi et al. 2005] initialized with our direct approach.
Code availability. The source code can be found at github link.
Acknowledgments
This work was supported in part by NIH grants R01GM126189, R01AI164266, and R01AI146210, NSF grants DMS-2052983, DMS-1761320, and IIS-1900473, NASA grant 80NSSC21M0023, MSU Research Foundation, Bristol-Myers Squibb 65109, and Pfizer.
References
- Christopher Batty, Florence Bertails, and Robert Bridson. 2007. A fast variational framework for accurate solid-fluid coupling. ACM Transactions on Graphics (TOG) 26, 3 (2007), 100–es.
- Michele Benzi, Gene H Golub, and Jörg Liesen. 2005. Numerical solution of saddle point problems. Acta numerica 14 (2005), 1–137.
- Harsh Bhatia, Gregory Norgard, Valerio Pascucci, and Peer-Timo Bremer. 2012. The Helmholtz-Hodge decomposition—a survey. IEEE Transactions on visualization and computer graphics 19, 8 (2012), 1386–1404.
- Jason Cantarella, Dennis DeTurck, and Herman Gluck. 2002. Vector calculus and the topology of domains in 3-space. The American Mathematical Monthly 109, 5 (2002), 409–442.
- Fernando De Goes, Mathieu Desbrun, and Yiying Tong. 2016. Vector field processing on triangle meshes. In ACM SIGGRAPH 2016 Courses. 1–49.
- Mathieu Desbrun, Eva Kanso, and Yiying Tong. 2006. Discrete differential forms for computational modeling. In ACM SIGGRAPH 2006 Courses. 39–54.
- Ronald Fedkiw, Jos Stam, and Henrik Wann Jensen. 2001. Visual simulation of smoke. In Proceedings of the 28th annual conference on Computer graphics and interactive techniques. 15–22.
- Kurt Otto Friedrichs. 1955. Differential forms on Riemannian manifolds. Communications on Pure and Applied Mathematics 8, 4 (1955), 551–590.
- Qinghong Guo, Mrinal K Mandal, and Micheal Y Li. 2005. Efficient Hodge–Helmholtz decomposition of motion fields. Pattern Recognition Letters 26, 4 (2005), 493–501.
- William Vallance Douglas Hodge. 1989. The theory and applications of harmonic integrals. CUP Archive.
- Alexandros Keros and Kartic Subr. 2023. Spectral coarsening with hodge laplacians. In ACM SIGGRAPH 2023 Conference Proceedings. 1–11.
- Beibei Liu, Gemma Mason, Julian Hodgson, Yiying Tong, and Mathieu Desbrun. 2015. Model-reduced variational fluid simulation. ACM Transactions on Graphics (TOG) 34, 6 (2015), 1–12.
- Charles B Morrey. 1956. A variational method in the theory of harmonic integrals, II. American Journal of Mathematics 78, 1 (1956), 137–170.
- Yen Ting Ng, Chohong Min, and Frédéric Gibou. 2009. An efficient fluid–solid coupling algorithm for single-phase flows. J. Comput. Phys. 228, 23 (2009), 8807–8829.
- Fabiano Petronetto, Afonso Paiva, Marcos Lage, Geovan Tavares, Hélio Lopes, and Thomas Lewiner. 2009. Meshless helmholtz-hodge decomposition. IEEE transactions on visualization and computer graphics 16, 2 (2009), 338–349.
- Konstantin Poelke. 2017. Hodge-type decompositions for piecewise constant vector fields on simplicial surfaces and solids with boundary. Ph. D. Dissertation.
- Konstantin Poelke and Konrad Polthier. 2016. Boundary-aware Hodge decompositions for piecewise constant vector fields. Computer-Aided Design 78 (2016), 126–136.
- Konrad Polthier and Eike Preuß. 2000. Variational approach to vector field decomposition. In Data Visualization 2000: Proceedings of the Joint EUROGRAPHICS and IEEE TCVG Symposium on Visualization in Amsterdam, The Netherlands, May 29–30, 2000. Springer, 147–155.
- Konrad Polthier and Eike Preuß. 2003. Identifying vector field singularities using a discrete Hodge decomposition. In Visualization and mathematics III. Springer, 113–134.
- Faniry H Razafindrazaka, Konstantin Poelke, Konrad Polthier, and Leonid Goubergrits. 2019. A Consistent Discrete 3D Hodge-type Decomposition: implementation and practical evaluation. arXiv preprint arXiv:1911.12173 (2019).
- Emily Ribando-Gros, Rui Wang, Jiahui Chen, Yiying Tong, and Guo-Wei Wei. 2022. Graph and Hodge Laplacians: Similarity and difference. arXiv preprint arXiv:2204.12218 (2022).
- Rohan Sawhney and Keenan Crane. 2020. Monte Carlo geometry processing: A grid-free approach to PDE-based methods on volumetric domains. ACM Transactions on Graphics 39, 4 (2020).
- G. Schwarz. 2006. Hodge Decomposition - A Method for Solving Boundary Value Problems. Springer Berlin Heidelberg. https://books.google.com/books?id=6-17CwAAQBAJ
- Clayton Shonkwiler. 2009. Poincaré duality angles on Riemannian manifolds with boundary. Ph. D. Dissertation. University of Pennsylvania.
- Clayton Shonkwiler. 2013. Poincaré duality angles and the Dirichlet-to-Neumann operator. Inverse Problems 29, 4 (2013), 045007.
- Jos Stam. 2023. Stable fluids. In Seminal Graphics Papers: Pushing the Boundaries, Volume 2. 779–786.
- Zhe Su, Yiying Tong, and Guo-Wei Wei. 2024. Hodge decomposition of single-cell RNA velocity. Journal of chemical information and modeling (2024).
- Yiying Tong, Santiago Lombeyda, Anil N Hirani, and Mathieu Desbrun. 2003. Discrete multiscale vector field decomposition. ACM transactions on graphics (TOG) 22, 3 (2003), 445–452.
- Stephanie Wang and Albert Chern. 2021. Computing minimal surfaces with differential forms. ACM Transactions on Graphics (TOG) 40, 4 (2021), 1–14.
- Stephanie Wang, Mohammad Sina Nabizadeh, and Albert Chern. 2023. Exterior Calculus in Graphics: Course Notes for a SIGGRAPH 2023 Course. In ACM SIGGRAPH 2023 Courses. 1–126.
- Shuqi Yang, Shiying Xiong, Yaorui Zhang, Fan Feng, Jinyuan Liu, and Bo Zhu. 2021. Clebsch gauge fluid. ACM Transactions on Graphics (TOG) 40, 4 (2021), 1–11.
- Hang Yin, Mohammad Sina Nabizadeh, Baichuan Wu, Stephanie Wang, and Albert Chern. 2023. Fluid Cohomology. ACM Trans. Graph. 42, 4, Article 126 (jul 2023), 25 pages. https://doi.org/10.1145/3592402
- Rundong Zhao, Mathieu Desbrun, Guo-Wei Wei, and Yiying Tong. 2019. 3D Hodge decompositions of edge-and face-based vector fields. ACM Transactions on Graphics (TOG) 38, 6 (2019), 1–13.
Footnote
Authors' Contact Information: Zhe Su, Michigan State University, United States of America, suzhe@msu.edu; Yiying Tong, Michigan State University, United States of America, ytong@msu.edu; Guowei Wei, Michigan State University, United States of America, weig@msu.edu.
This work is licensed under a Creative Commons Attribution International 4.0 License.
SA Conference Papers '24, December 03–06, 2024, Tokyo, Japan
© 2024 Copyright held by the owner/author(s).
ACM ISBN 979-8-4007-1131-2/24/12.
DOI: https://doi.org/10.1145/3680528.3687602