@@ -113,8 +113,8 @@ using LinearMaps
113113
114114# and setup some of the (global) problem parameters:
115115
116- k = 4 π
117- λ = 2 π / k
116+ k = 4 π
117+ λ = 2 π / k
118118qorder = 4 # quadrature order
119119gorder = 2 # order of geometrical approximation
120120nothing # hide
@@ -127,7 +127,7 @@ nothing #hide
127127# function to mesh the circle:
128128
129129function gmsh_circle (; name, meshsize, order = 1 , radius = 1 , center = (0 , 0 ))
130- try
130+ return try
131131 gmsh. initialize ()
132132 gmsh. model. add (" circle-mesh" )
133133 gmsh. option. setNumber (" Mesh.MeshSizeMax" , meshsize)
@@ -190,7 +190,7 @@ nothing #hide
190190# integrating the function `x->1` over `Q` gives an approximation to the
191191# perimeter:
192192
193- @assert abs (Inti. integrate (x -> 1 , Q) - 2 π) < 1e -5 # hide
193+ @assert abs (Inti. integrate (x -> 1 , Q) - 2 π) < 1.0e -5 # hide
194194abs (Inti. integrate (x -> 1 , Q) - 2 π)
195195
196196# With the [`Quadrature`](@ref Inti.Quadrature) constructed, we now can define
@@ -260,7 +260,7 @@ nothing #hide
260260# potentials, and then combine them as follows:
261261
262262𝒮, 𝒟 = Inti. single_double_layer_potential (; op, source = Q)
263- uₛ = x -> 𝒟[σ](x) - im * k * 𝒮[σ](x)
263+ uₛ = x -> 𝒟[σ](x) - im * k * 𝒮[σ](x)
264264nothing # hide
265265
266266# The variable `uₛ` is an anonymous/lambda function representing the approximate
@@ -277,9 +277,9 @@ function circle_helmholtz_soundsoft(pt; radius = 1, k, θin)
277277 u = 0.0
278278 r < radius && return u
279279 c (n) = - exp (im * n * (π / 2 - θin)) * besselj (n, k * radius) / besselh (n, k * radius)
280- u = c (0 ) * besselh (0 , k * r)
281- n = 1
282- while (abs (c (n)) > 1e -12 )
280+ u = c (0 ) * besselh (0 , k * r)
281+ n = 1
282+ while (abs (c (n)) > 1.0e -12 )
283283 u +=
284284 c (n) * besselh (n, k * r) * exp (im * n * θ) +
285285 c (- n) * besselh (- n, k * r) * exp (- im * n * θ)
@@ -297,7 +297,7 @@ er = maximum(0:0.01:2π) do θ
297297 x = (R * cos (θ), R * sin (θ))
298298 return abs (uₛ (x) - uₑ (x))
299299end
300- @assert er < 1e -3 # hide
300+ @assert er < 1.0e -3 # hide
301301@info " maximum error = $er "
302302
303303# As we can see, the error is quite small! Let's use `Makie` to visualize the solution in this
@@ -450,15 +450,15 @@ S, D = Inti.single_double_layer(;
450450 op,
451451 target = Q,
452452 source = Q,
453- compression = (method = :hmatrix , tol = 1e -4 ),
453+ compression = (method = :hmatrix , tol = 1.0e -4 ),
454454 correction = (method = :dim ,),
455455)
456456nothing # hide
457457
458458# Here is how much memory it would take to store the dense representation of
459459# these matrices:
460460
461- mem = 2 * length (S) * 16 / 1e9 # 16 bytes per complex number, 1e9 bytes per GB, two matrices
461+ mem = 2 * length (S) * 16 / 1.0e9 # 16 bytes per complex number, 1e9 bytes per GB, two matrices
462462println (" memory required to store S and D: $(mem) GB" )
463463
464464# Even for this simple example, the dense representation of the integral
@@ -492,7 +492,7 @@ rhs = map(Q) do q
492492 return - uᵢ (x)
493493end
494494σ, hist =
495- gmres (L, rhs; log = true , abstol = 1e -6 , verbose = false , restart = 100 , maxiter = 100 )
495+ gmres (L, rhs; log = true , abstol = 1.0e -6 , verbose = false , restart = 100 , maxiter = 100 )
496496@show hist
497497
498498# As before, let us represent the solution using `IntegralPotential`s:
@@ -517,7 +517,7 @@ function sphere_helmholtz_soundsoft(xobs; radius = 1, k = 1, θin = 0, ϕin = 0)
517517 r < radius && return u
518518 function c (l, m)
519519 return - 4 π * im^ l * sphharmonic (l, - m, θin, ϕin) * sphbesselj (l, k * radius) /
520- sphbesselh (l, k * radius)
520+ sphbesselh (l, k * radius)
521521 end
522522 l = 0
523523 for l in 0 : 60
@@ -538,7 +538,7 @@ er = maximum(1:100) do _
538538 x = 2 * x̂
539539 return abs (uₛ (x) - uₑ (x))
540540end
541- @assert er < 1e -3 # hide
541+ @assert er < 1.0e -3 # hide
542542@info " error with correction = $er "
543543
544544# We see that, once again, the approximation is quite accurate. Let us now
@@ -553,7 +553,7 @@ S, D = Inti.single_double_layer(;
553553 op,
554554 target,
555555 source = Q,
556- compression = (method = :hmatrix , tol = 1e -4 ),
556+ compression = (method = :hmatrix , tol = 1.0e -4 ),
557557 # # correction for the nearfield (for visual purposes, set to `:none` to disable)
558558 correction = (method = :dim , maxdist = meshsize, target_location = :outside ),
559559)
0 commit comments