Skip to content

Commit

Permalink
Deploying to gh-pages from @ 39903ea 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
pancetta committed Nov 10, 2023
1 parent beb9a7a commit 1aa8738
Show file tree
Hide file tree
Showing 328 changed files with 2,605 additions and 2,179 deletions.
Binary file modified .doctrees/environment.pickle
Binary file not shown.
Binary file modified .doctrees/projects/Hamiltonian.doctree
Binary file not shown.
Binary file modified .doctrees/projects/doc_fput.doctree
Binary file not shown.
Binary file modified .doctrees/projects/doc_matrixPFASST_matrix.doctree
Binary file not shown.
Binary file modified .doctrees/projects/matrixPFASST.doctree
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .doctrees/pySDC/implementations.problem_classes.Quench.doctree
Binary file not shown.
Binary file not shown.
Binary file modified .doctrees/tutorial/doc_step_2_C.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/doc_step_3_B.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/doc_step_4_D.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/doc_step_7_A.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/doc_step_7_B.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/doc_step_7_C.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/doc_step_8_C.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/step_2.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/step_3.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/step_4.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/step_7.doctree
Binary file not shown.
Binary file modified .doctrees/tutorial/step_8.doctree
Binary file not shown.
Binary file modified _images/timings_SDC_variants_Fisher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _images/timings_SDC_variants_GrayScott.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,8 @@ <h1>Source code for implementations.convergence_controller_classes.estimate_extr
<span class="n">default_params</span> <span class="o">=</span> <span class="p">{</span>
<span class="s1">&#39;Taylor_order&#39;</span><span class="p">:</span> <span class="mi">2</span> <span class="o">*</span> <span class="n">num_nodes</span><span class="p">,</span>
<span class="s1">&#39;n&#39;</span><span class="p">:</span> <span class="n">num_nodes</span><span class="p">,</span>
<span class="s1">&#39;recompute_coefficients&#39;</span><span class="p">:</span> <span class="kc">False</span><span class="p">,</span>
<span class="o">**</span><span class="n">params</span><span class="p">,</span>
<span class="p">}</span>

<span class="k">return</span> <span class="p">{</span><span class="o">**</span><span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="n">controller</span><span class="p">,</span> <span class="n">params</span><span class="p">,</span> <span class="n">description</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">),</span> <span class="o">**</span><span class="n">default_params</span><span class="p">}</span></div>
Expand Down Expand Up @@ -573,18 +575,21 @@ <h1>Source code for implementations.convergence_controller_classes.estimate_extr
<span class="n">t_eval</span> <span class="o">=</span> <span class="n">S</span><span class="o">.</span><span class="n">time</span> <span class="o">+</span> <span class="n">nodes_</span><span class="p">[</span><span class="o">-</span><span class="mi">1</span><span class="p">]</span>

<span class="n">dts</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">nodes_</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">nodes_</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span> <span class="o">-</span> <span class="n">nodes_</span><span class="p">[:</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span>
<span class="bp">self</span><span class="o">.</span><span class="n">params</span><span class="o">.</span><span class="n">Taylor_order</span> <span class="o">=</span> <span class="mi">2</span> <span class="o">*</span> <span class="nb">len</span><span class="p">(</span><span class="n">nodes</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">params</span><span class="o">.</span><span class="n">Taylor_order</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">nodes</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">params</span><span class="o">.</span><span class="n">n</span> <span class="o">=</span> <span class="nb">len</span><span class="p">(</span><span class="n">nodes</span><span class="p">)</span>

<span class="c1"># compute the extrapolation coefficients</span>
<span class="c1"># TODO: Maybe this can be reused</span>
<span class="bp">self</span><span class="o">.</span><span class="n">get_extrapolation_coefficients</span><span class="p">(</span><span class="n">nodes</span><span class="p">,</span> <span class="n">dts</span><span class="p">,</span> <span class="n">t_eval</span><span class="p">)</span>
<span class="k">if</span> <span class="kc">None</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">coeff</span><span class="o">.</span><span class="n">u</span> <span class="ow">or</span> <span class="bp">self</span><span class="o">.</span><span class="n">params</span><span class="o">.</span><span class="n">recompute_coefficients</span><span class="p">:</span>
<span class="bp">self</span><span class="o">.</span><span class="n">get_extrapolation_coefficients</span><span class="p">(</span><span class="n">nodes</span><span class="p">,</span> <span class="n">dts</span><span class="p">,</span> <span class="n">t_eval</span><span class="p">)</span>

<span class="c1"># compute the extrapolated solution</span>
<span class="k">if</span> <span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">=</span> <span class="n">lvl</span><span class="o">.</span><span class="n">prob</span><span class="o">.</span><span class="n">eval_f</span><span class="p">(</span><span class="n">lvl</span><span class="o">.</span><span class="n">u</span><span class="p">[</span><span class="mi">0</span><span class="p">],</span> <span class="n">lvl</span><span class="o">.</span><span class="n">time</span><span class="p">)</span>

<span class="k">if</span> <span class="nb">type</span><span class="p">(</span><span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="n">imex_mesh</span><span class="p">:</span>
<span class="n">f</span> <span class="o">=</span> <span class="p">[</span><span class="n">me</span><span class="o">.</span><span class="n">impl</span> <span class="o">+</span> <span class="n">me</span><span class="o">.</span><span class="n">expl</span> <span class="k">for</span> <span class="n">me</span> <span class="ow">in</span> <span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">]</span>
<span class="n">f</span> <span class="o">=</span> <span class="p">[</span><span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">impl</span> <span class="o">+</span> <span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">.</span><span class="n">expl</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">coeff</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="ow">and</span> <span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="k">else</span> <span class="mf">0.0</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)]</span>
<span class="k">elif</span> <span class="nb">type</span><span class="p">(</span><span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span> <span class="o">==</span> <span class="n">mesh</span><span class="p">:</span>
<span class="n">f</span> <span class="o">=</span> <span class="n">lvl</span><span class="o">.</span><span class="n">f</span>
<span class="n">f</span> <span class="o">=</span> <span class="p">[</span><span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">coeff</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="k">else</span> <span class="mf">0.0</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)]</span>
<span class="k">else</span><span class="p">:</span>
<span class="k">raise</span> <span class="n">DataError</span><span class="p">(</span>
<span class="sa">f</span><span class="s2">&quot;Unable to store f from datatype </span><span class="si">{</span><span class="nb">type</span><span class="p">(</span><span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span><span class="si">}</span><span class="s2">, extrapolation based error estimate only</span><span class="se">\</span>
Expand All @@ -594,7 +599,7 @@ <h1>Source code for implementations.convergence_controller_classes.estimate_extr
<span class="c1"># compute the error with the weighted sum</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">comm</span><span class="p">:</span>
<span class="n">idx</span> <span class="o">=</span> <span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">comm</span><span class="o">.</span><span class="n">rank</span> <span class="o">+</span> <span class="mi">1</span><span class="p">)</span> <span class="o">%</span> <span class="bp">self</span><span class="o">.</span><span class="n">comm</span><span class="o">.</span><span class="n">size</span>
<span class="n">sendbuf</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">coeff</span><span class="o">.</span><span class="n">u</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span> <span class="o">*</span> <span class="n">lvl</span><span class="o">.</span><span class="n">u</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">coeff</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span> <span class="o">*</span> <span class="n">lvl</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span>
<span class="n">sendbuf</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">coeff</span><span class="o">.</span><span class="n">u</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span> <span class="o">*</span> <span class="n">lvl</span><span class="o">.</span><span class="n">u</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">coeff</span><span class="o">.</span><span class="n">f</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span> <span class="o">*</span> <span class="n">f</span><span class="p">[</span><span class="n">idx</span><span class="p">]</span>
<span class="n">u_ex</span> <span class="o">=</span> <span class="n">lvl</span><span class="o">.</span><span class="n">prob</span><span class="o">.</span><span class="n">dtype_u</span><span class="p">(</span><span class="n">lvl</span><span class="o">.</span><span class="n">prob</span><span class="o">.</span><span class="n">init</span><span class="p">,</span> <span class="n">val</span><span class="o">=</span><span class="mf">0.0</span><span class="p">)</span> <span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">comm</span><span class="o">.</span><span class="n">rank</span> <span class="o">==</span> <span class="bp">self</span><span class="o">.</span><span class="n">comm</span><span class="o">.</span><span class="n">size</span> <span class="o">-</span> <span class="mi">1</span> <span class="k">else</span> <span class="kc">None</span>
<span class="bp">self</span><span class="o">.</span><span class="n">comm</span><span class="o">.</span><span class="n">Reduce</span><span class="p">(</span><span class="n">sendbuf</span><span class="p">,</span> <span class="n">u_ex</span><span class="p">,</span> <span class="n">op</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">sum</span><span class="p">,</span> <span class="n">root</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">comm</span><span class="o">.</span><span class="n">size</span> <span class="o">-</span> <span class="mi">1</span><span class="p">)</span>
<span class="k">else</span><span class="p">:</span>
Expand Down
Loading

0 comments on commit 1aa8738

Please sign in to comment.