lapy.heat¶
Functions for computing heat kernel and diffusion.
Inputs are eigenvalues and eigenvectors (for heat kernel) and the mesh geometries (tet or tria mesh) for heat diffusion.
- lapy.heat.diagonal(t, x, evecs, evals, n)¶
Compute heat kernel diagonal ( K(t,x,x,) ).
For a given time t (can be a vector) using only the first n smallest eigenvalues and eigenvectors.
- Parameters:
- Returns:
- h
array
Matrix, rows: vertices selected in x, cols: times in t.
- h
- lapy.heat.diffusion(geometry, vids, m=1.0, aniso=None, use_cholmod=False)¶
Compute the heat diffusion from initial vertices in vids.
It uses the backward Euler solution \(t = m l^2\), where l describes the average edge length.
- Parameters:
- geometry
TriaMesh
|TetMesh
Geometric object on which to run diffusion.
- vids
array
Vertex index or indices where initial heat is applied.
- m
float
, default=1.0 Factor to compute time of heat evolution.
- aniso
int
Number of smoothing iterations for curvature computation on vertices.
- use_cholmod
bool
, default=False - Which solver to use:
True : Use Cholesky decomposition from scikit-sparse cholmod.
False: Use spsolve (LU decomposition).
- geometry
- Returns:
- vfunc:
array
of shape (n, 1) Heat diffusion at vertices.
- vfunc:
- lapy.heat.kernel(t, vfix, evecs, evals, n)¶
Compute heat kernel from all points to a fixed point (vfix).
For a given time t (using only the first n smallest eigenvalues and eigenvectors):
\[K_t (p,q) = \sum_j \ exp(-eval_j \ t) \ evec_j(p) \ evec_j(q)\]- Parameters:
- Returns:
- h
array
Matrix m rows: all vertices, cols: times in t.
- h