]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Step 81: fix logic inversion when selecting absorbing boundary conditions 18385/head
authorMatthias Maier <tamiko@43-1.org>
Thu, 24 Apr 2025 21:09:27 +0000 (16:09 -0500)
committerMatthias Maier <tamiko@43-1.org>
Thu, 24 Apr 2025 21:33:03 +0000 (16:33 -0500)
examples/step-81/step-81.cc

index eb1b788c279bd415e1d8d5161dc79a540d414cc7..9e4eaa13f1303c0e2a5be45e4c4cb41f5b44f2d4 100644 (file)
@@ -504,7 +504,7 @@ namespace Step81
     GridGenerator::hyper_cube(triangulation, -scaling, scaling);
     triangulation.refine_global(refinements);
 
-    if (!absorbing_boundary)
+    if (absorbing_boundary)
       {
         for (auto &face : triangulation.active_face_iterators())
           if (face->at_boundary())
@@ -710,6 +710,11 @@ namespace Step81
         // \f}
         // respectively. The test variables and the PML are implemented
         // similarly as the domain.
+        //
+        // If we are at the domain boundary $\partial\Omega$ and absorbing
+        // boundary conditions are set (<code>id == 1</code>) we assemble
+        // the corresponding boundary term:
+        //
         const FEValuesExtractors::Vector real_part(0);
         const FEValuesExtractors::Vector imag_part(dim);
         for (const auto &face : cell->face_iterators())
@@ -717,7 +722,7 @@ namespace Step81
             if (face->at_boundary())
               {
                 const auto id = face->boundary_id();
-                if (id != 0)
+                if (id == 1)
                   {
                     fe_face_values.reinit(cell, face);
 

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.