On a uniform grid, the finite element matrices of Neumann problems are diagonalised by discrete cosine transforms (DCT). This is the basis of fast solvers and spectral norms on rectangles (see Fast Solvers on Rectangular Domains and Spectral Sobolev Norms on Rectangles).
Two variants
Different grid positions give different cosine bases.
- DCT-I (nodal). For the nodes , , of a uniform 1D mesh, the modes are
- DCT-II (cell-centred). For the cell centres , , the modes are
Both are discrete versions of the Neumann eigenfunctions of on an interval of length .
Linear elements: nodal matrices
For linear elements with spacing , the 1D Neumann Stiffness Matrix and Mass Matrix are tridiagonal, with halved diagonal entries in the first and last rows. Let and (trapezoidal weights). With ,
The interior rows are the standard identity . In the boundary rows both sides carry the factor of . The modes are orthogonal in the trapezoidal inner product,
so . Consequently and : the columns of solve the generalised eigenproblem of the pair .
Tensor products. On a uniform rectangle grid with spacings , the bilinear (Q1) matrices are Kronecker products of 1D matrices,
so diagonalises them, with eigenvalues (spacing in the first, in the second factor of each product). The same holds for three factors in 3D.
Solving. The only zero eigenvalue belongs to the constant mode (see Null Space of the Neumann Problem). Dropping it gives
whose solutions satisfy with the tensor trapezoidal weights . For bilinear functions this is exactly , so the transform solver comes with its own grounding; other groundings follow by subtracting a constant (see Grounding of the Potential).
Piecewise constants: cell-centred matrices
For piecewise constants on the cells of the same grid, the two-point-flux jump matrix is, in 1D, with ones in the corners. It satisfies
and is diagonal. In 2D the jump matrix is , diagonalised by . The mass matrix is .
Dirichlet conditions
On the interior nodes (Dirichlet data eliminated, see Enforcing Dirichlet Conditions), the modes are sines , (DST-I). The eigenvalues are the same expressions in , and .
Fast evaluation
Products with and cost through the FFT. The even extension of length gives
and is symmetric, so uses the same routine. DCT-II and DST-I follow from analogous extensions, or from one FFT of length after reordering (Makhoul). A complex FFT is therefore sufficient, which matters on GPUs, where FFT libraries do not provide cosine transforms. Several right-hand sides are transformed as one batch.
In ModularEIT.jl: dct_neumann_solve, StructuredGrid.
References
- G. Strang (1999). The Discrete Cosine Transform. SIAM Rev. 41(1), 135–147. doi:10.1137/S0036144598336745
- J. Makhoul (1980). A fast cosine transform in one and two dimensions. IEEE Trans. Acoust. Speech Signal Process. 28(1), 27–34. doi:10.1109/TASSP.1980.1163351
- P. N. Swarztrauber (1977). The Methods of Cyclic Reduction, Fourier Analysis and the FACR Algorithm for the Discrete Solution of Poisson’s Equation on a Rectangle. SIAM Rev. 19(3), 490–501. doi:10.1137/1019071