Skip to content
Projects

Mass matrices

The equations of patchwork.spaces.mass, declared on the code that implements them and checked by the tests.

edge_cross_blocks

functionsource

The coupling of every cell's edges along two different axes, (m, 2**(d-1), 2**(d-1)).

cross
M1,K(a,b)=∣K∣hahb 14⨂i≠a,bm(a≠b)M_{1,K}^{(a,b)} = \frac{|K|}{h_a h_b}\,\frac14 \bigotimes_{i \ne a, b} m \quad (a \ne b)
Assumes
  • an edge value is the line integral of the field along it (Whitney edges)
  • the same for the lumped and the consistent mass along aa and bb: the vertex quadrature of a product of a hat and a constant is exact
  • a tensor-product (box) cell; Cartesian measure

edge_mass_blocks

functionsource

The mass block of every cell's edges along axis, (m, 2**(d-1), 2**(d-1)).

edges
M1,K(a)=∏i≠ahiha⨂i≠amM_{1,K}^{(a)} = \frac{\prod_{i \ne a} h_i}{h_a} \bigotimes_{i \ne a} m
lumped edges
M1,K(a)=∏i≠ahi2d−1ha IM_{1,K}^{(a)} = \frac{\prod_{i \ne a} h_i}{2^{d-1} h_a}\,I
Assumes
  • an edge value is the line integral of the field along it (Whitney edges)
  • a tensor-product (box) cell; Cartesian measure

face_mass_blocks

functionsource

The mass block of every cell's two faces normal to axis, (m, 2, 2).

faces
M2,K(a)=ha∏i≠ahi mM_{2,K}^{(a)} = \frac{h_a}{\prod_{i \ne a} h_i}\, m
lumped faces
M2,K(a)=ha2∏i≠ahi IM_{2,K}^{(a)} = \frac{h_a}{2 \prod_{i \ne a} h_i}\,I
Assumes
  • a face value is the flux through it (Raviart–Thomas faces): the normal component varies linearly between the cell's two faces normal to the axis
  • a tensor-product (box) cell; Cartesian measure

node_mass_blocks

functionsource

The node mass block of every cell, (m, 2**d, 2**d), in corner order.

nodes
M0,K=∣K∣⨂i=1dmM_{0,K} = |K| \bigotimes_{i=1}^{d} m
lumped nodes
M0,K=∣K∣2d IM_{0,K} = \frac{|K|}{2^d}\,I
Assumes
  • a tensor-product (box) cell; Cartesian measure

stiffness_blocks

functionsource

The nodal stiffness block G^T M1(K) G of every cell, (m, 2**d, 2**d).

stiffness
SK=∑a,bDa⊤(Kab M1,K(a,b))Db,M1,K(a,a)=M1,K(a)S_K = \sum_{a, b} D_a^\top \big(K_{ab}\, M_{1,K}^{(a,b)}\big) D_b, \qquad M_{1,K}^{(a,a)} = M_{1,K}^{(a)}
edges
M1,K(a,b)→diag(κa) M1,K(a,b) diag(κb)(a coefficient per edge)M_{1,K}^{(a,b)} \to \mathrm{diag}(\sqrt{\kappa_a})\, M_{1,K}^{(a,b)}\, \mathrm{diag}(\sqrt{\kappa_b}) \quad \text{(a coefficient per edge)}
energy
u⊤SKu=∫K∇u⋅K ∇u dA(consistent mass, constant K)u^\top S_K u = \int_K \nabla u \cdot \mathsf{K}\, \nabla u \, dA \quad \text{(consistent mass, constant } \mathsf{K}\text{)}
Assumes
  • DaD_a the corner differences along the cell's edges on axis aa (the local discrete gradient)
  • a symmetric coefficient K\mathsf{K} per cell; with the lumped mass the vertex quadrature of ∫∇u⋅K∇u\int \nabla u \cdot \mathsf{K} \nabla u, positive for a positive definite K\mathsf{K}
  • a coefficient per edge κ≥0\kappa \geq 0 scales the edge's rows and columns by κ\sqrt{\kappa}: on the lumped (diagonal) blocks the edge's conductance times κ\kappa
Built from