Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a few docs fixes #284

Merged
merged 1 commit into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 30 additions & 25 deletions docs/source/compressible-convergence.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,31 +69,16 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "cc7c0964-e0cf-43f4-8ca8-3ea6ed11c9fd",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[1mpyro ...\u001b[0m\n",
"\u001b[1minitializing the acoustic pulse problem...\u001b[0m\n",
"\u001b[1mpyro ...\u001b[0m\n",
"\u001b[1minitializing the acoustic pulse problem...\u001b[0m\n",
"\u001b[1mpyro ...\u001b[0m\n",
"\u001b[1minitializing the acoustic pulse problem...\u001b[0m\n",
"\u001b[1mpyro ...\u001b[0m\n",
"\u001b[1minitializing the acoustic pulse problem...\u001b[0m\n"
]
}
],
"outputs": [],
"source": [
"sims = []\n",
"\n",
"for N in [32, 64, 128, 256]:\n",
" dt = timestep(N)\n",
" params = {\"driver.fix_dt\": dt, \"mesh.nx\": N, \"mesh.ny\": N, \"driver.verbose\": 0}\n",
" params = {\"driver.fix_dt\": dt, \"mesh.nx\": N, \"mesh.ny\": N}\n",
" p = Pyro(\"compressible\")\n",
" p.initialize_problem(problem_name=\"acoustic_pulse\", inputs_dict=params)\n",
" p.run_sim()\n",
Expand All @@ -111,7 +96,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "9705ab17-81c6-4b8a-becd-6a9af75371e1",
"metadata": {},
"outputs": [],
Expand All @@ -122,10 +107,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "97d051b5-563a-40ea-a838-9b4f7832380f",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 64 -> 32 : 0.0002674195946900653\n",
"128 -> 64 : 5.7696409241208797e-05\n",
"256 -> 128 : 1.3860268814816614e-05\n"
]
}
],
"source": [
"for coarse, fine in pairwise(sims):\n",
" cvar = coarse.get_var(var)\n",
Expand Down Expand Up @@ -161,7 +156,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "dd7a64cb-992e-4e0f-96f7-c8c03c0ca3eb",
"metadata": {},
"outputs": [],
Expand All @@ -170,7 +165,7 @@
"\n",
"for N in [32, 64, 128, 256]:\n",
" dt = timestep(N)\n",
" params = {\"driver.fix_dt\": dt, \"mesh.nx\": N, \"mesh.ny\": N, \"driver.verbose\": 0}\n",
" params = {\"driver.fix_dt\": dt, \"mesh.nx\": N, \"mesh.ny\": N}\n",
" p = Pyro(\"compressible_fv4\")\n",
" p.initialize_problem(problem_name=\"acoustic_pulse\", inputs_dict=params)\n",
" p.run_sim()\n",
Expand All @@ -179,10 +174,20 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "f03120c8-bc1d-4f0d-b79f-e498c64076a3",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" 64 -> 32 : 6.519131423273572e-05\n",
"128 -> 64 : 4.825569192556014e-06\n",
"256 -> 128 : 3.0769222917915304e-07\n"
]
}
],
"source": [
"for coarse, fine in pairwise(sims):\n",
" cvar = coarse.get_var(var)\n",
Expand Down
53 changes: 27 additions & 26 deletions docs/source/compressible-rt-compare.ipynb

Large diffs are not rendered by default.

8 changes: 3 additions & 5 deletions docs/source/running.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ Pyro class
----------

Alternatively, pyro can be run using the :func:`Pyro <pyro.pyro_sim.Pyro>` class. This provides
an interface that enables simulations to be set up and run in a Jupyter notebook -- see
``examples/examples.ipynb`` for an example notebook. A simulation can be set up and run
an interface that enables simulations to be set up and run in a Jupyter notebook. A simulation can be set up and run
by carrying out the following steps:

* create a :func:`Pyro <pyro.pyro_sim.Pyro>` object, initializing it with a specific solver
Expand All @@ -67,7 +66,7 @@ Kelvin-Helmholtz problem ``kh``, we would do the following:

from pyro import Pyro
p = Pyro("compressible")
p.initialize_problem(problem_name="kh")
p.initialize_problem("kh")
p.run_sim()

This will use the default set of parameters for the problem specified
Expand Down Expand Up @@ -99,8 +98,7 @@ verbosity for the previous example, we would do:
.. code-block:: python

parameters = {"driver.verbose": 1}
p.initialize_problem(problem_name="kh",
inputs_dict=parameters)
p.initialize_problem("kh", inputs_dict=parameters)

It's possible to evolve the simulation forward timestep by timestep manually using
the :func:`single_step <pyro.pyro_sim.Pyro.single_step>` function (rather than allowing
Expand Down
Loading