massmatrix_intrinsic
massmatrix_intrinsic(l_sq, F, n=None, type='voronoi')
FEM intrinsic mass matrix
Builds the finite elements mass matrix for a triangle mesh using a piecewise linear hat function basis, using only intrinsic information (squared halfedge edge lengths).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
l_sq |
(m,3) numpy double array
|
Vector of squared halfedge lengths as computed by halfedge_lengths_squared |
required |
F |
(m,3) numpy int array
|
face index list of a triangle mesh (into a V assumed to exist) |
required |
n |
int, optional (default: None)
|
Integer denoting the number of vertices in the mesh |
None
|
type |
str, optional (default: 'voronoi')
|
Type of mass matrix computation: 'voronoi' (default), 'full' or 'barycentric' |
'voronoi'
|
Returns:
Name | Type | Description |
---|---|---|
M |
(n,n) scipy sparse.csr_matrix
|
Intrinsicly computed mass matrix |
See Also
massmatrix.
Notes
This implementation is lifted from https://github.com/alecjacobson/gptoolbox/blob/master/mesh/massmatrix_intrinsic.m
Examples:
from gpytoolbox import massmatrix_intrinsic
l_sq = np.array([[1.,1.,1.]]) # edge lengths
f = np.array([[0,1,2]],dtype=int) # simple triangle
M_b = massmatrix_intrinsic(l_sq,f, type='barycentric')
# M_b will be a diagonal matrix with 0.25/sqrt(3) on the diagonal
Source code in src/gpytoolbox/massmatrix_intrinsic.py
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
|