diff --git a/docs/source/manual/advanced_usage.rst b/docs/source/manual/advanced_usage.rst index 3554c67a..8c7a9f5d 100644 --- a/docs/source/manual/advanced_usage.rst +++ b/docs/source/manual/advanced_usage.rst @@ -7,7 +7,7 @@ A crucial aspect of partial differential equations are boundary conditions, whic to be specified at the domain boundaries. For the simple domains contained in `py-pde`, all boundaries are orthogonal to one of the axes in the domain, so boundary conditions need to be applied to both sides of each axis. Here, the lower side of an axis can have -a differnt condition than the upper side. For instance, one can enforce the value of a +a different condition than the upper side. For instance, one can enforce the value of a field to be `4` at the lower side and its derivative (in the outward direction) to be `2` on the upper side using the following code: @@ -171,7 +171,7 @@ defined in this package. Note that operators need to be specified with their ful i.e., `laplace` for a scalar Laplacian and `vector_laplace` for a Laplacian operating on a vector field. Moreover, the dot product between two vector fields can be denoted by using :code:`dot(field1, field2)` in the expression, and :code:`outer(field1, field2)` -calculates an outer product. In this case, boundary conditons for the operators can be +calculates an outer product. In this case, boundary conditions for the operators can be specified using the `bc` argument, in which case the same boundary conditions are applied to all operators. The additional argument `bc_ops` provides a more fine-grained control, where conditions for each individual operator can be specified. @@ -182,9 +182,9 @@ field is defined on a two-dimensional Cartesian grid, the variables :code:`x` an :math:`x`-direction, one can use either :code:`(x > 5)` or :code:`heaviside(x - 5, 0.5)`, where the second argument denotes the returned value in case the first argument is `0`. For convenience, Cartesian coordinates are also available when using curvilinear grids. -The respective coordinate values at a point can be acccessed using :code:`cartesian[i]`, +The respective coordinate values at a point can be accessed using :code:`cartesian[i]`, where :code:`i` is an index, e.g., `i=0` for the first axis (normally the x-axis). -Finally, expressions for equations in :class:`~pde.pdes.pde.PDE` can explicitely depend +Finally, expressions for equations in :class:`~pde.pdes.pde.PDE` can explicitly depend on time, which is denoted by the variable :code:`t`. Expressions also support user-defined functions via the `user_funcs` argument, which is diff --git a/docs/source/manual/basic_usage.rst b/docs/source/manual/basic_usage.rst index c5e891e1..5a4e261c 100644 --- a/docs/source/manual/basic_usage.rst +++ b/docs/source/manual/basic_usage.rst @@ -90,8 +90,8 @@ and the operators defined by the package. Running the simulation """""""""""""""""""""" -To solve the PDE, we first need to generate an initial condition, i.e., the initial -values of the fields that are evolved forward in time by the PDE. +To solve the PDE, we use the generated initial condition, i.e., the initial +field :code:`field`, which are evolved forward in time by the PDE. This field also defined the geometry on which the PDE is solved. In the simplest case, the solution is then obtain by running @@ -135,6 +135,6 @@ subsequently: for time, field in storage.items(): print(f"t={time}, field={field.magnitude}") -Moreover, a movie of the simulation can be created using +Moreover, a movie of the simulation can be created using :func:`~pde.visualization.movies.movie`, i.e., by calling :code:`pde.movie(storage, filename=FILE)`, where `FILE` determines where the movie is written. diff --git a/docs/source/manual/mathematical_basics.rst b/docs/source/manual/mathematical_basics.rst index f63d8e4c..5311ef4b 100644 --- a/docs/source/manual/mathematical_basics.rst +++ b/docs/source/manual/mathematical_basics.rst @@ -14,12 +14,13 @@ methods as described below. Curvilinear coordinates """"""""""""""""""""""" -The package supports multiple curvilinear coordinate systems. They allow to exploit +The package supports multiple curvilinear coordinate systems through :mod:`pde.grids.coordinates`. +They allow to exploit symmetries present in physical systems. Consequently, many grids implemented in `py-pde` inherently assume symmetry of the described fields. However, a drawback of curvilinear coordinates are the fact that the basis vectors now depend on position, which makes tensor fields less intuitive and complicates the expression of differential -operators. To avoid confusion, we here specify the used coordinate systems explictely: +operators. To avoid confusion, we here specify the used coordinate systems explicitly: Polar coordinates ----------------- @@ -131,7 +132,7 @@ which is also indicated in the inset. Differential operators are implemented using the usual second-order central differences. -This requires the introducing of virtual support points at :math:`x_{-1}` and +This requires introducing virtual support points at :math:`x_{-1}` and :math:`x_N`, which can be determined from the boundary conditions at :math:`x=x_\mathrm{min}` and :math:`x=x_\mathrm{max}`, respectively. The field classes automate this transparently. diff --git a/docs/source/manual/performance.rst b/docs/source/manual/performance.rst index 5a21b650..729525f0 100644 --- a/docs/source/manual/performance.rst +++ b/docs/source/manual/performance.rst @@ -58,13 +58,6 @@ To enable those, it's best to specify an initial time step, like so eq.solve(t_range=10, dt=1e-3, adaptive=True) -An additional advantage of this choice is that it selects -:class:`~pde.solvers.explicit.ExplicitSolver`, which is also compiled with :mod:`numba` -for speed. -Alternatively, if only `t_range` is specified, the generic scipy-solver -:class:`~pde.solvers.scipy.ScipySolver`, which can be significantly slower. - - Additional factors influencing the performance of the package include the compiler used for :mod:`numpy`, :mod:`scipy`, and of course :mod:`numba`. Moreover, the BLAS and LAPACK libraries might make a difference. @@ -79,9 +72,9 @@ of typical packages .. code-block:: bash - port install py37-numpy +gcc8+openblas - port install py37-scipy +gcc8+openblas - port install py37-numba +tbb + port install py312-numpy +gcc14+openblas + port install py312-scipy +gcc14+openblas + port install py312-numba +tbb Note that you can disable the automatic multithreading via :ref:`configuration`. @@ -139,7 +132,7 @@ To avoid confusion, trackers will only be used on one process and also the resul only returned in one process to avoid problems where multiple process write data simultaneously. Consequently, the example above checked whether `result is None` (in which case the -corresponnding process is a child process) and only resumes analysis when the result is +corresponding process is a child process) and only resumes analysis when the result is actually present. The automatic treatment tries to use sensible default values, so typical simulations diff --git a/pde/grids/coordinates/cylindrical.py b/pde/grids/coordinates/cylindrical.py index 22dfa3a0..7f97d664 100644 --- a/pde/grids/coordinates/cylindrical.py +++ b/pde/grids/coordinates/cylindrical.py @@ -11,7 +11,7 @@ class CylindricalCoordinates(CoordinatesBase): - """N-dimensional Cartesian coordinates.""" + """3-dimensional cylindrical coordinates.""" _singleton: CylindricalCoordinates | None = None dim = 3