From: Timo Heister Date: Tue, 24 Sep 2024 01:00:20 +0000 (-0400) Subject: capitalize Python and Jupyter X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=888445510c23229112221465b33025a1fc7e949f;p=dealii.git capitalize Python and Jupyter --- diff --git a/examples/step-3/doc/results.dox b/examples/step-3/doc/results.dox index a79dc6088e..558e8dcd29 100644 --- a/examples/step-3/doc/results.dox +++ b/examples/step-3/doc/results.dox @@ -359,7 +359,7 @@ data_file.write_dataset("mean_value",mean_value);

Using R and ggplot2 to generate plots

-@note Alternatively, one could use the python code in the next subsection. +@note Alternatively, one could use the Python code in the next subsection. The data put into %HDF5 files above can then be used from scripting languages for further postprocessing. In the following, let us show @@ -548,7 +548,7 @@ to zero: -

Using python to generate plots

+

Using Python to generate plots

In this section we discuss the postprocessing of the data stored in %HDF5 files using the "python" programming language. The necessary packages to import are @@ -704,7 +704,7 @@ plt.ylabel("point value error") plt.show() @endcode -A python package which mimics the `R` ggplot2 (which is based on specifying the grammar of the graphics) is +A Python package which mimics the `R` ggplot2 (which is based on specifying the grammar of the graphics) is plotnine. @code{.py} We need to import the following from the plotnine package diff --git a/examples/step-49/doc/intro.dox b/examples/step-49/doc/intro.dox index fb56c7f1a2..bc3e5e164e 100644 --- a/examples/step-49/doc/intro.dox +++ b/examples/step-49/doc/intro.dox @@ -7,7 +7,7 @@ This tutorial is an extension to step-1 and demonstrates several ways to obtain more involved meshes than the ones shown there. @note This tutorial is also available as a Jupyter Python notebook that - uses the deal.II python interface. The notebook is available in the + uses the deal.II Python interface. The notebook is available in the same directory as the original C++ program. Generating complex geometries is a challenging task, especially in three space diff --git a/examples/step-62/doc/intro.dox b/examples/step-62/doc/intro.dox index 8ba8d83d16..a03c873daf 100644 --- a/examples/step-62/doc/intro.dox +++ b/examples/step-62/doc/intro.dox @@ -58,7 +58,7 @@ There are two regimes that depend on the waveguide width: This case can be solved using FEM or with a [scattering matrix formalism](https://doi.org/10.1103/PhysRevA.94.033813). Although we do not study this case in this tutorial, it is very easy to reach the multimode - regime by increasing the parameter waveguide width (`dimension_y` in the jupyter notebook). + regime by increasing the parameter waveguide width (`dimension_y` in the Jupyter Notebook). The simulations of this tutorial are performed in the frequency domain. To calculate the transmission spectrum, we use a @@ -165,8 +165,8 @@ F_i &=& \int_\Omega\varphi_m^i f_m @f}

Simulation parameters

-In this tutorial we use a python -[jupyter notebook](https://github.com/dealii/dealii/blob/master/examples/step-62/step-62.ipynb) +In this tutorial we use a Python +[Jupyter Notebook](https://github.com/dealii/dealii/blob/master/examples/step-62/step-62.ipynb) to set up the parameters and run the simulation. First we create a HDF5 file where we store the parameters and the results of the simulation. diff --git a/examples/step-62/doc/results.dox b/examples/step-62/doc/results.dox index c1a656760e..f04861758e 100644 --- a/examples/step-62/doc/results.dox +++ b/examples/step-62/doc/results.dox @@ -3,7 +3,7 @@

Resonance frequency and bandgap

The results are analyzed in the -[jupyter notebook](https://github.com/dealii/dealii/blob/master/examples/step-62/step-62.ipynb) +[Jupyter Notebook](https://github.com/dealii/dealii/blob/master/examples/step-62/step-62.ipynb) with the following code @code{.py} h5_file = h5py.File('results.h5', 'r') @@ -79,7 +79,7 @@ has a gaussian shape a^2 = a_\textrm{max}^2\frac{\omega^2\Gamma^2}{(\omega_r^2-\omega^2)^2+\Gamma^2\omega^2} @f] where $f_r = \frac{\omega_r}{2\pi}$ is the resonance frequency and $\Gamma=\frac{\omega_r}{Q}$ is the dissipation rate. -We used the previous equation in the jupyter notebook to fit the mechanical resonance. +We used the previous equation in the Jupyter Notebook to fit the mechanical resonance. Given the values we have chosen for the parameters, one could estimate the resonance frequency analytically. Indeed, this is then confirmed by what we get in this program: @@ -137,7 +137,7 @@ macroscopic quantum harmonic oscillator.

Possibilities for extensions

Instead of setting the parameters in the C++ file we could set the parameters -using a python script and save them in the HDF5 file that we will use for +using a Python script and save them in the HDF5 file that we will use for the simulations. Then the deal.II program will read the parameters from the HDF5 file. diff --git a/examples/step-62/step-62.cc b/examples/step-62/step-62.cc index 8ca692c73c..64e773ad05 100644 --- a/examples/step-62/step-62.cc +++ b/examples/step-62/step-62.cc @@ -96,7 +96,7 @@ namespace step62 HDF5::Group data; // The simulation parameters are stored in `data` as HDF5 attributes. The - // following attributes are defined in the jupyter notebook, stored in + // following attributes are defined in the Jupyter Notebook, stored in // `data` as HDF5 attributes and then read by the constructor. const double max_force_amplitude; const double force_sigma_x; @@ -127,8 +127,8 @@ namespace step62 // HDF5::Group in which all the simulation results will be stored. HDF5::Group data; - // The same as before, the following attributes are defined in the jupyter - // notebook, stored in `data` as HDF5 attributes and then read by the + // The same as before, the following attributes are defined in the Jupyter + // Notebook, stored in `data` as HDF5 attributes and then read by the // constructor. const double pml_coeff; const int pml_coeff_degree; @@ -159,8 +159,8 @@ namespace step62 // HDF5::Group in which all the simulation results will be stored. HDF5::Group data; - // The same as before, the following attributes are defined in the jupyter - // notebook, stored in `data` as HDF5 attributes and then read by the + // The same as before, the following attributes are defined in the Jupyter + // Notebook, stored in `data` as HDF5 attributes and then read by the // constructor. const double lambda; const double mu; @@ -186,8 +186,8 @@ namespace step62 // HDF5::Group in which all the simulation results will be stored. HDF5::Group data; - // The same as before, the following attributes are defined in the jupyter - // notebook, stored in `data` as HDF5 attributes and then read by the + // The same as before, the following attributes are defined in the Jupyter + // Notebook, stored in `data` as HDF5 attributes and then read by the // constructor. const std::string simulation_name; const bool save_vtu_files; @@ -424,8 +424,8 @@ namespace step62 // As before, the constructor reads all the parameters from the HDF5::Group // `data` using the HDF5::Group::get_attribute() function. As we have - // discussed, a quadratic turn-on of the PML has been defined in the jupyter - // notebook. It is possible to use a linear, cubic or another power degree by + // discussed, a quadratic turn-on of the PML has been defined in the Jupyter + // Notebook. It is possible to use a linear, cubic or another power degree by // changing the parameter `pml_coeff_degree`. The parameters `pml_x` and // `pml_y` can be used to turn on and off the `x` and `y` PMLs. template @@ -809,7 +809,7 @@ namespace step62 n_q_points, Vector>(dim)); // We calculate the stiffness tensor for the $\lambda$ and $\mu$ that have - // been defined in the jupyter notebook. Note that contrary to $\rho$ the + // been defined in the Jupyter Notebook. Note that contrary to $\rho$ the // stiffness is constant among for the whole domain. const SymmetricTensor<4, dim> stiffness_tensor = get_stiffness_tensor(parameters.lambda, parameters.mu);