]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix step-30. 18637/head
authorDavid Wells <drwells@email.unc.edu>
Mon, 7 Jul 2025 13:32:21 +0000 (09:32 -0400)
committerDavid Wells <drwells@email.unc.edu>
Mon, 7 Jul 2025 14:48:59 +0000 (10:48 -0400)
We assume these arrays are filled with zeros - without the explicit initialization
(via = {}) they instead contain arbitrary values (i.e., undefined
behavior).

examples/step-30/step-30.cc

index 39f6b08f4bdb4d07fd8440ef0454dd47c8824ecb..d394f843f1b491aa0c7779354b096a551257bb09 100644 (file)
@@ -711,8 +711,8 @@ namespace Step30
       // We only need to consider cells which are flagged for refinement.
       if (cell->refine_flag_set())
         {
-          std::array<double, dim> jump_in_coordinate_direction;
-          std::array<double, dim> face_area_in_coordinate_direction;
+          std::array<double, dim> jump_in_coordinate_direction      = {};
+          std::array<double, dim> face_area_in_coordinate_direction = {};
 
           for (const auto face_no : cell->face_indices())
             {

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.