From 5a46707e82b524adb568cc6819604492d0c69b13 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 24 Apr 2025 16:09:27 -0500 Subject: [PATCH] Step 81: fix logic inversion when selecting absorbing boundary conditions --- examples/step-81/step-81.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/examples/step-81/step-81.cc b/examples/step-81/step-81.cc index eb1b788c27..9e4eaa13f1 100644 --- a/examples/step-81/step-81.cc +++ b/examples/step-81/step-81.cc @@ -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 (id == 1) 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); -- 2.39.5