You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/running.rst
+23-7Lines changed: 23 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,9 @@
1
1
Running
2
2
=======
3
3
4
-
Pyro can be run in two ways: either from the commandline, using the ``pyro.py`` script and passing in the solver, problem and inputs as arguments, or by using the :func:`Pyro <pyro.Pyro>` class.
4
+
Pyro can be run in two ways: either from the commandline, using the ``pyro.py``
5
+
script and passing in the solver, problem and inputs as arguments, or by using
6
+
the :func:`Pyro <pyro.Pyro>` class.
5
7
6
8
Commandline
7
9
------------
@@ -47,13 +49,17 @@ above run, we could do:
47
49
Pyro class
48
50
----------
49
51
50
-
Alternatively, pyro can be run using the :func:`Pyro <pyro.Pyro>` class. This is done by the following steps:
52
+
Alternatively, pyro can be run using the :func:`Pyro <pyro.Pyro>` class. This provides
53
+
an interface that enables simulations to be set up and run in a Jupyter notebook - see
54
+
``examples/examples.ipynb`` for an example notebook. A simulation can be set up and run
55
+
by carrying out the following steps:
51
56
52
57
* create a ``Pyro`` object, initializing it with a specific solver
53
58
* initialize the problem, passing in runtime parameters and inputs
54
59
* run the simulation
55
60
56
-
For example, if we wished to use the ``compressible`` solver to run the Kelvin-Helmholtz problem ``kh``, we would do the following:
61
+
For example, if we wished to use the ``compressible`` solver to run the
62
+
Kelvin-Helmholtz problem ``kh``, we would do the following:
57
63
58
64
.. code-block:: python
59
65
@@ -62,7 +68,12 @@ For example, if we wished to use the ``compressible`` solver to run the Kelvin-H
62
68
inputs_file="inputs.kh")
63
69
pyro.run_sim()
64
70
65
-
Instead of using an inputs file to define the problem parameters, we can define a dictionary of parameters and pass them into the :func:`initialize_problem <pyro.Pyro.initialize_problem>` function using the keyword argument ``inputs_dict``. If an inputs file is also passed into the function, the parameters in the dictionary will override any parameters in the file. For example, if we wished to turn off visualization for the previous example, we would do:
71
+
Instead of using an inputs file to define the problem parameters, we can define a
72
+
dictionary of parameters and pass them into the :func:`initialize_problem
73
+
<pyro.Pyro.initialize_problem>` function using the keyword argument ``inputs_dict``.
74
+
If an inputs file is also passed into the function, the parameters in the dictionary
75
+
will override any parameters in the file. For example, if we wished to turn off
76
+
visualization for the previous example, we would do:
66
77
67
78
.. code-block:: python
68
79
@@ -71,21 +82,26 @@ Instead of using an inputs file to define the problem parameters, we can define
71
82
inputs_file="inputs.kh",
72
83
inputs_dict=parameters)
73
84
74
-
It's possible to evolve the simulation forward timestep by timestep manually using the :func:`single_step <pyro.Pyro.single_step>` function (rather than allowing :func:`run_sim <pyro.Pyro.run_sim>` to do this for us). To evolve our example simulation forward by a single step, we'd run
85
+
It's possible to evolve the simulation forward timestep by timestep manually using
86
+
the :func:`single_step <pyro.Pyro.single_step>` function (rather than allowing
87
+
:func:`run_sim <pyro.Pyro.run_sim>` to do this for us). To evolve our example
88
+
simulation forward by a single step, we'd run
75
89
76
90
.. code-block:: python
77
91
78
92
pyro.single_step()
79
93
80
-
This will fill the boundary conditions, compute the timestep ``dt``, evolve a single timestep and do output/visualization (if required).
94
+
This will fill the boundary conditions, compute the timestep ``dt``, evolve a
95
+
single timestep and do output/visualization (if required).
81
96
82
97
83
98
Runtime options
84
99
---------------
85
100
86
101
The behavior of the main driver, the solver, and the problem setup can
87
102
be controlled by runtime parameters specified in the inputs file (or
88
-
via the command line or passed into the ``initialize_problem`` function). Runtime parameters are grouped into sections,
103
+
via the command line or passed into the ``initialize_problem`` function).
104
+
Runtime parameters are grouped into sections,
89
105
with the heading of that section enclosed in ``[ .. ]``. The list of
0 commit comments