Skip to content
Projects

Node space

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

CompositeNodes

classsource

The nodes and leaf cells of a hierarchy, and the maps to its patches.

lattice
k=iL rLmax−L\mathbf{k} = \mathbf{i}_L\, r^{L_\mathrm{max} - L}
hanging
ϕhanging=(1−ks)ϕa+ks ϕb(from the ends a,b of the coarsest edge it lies in, span s)\phi_\mathrm{hanging} = \Big(1 - \frac{k}{s}\Big)\phi_a + \frac{k}{s}\,\phi_b \quad \text{(from the ends } a, b \text{ of the coarsest edge it lies in, span } s\text{)}
composition
T←T Tuntil no master hangs (at most Lmax+1 times)T \leftarrow T\,T \quad \text{until no master hangs (at most } L_\mathrm{max} + 1 \text{ times)}
control volume
Vp=∑K∋p∣K∣2dV_p = \sum_{K \ni p} \frac{|K|}{2^d}
Assumes
  • nodes shared by patches are one unknown; a periodic axis wraps the lattice
  • in 1D no node hangs: a coarse-fine interface is a node of both levels
  • a node is owned by the lowest rank of its leaf cells

deposit

functionsource

The charges of point particles at points (ndim, k) on the nodes: (n,).

bilinear
Qc=∑kqk wc(xk),w00=(1−ξ)(1−η), w10=ξ(1−η), w01=(1−ξ)η, w11=ξηQ_c = \sum_k q_k\, w_c(\mathbf{x}_k), \qquad w_{00} = (1-\xi)(1-\eta),\ w_{10} = \xi(1-\eta),\ w_{01} = (1-\xi)\eta,\ w_{11} = \xi\eta
transpose
Q=E⊤q,Ekc=wc(xk)(evaluation)Q = E^\top q, \qquad E_{kc} = w_c(\mathbf{x}_k) \quad (\texttt{evaluation})
hanging
QF=(T⊤Q)F(in NodalPoisson.solve(charge=)): the total is keptQ_F = (T^\top Q)_F \quad \text{(in } \texttt{NodalPoisson.solve(charge=)}\text{): the total is kept}
Assumes
  • (ξ,η)(\xi, \eta) the fractions of the point in its leaf cell, from its lower-left corner; linear weights in 1D
  • points outside the domain deposit nothing

mass

functionsource

The node mass matrix M0: u^T M0 u is the integral of u_h**2.

mass
u⊤M0u=∫uh2 dV,M0=∑KPK⊤M0,KPKu^\top M_0 u = \int u_h^2\, dV, \qquad M_0 = \sum_K P_K^\top M_{0,K} P_K
lumped
M0=diag(Vp)M_0 = \mathrm{diag}(V_p)
Assumes
  • on all nodes, hanging ones included: for the free nodes use T⊤M0TT^\top M_0 T
  • Cartesian measure, also on an (r,z)(r, z) hierarchy
Built from