Skip to content

Commit f092c24

Browse files
cosmetic fixes
1 parent 5d3498f commit f092c24

File tree

3 files changed

+18
-29
lines changed

3 files changed

+18
-29
lines changed

examples/nonlocaldiffusion.jl

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using FastTransforms
1+
using FastTransforms, LinearAlgebra
22

33
function oprec!(n::Integer, v::AbstractVector, alpha::Real, delta2::Real)
44
if n > 0
@@ -13,15 +13,19 @@ function oprec!(n::Integer, v::AbstractVector, alpha::Real, delta2::Real)
1313
return v
1414
end
1515

16-
# This example calculates the spectrum of the nonlocal diffusion operator:
17-
#
18-
# \mathcal{L}_\delta u = \int_{\mathbb{S}^2} \rho_\delta(|\mathbf{x}-\mathbf{y}|)\left[u(\mathbf{x}) - u(\mathbf{y})\right] \,\mathrm{d}\Omega(\mathbf{y}),
19-
#
20-
# defined in Eq. (2) of
21-
#
22-
# R. M. Slevinsky, H. Montanelli, and Q. Du, [A spectral method for nonlocal diffusion operators on the sphere](https://doi.org/10.1016/j.jcp.2018.06.024), *J. Comp. Phys.*, **372**:893--911, 2018.
23-
#
16+
"""
17+
This example calculates the spectrum of the nonlocal diffusion operator:
2418
19+
```math
20+
ℒ_δ u = ∫_𝕊² ρ_δ(|𝐱-𝐲|)[u(𝐱) - u(𝐲)] dΩ(𝐲),
21+
```
22+
23+
defined in Eq. (2) of
24+
25+
R. M. Slevinsky, H. Montanelli, and Q. Du, A spectral method for nonlocal diffusion operators on the sphere, J. Comp. Phys., 372:893--911, 2018.
26+
27+
available at https://doi.org/10.1016/j.jcp.2018.06.024
28+
"""
2529
function evaluate_lambda(n::Integer, alpha::T, delta::T) where T
2630
delta2 = delta*delta
2731
scl = (1+alpha)*(2-delta2/2)
@@ -56,7 +60,7 @@ function evaluate_lambda(n::Integer, alpha::T, delta::T) where T
5660
return lambda
5761
end
5862

59-
lambda = evaluate_lambda(1024, -0.5, 0.025)
60-
lambdabf = evaluate_lambda(1024, parse(BigFloat, "-0.5"), parse(BigFloat, "0.025"))
63+
lambda = evaluate_lambda(1024, -0.5, 1.0)
64+
lambdabf = evaluate_lambda(1024, parse(BigFloat, "-0.5"), parse(BigFloat, "1.0"))
6165

62-
norm(lambda64-lambdabf, Inf)/norm(lambda64, Inf)
66+
norm(lambda-lambdabf, Inf)/norm(lambda, Inf)

examples/sphere.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#
66
# is actually a degree-3 polynomial on 𝕊², where P₄ is the degree-4
77
# Legendre polynomial, and x,y,z ∈ 𝕊².
8-
# To verify, we sample the function on a 5×9 tensor product grid
9-
# at equispaced points-in-angle defined by:
8+
# To verify, we sample the function on a 5×9 equiangular grid
9+
# defined by:
1010
#
1111
# θₙ = (n+1/2)π/N, for 0 ≤ n < N, and
1212
#

src/libfasttransforms.jl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
# This file shows how to call `libfasttransforms` from Julia.
2-
# It is normally built by downloading precompiled binaries assuming that
3-
# dependencies are already installed. However, it may also be built from source.
4-
5-
# Step 1: In this repository,
6-
# `git clone -b v0.2.7 https://github.com/MikaelSlevinsky/FastTransforms.git deps/FastTransforms`
7-
8-
# Step 2: Get the dependencies. On macOS, run `brew install gcc@8 fftw mpfr`.
9-
# On linux, run `apt-get gcc-8 libblas-dev libopenblas-base libfftw3-dev libmpfr-dev`.
10-
11-
# Step 3: Build the library. On macOS, run `make CC=gcc-8 FT_USE_APPLEBLAS=1`.
12-
# On linux, run `make CC=gcc-8`.
13-
14-
# Step 4: move `libfastfransforms.dylib` out of the folder to be found by ↓.
15-
161
const libfasttransforms = joinpath(dirname(@__DIR__), "deps", "libfasttransforms")
172

183
if !(find_library(libfasttransforms) libfasttransforms)

0 commit comments

Comments
 (0)