<h3> Using R and ggplot2 to generate plots</h3>
-@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
</tr>
</table>
-<h3> Using python to generate plots</h3>
+<h3> Using Python to generate plots</h3>
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
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
<a href="https://plotnine.org/">plotnine</a>.
@code{.py}
We need to import the following from the <code>plotnine</code> package
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
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
@f}
<h3>Simulation parameters</h3>
-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.
<h3>Resonance frequency and bandgap</h3>
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')
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:
<h3>Possibilities for extensions</h3>
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.
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;
// 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;
// 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;
// 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;
// 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 <int dim>
n_q_points, Vector<std::complex<double>>(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<dim>(parameters.lambda, parameters.mu);