Skip to content

Commit

Permalink
Deploying to gh-pages from @ 98c3d99 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
pancetta committed Apr 3, 2024
1 parent 6254a0d commit 09eb19c
Show file tree
Hide file tree
Showing 370 changed files with 1,757 additions and 1,881 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 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.
24 changes: 12 additions & 12 deletions _modules/implementations/problem_classes/AllenCahn_MPIFFT.html

Large diffs are not rendered by default.

343 changes: 143 additions & 200 deletions _modules/implementations/problem_classes/GrayScott_MPIFFT.html

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ <h1>Source code for implementations.problem_classes.generic_MPIFFT_Laplacian</h1

<span class="n">xp</span> <span class="o">=</span> <span class="n">np</span>

<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">nvars</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">spectral</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">L</span><span class="o">=</span><span class="mi">2</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">comm</span><span class="o">=</span><span class="n">MPI</span><span class="o">.</span><span class="n">COMM_WORLD</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="s1">&#39;d&#39;</span><span class="p">):</span>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">nvars</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">spectral</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">L</span><span class="o">=</span><span class="mi">2</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="mf">1.0</span><span class="p">,</span> <span class="n">comm</span><span class="o">=</span><span class="n">MPI</span><span class="o">.</span><span class="n">COMM_WORLD</span><span class="p">,</span> <span class="n">dtype</span><span class="o">=</span><span class="s1">&#39;d&#39;</span><span class="p">,</span> <span class="n">x0</span><span class="o">=</span><span class="mf">0.0</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;Initialization routine&quot;&quot;&quot;</span>

<span class="k">if</span> <span class="n">nvars</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
Expand All @@ -109,13 +109,15 @@ <h1>Source code for implementations.problem_classes.generic_MPIFFT_Laplacian</h1

<span class="c1"># invoke super init, passing the communicator and the local dimensions as init</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">init</span><span class="o">=</span><span class="p">(</span><span class="n">tmp_u</span><span class="o">.</span><span class="n">shape</span><span class="p">,</span> <span class="n">comm</span><span class="p">,</span> <span class="n">tmp_u</span><span class="o">.</span><span class="n">dtype</span><span class="p">))</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_makeAttributeAndRegister</span><span class="p">(</span><span class="s1">&#39;nvars&#39;</span><span class="p">,</span> <span class="s1">&#39;spectral&#39;</span><span class="p">,</span> <span class="s1">&#39;L&#39;</span><span class="p">,</span> <span class="s1">&#39;alpha&#39;</span><span class="p">,</span> <span class="s1">&#39;comm&#39;</span><span class="p">,</span> <span class="n">localVars</span><span class="o">=</span><span class="nb">locals</span><span class="p">(),</span> <span class="n">readOnly</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_makeAttributeAndRegister</span><span class="p">(</span>
<span class="s1">&#39;nvars&#39;</span><span class="p">,</span> <span class="s1">&#39;spectral&#39;</span><span class="p">,</span> <span class="s1">&#39;L&#39;</span><span class="p">,</span> <span class="s1">&#39;alpha&#39;</span><span class="p">,</span> <span class="s1">&#39;comm&#39;</span><span class="p">,</span> <span class="s1">&#39;x0&#39;</span><span class="p">,</span> <span class="n">localVars</span><span class="o">=</span><span class="nb">locals</span><span class="p">(),</span> <span class="n">readOnly</span><span class="o">=</span><span class="kc">True</span>
<span class="p">)</span>

<span class="c1"># get local mesh</span>
<span class="n">X</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">xp</span><span class="o">.</span><span class="n">ogrid</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">local_slice</span><span class="p">(</span><span class="kc">False</span><span class="p">)]</span>
<span class="n">N</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">global_shape</span><span class="p">()</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">N</span><span class="p">)):</span>
<span class="n">X</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">X</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">L</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">/</span> <span class="n">N</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
<span class="n">X</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">x0</span> <span class="o">+</span> <span class="p">(</span><span class="n">X</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">*</span> <span class="n">L</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">/</span> <span class="n">N</span><span class="p">[</span><span class="n">i</span><span class="p">])</span>
<span class="bp">self</span><span class="o">.</span><span class="n">X</span> <span class="o">=</span> <span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">xp</span><span class="o">.</span><span class="n">broadcast_to</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">shape</span><span class="p">(</span><span class="kc">False</span><span class="p">))</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">X</span><span class="p">]</span>

<span class="c1"># get local wavenumbers and Laplace operator</span>
Expand Down Expand Up @@ -173,12 +175,13 @@ <h1>Source code for implementations.problem_classes.generic_MPIFFT_Laplacian</h1
<span class="k">return</span> <span class="n">f</span></div>


<span class="k">def</span> <span class="nf">_eval_Laplacian</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">u</span><span class="p">,</span> <span class="n">f_impl</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">_eval_Laplacian</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">u</span><span class="p">,</span> <span class="n">f_impl</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="n">alpha</span> <span class="o">=</span> <span class="n">alpha</span> <span class="k">if</span> <span class="n">alpha</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">alpha</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">spectral</span><span class="p">:</span>
<span class="n">f_impl</span><span class="p">[:]</span> <span class="o">=</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">alpha</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">K2</span> <span class="o">*</span> <span class="n">u</span>
<span class="n">f_impl</span><span class="p">[:]</span> <span class="o">=</span> <span class="o">-</span><span class="n">alpha</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">K2</span> <span class="o">*</span> <span class="n">u</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">u_hat</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">forward</span><span class="p">(</span><span class="n">u</span><span class="p">)</span>
<span class="n">lap_u_hat</span> <span class="o">=</span> <span class="o">-</span><span class="bp">self</span><span class="o">.</span><span class="n">alpha</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">K2</span> <span class="o">*</span> <span class="n">u_hat</span>
<span class="n">lap_u_hat</span> <span class="o">=</span> <span class="o">-</span><span class="n">alpha</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">K2</span> <span class="o">*</span> <span class="n">u_hat</span>
<span class="n">f_impl</span><span class="p">[:]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">backward</span><span class="p">(</span><span class="n">lap_u_hat</span><span class="p">,</span> <span class="n">f_impl</span><span class="p">)</span>
<span class="k">return</span> <span class="n">f_impl</span>

Expand Down Expand Up @@ -213,13 +216,14 @@ <h1>Source code for implementations.problem_classes.generic_MPIFFT_Laplacian</h1
<span class="k">return</span> <span class="n">me</span></div>


<span class="k">def</span> <span class="nf">_invert_Laplacian</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">me</span><span class="p">,</span> <span class="n">factor</span><span class="p">,</span> <span class="n">rhs</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">_invert_Laplacian</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">me</span><span class="p">,</span> <span class="n">factor</span><span class="p">,</span> <span class="n">rhs</span><span class="p">,</span> <span class="n">alpha</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="n">alpha</span> <span class="o">=</span> <span class="n">alpha</span> <span class="k">if</span> <span class="n">alpha</span> <span class="k">else</span> <span class="bp">self</span><span class="o">.</span><span class="n">alpha</span>
<span class="k">if</span> <span class="bp">self</span><span class="o">.</span><span class="n">spectral</span><span class="p">:</span>
<span class="n">me</span><span class="p">[:]</span> <span class="o">=</span> <span class="n">rhs</span> <span class="o">/</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">factor</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">alpha</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">K2</span><span class="p">)</span>
<span class="n">me</span><span class="p">[:]</span> <span class="o">=</span> <span class="n">rhs</span> <span class="o">/</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">factor</span> <span class="o">*</span> <span class="n">alpha</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">K2</span><span class="p">)</span>

<span class="k">else</span><span class="p">:</span>
<span class="n">rhs_hat</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">forward</span><span class="p">(</span><span class="n">rhs</span><span class="p">)</span>
<span class="n">rhs_hat</span> <span class="o">/=</span> <span class="mf">1.0</span> <span class="o">+</span> <span class="n">factor</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">alpha</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">K2</span>
<span class="n">rhs_hat</span> <span class="o">/=</span> <span class="mf">1.0</span> <span class="o">+</span> <span class="n">factor</span> <span class="o">*</span> <span class="n">alpha</span> <span class="o">*</span> <span class="bp">self</span><span class="o">.</span><span class="n">K2</span>
<span class="n">me</span><span class="p">[:]</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">fft</span><span class="o">.</span><span class="n">backward</span><span class="p">(</span><span class="n">rhs_hat</span><span class="p">)</span>
<span class="k">return</span> <span class="n">me</span></div>

Expand Down
2 changes: 1 addition & 1 deletion coverage/coverage-badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions coverage/d_020efe120a771d8a_fput_py.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h2>
<a id="nextFileLink" class="nav" href="d_020efe120a771d8a_hamiltonian_and_energy_output_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-04-01 12:33 +0000
created at 2024-04-03 08:55 +0000
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -328,7 +328,7 @@ <h2>
<a id="nextFileLink" class="nav" href="d_020efe120a771d8a_hamiltonian_and_energy_output_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-04-01 12:33 +0000
created at 2024-04-03 08:55 +0000
</p>
</div>
</footer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h2>
<a id="nextFileLink" class="nav" href="d_020efe120a771d8a_hamiltonian_output_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-04-01 12:33 +0000
created at 2024-04-03 08:55 +0000
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -196,7 +196,7 @@ <h2>
<a id="nextFileLink" class="nav" href="d_020efe120a771d8a_hamiltonian_output_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-04-01 12:33 +0000
created at 2024-04-03 08:55 +0000
</p>
</div>
</footer>
Expand Down
4 changes: 2 additions & 2 deletions coverage/d_020efe120a771d8a_hamiltonian_output_py.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h2>
<a id="nextFileLink" class="nav" href="d_020efe120a771d8a_harmonic_oscillator_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-04-01 12:33 +0000
created at 2024-04-03 08:55 +0000
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -170,7 +170,7 @@ <h2>
<a id="nextFileLink" class="nav" href="d_020efe120a771d8a_harmonic_oscillator_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-04-01 12:33 +0000
created at 2024-04-03 08:55 +0000
</p>
</div>
</footer>
Expand Down
4 changes: 2 additions & 2 deletions coverage/d_020efe120a771d8a_harmonic_oscillator_py.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h2>
<a id="nextFileLink" class="nav" href="d_020efe120a771d8a_simple_problems_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-04-01 12:33 +0000
created at 2024-04-03 08:55 +0000
</p>
<aside class="hidden">
<button type="button" class="button_next_chunk" data-shortcut="j"/>
Expand Down Expand Up @@ -254,7 +254,7 @@ <h2>
<a id="nextFileLink" class="nav" href="d_020efe120a771d8a_simple_problems_py.html">&#xbb; next</a>
&nbsp; &nbsp; &nbsp;
<a class="nav" href="https://coverage.readthedocs.io/en/7.4.4">coverage.py v7.4.4</a>,
created at 2024-04-01 12:33 +0000
created at 2024-04-03 08:55 +0000
</p>
</div>
</footer>
Expand Down
Loading

0 comments on commit 09eb19c

Please sign in to comment.