Skip to content

dec_h0

dec_h0(V, F)

Builds the DEC 0-Hodge-star operator as described, for example, in Crane et al. 2013. "Digital Geometry Processing with Discrete Exterior Calculus".

Parameters:

Name Type Description Default
V (n,d) numpy array

vertex list of a triangle mesh

required
F (m,3) numpy int array

face index list of a triangle mesh

required

Returns:

Name Type Description
h0 (n,n) scipy csr_matrix

DEC operator h0

Examples:

# Mesh in V,F
h0 = gpy.dec_h0(V,F)
Source code in src/gpytoolbox/dec_h0.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
def dec_h0(V,F):
    """Builds the DEC 0-Hodge-star operator as described, for example, in Crane
    et al. 2013. "Digital Geometry Processing with Discrete Exterior Calculus".

    Parameters
    ----------
    V : (n,d) numpy array
        vertex list of a triangle mesh
    F : (m,3) numpy int array
        face index list of a triangle mesh

    Returns
    -------
    h0 : (n,n) scipy csr_matrix
        DEC operator h0

    Examples
    --------
    ```python
    # Mesh in V,F
    h0 = gpy.dec_h0(V,F)
    ```

    """

    l_sq = halfedge_lengths_squared(V,F)
    return dec_h0_intrinsic(l_sq,F,n=V.shape[0])