betaFeedback

WorksMathematics

An FFT-based solver with general boundary conditions for stationary diffusion problems based on Chebyshev collocation

Abstract

An efficient and robust FFT-based solver is proposed for diffusion-type problems with general Neumann and Dirichlet boundary conditions, based on a Chebyshev collocation framework. The method combines Chebyshev polynomial approximations with FFT-based operators to provide a matrix-free implementation of the discrete differential operator at the Chebyshev-Gauss-Lobatto points. The linear system of equations resulting from the Chebyshev discretization is solved using LGMRES. To overcome convergence problems on fine grids, a hierarchical refinement strategy based on modal prolongation is proposed, enabling the solution of very large 3D problems. The methodology is applicable to homogeneous and heterogeneous domains, as well as to linear and nonlinear constitutive equations. The accuracy of the proposed method is analyzed by solving the Poisson equation in homogeneous 1D and 3D domains with general boundary conditions, using manufactured analytical solutions as references. Convergence to the analytical solution is achieved in a few iterations, with smaller errors than those obtained using DCT/DST approaches. Discretizations of up to 2563256^3 are achieved thanks to the hierarchical refinement strategy. In the case of heterogeneous domains, the accuracy and efficiency obtained are similar to those of a standard periodic FFT approach. It is found that the computational complexity of the method preserves the FFT scaling, of order nlog⁡nn\log n, in all the cases studied.

Introduction

Spectral methods are a well-established class of high-order techniques for the numerical resolution of partial differential equations (PDEs), especially useful when the solution is sufficiently smooth and the global approximation is advantageous [1, 2, 3, 4]. In contrast to low-order finite-difference or finite-element methods, spectral approaches approximate the solution in terms of global basis functions, such as trigonometric or orthogonal polynomials, and can exhibit very rapid convergence as the approximation order increases [2, 3, 4].

Among spectral techniques, Fourier-based methods have been particularly successful because differential operators can be applied efficiently through the discrete Fourier transform and its fast implementation, the Fast Fourier Transform (FFT) leading to solution methods with computational cost O(Nlog⁡N)\mathcal{O}(N \log N). This feature has made FFT-based schemes especially attractive in computational micromechanics and homogenization where large-scale problems on regular grids can be solved without assembling global sparse or dense matrices [5, 6, 7, 8]. However, the same trigonometric structure that makes these methods efficient also ties them naturally to periodic settings. As a result, the treatment of non-periodic boundary conditions typically requires either reformulation on an enlarged periodic domain or the use of specialized constructions, which may reduce flexibility and complicate the accurate imposition of general Dirichlet or Neumann conditions [1, 2, 4].

Several recent contributions have addressed this limitation while retaining the computational advantages of FFT-based solvers. A first group of approaches, known as framing methods, is based on embedding the domain under study in a larger prism surrounded by a frame or buffer with special properties. The target boundary conditions are prescribed considering this frame by including some condition on the solution scheme. This group includes, among other works, the methods of [9] for Dirichlet boundary conditions or [10] who consider both types. An alternative approach is based on applying singular body forces on some internal boundary, as first proposed in [11] for elastodynamic problems, in [12] for chemomechanics, and in [13] for mechanical static approaches.

A third framework is based on using sine–cosine transform formulations (discrete DST and DST algorithms) as an alternative to standard Fourier transforms to prescribe Dirichlet or Neumann BCs in different problems. In [14, 15], a solver based on DCT/DST was proposed for conductivity problems with combined non-uniform Neumann, periodic and Dirichlet boundary conditions. [16] also proposed a method for thermal homogenization with Dirichlet, Neumann and periodic conditions within FFT- and tensor-train-based Green’s operator methods. Risthaus and Schneider developed a direct extended these DCT/DST formulations to enforce Dirichlet boundary conditions in FFT-based micromechanics, avoiding some of the auxiliary constructions commonly used to enforce prescribed displacements [17]. Also in mechanical problems, Paux et. al. proposed an approach which uses DCT/DST in addition to some conditions on the nodes of the boundary, allowing to impose general boundary conditions, including arbitrary tractions on the boundary [18].

These developments show the growing interest in extending FFT-based solvers beyond purely periodic settings. Nevertheless, most of these approaches remain closely connected to trigonometric approximation spaces and often rely on problem-specific ingredients, such as sine–cosine basis selections, auxiliary decompositions, Green’s operators adapted to the boundary conditions, buffer regions, or periodic embeddings. Although effective in their respective settings, such strategies do not always provide a unified collocation framework for general non-periodic boundary-value problems on bounded domains.

A natural alternative is to replace purely trigonometric approximations by polynomial spectral discretizations on bounded domains. In particular, Chebyshev collocation methods retain the global character and high accuracy of spectral approximations while being well suited to non-periodic problems posed on finite intervals and tensor-product domains [1, 2, 4]. Moreover, Chebyshev-based differentiation can still be implemented efficiently through fast cosine- and sine-transform techniques, making these methods attractive from a computational standpoint. At the same time, the imposition of general boundary conditions and the poor conditioning of high-order differentiation operators remain important practical issues in collocation formulations [19].

Motivated by these considerations, this work proposes a novel, robust, and efficient Chebyshev collocation framework for diffusion-type problems with fully general boundary conditions on bounded domains. The formulation uses fast transform-based operator evaluations to avoid the explicit assembly of dense differentiation matrices and to obtain a matrix-free implementation. A key ingredient of our formulation is the development of a hierarchical refinement procedure, based on modal prolongation, which succeeds in overcoming the convergence limitations of classical Chebyshev implementations and improves the practical performance of the iterative solution process across nested discretizations. The main objective is to provide a practical transform-based Chebyshev framework that extends some of the computational advantages of FFT-enabled spectral methods to non-periodic settings. The methodology is assessed on representative benchmark Poisson problems, including diffusion on a homogeneous domain, its extension to two-phase heterogeneous domains, and nonlinear heat transfer. These examples are used to examine the precision of the formulation, the treatment of boundary conditions, and the practical role of hierarchical refinement in the iterative solution process. A comparison with sine–cosine-based transform solvers is also included in order to highlight the relative advantages and limitations of the Chebyshev approach for non-periodic problems. The remainder of the paper is organized as follows. Section 2 presents the numerical formulation, including the Chebyshev collocation discretization, matrix-free differential operators, the treatment of boundary conditions, and the hierarchical refinement strategy. Section 3 presents the numerical examples. Finally, Section 4 summarizes the main conclusions.

Numerical framework

Spectral methods aim to solve boundary value problems (BVP) by approximating the solution as a finite sum of known global support smooth functions. In this work, a spectral method is proposed for general stationary boundary-value problems based on Chebyshev polynomials and the FFT algorithm. For simplicity, the formulation in one dimension is presented first.

Spectral collocation in one dimension

In a one-dimensional setting, the objective is to find the function u(x)u(x) in a spatial domain DD with boundary ∂D\partial D, which fulfills

L(u(x))+N(u(x))=f(x)x∈D(1)\mathcal{L}(u(x))+\mathcal{N}(u(x))=f(x) \quad x\in D \tag*{(1)}
B(u(x))=g(x)x∈∂D(2)\mathcal{B}(u(x))=g(x) \quad x\in\partial D \tag*{(2)}

Here, L(⋅)\mathcal{L}(\cdot) and B(⋅)\mathcal{B}(\cdot) are linear operators that include spatial derivatives. B\mathcal{B} is defined on the boundary ∂D\partial D and imposes the boundary conditions defined as g(x)g(x). N(⋅)\mathcal{N}(\cdot) is a nonlinear operator, and f(x)f(x) represents the source term. The function u(x)u(x), solution of the problem in Eqs. (1)-(2), is an element of the Hilbert space H\mathcal{H} with inner product (⋅,⋅)(\cdot,\cdot) and norm ∥⋅∥\lVert\cdot\rVert. It belongs to a subspace B\mathcal{B} of H\mathcal{H} consisting of all functions u∈Hu\in\mathcal{H} satisfying the boundary conditions B(u(x))=g(x)\mathcal{B}(u(x))=g(x) when x∈∂Dx\in\partial D. The approximate solution to the general BVP (Eqs. (1)-(2)) in a finite dimensional function space PNP_N is expressed as

u(x)≈uN(x)=∑k=0Nakϕk(x)(3)u(x)\approx u_N(x)=\sum_{k=0}^{N}a_k\phi_k(x) \tag*{(3)}

where the functions ϕn(x)\phi_n(x) are the basis functions, belonging to the space PN∈HP_N\in\mathcal{H}. The finite number of unknowns are the coefficients ana_n. A residual function RNR_N can be defined by substituting the solution uNu_N into (1),

RN(x):=L(uN(x))+N(uN(x))−f(x)(4)R_N(x):=\mathcal{L}(u_N(x))+\mathcal{N}(u_N(x))-f(x) \tag*{(4)}

and the spectral solution can then be obtained by forcing the projection of the residual to be zero on a set of test functions ψj\psi_j.

(RN,ψj)ω=∫DRN(x)ψj(x)ω(x) dx=0,0≤j≤N(5)(R_N,\psi_j)_\omega=\int_D R_N(x)\psi_j(x)\omega(x)\,\mathrm{d}x=0,\quad0\leq j\leq N \tag*{(5)}

where ω\omega is a positive weight function. The choice of basis and test functions is one of the main features that distinguish spectral methods from finite-element and finite-difference methods. In the latter two methods, these functions are local in character with finite regularities. In contrast, spectral methods employ globally supported smooth functions. The most commonly used functions are trigonometric functions or orthogonal polynomials (typically, the eigenfunctions of Sturm-Liouville problems).

The method proposed is based on a collocation approach. The test functions {ψk}\{\psi_k\} are the Lagrange basis polynomials such that ψk(xj)=δjk\psi_k(x_j)=\delta_{jk}, where {xj}\{x_j\} is a set of preassigned collocation points. Hence, PNP_N is the set of all real algebraic polynomials of degree ≤N\leq N and to find the solution uN∈PNu_N \in P_N the residual is forced to zero RN(xj)=0R_N(x_j)=0 at every point in a set of Gauss–Lobatto points {xj}j=0N\{x_j\}_{j=0}^{N}. The prescribed conditions become

RN(xj)=L(uN(xj))+N(uN(xj))−f(xj)=01≤j≤N−1(6)R_N(x_j)=\mathcal{L}(u_N(x_j))+\mathcal{N}(u_N(x_j))-f(x_j)=0 \qquad1\leq j\leq N-1 \tag*{(6)}

and at the boundaries ∂D−=x0\partial D_- = x_0 and ∂D+=xN\partial D_+ = x_N satisfies the conditions

B(uN(x0))=g(x0),B(uN(xN))=g(xN)(7)\mathcal{B}(u_N(x_0))=g(x_0), \qquad\mathcal{B}(u_N(x_N))=g(x_N) \tag*{(7)}

The spectral approach to the BVP in Eq. (2) leads to:

L(∑k=0Nakϕk(xj))+N(∑k=0Nakϕk(xj))=f(xj),1≤j≤N−1.\mathcal{L}\left(\sum_{k=0}^{N}a_k\phi_k(x_j)\right)+\mathcal{N}\left(\sum_{k=0}^{N}a_k\phi_k(x_j)\right)=f(x_j), \qquad1\leq j\leq N-1.
∑k=0NB−[akϕk(x0)]=g−,∑k=0NB+[akϕk(xN)]=g+.(8)\sum_{k=0}^{N}\mathcal{B}_{-}[a_k\phi_k(x_0)]=g_-, \qquad\sum_{k=0}^{N}\mathcal{B}_{+}[a_k\phi_k(x_N)]=g_+. \tag*{(8)}

The above system contains N+1N+1 equations and N+1N+1 unknowns aka_k. The basis functions ϕk(x)\phi_k(x) are chosen as Jacobi polynomials, whose properties are well known [3].

Although the approximation (8) has been introduced in modal form, the collocation equations are evaluated at the Gauss–Lobatto nodes. Let {xj}j=0N\{x_j\}_{j=0}^{N} be the collocation nodes and let Uj=uN(xj)U_j=u_N(x_j) denote the nodal values of the interpolant. Equivalently, uNu_N can be written in the cardinal Lagrange basis associated with these nodes as

uN(x)=∑m=0Nℓm(x)Um,ℓm(xj)=δjm.(9)u_N(x)=\sum_{m=0}^{N}\ell_m(x)U_m,\qquad\ell_m(x_j)=\delta_{jm}. \tag*{(9)}

Therefore, its derivative evaluated at the collocation nodes is

∂uN∂x∣x=xj=∑m=0Nℓm′(xj)Um≡∑m=0NDjmUm,j=0,…,N(10)\left.\frac{\partial u_N}{\partial x}\right|_{x=x_j}=\sum_{m=0}^{N}\ell'_m(x_j)U_m\equiv\sum_{m=0}^{N}D_{jm}U_m,\qquad j=0,\ldots,N \tag*{(10)}

where Djm=ℓm′(xj)D_{jm}=\ell'_m(x_j) is the nodal Chebyshev–Gauss–Lobatto differentiation matrix. As the aim of this work is to develop an efficient method, Jacobi polynomials are selected so that the action of the differentiation operator can be computed using an FFT-type algorithm, with a computational cost of O(Nlog⁡N)O(N\log N) instead of the usual O(N2)O(N^2) required by a standard differentiation matrix approach.

Extension to the three-dimensional setting

In three dimensions, we consider the stationary BVP posed on the cube D=[a,b]3D=[a,b]^3, with x=(x)∈D\boldsymbol{x}=(x)\in D,

L(u(x))+N(u(x))=f(x)x∈D,B(u(x))=g(x)x∈∂D.(11)\mathcal{L}(u(\boldsymbol{x}))+\mathcal{N}(u(\boldsymbol{x}))=f(\boldsymbol{x}) \quad\boldsymbol{x}\in D,\qquad\mathcal{B}(u(\boldsymbol{x}))=g(\boldsymbol{x}) \quad\boldsymbol{x}\in\partial D. \tag*{(11)}

The spectral collocation approximation is built on the space PN(D):=PN([a,b])⊗PN([a,b])⊗PN([a,b])P_N(D):=P_N([a,b])\otimes P_N([a,b])\otimes P_N([a,b]):

u(x)≈uN(x)=∑i,j,k=0Naijk ϕi(x)ϕj(y)ϕk(z).(12)u(\boldsymbol{x})\approx u_N(\boldsymbol{x})=\sum_{i,j,k=0}^{N}a_{ijk}\,\phi_i(x)\phi_j(y)\phi_k(z). \tag*{(12)}

Let {xp}p=0N\{x_p\}_{p=0}^{N}, {yq}q=0N\{y_q\}_{q=0}^{N}, {zr}r=0N\{z_r\}_{r=0}^{N} be Gauss–Lobatto nodes in each coordinate direction; the 3D collocation grid is the Cartesian product {(xp,yq,zr)}p,q,r=0N\{(x_p,y_q,z_r)\}_{p,q,r=0}^{N}. The collocation formulation enforces

RN(xp,yq,zr)=L(uN(xp,yq,zr))+N(uN(xp,yq,zr))−f(xp,yq,zr)=0,1≤p,q,r≤N−1,(13)R_N(x_p,y_q,z_r)=\mathcal{L}(u_N(x_p,y_q,z_r))+\mathcal{N}(u_N(x_p,y_q,z_r))-f(x_p,y_q,z_r)=0,\qquad1\leq p,q,r\leq N-1, \tag*{(13)}

while on boundary nodes the corresponding equations are replaced by the discrete boundary conditions B(uN(x))=g(x)\mathcal{B}(u_N(\boldsymbol{x}))=g(\boldsymbol{x}) evaluated on ∂D\partial D. Denote by Upqr=uN(xp,yq,zr)U_{pqr}=u_N(x_p,y_q,z_r) the nodal values and by Dx,Dy,Dz∈R(N+1)×(N+1)D^x,D^y,D^z\in\mathbb{R}^{(N+1)\times(N+1)} the one-dimensional differentiation matrices on each corresponding axis. Then the partial derivatives are obtained by separable differentiation:

[∂uN∂x]pqr=∑m=0NDpm(x)Umqr,[∂uN∂y]pqr=∑m=0NDqm(y)Upmr,[∂uN∂z]pqr=∑m=0NDrm(z)Upqm.(14)\left[\frac{\partial u_N}{\partial x}\right]_{pqr}=\sum_{m=0}^{N}D^{(x)}_{pm}U_{mqr},\qquad \left[\frac{\partial u_N}{\partial y}\right]_{pqr}=\sum_{m=0}^{N}D^{(y)}_{qm}U_{pmr},\qquad \left[\frac{\partial u_N}{\partial z}\right]_{pqr}=\sum_{m=0}^{N}D^{(z)}_{rm}U_{pqm}. \tag*{(14)}

and, upon vectorization u=vec⁡(U)\boldsymbol{u}=\operatorname{vec}(U),

∂u∂x≈(D(x)⊗I⊗I)u,∂u∂y≈(I⊗D(y)⊗I)u,∂u∂z≈(I⊗I⊗D(z))u.(15)\frac{\partial\boldsymbol{u}}{\partial x}\approx(D^{(x)}\otimes I\otimes I)\boldsymbol{u},\qquad \frac{\partial\boldsymbol{u}}{\partial y}\approx(I\otimes D^{(y)}\otimes I)\boldsymbol{u},\qquad \frac{\partial\boldsymbol{u}}{\partial z}\approx(I\otimes I\otimes D^{(z)})\boldsymbol{u}. \tag*{(15)}

Chebyshev polynomials as basis functions

Among the most flexible and thorough options for basis functions with global support are the orthogonal Jacobi polynomials, which will be the foundation of this work. These polynomial families form the core of many practical spectral schemes, and the choice between them typically depends on the geometry of the domain and the desired accuracy and properties of the approximation. In particular, a subtype of Jacobi polynomials, the Chebyshev polynomials, will be used.

Chebyshev polynomials admit a simple trigonometric representation, and interpolation and differentiation can be carried out using efficient FFT-based algorithms. This property is highly beneficial as the computational cost tends to O(Nlog⁡N)O(N\log N), while being versatile in representing complex solutions. Unlike trigonometric polynomial bases, which are naturally associated with periodic approximations, Chebyshev polynomials provide polynomial approximants on bounded intervals without imposing periodicity or endpoint compatibility conditions. Since algebraic polynomials are dense in spaces of continuous functions on compact intervals, and Chebyshev interpolation exhibits spectral convergence for sufficiently smooth functions, they offer a flexible basis for approximating a wide class of non-periodic solutions while allowing boundary conditions to be imposed independently. The Chebyshev polynomials are solutions to the differential equation:

1−x2ddx(1−x2dTndx)+n2Tn=0,x∈[−1,1](16)\sqrt{1-x^2}\frac{d}{dx}\left(\sqrt{1-x^2}\frac{dT_n}{dx}\right)+n^2T_n=0,\qquad x\in[-1,1] \tag*{(16)}

The analytical expressions of these polynomials are well known and can be obtained from the recurrence relation

T0(x)=1,T1(x)=x,Tn+1(x)=2xTn(x)−Tn−1(x).(17)\begin{aligned} T_0(x)&=1,\\ T_1(x)&=x,\\ T_{n+1}(x)&=2xT_n(x)-T_{n-1}(x). \tag*{(17)} \end{aligned}

The Chebyshev polynomials can be expressed in terms of cosines. Let zz be a complex number on the unit circle (Figure 1). It can be represented using Euler formula as z=eiθz=e^{i\theta} (∣z∣=1|z|=1) where θ\theta is the argument, and then each x∈[−1,1]x\in[-1,1] can be obtained as

Figure 1. Projection of uniformly spaced points θ\theta onto xx through (x=cos⁡θ)(x=\cos\theta), leading to the Chebyshev–Gauss–Lobatto nodes and the cosine representation (Tn(x)=cos⁡(nθ))(T_n(x)=\cos(n\theta)).

x=Re⁡(z)=12(z+z−1)=cos⁡(θ),x∈[−1,1].(18)x=\operatorname{Re}(z)=\frac{1}{2}(z+z^{-1})=\cos(\theta),\qquad x\in[-1,1]. \tag*{(18)}

z−1z^{-1} is the inverse of zz (equal to the conjugate for points in the unit circle). The order nthn^{\mathrm{th}} Chebyshev polynomial can then be expressed in a very simple form as a function of θ\theta using Eq. (18) as Tn(x)=Re⁡(zn)T_n(x)=\operatorname{Re}(z^n)

T0(x)=1=Re⁡(z0)=1T_0(x)=1=\operatorname{Re}(z^0)=1
T1(x)=x=Re⁡(z)=12(ejθ+e−jθ)=cos⁡(θ)T_1(x)=x=\operatorname{Re}(z)=\frac{1}{2}\left(e^{j\theta}+e^{-j\theta}\right)=\cos(\theta)
T2(x)=2x2−1=2(Re⁡(z))2−1=12(e2jθ+e−2jθ+2)−1=12(e2jθ+e−2jθ)=cos⁡(2θ)(19)T_2(x)=2x^2-1=2\left(\operatorname{Re}(z)\right)^2-1=\frac{1}{2}\left(e^{2j\theta}+e^{-2j\theta}+2\right)-1=\frac{1}{2}\left(e^{2j\theta}+e^{-2j\theta}\right)=\cos(2\theta) \tag*{(19)}
⋯\cdots
Tn(x)=⋯=cos⁡(nθ)T_n(x)=\cdots=\cos(n\theta)

Equation (19) is essential because it allows us to express the Chebyshev polynomials in terms of cos⁡(nθ)\cos(n\theta), which makes possible to perform calculations using an FFT-based algorithm that implies a cost of order O(Nlog⁡N)O(N\log N) [20].

Derivation of the Chebyshev interpolant: FFT-based implementation

An arbitrary function f(x)f(x) in the domain [−1,1][-1,1] can be approximated by a linear combination of Chebyshev polynomials TnT_n. The approximate expansion of f(x)f(x) in the discrete Chebyshev basis, fN(x)f_N(x), corresponds to

f(x)≈fN(x)=∑k=0NakTk(x)=∑k=0Nakcos⁡(kθ)=∑k=0Nakcos⁡(karccos⁡(x))(20)f(x)\approx f_N(x)=\sum_{k=0}^{N}a_kT_k(x)=\sum_{k=0}^{N}a_k\cos(k\theta)=\sum_{k=0}^{N}a_k\cos(k\arccos(x)) \tag*{(20)}

The derivative of ff corresponds to

ddxf(θ(x))=ddθf(θ)dθdx=f′(θ)ddxarccos⁡(x)=f′(θ)−11−x2(21)\frac{d}{dx}f(\theta(x))=\frac{d}{d\theta}f(\theta)\frac{d\theta}{dx}=f'(\theta)\frac{d}{dx}\arccos(x)=f'(\theta)\frac{-1}{\sqrt{1-x^2}} \tag*{(21)}

with

f′(θ)=df(θ)dθ≈ddθ∑k=0Nakcos⁡(kθ)=−∑k=0Nkaksin⁡(kθ)(22)f'(\theta)=\frac{df(\theta)}{d\theta}\approx\frac{d}{d\theta}\sum_{k=0}^{N}a_k\cos(k\theta)=-\sum_{k=0}^{N}ka_k\sin(k\theta) \tag*{(22)}

Second order derivatives can be computed in an analogous way

d2dx2f(θ)=−ddx(f′(θ)1−x2)=f′′(θ)1−x2−xf′(θ)(1−x2)3/2(23)\frac{d^2}{dx^2}f(\theta)=-\frac{d}{dx}\left(\frac{f'(\theta)}{\sqrt{1-x^2}}\right)=\frac{f''(\theta)}{1-x^2}-\frac{xf'(\theta)}{(1-x^2)^{3/2}} \tag*{(23)}

Note that the second derivative with respect to xx involves both the first and second order derivatives with respect to θ\theta. This effect grows as we move to higher orders: computing the pp-th derivative with respect to xx requires access to every derivative with respect to θ\theta of order at most pp. The term f′(θ)f'(\theta) is calculated as expressed in equation (22) and the term f′′(θ)f''(\theta):

f′′(θ)=d2f(θ)dθ2=d2dθ2∑k=0Nakcos⁡(kθ)=−∑k=0Nk2akcos⁡(kθ)(24)f''(\theta)=\frac{d^2f(\theta)}{d\theta^2}=\frac{d^2}{d\theta^2}\sum_{k=0}^{N}a_k\cos(k\theta)=-\sum_{k=0}^{N}k^2a_k\cos(k\theta) \tag*{(24)}

Chebyshev polynomials Tn(x)T_n(x) are defined for x∈[−1,1]x\in[-1,1]. Although differentiating them introduces chain-rule factors involving inverse powers of 1−x2\sqrt{1-x^2}, the apparent singularities at the endpoints are removable; the cases x=±1x=\pm1 can be treated separately, so the polynomials remain well defined over the entire interval. The expressions of the derivatives at the edges of the domain are well known [1]. For the first derivative the resulting expressions are

ddxf(x=1)=∑k=1Nk2ak(25)\frac{d}{dx}f(x=1)=\sum_{k=1}^{N}k^2a_k \tag*{(25)}
ddxf(x=−1)=∑k=1N(−1)k+1k2ak(26)\frac{d}{dx}f(x=-1)=\sum_{k=1}^{N}(-1)^{k+1}k^2a_k \tag*{(26)}

The terms dμf(θ)dθμ\frac{d^\mu f(\theta)}{d\theta^\mu} can be handled using the Discrete Cosine Transform (DCT) and the Discrete Sine Transform (DST). First, a discrete transformation should be defined to obtain the value of the coefficients aka_k as a function of a set of discrete values of the function ff. Considering the uniformly spaced points in θ\theta, {xn=cos⁡(θn)}n=0N\{x_n=\cos(\theta_n)\}_{n=0}^{N}, which correspond to the Chebyshev-Gauss-Lobatto points, it is possible to obtain the coefficients aka_k of the spectral series (Eq. (20)) using the DCT. Among the different implementations of the DCT/DST, the DCT/DST type 1 algorithms from [21] are considered. Let be fn=f(xn)f_n=f(x_n) the values of the function on the Chebyshev-Gauss-Lobatto points, then the coefficients aka_k in the cosine expansion resulting in Eq. (19) are

ak=ckN[f0+(−1)kfN+2∑n=1N−1fncos⁡(πknN)]=ckNDCT-I(f),k=0,…,N(27)a_k=\frac{c_k}{N}\left[f_0+(-1)^kf_N+2\sum_{n=1}^{N-1}f_n\cos\left(\frac{\pi kn}{N}\right)\right]=\frac{c_k}{N}\mathbf{DCT\text{-}I}(f),\qquad k=0,\ldots,N \tag*{(27)}

and ckc_k:

ck={12,k=0 or k=N,1,1≤k≤N−1.(28)c_k= \begin{cases} \frac{1}{2}, & k=0\text{ or }k=N,\\ 1, & 1\leq k\leq N-1. \end{cases} \tag*{(28)}

Once the coefficients aka_k are obtained, following the expressions (22) and (23), the derivatives of f(θ)f(\theta) can be calculated using the DST and the DCT, where ⊙\odot is the elementwise product.

fn′=−2∑k=0Nkaksin⁡(πknN)=IDST-I(−N(k⊙ak)),n=1,…,N−1(29)f'_n=-2\sum_{k=0}^{N}ka_k\sin\left(\frac{\pi kn}{N}\right)=\mathbf{IDST\text{-}I}\left(-N(k\odot a_k)\right),\qquad n=1,\ldots,N-1 \tag*{(29)}
fn′′=−[N2(−1)naN+∑k=1N−1k2akcos⁡(πknN)]=IDCT-I(−N(k2⊙ak)),n=0,…,N(30)f''_n=-\left[N^2(-1)^na_N+\sum_{k=1}^{N-1}k^2a_k\cos\left(\frac{\pi kn}{N}\right)\right]=\mathbf{IDCT\text{-}I}\left(-N(k^2\odot a_k)\right),\qquad n=0,\ldots,N \tag*{(30)}

The implementation of the latter procedure to compute the 1st1^{st} order derivatives taking advantage of the FFT algorithms is presented in Algorithm 1.

Algorithm 1 Chebyshev 1st derivative at Chebyshev–Gauss–Lobatto nodes (FFT-based)
1: function ChebDeriv($f,x$) ▷ $f_n=f(x_n)$ at $x_n=\cos(n\pi/N)$
2: $\hat{f}\leftarrow\operatorname{DCT-I}(f)$ ▷ unnormalized type-I discrete cosine transform
3: $k\leftarrow[0,1,\ldots,N-1,0]$
4: $f'\leftarrow\operatorname{IDST-I}(-(k\mathbin{\odot}\hat{f})_{1:N-1})$ ▷ $\odot$ elementwise product and inverse type-I sine transform on interior indices
5: for $j\leftarrow1$ to $N-1$ do
6: $\left(\frac{df}{dx}\right)_j\leftarrow-\frac{f'_j}{\sqrt{1-x_j^2}}$
7: end for
8: $df_0\leftarrow\frac{1}{N}\sum_{i=0}^{N-1}i^2\hat{f}_i+\frac{N}{2}\hat{f}_N$
9: $df_N\leftarrow\frac{1}{N}\sum_{i=0}^{N-1}(-1)^{i+1}i^2\hat{f}_i+\frac{N}{2}(-1)^{N+1}\hat{f}_N$
10: return $df$
11: end function

Finally, although the Chebyshev construction has been presented on the reference interval [−1,1][-1,1], the same differentiation procedure can be applied on an arbitrary physical interval [a,b][a,b] by means of the affine mapping

t=b−a2x+a+b2,x∈[−1,1],t∈[a,b].(31)t=\frac{b-a}{2}x+\frac{a+b}{2},\qquad x\in[-1,1],\qquad t\in[a,b]. \tag*{(31)}

Therefore, the function must be sampled at the mapped Chebyshev–Gauss–Lobatto nodes

tn=b−a2cos⁡(πnN)+a+b2,n=0,…,N.(32)t_n=\frac{b-a}{2}\cos\left(\frac{\pi n}{N}\right)+\frac{a+b}{2},\qquad n=0,\ldots,N. \tag*{(32)}

After computing the derivative on the reference coordinate xx, the derivative with respect to the physical coordinate tt is obtained by the corresponding chain-rule rescaling,

dpfdtp=(2b−a)pdpfdxp.(33)\frac{d^p f}{dt^p}=\left(\frac{2}{b-a}\right)^p\frac{d^p f}{dx^p}. \tag*{(33)}

The numerical derivative can be easily extended to obtain partial derivatives in higher dimensions. The procedure consists of applying the one-dimensional FFT-based differentiation operator along a prescribed axis, with the remaining coordinate held fixed and with the appropriate affine rescaling from the reference interval [−1,1][-1,1] to a general physical domain. This yields an efficient matrix-free procedure for evaluating first-order partial derivatives with respect to any selected coordinate direction.

Krylov-based PDE Solver

To solve a PDE with a spectral collocation method, spatial derivatives are replaced by discrete differentiation operators acting on the vector of nodal values, as defined in the previous section. In contrast to local finite-difference stencils, the resulting approximation is global, each derivative evaluation at a node depends on the function values at all collocation points. In this work, we apply these operators in a matrix-free approach without explicitly assembling or storing full differentiation matrices.

The general PDE considered is defined in Eq. (1). In one spatial dimension, L(⋅)\mathcal{L}(\cdot) may be written as

L(⋅)=∑j=0pljdj(⋅)dxj.(34)\mathcal{L}(\cdot)=\sum_{j=0}^{p}l_j\frac{d^j(\cdot)}{dx^j}. \tag*{(34)}

with coefficients ljl_j and pp the maximum order of the spatial derivatives. Let {xi}i=0N\{x_i\}_{i=0}^{N} be a set of collocation points, and let u∈RN+1\mathbf{u}\in\mathbb{R}^{N+1} denote the vector of nodal values, ui:=u(xi)u_i:=u(x_i). Denote by C\mathbf{C} the discrete first-derivative operator acting on nodal vectors, such that C(u)≈∂xu\mathcal{C}(\mathbf{u}) \approx\partial_x u is evaluated at the collocation points. Higher derivatives are obtained by repeated application, Cj(u)≈∂xju\mathcal{C}^{j}(\mathbf{u}) \approx\partial_x^{j}u, or, more generally, by the corresponding discrete operators of order jj. A discrete version of the operator L(⋅)\mathcal{L}(\cdot) can be defined, LN(⋅)\mathcal{L}_{N}(\cdot), which operates on the vector u\mathbf{u} as

L(uN)∣x=xi≈[LN(u)]i:=[∑j=0pljCj(u)]i(35)\left.\mathcal{L}(u_{N})\right|_{x=x_i} \approx[\mathcal{L}_{N}(\mathbf{u})]_i := \left[\sum_{j=0}^{p} l_j \mathcal{C}^{j}(\mathbf{u})\right]_i \tag*{(35)}

and (1) is reduced to a linear system of equations

[∑j=0kljCj(u)]i+[NN(u)]i=fi,i=1,…,N−1(36)\left[\sum_{j=0}^{k} l_j \mathcal{C}^{j}(\mathbf{u})\right]_i + [\mathcal{N}_{N}(\mathbf{u})]_i = f_i,\qquad i=1,\ldots,N-1 \tag*{(36)}

where NN\mathcal{N}_{N} is the discrete version of the nonlinear operator in (1), and fif_i denotes the source term sampled at the collocation point xix_i. The extension to multiple spatial dimensions is straightforward by introducing discrete derivative operators in each coordinate direction. For f:Ω⊂R3→Rf:\Omega\subset\mathbb{R}^{3}\to\mathbb{R} sampled on a tensor-product grid, we define operators Cx\mathcal{C}_x, Cy\mathcal{C}_y, and Cz\mathcal{C}_z such that

∂f(x)∂x∣{xi,yj,zk}≈Cx(f)ijk,∂f(x)∂y∣{xi,yj,zk}≈Cy(f)ijk,∂f(x)∂z∣{xi,yj,zk}≈Cz(f)ijk,(37)\left.\frac{\partial f(\mathbf{x})}{\partial x}\right|_{\{x_i,y_j,z_k\}} \approx\mathcal{C}_x(f)_{ijk},\qquad \left.\frac{\partial f(\mathbf{x})}{\partial y}\right|_{\{x_i,y_j,z_k\}} \approx\mathcal{C}_y(f)_{ijk},\qquad \left.\frac{\partial f(\mathbf{x})}{\partial z}\right|_{\{x_i,y_j,z_k\}} \approx\mathcal{C}_z(f)_{ijk}, \tag*{(37)}

with analogous constructions for higher-order and mixed derivatives. In the present framework, the discrete residual equation (36) is solved in a matrix-free manner, with all spatial derivatives evaluated through repeated applications of the discrete differentiation operators, thereby avoiding the explicit construction and storage of dense collocation matrices while preserving the global spectral character of the approximation. When N≡0\mathcal{N}\equiv0, the residual is linear and the resulting algebraic system is solved by a Krylov subspace method. When N≠0\mathcal{N}\ne0, the collocation discretization yields a nonlinear algebraic system, and a nonlinear outer iteration is employed, while Krylov methods are used for the linear solves arising at each nonlinear step. In a Picard iteration, the nonlinear term is evaluated at the previous iteration mm, N(u(m))\mathcal{N}(u^{(m)}), and moved to the right-hand side, so that one solves

L(u(m+1))=f−N(u(m)),(38)\mathcal{L}(u^{(m+1)})=f-\mathcal{N}(u^{(m)}), \tag*{(38)}

In a Newton framework, one instead solves a sequence of linearized correction problems

J(u(m))δu(m)=−[L(u(m))+N(u(m))−f],u(m+1)=u(m)+δu(m).(39)J(u^{(m)})\delta u^{(m)}=-\left[\mathcal{L}(u^{(m)})+\mathcal{N}(u^{(m)})-f\right],\qquad u^{(m+1)}=u^{(m)}+\delta u^{(m)}. \tag*{(39)}

where J(⋅)J(\cdot) is the Jacobian of the discrete residual.

Boundary Conditions

Boundary conditions are enforced as linear constraints on the discrete state, following the procedure of [19]. Let be the linear system resulting from discretization and collocation (e.g., Eq. (36) in 1D problems),

Ax=f,A∈RN+1×N+1,(40)A x=f,\qquad A\in\mathbb{R}^{N+1\times N+1}, \tag*{(40)}

where x∈RN+1x\in\mathbb{R}^{N+1} is the vector of degrees of freedom. Let nn be the number of independent boundary conditions, each associated with a given degree of freedom in the boundary {xri}i=0n−1\{x_r^i\}_{i=0}^{n-1}, and defined as

Bx=g,B∈Rn×N+1,g∈Rn.(41)B x=g,\qquad B\in\mathbb{R}^{n\times N+1},\quad g\in\mathbb{R}^{n}. \tag*{(41)}

The unknowns are split into two groups, the ones in which boundary conditions are applied (removed, xrx_r), and the rest, belonging to the interior of the domain (interior, xkx_k). Then, the matrix expression of the boundary conditions can be rewritten as

(Bk  Br)(xkxr)=g⇒xr=−Br−1Bkxk+Br−1g≡Gxk+Hg(42)\left(B_k\ \ B_r\right) \begin{pmatrix}x_k\\x_r\end{pmatrix} = g \quad\Rightarrow\quad x_r=-B_r^{-1}B_kx_k+B_r^{-1}g\equiv Gx_k+Hg \tag*{(42)}

with G=−Br−1BkG=-B_r^{-1}B_k and H=Br−1H=B_r^{-1}. For homogeneous boundary conditions (g=0g=0), xr=Gxkx_r=Gx_k. The practical requirement is that BrB_r is nonsingular, which is ensured by choosing xrx_r such that the boundary constraints are linearly independent.

The reordering of unknowns is then applied to the system (Eq. (40)), leading to

A=(AkkAkrArkArr),f=(fkfr).A=\begin{pmatrix}A_{kk}&A_{kr}\\A_{rk}&A_{rr}\end{pmatrix},\qquad f=\begin{pmatrix}f_k\\f_r\end{pmatrix}.

Substituting xr=Gxk+Hgx_r=Gx_k+Hg into the system yields a reduced linear system involving only xkx_k,

A~xk=f~,A~=Akk+AkrG,f~=fk−AkrHg.(43)\widetilde{A}x_k=\widetilde{f},\qquad \widetilde{A}=A_{kk}+A_{kr}G,\qquad \widetilde{f}=f_k-A_{kr}Hg. \tag*{(43)}

After solving for xkx_k, the eliminated variables are recovered by

xr=Gxk+Hg,(44)x_r=Gx_k+Hg, \tag*{(44)}

and the full state xx is obtained by undoing the reordering.

In the present approach, the matrix of coefficients AA is not explicitly assembled, but is provided as a matrix-free differential operator of LN(⋅)\mathcal{L}_N(\cdot). Although Eqs. (42) and (43) involve matrix operations, the operations are carried out implicitly through the differential operator, keeping the matrix-free approach except when it is necessary to calculate the components of BB involving Neumann boundary conditions.

PDE Solver Pseudo-algorithm

For clarity, the linear PDE solver is presented through a main algorithm describing the global collocation workflow (Algorithm 2), together with the auxiliary algorithm detailing the matrix-free evaluation of the discrete operator (Algorithm 3). The algorithms given below provide a representative two-dimensional implementation of the spectral collocation solver described in the previous sections. In particular, they illustrate the resolution of the elliptic problem

∂∂x(−α(x,y)∂u∂x)+∂∂y(−α(x,y)∂u∂y)=f(x,y)(45)\frac{\partial}{\partial x}\left(-\alpha(x,y)\frac{\partial u}{\partial x}\right)+\frac{\partial}{\partial y}\left(-\alpha(x,y)\frac{\partial u}{\partial y}\right)=f(x,y) \tag*{(45)}

Algorithm 2 Linear collocation solver with matrix-free boundary reduction

1: function LinearCollocationSolver(N, bcs, f, L_x, L_y, u_0, rtol, atol, maxiter)
2:     (n_y,n_x) ← (N)
3:     (X,Y) ← (n_y,n_x,L_x,L_y) ▷ CGL grid
4:     f_N ← f(X,Y)
5:     (G,H,g) ← BuildBoundarySystem(bcs) ▷ from equation (42)
6:     L_N ← DefineDiscreteOperator(·)
7:     (\widetilde{L}_N,\widetilde{f}) ← EnforceBCs(L_N,f_N,G,H,g) ▷ from equation (43)
8:     \widetilde{u}_N ← LGMRES(\widetilde{L}_N,\widetilde{f},u_0,rtol,atol,maxiter)
9:     u_N ← ReconstructFullState(\widetilde{u}_N,G,H,g) ▷ from equation (44)
10:    return X,Y,u_N
11: end function

Algorithm 3 Matrix-free evaluation of the discrete linear operator

1: function DefineDiscreteOperator(uu) ▷ Ci(⋅)←C_i(\cdot) \gets ChebDeriv(⋅\cdot) to axis=ii from Algorithm 1 2: ux←Cx(u)u_x \gets C_x(u) 3: uy←Cy(u)u_y \gets C_y(u) 4: L(u)=Δu←Cx(−α(x,y)⊙ux)+Cy(−α(x,y)⊙uy)\mathcal{L}(u) = \Delta u \gets C_x(-\alpha(x,y) \odot u_x) + C_y(-\alpha(x,y) \odot u_y) 5: return L(u)\mathcal{L}(u) 6: end function

A method for convergence improvement: Hierarchical refinement

In the present collocation framework, the discrete solution is sought in a finite-dimensional polynomial space built from Chebyshev polynomials on a domain Ω⊂R3\Omega\subset\mathbb{R}^{3}. If N+1N+1 denotes the number of Chebyshev–Gauss–Lobatto (CGL) nodes per coordinate direction, then the corresponding interpolation space is

PN:=PN⊗PN⊗PN.(46)\mathbb{P}_{N} := \mathbb{P}_{N} \otimes\mathbb{P}_{N} \otimes\mathbb{P}_{N}. \tag*{(46)}

Here, PN\mathbb{P}_{N} denotes the space of polynomials of degree at most NN. Equivalently, in the Chebyshev basis,

PN=span⁡{T0,T1,…,TN}.\mathbb{P}_{N} = \operatorname{span}\{T_{0}, T_{1}, \ldots, T_{N}\}.

The numerical solution uN∈PNu_{N} \in\mathbb{P}_{N} is defined by enforcing the governing PDE at the interior CGL collocation points and imposing the boundary conditions at boundary nodes. Once the nodal values {uN(xi,yj,zk)}i,j,k=0N\{u_{N}(x_i,y_j,z_k)\}_{i,j,k=0}^{N} are obtained, the discrete field is fully determined, since there exists a unique tensor-product polynomial in PN\mathbb{P}_{N} interpolating these values. Hence, evaluating the solution at additional points does not introduce any new discretization error, but merely re-evaluates the same discrete polynomial representation. This property enables a natural hierarchical refinement without re-solving the PDE. The nodal solution is first transformed into modal Chebyshev coefficients {Amnl}m,n,l=0N\{A_{mnl}\}_{m,n,l=0}^{N}, and the resulting representation is embedded into a richer space with Nf+1N_f+1 nodes per coordinate direction,

PNf:=PNf⊗PNf⊗PNf,Nf>N,(47)\mathbb{P}_{N_f} := \mathbb{P}_{N_f} \otimes\mathbb{P}_{N_f} \otimes\mathbb{P}_{N_f}, \qquad N_f > N, \tag*{(47)}

by zero-padding the coefficient array:

Amnl(f)={Amnl,0≤m,n,l≤N,0,otherwise.A_{mnl}^{(f)} = \begin{cases} A_{mnl}, & 0 \le m,n,l \le N,\\ 0, & \text{otherwise}. \end{cases}

Therefore, the refinement is not a new approximation of the PDE solution but an exact prolongation of the already computed spectral approximation into a higher-resolution sampling. This is particularly effective in Chebyshev spaces, whose basis functions form a rich and highly expressive approximation family for smooth solutions, with fast modal decay and spectral accuracy.

Finally, since the linear systems arising at each refinement level are solved iteratively, the solution on the refined grid is used as the initial guess u(0)u^{(0)} for the solver. In practice, the interpolated field uNf(0)u_{N_f}^{(0)}, obtained by the DCT-based coefficient prolongation described above, is, usually, already very close to the discrete solution in PNf\mathbb{P}_{N_f} when the underlying solution is sufficiently smooth. As a result, only a small number of additional iterations is typically required to satisfy the prescribed stopping criterion. This substantially accelerates the solution process across refinement levels and, in many cases, makes it possible to converge reliably even though Chebyshev collocation operators become increasingly ill-conditioned as NfN_f grows, without the need for explicit preconditioning. Moreover, because the prolongation is implemented through forward/inverse DCTs and zero-padding, its computational cost is negligible compared with the cost of the iterative solve, so the overall refinement strategy remains highly efficient.

An additional practical consequence of this hierarchical spectral refinement is that it allows us to assess the convergence of the problem, providing a stopping criterion for the refinement. Once NN is sufficiently large, it may become unnecessary to compute further Chebyshev modes by explicitly resolving the problem on a finer grid. Indeed, when the coarse-grid approximation has already entered the asymptotic spectral-convergence regime, the higher-order coefficients neglected at level NN carry negligible energy, and the prolongated field obtained by modal zero-padding provides, up to the prescribed tolerance, essentially the same discrete solution that would be recovered after a new Krylov solve on the refined grid. In practice, this situation can be identified by monitoring the relative variation of a suitable discrete norm, namely

eref(Nf)=∥UNf−UN→Nf∥2∥UNf∥2,(48)e_{\mathrm{ref}}^{(N_f)} = \frac{\left\lVert U_{N_f} - U_{N\to N_f}\right\rVert_2}{\left\lVert U_{N_f}\right\rVert_2}, \tag*{(48)}

where UNU_N denotes the discrete solution on the current grid and UNfU_{N_f} its prolongation onto the finer grid. When this criterion is satisfied, the approximation may be regarded as numerically converged with respect to further hierarchical refinement, and additional iterative solves on finer meshes become unnecessary. The refinement step then reduces to a purely spectral interpolation procedure, which preserves the already computed solution at negligible cost while avoiding the increasingly ill-conditioned Krylov solves associated with very fine Chebyshev collocation grids.

The procedure of hierarchical refinement is implemented using Algorithm 4

Algorithm 4 Hierarchical spectral refinement for the linear collocation solver
1: function HierarchicalRefinement($N_0$, $N_f$, bcs, $f$, coeffs, $L_x$, $L_y$, tol, $u_0$)
2:     $u \leftarrow$ LinearCollocationSolver($N_0$, bcs, $f$, coeffs, $L_x$, $L_y$, $u_0$)
3:     $u_{N_f}^{(0)} \leftarrow$ ChebyshevProlongation($u$, $N_f$) ▷ DCT to modal space, zero-padding, inverse DCT
4:     $\varepsilon \leftarrow \dfrac{\left\lVert u_{N_f}^{(0)}-u\right\rVert}{\left\lVert u\right\rVert}$
5:     $u \leftarrow$ LinearCollocationSolver($N_{\mathrm{next}}$, bcs, $f$, coeffs, $L_x$, $L_y$, $u_{N_f}^{(0)}$)
6:     return $u,\varepsilon$
7: end function

Results

A set of four problems is solved to assess the accuracy, convergence, and efficiency of the matrix-free FFT-based Chebyshev solver proposed. The algorithms 1-4 are programmed in python using scipy FFT algorithm and LGMRES solver. The relative and absolute errors for the LGMRES used in all the calculations are rtol = 10−610^{-6} and atol = 10−810^{-8}, respectively. All simulations are computed in the same Macbook Pro M2 2022 laptop, and computational times refer to this setting.

1D Poisson problem: comparison with sine–cosine-based solvers

In this first section, we will use the method developed to solve a one-dimensional Poisson problem with an analytical solution and Dirichlet boundary conditions. The numerical solution for different discretization levels will be compared with the analytical one and the solution provided by sine–cosine transform (DCT/DST)-based methods.

Sine–cosine transform solver.

The sine–cosine transform framework used in [14, 15, 22, 16, 17], among other works, provides an efficient FFT-based strategy to solve transient and stationary diffusion problems on rectangular domains with non-periodic boundary conditions. The main idea is to choose, in each coordinate direction, a trigonometric basis whose symmetry is compatible with the prescribed boundary condition. Dirichlet conditions are naturally associated with sine expansions, while Neumann conditions are associated with cosine expansions. Mixed boundary conditions are handled by using the corresponding half-range sine or cosine transforms.

In this setting, the boundary conditions are embedded directly into the approximation space. Therefore, for homogeneous boundary data, the transformed unknown automatically satisfies the boundary conditions, and no additional boundary equations are required. For non-homogeneous data, one first subtracts a suitable lifting of the boundary values so that the remaining auxiliary problem has homogeneous boundary conditions and can be solved in the same space.

For example, Dirichlet–Dirichlet, Neumann–Neumann, Dirichlet–Neumann, and Neumann–Dirichlet boundary conditions are associated, respectively, with DST-I, DCT-I, DST-III, and DCT-III transforms. Once the appropriate transform has been selected in each coordinate direction, the Laplacian becomes diagonal in modal space. Thus, the solution procedure consists of three steps: applying a forward sine–cosine transform to the right-hand side, solving independent scalar equations for the modal coefficients, and applying the inverse transform. When fast sine and cosine transforms are used, the resulting computational cost is O(Nlog⁡N)O(N \log N).

Accuracy and convergence

To illustrate the behavior of the Chebyshev solver proposed in a simple setting and compare it with the result provided using DCT-DST methods, we consider the one-dimensional boundary-value problem

d2udx2=e4x,x∈[−1,1],(49)\frac{d^2u}{dx^2}=e^{4x}, \qquad x \in[-1,1], \tag*{(49)}

with homogeneous Dirichlet boundary conditions

u(−1)=0,u(1)=0.(50)u(-1)=0,\qquad u(1)=0. \tag*{(50)}

The exact solution of this problem is

u(x)=exp⁡(4x)−sinh⁡(4)x−cosh⁡(4)16.(51)u(x)=\frac{\exp(4x)-\sinh(4)x-\cosh(4)}{16}. \tag*{(51)}

For this problem, the Dirichlet conditions at both endpoints lead to a DST-I discretization. If xjx_j, j=1,…,N−2j=1,\ldots,N-2, denote the interior grid points, the numerical solution is represented as a finite sine expansion,

uN(xj)=∑k=1N−2u^ksin⁡(kπ(xj+1)2).(52)u_N(x_j)=\sum_{k=1}^{N-2}\widehat{u}_k\sin\left(\frac{k\pi(x_j+1)}{2}\right). \tag*{(52)}

Since

d2dx2sin⁡(kπ(x+1)2)=−(kπ2)2sin⁡(kπ(x+1)2),(53)\frac{d^2}{dx^2}\sin\left(\frac{k\pi(x+1)}{2}\right)=-\left(\frac{k\pi}{2}\right)^2\sin\left(\frac{k\pi(x+1)}{2}\right), \tag*{(53)}

the modal coefficients are obtained directly from

u^k=−f^k(kπ/2)2,k=1,…,N−2,(54)\widehat{u}_k=-\frac{\widehat{f}_k}{(k\pi/2)^2},\qquad k=1,\ldots,N-2, \tag*{(54)}

where f^k\widehat{f}_k are the DST-I coefficients of the right-hand side evaluated at the interior points. The numerical solution is then recovered by applying the inverse DST-I.

Next, the problem is solved using the Chebyshev method developed, utilizing an increasing discretization ranging from N=4N = 4 to N=128N = 128. Figure 2(a) shows the numerical solution for N=5N = 5 together with the convergence of the maximum error. The DST-I method enforces the homogeneous Dirichlet boundary conditions exactly, since all sine basis functions vanish at x=−1x = -1 and x=1x = 1. However, the accuracy is governed not only by the boundary values but also by the smoothness of the corresponding sine expansion. Chebyshev polynomial expansions constitute a suitable high-order approximation space for regular solution fields. Their global polynomial structure, together with their CNC^N-regularity, allows the dominant features of smooth solutions to be represented with a relatively small number of modes. Moreover, once the expansion is truncated, the resulting approximation space is finite-dimensional; hence, bounded families in this space exhibit compactness properties under the usual norms are employed for the solution functions. This provides a stable setting for constructing convergent modal approximations. The geometric convergence estimate follows from the classical theory of Chebyshev approximation for analytic functions; see [23 Theorem 8.2]

Figure 2. One dimensional Poisson problem: Comparison between the sine-transform approximation and the reference solution. (a) Numerical solution for N=6N = 6. (b) Maximum error ∥u−uh∥∞\lVert u-u_h\rVert_\infty as a function of the maximum series order.

∥u−uNCh∥∞≤Cρ−N,ρ>1.(55)\lVert u-u_N^{Ch}\rVert_\infty\leq C\rho^{-N}, \qquad\rho> 1. \tag*{(55)}

By contrast, sine and cosine expansions provide exponential convergence only when the corresponding odd, even, or periodic extension of the solution remains sufficiently smooth. If the boundary values or higher derivatives are not compatible with such an extension, the coefficients decay only algebraically, leading to estimates of the form

∥u−uNS∥≤CN−m.(56)\lVert u-u_N^S\rVert\leq CN^{-m}. \tag*{(56)}

Thus, for non-periodic smooth solutions on bounded intervals, Chebyshev polynomial spaces may represent the solution more efficiently than sine–cosine spaces with the same number of modes, because their convergence is governed by the intrinsic regularity of the solution on the interval rather than by the regularity of an induced periodic extension. To illustrate this convergence behavior, the differences between the results obtained with the Chebyshev and DST methods and the analytical solution are shown in Figure 2(b). It can be observed that the error decay in the Chebyshev approximation is exponential, reaching machine precision when using around 64 terms. In contrast, the DST approximation decay is algebraic, and for the same refinement level, the error provided by the two approximations differs by 12 orders of magnitude. Regarding the Chebyshev solution, it should be noted that once machine precision is reached, adding more terms becomes useless.

3D-Diffusion problem

The next case analyzed is a three-dimensional Poisson problem on a unit cube Ω=(0,1)3\Omega= (0,1)^3. The objective of this example is to assess the performance of the matrix-free Chebyshev collocation solver with fine 3D discretization and under mixed Dirichlet–Neumann boundary conditions. In order to evaluate the accuracy of the response, the proposed problem will be obtained by the method of manufactured solutions. The starting point is an analytical expression of a function in the domain,

uexact(x)=ex+y+z+x2+2y−z2.(57)u_{\mathrm{exact}}(\mathbf{x}) = e^{x+y+z} + x^2 + 2y - z^2. \tag*{(57)}

The Laplacian of the select function is Δuexact=3ex+y+z\Delta u_{\mathrm{exact}} = 3e^{x+y+z}, which will be used as a source term in the Poisson equation. Finally, the boundary conditions on the six faces of the unit cube (named as Γ\Gamma underscored with its corresponding plane) are taken as the local value of the function on the surface points uexactu_{\mathrm{exact}} in the case of Dirichlet, or its gradient projected by the exterior normal in the case of Neumann. The Poisson equation to be solved, including boundary conditions, reads

Find u∈Ω∥Δu=3ex+y+z,withu=ey+z+2y−z2,on Γx=0,u=e1+y+z+1+2y−z2,on Γx=1,∇u⋅n=−(ex+z+2),on Γy=0,∇u⋅n=ex+1+z+2,on Γy=1,u=ex+y+x2+2y,on Γz=0,∇u⋅n=ex+y+1−2,on Γz=1.(58)\begin{aligned} \text{Find } \mathbf{u} \in\Omega\quad&\Vert\quad\Delta u = 3e^{x+y+z}, \quad\text{with} \\ u &= e^{y+z} + 2y - z^2, &&\text{on } \Gamma_{x=0},\\ u &= e^{1+y+z} + 1 + 2y - z^2, &&\text{on } \Gamma_{x=1},\\ \nabla u \cdot n &= -(e^{x+z}+2), &&\text{on } \Gamma_{y=0},\\ \nabla u \cdot n &= e^{x+1+z}+2, &&\text{on } \Gamma_{y=1},\\ u &= e^{x+y} + x^2 + 2y, &&\text{on } \Gamma_{z=0},\\ \nabla u \cdot n &= e^{x+y+1}-2, &&\text{on } \Gamma_{z=1}. \tag*{(58)} \end{aligned}

In this problem, the function in Eq. (57) fulfills exactly the differential equation and boundary conditions in Eqs. (58).

The Laplace operator is replaced by the discrete differentiation associated with this problem,

Δ(⋅)≈[Cx2(⋅)+Cy2(⋅)+Cz2(⋅)],(59)\Delta(\cdot) \approx\left[C_x^2(\cdot) + C_y^2(\cdot) + C_z^2(\cdot)\right], \tag*{(59)}

where the directional Chebyshev differentiation operators are defined in Eq. (37) and applied in matrix-free form as described in Algorithm 1. Boundary conditions are imposed through the elimination procedure introduced in Section 2.4.1, and the resulting reduced linear system is solved with LGMRES. The numerical results obtained in the mid plane are represented in Figure 3 for two different refinement levels, N=4N = 4 and N=256N = 256. It can be shown that, for this relatively smooth problem, the solution obtained by including only 5 terms in the matrix-free Chebyshev approach is qualitatively identical to the one obtained in a highly refined case.

Figure 3. Three dimensional diffusion problem: Numerical solution on the mid-plane z=0.5z = 0.5, comparing (a) low-order and (b) refined Chebyshev collocation approximations.

To assess the accuracy of the solutions, the local relative error of the numerical solution uNu_N with respect to the exact one uu is obtained as

err⁡(x)=∣u−uN∣u(60)\operatorname{err}(\mathbf{x}) = \frac{\lvert u-u_N\rvert}{u} \tag*{(60)}

and its value is represented in Figure 4(a) for the same mid-plane, showing values below 10−1010^{-10} for N=256N = 256. This result illustrates the high accuracy of the proposed method. The maximum local error in the full domain with respect to the exact solution is represented in Figure 4(b), showing its decay to values below 10−910^{-9} for only N=8N = 8. After that order, the error does not further decrease and is constrained by the tolerance used in the LGMRES solver. To further analyze the effect of the hierarchical refinement, a refinement error is defined as the difference between the prolonged solution and the one obtained in the finer mesh as

Figure 4. Three dimensional diffusion problem: (a) Error map for N=256N = 256 on the mid plane with respect analytical solution. (b) Maximum error, refinement error and computational time required as function of the Chebyshev polynomial order.

err⁡ref=max⁡∥uN−uNprev∥2∥uN∥2,(61)\operatorname{err}_{\mathrm{ref}} = \max\frac{\lVert u_N-u_{N_{\mathrm{prev}}}\rVert_2}{\lVert u_N\rVert_2}, \tag*{(61)}

and its evolution with the polynomial degree is also represented in Figure 4(b). It can be seen that the refinement error decreases with NN (smaller corrections with respect the lower order solution), but when N=64N = 64 is reached the higher order solution does not change at all with respect to the extrapolated one. Finally, the efficiency of the method is analyzed by representing in Figure 4(b) the computational time as a function of the number of terms. The tendency observed for N>32N > 32 is a linear relation between log⁡t\log t and log⁡N\log N, with slope around 2.7. If the total number of degrees of freedom of the problem is n=N3n = N^3, the order of complexity of the FFT would provide Δt∝nlog⁡n=N3log⁡N3=3N3log⁡N\Delta t \propto n\log n = N^3\log N^3 = 3N^3\log N, and log⁡Δt∝3log⁡N\log\Delta t \propto3\log N, very similar to the slope achieved of 2.7. Therefore, it is quantitatively confirmed that the order of convergence achieved with the method is nlog⁡nn\log n, as in any other FFT based approach in homogenization. The number of LGMRES iterations in the hierarchical approach remained quite constant with N>16N > 16, only requiring one iteration for finer refinements.

The effect of the hierarchical refinement is further analyzed in Figure 5, where the computational time is represented as a function of NN for the method with and without the use of the hierarchical refinement strategy.

Figure 5. Three dimensional diffusion problem: Computational time required as a function of the polynomial order NN, with and without hierarchical refinement, using a relative tolerance of 10−610^{-6}.

It can be first observed that the rough method fails to converge for N>48N > 48, due to the increasing ill-conditioning of the Laplace operator with NN. In contrast, when the hierarchical refinement is introduced, problems with more than 20 million degrees of freedom (N=256N = 256) are solved without major issues. Moreover, the slope of the computational cost order also decreases with the introduction of hierarchical refinement, indicating a poor scaling of the cost without this technique. The results in Figure 5 highlight the practical relevance of the hierarchical refinement strategy. By using the prolonged solution from a coarser Chebyshev discretization as the initial guess at the next refinement level, the iterative solver starts from a field that already captures the dominant spectral content of the solution. This reduces the computational cost at high polynomial orders, where the conditioning of the collocation operator becomes increasingly demanding while preserving the accuracy of the refined discretization. The comparison therefore shows that hierarchical refinement is not only a post-processing interpolation tool but also an effective acceleration mechanism for matrix-free Chebyshev solvers.

3D-Diffusion problem with an spherical inclusion

Next, a typical homogenization problem is analyzed, since such problems constitute the core application of FFT-based solvers. We consider a diffusion problem in a domain with a position-dependent diffusion coefficient,

∇⋅(−k(x)∇u(x))=F(x),x∈Ω:=(0,1)3,(62)\nabla\cdot\left(-k(x)\nabla u(x)\right) = F(x), \qquad x \in\Omega:= (0,1)^3, \tag*{(62)}

supplemented with boundary conditions that satisfy planar symmetry with respect to the faces of the box,

u(0,y,z)=−gon Γx=0,(63)u(0,y,z) = -g \quad\text{on } \Gamma_{x=0}, \tag*{(63)}
u(1,y,z)=gon Γx=1,(64)u(1,y,z) = g \quad\text{on } \Gamma_{x=1}, \tag*{(64)}
∇u⋅n=0on Γ∖(Γx=0∪Γx=1).(65)\nabla u \cdot n = 0 \quad\text{on } \Gamma\setminus\left(\Gamma_{x=0} \cup\Gamma_{x=1}\right). \tag*{(65)}

Following the matrix-free Chebyshev collocation framework, the directional derivatives are approximated using the operators Cx(⋅)C_x(\cdot), Cy(⋅)C_y(\cdot), and Cz(⋅)C_z(\cdot). At the interior collocation nodes, (66) is discretized as

−[Cx(k,Cx(u))+Cy(k,Cy(u))+Cz(k,Cz(u))]=F,(66)-\left[C_x\left(k,C_x(u)\right) + C_y\left(k,C_y(u)\right) + C_z\left(k,C_z(u)\right)\right] = F, \tag*{(66)}

The heterogeneous domain considered here consists of a two-phase composite with a spherical inclusion of radius RR and conductivity kik_i, embedded in a matrix with conductivity kmk_m. The spatially varying diffusion coefficient is defined as

k(x)={ki,x∈Ωi,km,x∈Ω∖Ωi,kikm=10,(67)k(x) = \begin{cases} k_i, & x \in\Omega_i,\\ k_m, & x \in\Omega\setminus\Omega_i, \end{cases} \qquad\frac{k_i}{k_m} = 10, \tag*{(67)}

where Ωi\Omega_i denotes the inclusion region. Two inclusion configurations are considered: (i) a single inclusion centered in Ω\Omega, and (ii) four quarter-inclusions placed at the corners of Ω\Omega, both represented in Figure 6. The infinite periodic extension of the domain in the three coordinate directions implies specular symmetry across the six bounding planes. This geometrical symmetry, together with the symmetry of the boundary conditions, makes the solution identical to that obtained under periodic boundary conditions, thereby enabling comparison with standard FFT methods [5].

Figure 6. Diffusion with an spherical inclusion: Discretization comparison of the two-phase conductivity field on non-uniform CGL grids.

The two inclusion configurations provide a stringent test of resolution effects intrinsic to Chebyshev–Gauss–Lobatto (CGL) collocation. Although the coefficient field (67) represents the same two-phase medium in both cases, the inclusion representation differs in the two scenarios. CGL nodes are distributed non-uniformly and cluster near the domain boundaries, with the strongest clustering occurring at the grid corners. Consequently, a centered inclusion is predominantly sampled by the relatively coarser interior spacing, whereas corner quarter-inclusions are sampled with a locally finer nodal density. By comparing these two cases, we can assess whether a given CGL resolution provides consistent accuracy for heterogeneities located in the interior and near the corners, and to what extent the non-uniform node distribution affects the representation of sharp coefficient jumps and the resulting solution quality. Nevertheless, note that in a generic microstructure, the local spatial resolution will not be constant as in the case of a regular grid, and the effect of this uneven resolution will depend on the size of the voxels where the interfaces are located. Therefore, in some cases, the local resolution might increase with respect to the regular case, and in others, it might decrease. A conservative metric of the discretization level in a CGL grid with N+1N+1 points and length L=2L=2 can be the maximum distance between two consecutive points, reached at the center. This value is hCGL=cos⁡(πN(N2+1))h_{CGL}=\cos\left(\frac{\pi}{N}\left(\frac{N}{2}+1\right)\right), compared to hregular=2Nh_{regular}=\frac{2}{N}. For a sufficiently large number of points, hCGL=π4hregular≈0.785hregularh_{CGL}=\frac{\pi}{4}h_{regular}\approx0.785h_{regular}, the reduction of the voxel size in the worst position is small.

The problem (62)–(65) is solved for different discretization levels, using the Chebyshev method proposed and a standard FFT-based solver (DBFFT approach [24] in the code FFTMAD [25]) on a periodic extension of the unit cell. The value of the field uu along the red line depicted in Figure 6, obtained with the Chebyshev solver and the two particle locations, is represented in Figure 7 together with the FFT solution for three different discretizations. It can be observed that for very coarse discretization, the location of the sphere influences the local result, and the corner-inclusion case is closer to the FFT profile than the centered-inclusion case, which is consistent with the stronger clustering of CGL nodes near the domain boundaries. However, when the discretization becomes sufficiently fine, the three results become superposed. In this case, using N=64N=64 provides an accurate response for the Chebyshev approach.

Figure 7. Diffusion with an spherical inclusion: Comparison of uu over the dashed red lines of Figure 6 for three final collocation resolutions, Nf=16N_f = 16, 32, and 64. and corresponding classical FFT solution

The resulting thermal-flux in the central plane obtained with the proposed Chebyshev collocation solver and the FFT-based reference solution is represented in Figure 8 for the discretization N=128N = 128. The main differences arise from the distinct discretization strategies used by both methods, which makes the representation of the material interface and the associated numerical oscillations not identical. Despite these local differences, both approaches provide very similar flux distributions, reproducing the same symmetry, localization of the extrema, and overall field pattern around the inclusion. This agreement confirms that the proposed Chebyshev solver captures the dominant response of the heterogeneous diffusion problem while retaining a discretization structure different from that of the FFT reference.

Thermal-flux field for the heterogeneous inclusion problem: comparison between the Chebyshev collocation solver and the FFT-based reference solution for centered and corner inclusions

Figure 8. Thermal-flux field for the heterogeneous inclusion problem at (N=128N=128): comparison between the Chebyshev collocation solver and the FFT-based reference solution for centered and corner inclusions.

To further assess the robustness of the proposed matrix-free Chebyshev solver on heterogeneous problems, a study of the influence of the phase-property contrast is carried out. In this test, the phase contrast is varied over several orders of magnitude, with ki/km∈[10−4,104]k_i/k_m \in[10^{-4}, 10^4], while keeping the geometrical configuration fixed. For each contrast value, the performance of the LGMRES iterative solver is quantified through the number of iterations required to reach the prescribed tolerance. In addition, the homogenized conductivity obtained from the numerical solution is compared with the Maxwell estimation for the dilute limit [26, 27]. The effective conductivity predicted by the Maxwell estimate is

KeffMaxwell=Km2km+ki+2ϕ(ki−km)2km+ki−ϕ(ki−km).(68)K_{\mathrm{eff}}^{\mathrm{Maxwell}} = K_m \frac{2k_m + k_i + 2\phi\left(k_i-k_m\right)}{2k_m + k_i - \phi\left(k_i-k_m\right)}. \tag*{(68)}

where ϕ\phi is the inclusion volume fraction. The numerical effective conductivity is obtained from the volume-averaged heat flux as

Knum=−⟨qy⟩ΩG,⟨qy⟩Ω=1∣Ω∣∫Ω−k(x)∂u∂y dΩ,(69)K_{\mathrm{num}} = -\frac{\langle q_y\rangle_{\Omega}}{G}, \qquad\langle q_y\rangle_{\Omega} = \frac{1}{|\Omega|}\int_{\Omega} -k(\mathbf{x})\frac{\partial u}{\partial y}\,\mathrm{d}\Omega, \tag*{(69)}

where GG is the imposed macroscopic temperature gradient. For the boundary conditions used in Eq. (63), this gradient is G=2ϑLyG = \frac{2\vartheta}{L_y}. The relative error in the effective conductivity is then computed as

e(Keff)=∣Knum−KeffMaxwell∣∣KeffMaxwell∣.(70)e(K_{\mathrm{eff}}) = \frac{\left|K_{\mathrm{num}}-K_{\mathrm{eff}}^{\mathrm{Maxwell}}\right|}{\left|K_{\mathrm{eff}}^{\mathrm{Maxwell}}\right|}. \tag*{(70)}

Figure 9. Influence of phase contrast on the iterative convergence and homogenized response of the heterogeneous diffusion problem.

Fig. 9(a) reports the effect of the phase-contrast of the proposed matrix-free Chebyshev solver on its numerical efficiency for a volume fraction ϕ≈0.03351\phi\approx0.03351. The results show that the number of LGMRES iterations increases with the phase contrast, as it does in all the different schemes proposed for FFT-based homogenization [28]. The convergence deteriorates more when conductivity increases, but the method is able to converge for a wide range of contrasts, making it as versatile as general FFT-based approaches while allowing the use of totally general BCs. Regarding the effective conductivity obtained, the model reproduces the Maxwell estimate with differences below 10−310^{-3} for most of the contrast range. This difference with the Maxwell estimate is reasonable due to the non-dilute character and the regular arrangement of particles in our numerical problem. For very low conductivities, the numerical solution becomes nearly invariant, showing convergence to the case of a hollow sphere. For high conductivities, the solution has slightly more variations but also reaches a relatively constant solution, the infinitely conducting inclusion.

3D Nonlinear thermal equilibrium problem

As a final demonstration, a nonlinear problem of thermal equilibrium will be solved using the Chebyshev technique proposed. As in previous sections, an exact analytical solution is constructed in order to assess the accuracy and convergence of the numerical solutions obtained with the method developed. In nonlinear heat-conduction problems, the exact temperature field depends explicitly on the constitutive relation adopted for the thermal conductivity; therefore, the manufactured solution must be constructed consistently with the selected nonlinear law.

We consider a nonlinear three-dimensional thermal equilibrium boundary value problem posed on the unit cube Ω=(0,1)3\Omega=(0,1)^3 and governed by

∇⋅(−k(T)∇T)=fin Ω.(71)\nabla\cdot\left(-k(T)\nabla T\right)=f \qquad\text{in }\Omega. \tag*{(71)}

All quantities in this manufactured problem are written in nondimensional form. Accordingly, TT denotes a dimensionless temperature, k(T)k(T) denotes the corresponding normalized thermal conductivity, and ff represents a dimensionless source term. The thermal conductivity is assumed to depend on the temperature according to the normalized reciprocal law

k(T)=11+αT,α=0.5.(72)k(T)=\frac{1}{1+\alpha T}, \qquad\alpha=0.5. \tag*{(72)}

This expression is not intended to represent a universal material law for metals, but rather a simple admissible nonlinear constitutive relation suitable for verification purposes. Such a monotonic decrease in effective conductivity is consistent with the qualitative behavior observed in several metallic materials over moderate temperature ranges, where increased scattering at higher temperatures reduces the heat-conduction capacity.

To generate a manufactured solution of the nonlinear problem in Eq. (71), the first step is to define a sufficiently smooth function Φ\Phi. Then, it can be proven that the temperature field

T(x)=exp⁡(αΦ(x))−1α,(73)T(\mathbf{x})=\frac{\exp\left(\alpha\Phi(\mathbf{x})\right)-1}{\alpha}, \tag*{(73)}

and the source term f=−ΔΦf=-\Delta\Phi fulfill Eq. (71). As in previous examples, the boundary conditions are set based on the values of TT and k(T)∇T⋅nk(T)\nabla T\cdot\mathbf{n} on the surfaces. In this example, we have selected

Φ(x)=sin⁡(πx)sin⁡(πy)sin⁡(πz),f=−ΔΦ=3π2sin⁡(πx)sin⁡(πy)sin⁡(πz).(74)\Phi(\mathbf{x})=\sin(\pi x)\sin(\pi y)\sin(\pi z), \qquad f=-\Delta\Phi=3\pi^2\sin(\pi x)\sin(\pi y)\sin(\pi z). \tag*{(74)}

Mixed boundary conditions are imposed consistently with the exact solution. Dirichlet data are prescribed on Γx=0\Gamma_{x=0} and Γy=0\Gamma_{y=0} by evaluating the manufactured solution on the corresponding boundary faces

T(0,y,z)=exp⁡(αΦ(0,y,z))−1α=0,on Γx=0,T(x,0,z)=exp⁡(αΦ(x,0,z))−1α=0,on Γy=0.(75)\begin{aligned} T(0,y,z)&=\frac{\exp\left(\alpha\Phi(0,y,z)\right)-1}{\alpha}=0,\qquad&&\text{on }\Gamma_{x=0},\\ T(x,0,z)&=\frac{\exp\left(\alpha\Phi(x,0,z)\right)-1}{\alpha}=0,\qquad&&\text{on }\Gamma_{y=0}. \tag*{(75)} \end{aligned}

On the remaining boundary faces, Neumann conditions are imposed in terms of the nondimensional heat flux,

qN=−k(T)∇T⋅n=−∇Φ⋅n(76)q_N=-k(T)\nabla T\cdot\mathbf{n}=-\nabla\Phi\cdot\mathbf{n} \tag*{(76)}

where n\mathbf{n} denotes the outward unit normal. Thus, the prescribed Neumann boundary conditions are

qN=−Φx(1,y,z)on Γx=1,qN=−Φy(x,1,z)on Γy=1,qN=−Φz(x,y,0)on Γz=0,qN=−Φz(x,y,1)on Γz=1.(77)\begin{aligned} q_N&=-\Phi_x(1,y,z) &&\text{on }\Gamma_{x=1},\\ q_N&=-\Phi_y(x,1,z) &&\text{on }\Gamma_{y=1},\\ q_N&=\phantom{-}\Phi_z(x,y,0) &&\text{on }\Gamma_{z=0},\\ q_N&=-\Phi_z(x,y,1) &&\text{on }\Gamma_{z=1}. \tag*{(77)} \end{aligned}

With these choices, the temperature field in Eq. (73) satisfies all the equations of the nonlinear boundary value problem. The nonlinear PDE is solved by Newton’s method. Let R(T)R(T) be the residual function,

R(T)=∇⋅(−k(T)∇T)−f.(78)R(T) = \nabla\cdot\left(-k(T)\nabla T\right) - f. \tag*{(78)}

The residual is linearized at iteration mm, corresponding to a field TmT^{m}, as

R(Tm+δT)≈R(Tm)+J(Tm)δT.(79)R\left(T^{m}+\delta T\right) \approx R\left(T^{m}\right) + J\left(T^{m}\right)\delta T. \tag*{(79)}

Forcing the residual to be zero results in the linear equation

J(Tm)δT=−R(Tm),andTm+1=Tm+δT(80)J\left(T^{m}\right)\delta T = -R\left(T^{m}\right), \quad\text{and} \quad T^{m+1}=T^{m}+\delta T \tag*{(80)}

where the action of the Jacobian over the correction δT\delta T is

J(Tm)δT=∇⋅(−k(Tm)∇δT−k′(Tm)δT∇Tm).(81)J\left(T^{m}\right)\delta T = \nabla\cdot\left(-k\left(T^{m}\right)\nabla\delta T-k'\left(T^{m}\right)\delta T\nabla T^{m}\right). \tag*{(81)}

The nonlinear PDE resulting from each Newton increment is solved using the Chebyshev approach, following Algorithm 2 with hierarchical refinement. The dimensionless temperature resulting from two different discretization levels is represented in Figure 10. From a qualitative viewpoint, the results for

Figure 10. Non linear thermal equilibrium: Numerical solution of the nonlinear heat-conduction problem on the mid-plane z=0.5z = 0.5, comparing low-order and refined Chebyshev collocation approximations for N=4N = 4 and N=128N = 128.

both both number of polynomial terms and indistinguishable. To assess the validity of the solution, the local error (Eq. (60)) with respect to the analytical solution has been computed for every CGL point and represented in Figure 10 for N=256N=256. It is observed that the error is below 10−910^{-9} at every point again; this accuracy is dictated by the tolerances chosen in the LGMRES. The maximum local error and refinement error (Eq. (61)) are represented on the right side of Figure 11. The conclusions from this graph are the same as for the linear case; the error decays very fast, and a stationary value around 10−910^{-9} is reached from 32 polynomial terms. After that polynomial order, the solution does not improve with respect to the analytical response because the tolerance of the LGMRES is reached. The refinement error, which shows the improvement in the solution by increasing the polynomial order, decays with NN. The evolution of this metric indicates that the improvement of the solution through the introduction of higher order terms is observed for all entire range of NN.

Figure 11. Non linear thermal equilibrium: Error distribution and refinement history for the heat-conduction problem, showing the maximum error with respect analytical solution, the hierarchical refinement indicator, and the computational time as the polynomial order increases.

Finally, regarding the computational cost, the right side of Figure 11 shows the time spent solving the problem with a different number of terms NN. The double logarithm diagram has a linear tendency with a slope of 2.98, coinciding almost exactly with the a slope of 3 expected for a scaling depending on the FFT. Therefore, it is quantitatively confirmed that the order of convergence achieved with the method, even in nonlinear cases, is nlog⁡nn \log n.

To further analyze the numerical performance of the proposed method, Table 1 presents the number of Newton iterations, LGMRES iterations, errors, and computational time for the different number of polynomial terms NN.

NNNewton it.LGMRES it. totalLGMRES it. per Newton∥T−Texact∥∞\lVert T-T_{\mathrm{exact}}\rVert_{\infty}ehierrefe_{\mathrm{hier}}^{\mathrm{ref}}Time [s]
448[2, 2, 2, 2]7.352339⋅10−27.352339 \cdot10^{-2}–0.035
8310[4, 3, 3]4.903119⋅10−44.903119 \cdot10^{-4}1.074604⋅10−11.074604 \cdot10^{-1}0.114
16213[7, 6]6.270730⋅10−96.270730 \cdot10^{-9}4.803893⋅10−44.803893 \cdot10^{-4}0.873
3215[5]1.272603⋅10−91.272603 \cdot10^{-9}7.084755⋅10−97.084755 \cdot10^{-9}2.008
64120[20]8.182031⋅10−108.182031 \cdot10^{-10}8.012567⋅10−108.012567 \cdot10^{-10}47.908
128150[?]7.737196⋅10−107.737196 \cdot10^{-10}8.682506⋅10−118.682506 \cdot10^{-11}557.870
256150[?]7.734714⋅10−107.734714 \cdot10^{-10}5.702445⋅10−135.702445 \cdot10^{-13}5245.951

Table 1. Hierarchical refinement results for the manufactured nonlinear heat-conduction problem using the matrix-free Chebyshev collocation solver and Newton–LGMRES iterations. The table reports the Newton iterations, the total number of LGMRES iterations, the LGMRES iterations per Newton step, the error with respect to the exact temperature field, the hierarchical refinement indicator, and the computational time.

It can be observed that the hierarchical refinement has a dual effect on the performance of the nonlinear problem. On one hand, using a prolonged initial field from an already converged solution at a lower order reduces the number of Newton iterations. Therefore, Newton operates only up to N=16N = 16, and for higher order, the initial solution is so close to the solution that solving the linearized problem provides the final result. On the other hand, the hierarchical refinement allows the convergence of linear problems with high polynomial orders that would fail to converge without the initial solution. Finally, the time column shows, by taking logarithms, that the log⁡Δt−log⁡N\log\Delta t - \log N slope is 3, confirming the FFT convergence order for the whole nonlinear PDE solver.

Conclusions

In this work, we present a novel approach for extending FFT-enabled spectral solvers to boundary-value problems with fully general, non-periodic boundary conditions, which is based on Chebyshev-based spectral collocation. The proposed method combines Chebyshev polynomial approximations with FFT-based differentiation operators, leading to a matrix-free implementation of the discrete differential operator at the Chebyshev–Gauss–Lobatto points. The resulting linear systems are solved using LGMRES, and to improve robustness and enable the solution of very large problems, a hierarchical refinement strategy based on modal prolongation has also been introduced. The method is also extended to efficiently solve problems with non-linear constitutive equations.

A series of numerical examples is proposed and shows that the method delivers high-fidelity solutions for diffusion, heat-transfer, and related boundary-value problems. In the case of smooth solutions, the method converges to the analytical solution very quickly with the number of polynomial terms. It is shown that the hierarchical refinement strategy constitutes an effective remedy for the ill-conditioning that typically accompanies high-order Chebyshev discretizations.

The proposed methodology is also able to solve typical problems in homogenization with heterogeneous properties, extended to general boundary conditions and showing similar accuracy and performance to classical FFT homogenization approaches in periodic cases.

Taken together, these results support the proposed approach as a flexible, efficient, and practically scalable spectral methodology with strong potential for the simulation of boundary value problems requiring accurate treatment of non-periodic boundaries.

Acknowledgments

Javier Segurado acknowledges "Ministerio de Ciencia, Innovación y Universidades" for the project WinPro (Wave Inverse Problems in Heterogeneous media, PID2023-1500750B-I00)

References

  1. [1]L. N. Trefethen, Spectral Methods in Matlab. SIAM, 2000.DOI
  2. [2]J. P. Boyd, Chebyshev and Fourier Spectral Methods. Dover, 2 ed., 2001.
  3. [3]C. Canuto, M. Y. Hussaini, A. Quarteroni, and T. A. Zang, Spectral Methods: Fundamentals in Single Domains. Springer, 2007.DOI
  4. [4]J. Shen, T. Tang, and L.-L. Wang, Spectral Methods: Algorithms, Analysis and Applications. Springer, 2011.DOI
  5. [5]H. Moulinec and P. Suquet, “A fast numerical method for computing the linear and nonlinear mechanical properties of composites,” Comptes Rendus de l’Académie des Sciences, Série II, vol. 318, pp. 1417–1423, 1994.
  6. [6]H. Moulinec and P. Suquet, “A numerical method for computing the overall response of nonlinear composites with complex microstructure,” Computer Methods in Applied Mechanics and Engineering, vol. 157, no. 1–2, pp. 69–94, 1998.DOI
  7. [7]P. Suquet, “A computational scheme for linear and non-linear composites with arbitrary phase contrast,” International Journal for Numerical Methods in Engineering, vol. 52, no. 1–2, pp. 283–301, 2001.DOI
  8. [8]J. Vondřejc, J. Zeman, and I. Marek, “An fft-based galerkin method for homogenization of periodic media,” Computers & Mathematics with Applications, vol. 68, no. 3, pp. 156–173, 2014.DOI
  9. [9]L. Gélébart, “A modified FFT-based solver for the mechanical simulation of heterogeneous materials with Dirichlet boundary conditions,” Comptes Rendus. Mécanique, vol. 348, no. 8-9, pp. 693–704, 2020.DOI
  10. [10]M. Zecevic and R. A. Lebensohn, “Extended fft-based micromechanical formulation to consider general non-periodic boundary conditions,” International Journal of Solids and Structures, vol. 311, p. 113225, 2025.DOI
  11. [11]R. Sancho, V. Rey-de Pedraza, P. Lafourcade, R. A. Lebensohn, and J. Segurado, “An implicit fft-based method for wave propagation in elastic heterogeneous media,” Computer Methods in Applied Mechanics and Engineering, vol. 404, p. 115772, 2023.
  12. [12]G. Zarzoso, E. Roque, F. Montero-Chacón, and J. Segurado, “An fft based chemo-mechanical framework with fracture: Application to mesoscopic electrode degradation,” Mechanics of Materials, vol. 201, p. 105211, 2025.arxiv.org/abs/2411.16583
  13. [13]V. Buryachenko, “New rve concept in thermoelasticity of periodic composites subjected to compact support loading,” International Journal for Multiscale Computational Engineering, 2025.
  14. [14]L. Gélébart, “FFT-based simulations of heterogeneous conducting materials with combined non-uniform Neumann, periodic and Dirichlet boundary conditions,” European Journal of Mechanics - A/Solids, vol. 105, p. 105248, 2024.DOI
  15. [15]J. Paux, L. Morin, and L. Gélébart, “A Discrete Sine-Cosine Transforms Galerkin Method for the Conductivity of Heterogeneous Materials with Mixed Dirichlet/Neumann Boundary Conditions,” International Journal for Numerical Methods in Engineering, vol. 126, no. 1, p. e7615, 2025.DOI
  16. [16]L. Risthaus and M. Schneider, “Imposing different boundary conditions for thermal computational homogenization problems with FFT- and tensor-train-based Green’s operator methods,” International Journal for Numerical Methods in Engineering, vol. 125, no. 7, p. e7423, 2024.DOI
  17. [17]L. Risthaus and M. Schneider, “Imposing Dirichlet boundary conditions directly for FFT-based computational micromechanics,” Computational Mechanics, vol. 74, no. 5, pp. 1089–1113, 2024.DOI
  18. [18]J. Paux, L. Morin, L. Gélébart, and A. M. A. Sanoko, “A discrete sine–cosine based method for the elasticity of heterogeneous materials with arbitrary boundary conditions,” Computer Methods in Applied Mechanics and Engineering, vol. 433, p. 117488, 2025.DOI
  19. [19]J. Hoepffner, “Implementation of boundary conditions,” tech. rep., Université de Provence, 2007. Technical report.
  20. [20]P. Komarov, “Spectral derivatives,” 2024.arxiv.org/abs/2506.06210
  21. [21]SciPy Developers, scipy.fftpack.dct — SciPy v1.11.0 Manual. SciPy, 2024. Online documentation.
  22. [22]A. M. A. Sanoko, S. Essongue, L. Gélébart, L. Lapostolle, L. Morin, and J. Paux, “A FFT-based numerical scheme for the transient conductivity of heterogeneous materials with non-periodic boundary conditions,” European Journal of Mechanics / A Solids, vol. 113, p. 105680, 2025.DOI
  23. [23]L. N. Trefethen, Approximation Theory and Approximation Practice. Philadelphia, PA: Society for Industrial and Applied Mathematics, 2013.
  24. [24]S. Lucarini and J. Segurado, “DBFFT: A displacement based fft approach for non-linear homogenization of the mechanical behavior,” International Journal of Engineering Science, vol. 144, p. 103131, 2019.DOI
  25. [25]S. Lucarini and J. Segurado, “On the accuracy of spectral solvers for micromechanics based fatigue modeling,” Computational Mechanics, vol. 63, p. 365–382, July 2018.DOI
  26. [26]J. C. Maxwell, A Treatise on Electricity and Magnetism. Oxford: Clarendon Press, 1873.
  27. [27]K. B. Kiradjiev, R. Anguelov, M. Vynnycky, and R. A. Van Gorder, “Maxwell-type models for the effective thermal conductivity of a porous material with radiative transfer in the pores,” International Journal of Thermal Sciences, 2019.arxiv.org/abs/1812.11696
  28. [28]S. Lucarini, M. V. Upadhyay, and J. Segurado, “FFT based approaches in micromechanics: fundamentals, methods and applications,” Modelling and Simulation in Materials Science and Engineering, vol. 30, no. 2, p. 023002, 2022.DOI

Paper details

vlnc:W_k5y9azkc
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 9

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Mathematics

Not recorded for this paper

View statement
Looking for related papers…
Contents