Skip to content

Commit 127b079

Browse files
author
Documenter.jl
committed
build based on 247cb21
1 parent f2336c3 commit 127b079

File tree

10 files changed

+40
-44
lines changed

10 files changed

+40
-44
lines changed

dev/.documenter-siteinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"julia_version":"1.11.6","generation_timestamp":"2025-08-15T21:01:18","documenter_version":"1.14.1"}}
1+
{"documenter":{"julia_version":"1.11.6","generation_timestamp":"2025-08-15T21:14:16","documenter_version":"1.14.1"}}

dev/advanced_usage/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@
4141
# test accuracy
4242
println("max error in target one: ", maximum(abs.(target_one.potential[5:7,:] .- v1)))
4343
println(&quot;max error in target two: &quot;, maximum(abs.(target_two.gradient_stretching[1:3,:] .- v2)))</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">max error in target one: 1.4007503612439853e-5
44-
max error in target two: 1.0289615966441179e-5</code></pre><p>Note that <code>scalar_potential</code>, <code>gradient</code>, and <code>hessian</code> can be passed as a single boolean or as a tuple of booleans, one for each target system. This allows the user to specify which values are desired for each target system, and avoids unnecessary calculations for values that are not needed. In this case, we have set <code>scalar_potential=false</code> and <code>gradient=true</code> to indicate all target systems, but a tuple <code>hessian=(false,true)</code> to indicate different settings for each. It is worth remembering that these switches must be implemented by the user when overloading the <code>direct!</code> function for each system to act as a source.</p><div class="admonition is-success" id="Tip-39caa8a77e0973de"><header class="admonition-header">Tip<a class="admonition-anchor" href="#Tip-39caa8a77e0973de" title="Permalink"></a></header><div class="admonition-body"><p>The <code>fmm!</code> keyword arguments <code>scalar_potential</code>, <code>gradient</code>, and <code>hessian</code> can be passed as a single boolean or as a tuple of booleans, one for each target system. This allows the user to specify which values are desired for each target system, and avoids unnecessary calculations for values that are not needed.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../tuning/">« Tuning Parameters</a><a class="docs-footer-nextpage" href="../advanced_usage_2/">Automated Tuning »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Friday 15 August 2025 21:01">Friday 15 August 2025</span>. Using Julia version 1.11.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
44+
max error in target two: 1.0289615966441179e-5</code></pre><p>Note that <code>scalar_potential</code>, <code>gradient</code>, and <code>hessian</code> can be passed as a single boolean or as a tuple of booleans, one for each target system. This allows the user to specify which values are desired for each target system, and avoids unnecessary calculations for values that are not needed. In this case, we have set <code>scalar_potential=false</code> and <code>gradient=true</code> to indicate all target systems, but a tuple <code>hessian=(false,true)</code> to indicate different settings for each. It is worth remembering that these switches must be implemented by the user when overloading the <code>direct!</code> function for each system to act as a source.</p><div class="admonition is-success" id="Tip-39caa8a77e0973de"><header class="admonition-header">Tip<a class="admonition-anchor" href="#Tip-39caa8a77e0973de" title="Permalink"></a></header><div class="admonition-body"><p>The <code>fmm!</code> keyword arguments <code>scalar_potential</code>, <code>gradient</code>, and <code>hessian</code> can be passed as a single boolean or as a tuple of booleans, one for each target system. This allows the user to specify which values are desired for each target system, and avoids unnecessary calculations for values that are not needed.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../tuning/">« Tuning Parameters</a><a class="docs-footer-nextpage" href="../advanced_usage_2/">Automated Tuning »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Friday 15 August 2025 21:14">Friday 15 August 2025</span>. Using Julia version 1.11.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

dev/advanced_usage_2/index.html

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,66 +33,62 @@
3333
multipole_acceptance = 0.3...
3434

3535
Best Parameters:
36-
leaf_size_source: [91]
36+
leaf_size_source: [115]
3737
expansion_order: 1
3838
multipole_acceptance: 0.3
39-
cost: 0.183228457 seconds
39+
cost: 0.183027123 seconds
4040

4141
multipole_acceptance = 0.4...
4242

4343
Best Parameters:
44-
leaf_size_source: [2563]
45-
expansion_order: 1
44+
leaf_size_source: [57]
45+
expansion_order: 3
4646
multipole_acceptance: 0.4
47-
cost: 0.182961457 seconds
47+
cost: 0.151308275 seconds
4848

4949
multipole_acceptance = 0.5...
5050

5151
Best Parameters:
52-
leaf_size_source: [1281]
53-
expansion_order: 1
52+
leaf_size_source: [57]
53+
expansion_order: 3
5454
multipole_acceptance: 0.5
55-
cost: 0.183465641 seconds
55+
cost: 0.116688059 seconds
5656

5757
multipole_acceptance = 0.6...
5858

5959
Best Parameters:
60-
leaf_size_source: [640]
61-
expansion_order: 1
60+
leaf_size_source: [61]
61+
expansion_order: 4
6262
multipole_acceptance: 0.6
63-
cost: 0.182784665 seconds
63+
cost: 0.08651342 seconds
6464

6565
multipole_acceptance = 0.7...
66-
<span class="sgr33"><span class="sgr1">┌ Warning: </span></span>Error tolerance 0.0001 not reached! Using max expansion order P=3.
67-
<span class="sgr33"><span class="sgr1"></span></span> ε_mp = 5.238853271497909e-5,
68-
<span class="sgr33"><span class="sgr1"></span></span> ε_l = 0.0014442636739866455
69-
<span class="sgr33"><span class="sgr1"></span></span><span class="sgr90">@ FastMultipole ~/work/FastMultipole.jl/FastMultipole.jl/src/translate.jl:990</span>
7066

7167
Best Parameters:
72-
leaf_size_source: [320]
68+
leaf_size_source: [61]
7369
expansion_order: 5
7470
multipole_acceptance: 0.7
75-
cost: 0.172622562 seconds
71+
cost: 0.07143482 seconds
7672

7773
multipole_acceptance = 0.8...
7874

7975
Best Parameters:
80-
leaf_size_source: [340]
76+
leaf_size_source: [71]
8177
expansion_order: 6
8278
multipole_acceptance: 0.8
83-
cost: 0.167787538 seconds
79+
cost: 0.059581367 seconds
8480

8581
Finished autotune!
8682

8783
Parameters:
88-
leaf_size_source: [340]
84+
leaf_size_source: [71]
8985
expansion_order: 6
9086
multipole_acceptance: 0.8
91-
cost: 0.167787538 seconds
87+
cost: 0.059581367 seconds
9288

9389
#===============================================#
9490

95-
Optimal parameters: (leaf_size_source = [340], expansion_order = 6, multipole_acceptance = 0.8)</code></pre><p>This will return a named tuple of the optimal parameters, which can then be passed to the <code>fmm!</code> function. The <code>cache</code> is a preallocated buffer that can be used to reduce memory allocations during the FMM call.</p><pre><code class="language-julia hljs"># run FMM without default parameters
91+
Optimal parameters: (leaf_size_source = [71], expansion_order = 6, multipole_acceptance = 0.8)</code></pre><p>This will return a named tuple of the optimal parameters, which can then be passed to the <code>fmm!</code> function. The <code>cache</code> is a preallocated buffer that can be used to reduce memory allocations during the FMM call.</p><pre><code class="language-julia hljs"># run FMM without default parameters
9692
println(&quot;Default Tuning Parameters:&quot;)
9793
system.potential .= 0.0
9894
t1 = @elapsed fmm!(system; scalar_potential=true, gradient=false, hessian=false, error_tolerance=PowerAbsolutePotential(1e-4))
@@ -110,7 +106,7 @@
110106
println(&quot;\tmax error: &quot;, maximum(abs.(phi_direct .- phi_fmm)))
111107
println(&quot;\ttime cost: &quot;, t2, &quot; seconds&quot;)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Default Tuning Parameters:
112108
max error: 0.00033237800897240044
113-
time cost: 0.177664836 seconds
109+
time cost: 0.176437001 seconds
114110
Optimal Tuning Parameters:
115111
max error: 0.00033237800897240044
116-
time cost: 0.197820736 seconds</code></pre><p>Note that the <code>tune_fmm</code> function iterates over each requested <code>multipole_acceptance</code> criterion, so it is not optimal to call it before every FMM call. Instead, <code>tune_fmm</code> can be called once for a representative system primarily to choose <code>multipole_acceptance</code>. Since the optimal parameters depend on the size, distribution, and strengths of the sources and targets, it is recommended to set the keyword argument <code>tune=true</code> to iteratively update the <code>expansion_order</code> and <code>leaf_size_source</code> parameters each time <code>fmm!</code> is called. This will allow the FMM to adapt to the system as it evolves, and will ensure that the optimal parameters are used for each call.</p><div class="admonition is-success" id="Tip-709239aed0176e90"><header class="admonition-header">Tip<a class="admonition-anchor" href="#Tip-709239aed0176e90" title="Permalink"></a></header><div class="admonition-body"><p>The <code>tune_fmm</code> function can be used to automatically tune the FMM parameters to satisfy an error tolerance. It returns a named tuple of the optimal parameters and a preallocated buffer to reduce memory allocations.</p></div></div><div class="admonition is-warning" id="Warning-36707f035a97fc82"><header class="admonition-header">Warning<a class="admonition-anchor" href="#Warning-36707f035a97fc82" title="Permalink"></a></header><div class="admonition-body"><p>The <code>tune_fmm</code> function is computationally expensive, so it should not be called before every FMM call. Instead, it should be called once for a representative system to choose the optimal <code>multipole_acceptance</code> parameter. Then, the optimal parameters will be updated in each <code>fmm!</code> call if the <code>tune=true</code> keyword argument is set. This allows the FMM to adapt to the system as it evolves.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../advanced_usage/">« Multiple Systems</a><a class="docs-footer-nextpage" href="../reference/">Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Friday 15 August 2025 21:01">Friday 15 August 2025</span>. Using Julia version 1.11.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
112+
time cost: 0.089609241 seconds</code></pre><p>Note that the <code>tune_fmm</code> function iterates over each requested <code>multipole_acceptance</code> criterion, so it is not optimal to call it before every FMM call. Instead, <code>tune_fmm</code> can be called once for a representative system primarily to choose <code>multipole_acceptance</code>. Since the optimal parameters depend on the size, distribution, and strengths of the sources and targets, it is recommended to set the keyword argument <code>tune=true</code> to iteratively update the <code>expansion_order</code> and <code>leaf_size_source</code> parameters each time <code>fmm!</code> is called. This will allow the FMM to adapt to the system as it evolves, and will ensure that the optimal parameters are used for each call.</p><div class="admonition is-success" id="Tip-709239aed0176e90"><header class="admonition-header">Tip<a class="admonition-anchor" href="#Tip-709239aed0176e90" title="Permalink"></a></header><div class="admonition-body"><p>The <code>tune_fmm</code> function can be used to automatically tune the FMM parameters to satisfy an error tolerance. It returns a named tuple of the optimal parameters and a preallocated buffer to reduce memory allocations.</p></div></div><div class="admonition is-warning" id="Warning-36707f035a97fc82"><header class="admonition-header">Warning<a class="admonition-anchor" href="#Warning-36707f035a97fc82" title="Permalink"></a></header><div class="admonition-body"><p>The <code>tune_fmm</code> function is computationally expensive, so it should not be called before every FMM call. Instead, it should be called once for a representative system to choose the optimal <code>multipole_acceptance</code> parameter. Then, the optimal parameters will be updated in each <code>fmm!</code> call if the <code>tune=true</code> keyword argument is set. This allows the FMM to adapt to the system as it evolves.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../advanced_usage/">« Multiple Systems</a><a class="docs-footer-nextpage" href="../reference/">Reference »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.14.1 on <span class="colophon-date" title="Friday 15 August 2025 21:14">Friday 15 August 2025</span>. Using Julia version 1.11.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)