You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/matrix_free.md
+12-3Lines changed: 12 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -181,10 +181,16 @@ This transforms the Poisson equation $\frac{d^2 u(x)}{dx^2} = f(x)$ into an alge
181
181
-k^2 \hat{u}_k = \hat{f}_k.
182
182
```
183
183
184
-
By solving for $\hat{u}_k$ and applying the inverse FFT, we can recover the solution $u(x)$ efficiently.
184
+
By solving for $\hat{u}_k$ and applying the IFFT, we can recover the solution $u(x)$ efficiently.
185
185
186
-
The inverse FFT (IFFT) is used to convert data from the frequency domain back to the spatial domain.
187
-
Once the solution in frequency space is obtained by dividing the Fourier coefficients $\hat{f}_k$ by $-k^2$, the IFFT is applied to transform the result back to the original grid points in the spatial domain.
186
+
The inverse FFT is used to convert data from the frequency domain back to the spatial domain.
187
+
Once the solution in frequency space is obtained by dividing the Fourier coefficients $\hat{f}_k$ by $-k^2$,
188
+
the IFFT is applied to transform the result back to the original grid points in the spatial domain.
189
+
190
+
In some cases, even though the FFT provides an efficient way to apply differential operators (such as the Laplacian)
191
+
in the frequency domain, a direct solution may not be feasible due to complex boundary conditions,
192
+
variable coefficients, or grid irregularities.
193
+
In these situations, the FFT must be coupled with a Krylov method to iteratively solve the problem.
188
194
189
195
This example consists of solving the 1D Poisson equation on a periodic domain $[0, 4\pi]$:
190
196
@@ -195,6 +201,9 @@ This example consists of solving the 1D Poisson equation on a periodic domain $[
195
201
where $u(x)$ is the unknown solution, and $f(x)$ is the given source term.
196
202
We solve this equation using [FFTW.jl](https://github.com/JuliaMath/FFTW.jl) to compute the matrix-free action of the Laplacian within the conjugate gradient solver.
197
203
204
+
Note that while a direct FFT-based approach can be used here due to the simplicity of the periodic boundary conditions,
205
+
this example illustrates how a Krylov method can be employed to solve more challenging problems.
0 commit comments