]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Address some more review comments
authorMatthias Maier <tamiko@43-1.org>
Tue, 24 May 2022 16:13:40 +0000 (11:13 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 26 May 2022 05:16:02 +0000 (00:16 -0500)
doc/doxygen/references.bib
examples/step-81/doc/builds-on
examples/step-81/doc/intro.dox
examples/step-81/doc/results.dox
examples/step-81/doc/tooltip
examples/step-81/step-81.cc

index b87479c506643075a513a3cf010f9771d3e36550..343eeb489fef21a5c04d9ada486453f2038c29b2 100644 (file)
   SERIES={International Series in Pure and Applied Physics},
 }
 
+@ARTICLE{berenger1994,
+  AUTHOR={Jean-Pierre Bérenger},
+  TITLE={A Perfectly Matched Layer for the Absorption of Electromagnetic
+    Waves},
+  JOURNAL={Journal of Computational Physics},
+  VOLUME={114},
+  PAGES={185-200},
+  YEAR={1994},
+}
+
 @ARTICLE{Gopalakrishnan2003,
   AUTHOR={J. Gopalakrishnan and Pasciak, J. E.},
   TITLE={Overlapping Schwarz preconditioners for indefinite time harmonic
index 850b582a69b18b6e87c84408d26383dbd7c8603e..efaf55a2214023d87ca3ef040c56564fdf1cf592 100644 (file)
@@ -1 +1,2 @@
+step-6
 step-8
index 3c5ac3d6f035050a916ab9f5622f7468ccfce5bc..91247e88c7267465f816575ada510400051f7b55 100644 (file)
@@ -382,19 +382,21 @@ this causes the solution image to be distorted. In order to reduce the resonance
 and distortion in our solutions, we are implementing a Perfectly Matched Layer
 (PML) in the scattering configuration.
 
-The concept of a PML was pioneered by Bérenger and it is is an indispensable tool
-for truncating unbounded domains for wave equations and often used in the
-numerical approximation of scattering problems. It is essentially a thin layer with
-modified material parameters placed near the boundary such that all outgoing
-electromagnetic waves decay exponentially with no “artificial” reflection due to
-truncation of the domain.
-
-Our PML is essentially a concentric circle with modified material coefficients
-($\varepsilon_r, \mu_r, \sigma$). It is located in a small region near the boundary
-$\partial\Omega$ and the transformation of the material coordinates is chosen to
-be a function of the radial distance $\rho$ from the origin $e_r$. The normal field
-$\nu$ of $\Sigma$ is orthogonal to the radial direction $e_r$, which makes
-$\mathbf{J}_a \equiv 0$ and $\mathbf{M}_a \equiv 0$ within the PML.
+The concept of a PML was pioneered by Bérenger @cite Berenger1994
+and it is is an indispensable tool for truncating unbounded domains for
+wave equations and often used in the numerical approximation of scattering
+problems. It is essentially a thin layer with modified material parameters
+placed near the boundary such that all outgoing electromagnetic waves decay
+exponentially with no “artificial” reflection due to truncation of the
+domain.
+
+Our PML is a concentric circle with modified material coefficients
+($\varepsilon_r, \mu_r, \sigma$). It is located in a small region near the
+boundary $\partial\Omega$ and the transformation of the material
+coordinates is chosen to be a function of the radial distance $\rho$ from
+the origin $e_r$. The normal field $\nu$ of $\Sigma$ is orthogonal to the
+radial direction $e_r$, which makes $\mathbf{J}_a \equiv 0$ and
+$\mathbf{M}_a \equiv 0$ within the PML.
 
 @htmlonly
 <p align="center">
index 8542186588f61dfdf95331dc099832e51a32785c..80c3bfd7d800a74eeb7676af753adbd99cfa4353 100644 (file)
@@ -44,12 +44,12 @@ Following are the output images:
       <p> Solution with no interface, Dirichlet boundary conditions and PML strength 0.</p>
       </td>
       <td></td>
-       <td align="center">
+        <td align="center">
       <img src="https://www.dealii.org/images/steps/developer/step-81-nointerface_noabs_PML0.png" alt="Visualization of the solution of step-81 with no interface, no absorbing boundary conditions and PML strength 0" height="210">
-       <p> Solution with no interface, absorbing boundary conditions and PML strength 0.</p>
-       </td>
-       <td></td>
-       <td align="center">
+        <p> Solution with no interface, absorbing boundary conditions and PML strength 0.</p>
+            </td>
+        <td></td>
+            <td align="center">
       <img src="https://www.dealii.org/images/steps/developer/step-81-nointerface_abs_PML4.png" alt="Visualization of the solution of step-81 with no interface, absorbing boundary conditions and PML strength 4" height="210">
       <p> Solution with no interface, absorbing boundary conditions and PML strength 4.</p>
     </td>
@@ -82,19 +82,19 @@ of $E_x$.
 
 <table width="80%" align="center">
   <tr>
-       <td align="center">
+        <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-imagEx_noabs_PML0.png" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 0" height="210">
         <p> Solution with an interface, Dirichlet boundary conditions and PML strength 0.</p>
-       </td>
-       <td></td>
-       <td align="center">
+            </td>
+            <td></td>
+        <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-imagEx_abs_PML0.png" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 0" height="210">
-       <p> Solution with an interface, absorbing boundary conditions and PML strength 0.</p>
+        <p> Solution with an interface, absorbing boundary conditions and PML strength 0.</p>
         </td>
         <td></td>
         <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-imagEx_abs_PML4.png" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 4" height="210">
-       <p> Solution with an interface, absorbing boundary conditions and PML strength 4.</p>
+        <p> Solution with an interface, absorbing boundary conditions and PML strength 4.</p>
         </td>
   </tr>
 </table>
@@ -102,19 +102,19 @@ of $E_x$.
 
 <table width="80%" align="center">
   <tr>
-       <td align="center">
+        <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-realEx_noabs_PML0.png" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 0" height="210">
-       <p> Solution with an interface, Dirichlet boundary conditions and PML strength 0.</p>
-       </td>
-       <td></td>
-       <td align="center">
+        <p> Solution with an interface, Dirichlet boundary conditions and PML strength 0.</p>
+            </td>
+            <td></td>
+        <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-realEx_abs_PML0.png" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 0" height="210">
-       <p> Solution with an interface, absorbing boundary conditions and PML strength 0.</p>
+        <p> Solution with an interface, absorbing boundary conditions and PML strength 0.</p>
         </td>
         <td></td>
         <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-realEx_abs_PML4.png" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 4" height="210">
-       <p> Solution with an interface, absorbing boundary conditions and PML strength 4.</p>
+        <p> Solution with an interface, absorbing boundary conditions and PML strength 4.</p>
     </td>
   </tr>
 </table>
@@ -130,19 +130,19 @@ the standing wave will dissipate more within the PML ring.
 Here are some animations to demonstrate the effect of the PML
 <table width="80%" align="center">
   <tr>
-       <td align="center">
+        <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-dirichlet_Ex.gif" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 0" height="210">
         <p> Solution with an interface, Dirichlet boundary conditions and PML strength 0.</p>
-       </td>
-       <td></td>
-       <td align="center">
+            </td>
+            <td></td>
+        <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-absorbing_Ex.gif" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 0" height="210">
-       <p> Solution with an interface, absorbing boundary conditions and PML strength 0.</p>
+        <p> Solution with an interface, absorbing boundary conditions and PML strength 0.</p>
         </td>
         <td></td>
         <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-perfectly_matched_layer_Ex.gif" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 4" height="210">
-       <p> Solution with an interface, absorbing boundary conditions and PML strength 4.</p>
+        <p> Solution with an interface, absorbing boundary conditions and PML strength 4.</p>
         </td>
   </tr>
 </table>
@@ -150,19 +150,19 @@ Here are some animations to demonstrate the effect of the PML
 
 <table width="80%" align="center">
   <tr>
-       <td align="center">
+        <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-dirichlet_Ey.gif" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 0" height="210">
         <p> Solution with an interface, Dirichlet boundary conditions and PML strength 0.</p>
-       </td>
-       <td></td>
-       <td align="center">
+            </td>
+            <td></td>
+        <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-absorbing_Ey.gif" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 0" height="210">
-       <p> Solution with an interface, absorbing boundary conditions and PML strength 0.</p>
+        <p> Solution with an interface, absorbing boundary conditions and PML strength 0.</p>
         </td>
         <td></td>
         <td align="center">
         <img src="https://www.dealii.org/images/steps/developer/step-81-perfectly_matched_layer_Ey.gif" alt="Visualization of the solution of step-81 with an interface, absorbing boundary conditions and PML strength 4" height="210">
-       <p> Solution with an interface, absorbing boundary conditions and PML strength 4.</p>
+        <p> Solution with an interface, absorbing boundary conditions and PML strength 4.</p>
         </td>
   </tr>
 </table>
index ae43afaffdfd703d9fb78ba855b13551fe18f37a..1ed4f5b8c65e0754b351b57abfca2f0bc4ed2140 100644 (file)
@@ -1 +1 @@
-Creating a mesh. Refining it. Writing it to a file.
+A time-harmonic Maxwell solver with interface jump conditions
index 6b9e9647246c87e7b9bb8de31d25e21858e6c040..0cb2dfeaf22620d6dcffd3f5ccace14ee57b2da5 100644 (file)
@@ -22,7 +22,8 @@
 // The set of include files is quite standard. The most notable include is
 // the fe/fe_nedelec_sz.h file which allows us to use the FE_NedelecSZ elements.
 // This is an implementation of the $H^{curl}$ conforming Nédélec Elements
-// that resolves the sign conflict issues that arise from parametrization.
+// that resolves the sign conflict issues that arise from parametrization
+// (for details we refer to the documentation of the FE_NedelecSZ element).
 
 #include <deal.II/base/function.h>
 #include <deal.II/base/parameter_acceptor.h>
@@ -257,7 +258,8 @@ namespace Step81
   class PerfectlyMatchedLayer : public ParameterAcceptor
   {
   public:
-    static_assert(dim == 2, "dim == 2"); /* only works in 2D */
+    static_assert(dim == 2,
+                  "The perfectly matched layer is only implemented in 2D.");
 
     Parameters<dim> parameters;
 
@@ -267,10 +269,6 @@ namespace Step81
 
     PerfectlyMatchedLayer();
 
-    double inner_radius;
-    double outer_radius;
-    double strength;
-
     std::complex<double> d(const Point<dim> point);
 
     std::complex<double> d_bar(const Point<dim> point);
@@ -285,6 +283,11 @@ namespace Step81
     rank2_type b_matrix(const Point<dim> point);
 
     rank2_type c_matrix(const Point<dim> point);
+
+  private:
+    double inner_radius;
+    double outer_radius;
+    double strength;
   };
 
 
@@ -309,11 +312,18 @@ namespace Step81
   typename std::complex<double>
   PerfectlyMatchedLayer<dim>::d(const Point<dim> point)
   {
-    const auto   radius = point.norm();
-    const double s =
-      strength * ((radius - inner_radius) * (radius - inner_radius)) /
-      ((outer_radius - inner_radius) * (outer_radius - inner_radius));
-    return 1.0 + 1.0i * s;
+    const auto radius = point.norm();
+    if (radius > inner_radius)
+      {
+        const double s =
+          strength * ((radius - inner_radius) * (radius - inner_radius)) /
+          ((outer_radius - inner_radius) * (outer_radius - inner_radius));
+        return 1.0 + 1.0i * s;
+      }
+    else
+      {
+        return 1.0;
+      }
   }
 
 
@@ -321,13 +331,21 @@ namespace Step81
   typename std::complex<double>
   PerfectlyMatchedLayer<dim>::d_bar(const Point<dim> point)
   {
-    const auto   radius = point.norm();
-    const double s_bar =
-      strength / 3. *
-      ((radius - inner_radius) * (radius - inner_radius) *
-       (radius - inner_radius)) /
-      (radius * (outer_radius - inner_radius) * (outer_radius - inner_radius));
-    return 1.0 + 1.0i * s_bar;
+    const auto radius = point.norm();
+    if (radius > inner_radius)
+      {
+        const double s_bar =
+          strength / 3. *
+          ((radius - inner_radius) * (radius - inner_radius) *
+           (radius - inner_radius)) /
+          (radius * (outer_radius - inner_radius) *
+           (outer_radius - inner_radius));
+        return 1.0 + 1.0i * s_bar;
+      }
+    else
+      {
+        return 1.0;
+      }
   }
 
 
@@ -639,24 +657,19 @@ namespace Step81
         for (unsigned int q_point = 0; q_point < n_q_points; ++q_point)
           {
             const Point<dim> &position = quadrature_points[q_point];
-            const auto        radius   = position.norm();
-            const auto inner_radius    = perfectly_matched_layer.inner_radius;
 
             auto       mu_inv  = parameters.mu_inv(position, id);
             auto       epsilon = parameters.epsilon(position, id);
             const auto J_a     = parameters.J_a(position, id);
 
-            if (radius >= inner_radius)
-              {
-                auto A = perfectly_matched_layer.a_matrix(position);
-                auto B = perfectly_matched_layer.b_matrix(position);
-                auto d = perfectly_matched_layer.d(position);
+            const auto A = perfectly_matched_layer.a_matrix(position);
+            const auto B = perfectly_matched_layer.b_matrix(position);
+            const auto d = perfectly_matched_layer.d(position);
 
-                mu_inv  = mu_inv / d;
-                epsilon = invert(A) * epsilon * invert(B);
-              };
+            mu_inv  = mu_inv / d;
+            epsilon = invert(A) * epsilon * invert(B);
 
-            for (unsigned int i = 0; i < dofs_per_cell; ++i)
+            for (const auto i : fe_values.dof_indices())
               {
                 const auto phi_i = real_part.value(i, q_point) -
                                    1.0i * imag_part.value(i, q_point);
@@ -667,7 +680,7 @@ namespace Step81
                   (1.0i * scalar_product(J_a, phi_i)) * fe_values.JxW(q_point);
                 cell_rhs(i) += rhs_value.real();
 
-                for (unsigned int j = 0; j < dofs_per_cell; ++j)
+                for (const auto j : fe_values.dof_indices())
                   {
                     const auto phi_j = real_part.value(j, q_point) +
                                        1.0i * imag_part.value(j, q_point);
@@ -708,34 +721,30 @@ namespace Step81
                          ++q_point)
                       {
                         const auto &position = quadrature_points[q_point];
-                        const auto  radius   = position.norm();
-                        const auto  inner_radius =
-                          perfectly_matched_layer.inner_radius;
 
                         auto mu_inv  = parameters.mu_inv(position, id);
                         auto epsilon = parameters.epsilon(position, id);
 
-                        if (radius >= inner_radius)
-                          {
-                            auto A = perfectly_matched_layer.a_matrix(position);
-                            auto B = perfectly_matched_layer.b_matrix(position);
-                            auto d = perfectly_matched_layer.d(position);
+                        const auto A =
+                          perfectly_matched_layer.a_matrix(position);
+                        const auto B =
+                          perfectly_matched_layer.b_matrix(position);
+                        const auto d = perfectly_matched_layer.d(position);
 
-                            mu_inv  = mu_inv / d;
-                            epsilon = invert(A) * epsilon * invert(B);
-                          };
+                        mu_inv  = mu_inv / d;
+                        epsilon = invert(A) * epsilon * invert(B);
 
                         const auto normal =
                           fe_face_values.normal_vector(q_point);
 
-                        for (unsigned int i = 0; i < dofs_per_cell; ++i)
+                        for (const auto i : fe_face_values.dof_indices())
                           {
                             const auto phi_i =
                               real_part.value(i, q_point) -
                               1.0i * imag_part.value(i, q_point);
                             const auto phi_i_T = tangential_part(phi_i, normal);
 
-                            for (unsigned int j = 0; j < dofs_per_cell; ++j)
+                            for (const auto j : fe_face_values.dof_indices())
                               {
                                 const auto phi_j =
                                   real_part.value(j, q_point) +
@@ -775,28 +784,22 @@ namespace Step81
                      ++q_point)
                   {
                     const auto &position = quadrature_points[q_point];
-                    const auto  radius   = position.norm();
-                    const auto  inner_radius =
-                      perfectly_matched_layer.inner_radius;
 
                     auto sigma = parameters.sigma(position, id1, id2);
 
-                    if (radius >= inner_radius)
-                      {
-                        auto B = perfectly_matched_layer.b_matrix(position);
-                        auto C = perfectly_matched_layer.c_matrix(position);
-                        sigma  = invert(C) * sigma * invert(B);
-                      };
+                    const auto B = perfectly_matched_layer.b_matrix(position);
+                    const auto C = perfectly_matched_layer.c_matrix(position);
+                    sigma        = invert(C) * sigma * invert(B);
 
                     const auto normal = fe_face_values.normal_vector(q_point);
 
-                    for (unsigned int i = 0; i < dofs_per_cell; ++i)
+                    for (const auto i : fe_face_values.dof_indices())
                       {
                         const auto phi_i = real_part.value(i, q_point) -
                                            1.0i * imag_part.value(i, q_point);
                         const auto phi_i_T = tangential_part(phi_i, normal);
 
-                        for (unsigned int j = 0; j < dofs_per_cell; ++j)
+                        for (const auto j : fe_face_values.dof_indices())
                           {
                             const auto phi_j =
                               real_part.value(j, q_point) +

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.