Skip to content

Commit

Permalink
atol --> rtol in fmm2d, make docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maltezfaria committed Jun 16, 2024
1 parent e2814f1 commit 1e2686d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ links = InterLinks(

bib = CitationBibliography(joinpath(@__DIR__, "src", "refs.bib"); style = :numeric)

draft = true
draft = false

const ON_CI = get(ENV, "CI", "false") == "true"
const GIT_HEAD = chomp(read(`git rev-parse HEAD`, String))
Expand Down
34 changes: 17 additions & 17 deletions ext/IntiFMM2DExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function __init__()
@info "Loading Inti.jl FMM2D extension"
end

function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; rtol = sqrt(eps()))
# unpack the necessary fields in the appropriate format
m, n = size(iop)
sources = Matrix{Float64}(undef, 2, n)
Expand All @@ -33,14 +33,14 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
@. charges = -1 / (2 * π) * weights * x
if same_surface
out =
FMM2D.rfmm2d(; sources = sources, charges = charges, eps = atol, pg = 1)
FMM2D.rfmm2d(; sources = sources, charges = charges, eps = rtol, pg = 1)
return copyto!(y, out.pot)
else
out = FMM2D.rfmm2d(;
sources = sources,
charges = charges,
targets = targets,
eps = atol,
eps = rtol,
pgt = 1,
)
return copyto!(y, out.pottarg)
Expand All @@ -66,7 +66,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
sources = sources,
dipstr = dipstr,
dipvecs = dipvecs,
eps = atol,
eps = rtol,
pg = 1,
)
return copyto!(y, out.pot)
Expand All @@ -76,7 +76,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
targets = targets,
dipstr = dipstr,
dipvecs = dipvecs,
eps = atol,
eps = rtol,
pgt = 1,
)
return copyto!(y, out.pottarg)
Expand All @@ -93,14 +93,14 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
@. charges = -1 / (2 * π) * weights * x
if same_surface
out =
FMM2D.rfmm2d(; charges = charges, sources = sources, eps = atol, pg = 2)
FMM2D.rfmm2d(; charges = charges, sources = sources, eps = rtol, pg = 2)
return copyto!(y, sum(xnormals .* out.grad; dims = 1) |> vec)
else
out = FMM2D.rfmm2d(;
charges = charges,
sources = sources,
targets = targets,
eps = atol,
eps = rtol,
pgt = 2,
)
return copyto!(y, sum(xnormals .* out.gradtarg; dims = 1) |> vec)
Expand Down Expand Up @@ -130,7 +130,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
dipvecs = dipvecs,
dipstr = dipstrs,
sources = sources,
eps = atol,
eps = rtol,
pg = 2,
)
return copyto!(y, sum(xnormals .* out.grad; dims = 1) |> vec)
Expand All @@ -140,7 +140,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
dipstr = dipstrs,
sources = sources,
targets = targets,
eps = atol,
eps = rtol,
pgt = 2,
)
return copyto!(y, sum(xnormals .* out.gradtarg; dims = 1) |> vec)
Expand All @@ -158,7 +158,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
zk = zk,
sources = sources,
charges = charges,
eps = atol,
eps = rtol,
pg = 1,
)
return copyto!(y, out.pot)
Expand All @@ -168,7 +168,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
sources = sources,
charges = charges,
targets = targets,
eps = atol,
eps = rtol,
pgt = 1,
)
return copyto!(y, out.pottarg)
Expand Down Expand Up @@ -196,7 +196,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
sources = sources,
dipstr = dipstrs,
dipvecs = dipvecs,
eps = atol,
eps = rtol,
pg = 1,
)
return copyto!(y, out.pot)
Expand All @@ -207,7 +207,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
targets = targets,
dipstr = dipstrs,
dipvecs = dipvecs,
eps = atol,
eps = rtol,
pgt = 1,
)
return copyto!(y, out.pottarg)
Expand All @@ -228,7 +228,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
zk = zk,
charges = charges,
sources = sources,
eps = atol,
eps = rtol,
pg = 2,
)
return copyto!(y, sum(xnormals .* out.grad; dims = 1) |> vec)
Expand All @@ -238,7 +238,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
charges = charges,
sources = sources,
targets = targets,
eps = atol,
eps = rtol,
pgt = 2,
)
return copyto!(y, sum(xnormals .* out.gradtarg; dims = 1) |> vec)
Expand Down Expand Up @@ -270,7 +270,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
dipvecs = dipvecs,
dipstr = dipstrs,
sources = sources,
eps = atol,
eps = rtol,
pg = 2,
)
return copyto!(y, sum(xnormals .* out.grad; dims = 1) |> vec)
Expand All @@ -281,7 +281,7 @@ function Inti._assemble_fmm2d(iop::Inti.IntegralOperator; atol = sqrt(eps()))
dipstr = dipstrs,
sources = sources,
targets = targets,
eps = atol,
eps = rtol,
pgt = 2,
)
return copyto!(y, sum(xnormals .* out.gradtarg; dims = 1) |> vec)
Expand Down

0 comments on commit 1e2686d

Please sign in to comment.