]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Where possible, replace '#ifdef DEBUG' by 'if constexpr(...debug mode...') in tests/. 18057/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 27 Feb 2025 22:01:05 +0000 (15:01 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 27 Feb 2025 22:01:05 +0000 (15:01 -0700)
35 files changed:
tests/adolc/helper_scalar_failure_01.cc
tests/adolc/helper_scalar_failure_02.cc
tests/adolc/helper_scalar_failure_03.cc
tests/adolc/helper_scalar_failure_04.cc
tests/adolc/helper_scalar_failure_05.cc
tests/fe/fe_enriched_color_08.cc
tests/fe/fe_nedelec_sz_hanging_nodes_convergence.cc
tests/hp/fe_nothing_dominates.h
tests/hp/limit_p_level_difference_01.cc
tests/hp/limit_p_level_difference_02.cc
tests/hp/limit_p_level_difference_03.cc
tests/matrix_free/fe_evaluation_shift.cc
tests/mpi/hp_cell_weights_01.cc
tests/mpi/hp_cell_weights_02.cc
tests/mpi/hp_cell_weights_03.cc
tests/mpi/hp_cell_weights_04.cc
tests/mpi/hp_constraints_consistent_01.cc
tests/mpi/hp_constraints_consistent_02.cc
tests/mpi/hp_constraints_consistent_03.cc
tests/mpi/hp_step-4.cc
tests/mpi/limit_p_level_difference_01.cc
tests/mpi/limit_p_level_difference_02.cc
tests/mpi/limit_p_level_difference_03.cc
tests/mpi/petsc_step-27.cc
tests/mpi/trilinos_step-27.cc
tests/sharedtria/limit_p_level_difference_01.cc
tests/sharedtria/limit_p_level_difference_02.cc
tests/sharedtria/limit_p_level_difference_03.cc
tests/simplex/hanging_nodes.h
tests/simplex/simplex_grids.h
tests/symengine/substitution_maps_scalar_01.cc
tests/symengine/substitution_maps_scalar_02.cc
tests/symengine/symengine_tensor_operations_03.cc
tests/trilinos/assemble_matrix_parallel_04.cc
tests/trilinos/assemble_matrix_parallel_06.cc

index b0833e34339f9c693578165fa521a0c4708b721f..68a4a56f89e190b9ddbe000bcde269148dca750b 100644 (file)
@@ -93,13 +93,17 @@ main()
   initlog();
 
   deal_II_exceptions::disable_abort_on_exception();
-#ifdef DEBUG
-  // Asserts should be triggered
-  const bool expected_result = false;
-#else
-  // User beware: Asserts ignored
-  const bool expected_result = true;
-#endif
+  bool expected_result;
+  if constexpr (running_in_debug_mode())
+    {
+      // Asserts should be triggered
+      expected_result = false;
+    }
+  else
+    {
+      // User beware: Asserts ignored
+      expected_result = true;
+    }
 
   const unsigned int dim = 2;
   AssertThrow(
index e19b136ad1d3cbd6c21e17059c52bc45b8b3e9ee..68b4b57c6c190ac4b5c560bb2306d64aa40b444f 100644 (file)
@@ -95,13 +95,17 @@ main()
   initlog();
 
   deal_II_exceptions::disable_abort_on_exception();
-#ifdef DEBUG
-  // Asserts should be triggered
-  const bool expected_result = false;
-#else
-  // User beware: Asserts ignored
-  const bool expected_result = true;
-#endif
+  bool expected_result;
+  if constexpr (running_in_debug_mode())
+    {
+      // Asserts should be triggered
+      expected_result = false;
+    }
+  else
+    {
+      // User beware: Asserts ignored
+      expected_result = true;
+    }
 
   const unsigned int dim = 2;
   AssertThrow(
index 19767d78d11598272eeb1c843f2c6942d85ba800..42bbbc2c4f007ffc17a24bde9c94c1ccc836e427 100644 (file)
@@ -96,13 +96,17 @@ main()
   initlog();
 
   deal_II_exceptions::disable_abort_on_exception();
-#ifdef DEBUG
-  // Asserts should be triggered
-  const bool expected_result = false;
-#else
-  // User beware: Asserts ignored
-  const bool expected_result = true;
-#endif
+  bool expected_result;
+  if constexpr (running_in_debug_mode())
+    {
+      // Asserts should be triggered
+      expected_result = false;
+    }
+  else
+    {
+      // User beware: Asserts ignored
+      expected_result = true;
+    }
 
   const unsigned int dim = 2;
   AssertThrow(
index f874f1df0a7248104cf145ce9b3448a00f463559..b808efbe0c9e812ddcf5c4b4bce6a25f62133ff1 100644 (file)
@@ -94,15 +94,20 @@ main()
   initlog();
 
   deal_II_exceptions::disable_abort_on_exception();
-#ifdef DEBUG
-  // Asserts should be triggered
-  const bool expected_result_taped    = false;
-  const bool expected_result_tapeless = false;
-#else
-  // User beware: Asserts ignored
-  const bool expected_result_taped    = true;
-  const bool expected_result_tapeless = false;
-#endif
+  bool expected_result_taped;
+  bool expected_result_tapeless;
+  if constexpr (running_in_debug_mode())
+    {
+      // Asserts should be triggered
+      expected_result_taped    = false;
+      expected_result_tapeless = false;
+    }
+  else
+    {
+      // User beware: Asserts ignored
+      expected_result_taped    = true;
+      expected_result_tapeless = false;
+    }
 
   const unsigned int dim = 2;
   AssertThrow((test_incorrect_no_of_ind_vars<dim,
index 20b941a9d10de9d9c44604eabeba20b6f5aee0c1..865dfed0a79476dbe7f494ee817aca155dcee614 100644 (file)
@@ -96,13 +96,17 @@ main()
   initlog();
 
   deal_II_exceptions::disable_abort_on_exception();
-#ifdef DEBUG
-  // Asserts should be triggered
-  const bool expected_result = false;
-#else
-  // User beware: Asserts ignored
-  const bool expected_result = true;
-#endif
+  bool expected_result;
+  if constexpr (running_in_debug_mode())
+    {
+      // Asserts should be triggered
+      expected_result = false;
+    }
+  else
+    {
+      // User beware: Asserts ignored
+      expected_result = true;
+    }
 
   const unsigned int dim = 2;
   AssertThrow(
index c6cd882251ce815a63a3af553496038dd449ae43..2f871bbd48604cf9d4f4f0ea83805a0aafeb1fed 100644 (file)
@@ -45,9 +45,6 @@
 
 #include "../tests.h"
 
-#undef DEBUG
-
-#ifdef DEBUG
 // used only for debugging
 template <int dim>
 void
@@ -162,7 +159,6 @@ plot_shape_function(DoFHandler<dim> &dof_handler, unsigned int patches = 5)
 
   deallog << "...finished plotting shape functions" << std::endl;
 }
-#endif
 
 
 
@@ -280,9 +276,7 @@ main(int argc, char **argv)
 
   constraints.print(deallog.get_file_stream());
 
-#ifdef DEBUG
-  plot_shape_function(dof_handler);
-#endif
+  //  plot_shape_function(dof_handler);
 
   dof_handler.clear();
   return 0;
index 5612038d71c644fd4b5e636c2b7ec8669ad376ae..955d9733d27906ca23005a4b29210bc07caedc69 100644 (file)
@@ -428,13 +428,9 @@ main()
 
   using namespace ConvergenceTest;
 
-  const unsigned int refinements = 1;
-  const unsigned int poly_degree = 2;
-#ifdef DEBUG
-  const unsigned int n_iterations = 2;
-#else
-  const unsigned int n_iterations = 3;
-#endif
+  const unsigned int refinements  = 1;
+  const unsigned int poly_degree  = 2;
+  const unsigned int n_iterations = (running_in_debug_mode ? 2 : 3);
 
   MaxwellProblem<2> maxwell_2d(refinements, poly_degree, n_iterations);
   maxwell_2d.run();
index 9b923a54508fde85866cd22181d1b3f08431221e..b11deb7cbcc7330082ebfd99e630c011b572b662 100644 (file)
@@ -43,13 +43,14 @@ project(const hp::FECollection<dim> &fe_collection,
         const hp::QCollection<dim>  &q_collection,
         const Function<dim>         &function)
 {
-#ifdef DEBUG
-  Assert(fe_collection.size() == 2, ExcInternalError());
-  Assert(q_collection.size() == 2, ExcInternalError());
-  for (unsigned int f = 0; f < fe_collection.size(); ++f)
-    Assert(fe_collection[f].n_components() == function.n_components,
-           ExcInternalError());
-#endif
+  if constexpr (running_in_debug_mode())
+    {
+      Assert(fe_collection.size() == 2, ExcInternalError());
+      Assert(q_collection.size() == 2, ExcInternalError());
+      for (unsigned int f = 0; f < fe_collection.size(); ++f)
+        Assert(fe_collection[f].n_components() == function.n_components,
+               ExcInternalError());
+    }
 
   // setup
   // +---+---+
index 868bbb8ee8c47135261079241a5518fa6bc6af89..e9f765ac3fb0aa814b60fae4dd4669975b78431c 100644 (file)
@@ -88,19 +88,21 @@ test(const unsigned int fes_size, const unsigned int max_difference)
     count[cell->active_fe_index()]++;
   deallog << "fe count:" << count << std::endl;
 
-#ifdef DEBUG
-  // check each cell's active FE index by its distance from the center
-  for (const auto &cell : dofh.active_cell_iterators())
+  if constexpr (running_in_debug_mode())
     {
-      const double distance = cell->center().distance(center_cell->center());
-      const unsigned int expected_level =
-        (sequence.size() - 1) -
-        max_difference * static_cast<unsigned int>(std::round(distance));
-
-      Assert(cell->active_fe_index() == sequence[expected_level],
-             ExcInternalError());
+      // check each cell's active FE index by its distance from the center
+      for (const auto &cell : dofh.active_cell_iterators())
+        {
+          const double distance =
+            cell->center().distance(center_cell->center());
+          const unsigned int expected_level =
+            (sequence.size() - 1) -
+            max_difference * static_cast<unsigned int>(std::round(distance));
+
+          Assert(cell->active_fe_index() == sequence[expected_level],
+                 ExcInternalError());
+        }
     }
-#endif
 
   deallog << "OK" << std::endl;
 }
index 81abc9823bc649043b6b08221ee34002246e8519..760fa386371f2fff479708b1e1adc31509c859d1 100644 (file)
@@ -95,19 +95,20 @@ test(const unsigned int fes_size, const unsigned int max_difference)
     }
   Assert(center_cell->active_fe_index() == sequence.back(), ExcInternalError());
 
-#ifdef DEBUG
-  // check each cell's active FE index by its distance from the center
-  for (const auto &cell : dofh.active_cell_iterators())
+  if constexpr (running_in_debug_mode())
     {
-      const double       distance = cell->center().distance(Point<dim>());
-      const unsigned int expected_level =
-        (sequence.size() - 1) -
-        max_difference * static_cast<unsigned int>(std::round(distance));
-
-      Assert(cell->active_fe_index() == sequence[expected_level],
-             ExcInternalError());
+      // check each cell's active FE index by its distance from the center
+      for (const auto &cell : dofh.active_cell_iterators())
+        {
+          const double       distance = cell->center().distance(Point<dim>());
+          const unsigned int expected_level =
+            (sequence.size() - 1) -
+            max_difference * static_cast<unsigned int>(std::round(distance));
+
+          Assert(cell->active_fe_index() == sequence[expected_level],
+                 ExcInternalError());
+        }
     }
-#endif
 
   deallog << "OK" << std::endl;
 }
index ce75a726bd2bb9ab2744fee4f07db0104c2055e1..1034453e0ced7e6388087e3eb844fc4a591e66b6 100644 (file)
@@ -98,18 +98,19 @@ test(const unsigned int fes_size, const unsigned int max_difference)
   (void)fe_indices_changed;
   Assert(fe_indices_changed, ExcInternalError());
 
-#ifdef DEBUG
-  // check each cell's active FE by its h-level
-  for (unsigned int l = 0; l < tria.n_levels(); ++l)
-    for (const auto &cell : dofh.cell_iterators_on_level(l))
-      if (cell->is_active())
-        {
-          const unsigned int expected_level = std::max(
-            0, static_cast<int>(sequence.size() - 1 - l * max_difference));
-          Assert(cell->active_fe_index() == sequence[expected_level],
-                 ExcInternalError());
-        }
-#endif
+  if constexpr (running_in_debug_mode())
+    {
+      // check each cell's active FE by its h-level
+      for (unsigned int l = 0; l < tria.n_levels(); ++l)
+        for (const auto &cell : dofh.cell_iterators_on_level(l))
+          if (cell->is_active())
+            {
+              const unsigned int expected_level = std::max(
+                0, static_cast<int>(sequence.size() - 1 - l * max_difference));
+              Assert(cell->active_fe_index() == sequence[expected_level],
+                     ExcInternalError());
+            }
+    }
 
   deallog << "OK" << std::endl;
 }
index ae41d860663d006dde8fe847c7ef79c23df52419..eda70dac538cdfdd8dedfe05d64741203db03229 100644 (file)
@@ -137,13 +137,14 @@ namespace dealii
     else
       this->data = this->shape_info_base;
 
-#ifdef DEBUG
-    this->is_reinitialized           = true;
-    this->dof_values_initialized     = false;
-    this->values_quad_initialized    = false;
-    this->gradients_quad_initialized = false;
-    this->hessians_quad_initialized  = false;
-#endif
+    if constexpr (running_in_debug_mode())
+      {
+        this->is_reinitialized           = true;
+        this->dof_values_initialized     = false;
+        this->values_quad_initialized    = false;
+        this->gradients_quad_initialized = false;
+        this->hessians_quad_initialized  = false;
+      }
   }
 
   template <int dim,
@@ -241,13 +242,14 @@ namespace dealii
     else
       this->data = this->shape_info_base;
 
-#ifdef DEBUG
-    this->is_reinitialized           = true;
-    this->dof_values_initialized     = false;
-    this->values_quad_initialized    = false;
-    this->gradients_quad_initialized = false;
-    this->hessians_quad_initialized  = false;
-#endif
+    if constexpr (running_in_debug_mode())
+      {
+        this->is_reinitialized           = true;
+        this->dof_values_initialized     = false;
+        this->values_quad_initialized    = false;
+        this->gradients_quad_initialized = false;
+        this->hessians_quad_initialized  = false;
+      }
   }
 } // namespace dealii
 
index 885c60973296d8224aa9cd9687dc42a31985f633..f7dfcb026dfd633aa5d8d3ebb90058a06130c991 100644 (file)
@@ -90,27 +90,30 @@ test()
     deallog << "  Cumulative dofs per cell: " << dof_counter << std::endl;
   }
 
-#ifdef DEBUG
-  parallel::distributed::Triangulation<dim> other_tria(MPI_COMM_WORLD);
-  GridGenerator::hyper_cube(other_tria);
-  other_tria.refine_global(2);
-
-  dh.reinit(other_tria);
-  dh.distribute_dofs(fe_collection);
-
-  try
+  if constexpr (running_in_debug_mode())
     {
-      tria.repartition();
+      parallel::distributed::Triangulation<dim> other_tria(MPI_COMM_WORLD);
+      GridGenerator::hyper_cube(other_tria);
+      other_tria.refine_global(2);
+
+      dh.reinit(other_tria);
+      dh.distribute_dofs(fe_collection);
+
+      try
+        {
+          tria.repartition();
+        }
+      catch (const ExceptionBase &e)
+        {
+          deallog << e.get_exc_name() << std::endl;
+        }
     }
-  catch (const ExceptionBase &e)
+  else
     {
-      deallog << e.get_exc_name() << std::endl;
+      deallog
+        << "ExcMessage(\"Triangulation associated with the DoFHandler has changed!\")"
+        << std::endl;
     }
-#else
-  deallog
-    << "ExcMessage(\"Triangulation associated with the DoFHandler has changed!\")"
-    << std::endl;
-#endif
 
   // make sure no processor is hanging
   MPI_Barrier(MPI_COMM_WORLD);
index f3b59127736adac6a1eb069b8d34da35e6eb6ce3..a725ce9a72c33dea70830433a4028117b1c5aa0f 100644 (file)
@@ -96,27 +96,30 @@ test()
     deallog << "  Cumulative dofs per cell: " << dof_counter << std::endl;
   }
 
-#ifdef DEBUG
-  parallel::distributed::Triangulation<dim> other_tria(MPI_COMM_WORLD);
-  GridGenerator::hyper_cube(other_tria);
-  other_tria.refine_global(3);
-
-  dh.reinit(other_tria);
-  dh.distribute_dofs(fe_collection);
-
-  try
+  if constexpr (running_in_debug_mode())
     {
-      tria.repartition();
+      parallel::distributed::Triangulation<dim> other_tria(MPI_COMM_WORLD);
+      GridGenerator::hyper_cube(other_tria);
+      other_tria.refine_global(3);
+
+      dh.reinit(other_tria);
+      dh.distribute_dofs(fe_collection);
+
+      try
+        {
+          tria.repartition();
+        }
+      catch (const ExceptionBase &e)
+        {
+          deallog << e.get_exc_name() << std::endl;
+        }
     }
-  catch (const ExceptionBase &e)
+  else
     {
-      deallog << e.get_exc_name() << std::endl;
+      deallog
+        << "ExcMessage(\"Triangulation associated with the DoFHandler has changed!\")"
+        << std::endl;
     }
-#else
-  deallog
-    << "ExcMessage(\"Triangulation associated with the DoFHandler has changed!\")"
-    << std::endl;
-#endif
 
   // make sure no processor is hanging
   MPI_Barrier(MPI_COMM_WORLD);
index df5768bc70ead61aa1128c77c0f025e8eeb60979..02223e275968a321c4d42c7ab2f855f419f35150 100644 (file)
@@ -97,34 +97,37 @@ test()
     deallog << "  Cumulative dofs per cell: " << dof_counter << std::endl;
   }
 
-#ifdef DEBUG
-  parallel::shared::Triangulation<dim> other_tria(
-    MPI_COMM_WORLD,
-    ::Triangulation<dim>::none,
-    false,
-    parallel::shared::Triangulation<dim>::Settings::partition_metis);
-  GridGenerator::hyper_cube(other_tria);
-  other_tria.refine_global(3);
-
-  dh.reinit(other_tria);
-  dh.distribute_dofs(fe_collection);
-
-  try
+  if constexpr (running_in_debug_mode())
     {
-      tria.execute_coarsening_and_refinement();
-      deallog << "Error: we did not throw an exception when we should have"
-              << std::endl;
-      std::abort();
+      parallel::shared::Triangulation<dim> other_tria(
+        MPI_COMM_WORLD,
+        ::Triangulation<dim>::none,
+        false,
+        parallel::shared::Triangulation<dim>::Settings::partition_metis);
+      GridGenerator::hyper_cube(other_tria);
+      other_tria.refine_global(3);
+
+      dh.reinit(other_tria);
+      dh.distribute_dofs(fe_collection);
+
+      try
+        {
+          tria.execute_coarsening_and_refinement();
+          deallog << "Error: we did not throw an exception when we should have"
+                  << std::endl;
+          std::abort();
+        }
+      catch (const ExceptionBase &e)
+        {
+          deallog << e.get_exc_name() << std::endl;
+        }
     }
-  catch (const ExceptionBase &e)
+  else
     {
-      deallog << e.get_exc_name() << std::endl;
+      deallog
+        << "ExcMessage(\"Triangulation associated with the DoFHandler has changed!\")"
+        << std::endl;
     }
-#else
-  deallog
-    << "ExcMessage(\"Triangulation associated with the DoFHandler has changed!\")"
-    << std::endl;
-#endif
 
   // make sure no processor is hanging
   MPI_Barrier(MPI_COMM_WORLD);
index 7161e8f12b4668379b1d3d0324f9efe1715e529b..228c0c0e236f543723956bdcaf056a91ebad05f3 100644 (file)
@@ -99,34 +99,37 @@ test()
     deallog << "  Cumulative dofs per cell: " << dof_counter << std::endl;
   }
 
-#ifdef DEBUG
-  parallel::shared::Triangulation<dim> other_tria(
-    MPI_COMM_WORLD,
-    ::Triangulation<dim>::none,
-    false,
-    parallel::shared::Triangulation<dim>::Settings::partition_metis);
-  GridGenerator::hyper_cube(other_tria);
-  other_tria.refine_global(3);
-
-  dh.reinit(other_tria);
-  dh.distribute_dofs(fe_collection);
-
-  try
+  if constexpr (running_in_debug_mode())
     {
-      tria.execute_coarsening_and_refinement();
-      deallog << "Error: we did not throw an exception when we should have"
-              << std::endl;
-      std::abort();
+      parallel::shared::Triangulation<dim> other_tria(
+        MPI_COMM_WORLD,
+        ::Triangulation<dim>::none,
+        false,
+        parallel::shared::Triangulation<dim>::Settings::partition_metis);
+      GridGenerator::hyper_cube(other_tria);
+      other_tria.refine_global(3);
+
+      dh.reinit(other_tria);
+      dh.distribute_dofs(fe_collection);
+
+      try
+        {
+          tria.execute_coarsening_and_refinement();
+          deallog << "Error: we did not throw an exception when we should have"
+                  << std::endl;
+          std::abort();
+        }
+      catch (const ExceptionBase &e)
+        {
+          deallog << e.get_exc_name() << std::endl;
+        }
     }
-  catch (const ExceptionBase &e)
+  else
     {
-      deallog << e.get_exc_name() << std::endl;
+      deallog
+        << "ExcMessage(\"Triangulation associated with the DoFHandler has changed!\")"
+        << std::endl;
     }
-#else
-  deallog
-    << "ExcMessage(\"Triangulation associated with the DoFHandler has changed!\")"
-    << std::endl;
-#endif
 
   // make sure no processor is hanging
   MPI_Barrier(MPI_COMM_WORLD);
index 00e1054dfca80897927a0bd04f9f2aa77c1d054f..cb1024ba916b43854011d988d5b1f3da10e8914d 100644 (file)
@@ -86,16 +86,17 @@ test(const unsigned int degree_center,
         // set different FE on center cell
         cell->set_active_fe_index(1);
 
-#ifdef DEBUG
-        // verify that our scenario is initialized correctly
-        // by checking the number of neighbors of the center cell
-        unsigned int n_neighbors = 0;
-        for (const unsigned int i : GeometryInfo<dim>::face_indices())
-          if (static_cast<unsigned int>(cell->neighbor_index(i)) !=
-              numbers::invalid_unsigned_int)
-            ++n_neighbors;
-        Assert(n_neighbors == 3, ExcInternalError());
-#endif
+        if constexpr (running_in_debug_mode())
+          {
+            // verify that our scenario is initialized correctly
+            // by checking the number of neighbors of the center cell
+            unsigned int n_neighbors = 0;
+            for (const unsigned int i : GeometryInfo<dim>::face_indices())
+              if (static_cast<unsigned int>(cell->neighbor_index(i)) !=
+                  numbers::invalid_unsigned_int)
+                ++n_neighbors;
+            Assert(n_neighbors == 3, ExcInternalError());
+          }
       }
 
   dh.distribute_dofs(fe_collection);
index ebaaf0af78cf0945cfb44ec01d7e7b8b7696b3cc..190cbba94e028d4170ee03402a261b7713fa1b11 100644 (file)
@@ -86,16 +86,17 @@ test(const unsigned int degree_center,
         // set different FE on center cell
         cell->set_active_fe_index(1);
 
-#ifdef DEBUG
-        // verify that our scenario is initialized correctly
-        // by checking the number of neighbors of the center cell
-        unsigned int n_neighbors = 0;
-        for (const unsigned int i : GeometryInfo<dim>::face_indices())
-          if (static_cast<unsigned int>(cell->neighbor_index(i)) !=
-              numbers::invalid_unsigned_int)
-            ++n_neighbors;
-        Assert(n_neighbors == 3, ExcInternalError());
-#endif
+        if constexpr (running_in_debug_mode())
+          {
+            // verify that our scenario is initialized correctly
+            // by checking the number of neighbors of the center cell
+            unsigned int n_neighbors = 0;
+            for (const unsigned int i : GeometryInfo<dim>::face_indices())
+              if (static_cast<unsigned int>(cell->neighbor_index(i)) !=
+                  numbers::invalid_unsigned_int)
+                ++n_neighbors;
+            Assert(n_neighbors == 3, ExcInternalError());
+          }
       }
 
   dh.distribute_dofs(fe_collection);
index bd3bb60865062b73c4e956c080a1ffdc140db917..8cbc8939fa696ae251fa49180be1a76be93c3f20 100644 (file)
@@ -89,16 +89,17 @@ test(const unsigned int degree_center,
           // set different FE on center cell
           cell->set_active_fe_index(1);
 
-#ifdef DEBUG
-          // verify that our scenario is initialized correctly
-          // by checking the number of neighbors of the center cell
-          unsigned int n_neighbors = 0;
-          for (const unsigned int i : GeometryInfo<dim>::face_indices())
-            if (static_cast<unsigned int>(cell->neighbor_index(i)) !=
-                numbers::invalid_unsigned_int)
-              ++n_neighbors;
-          Assert(n_neighbors == 3, ExcInternalError());
-#endif
+          if constexpr (running_in_debug_mode())
+            {
+              // verify that our scenario is initialized correctly
+              // by checking the number of neighbors of the center cell
+              unsigned int n_neighbors = 0;
+              for (const unsigned int i : GeometryInfo<dim>::face_indices())
+                if (static_cast<unsigned int>(cell->neighbor_index(i)) !=
+                    numbers::invalid_unsigned_int)
+                  ++n_neighbors;
+              Assert(n_neighbors == 3, ExcInternalError());
+            }
         }
       else if (cell->id().to_string() == "0_0:")
         {
index 5107070da098f288eac216a0c56311eb4ae25ca6..77a0dc4069bab52b177450d6e1633659c51e5c00 100644 (file)
@@ -197,23 +197,25 @@ namespace Step4
 
     DoFTools::make_zero_boundary_constraints(dof_handler, constraints);
 
-#ifdef DEBUG
-    // We did not think about hp-constraints on ghost cells yet.
-    // Thus, we are content with verifying their consistency for now.
-    const std::vector<IndexSet> locally_owned_dofs_per_processor =
-      Utilities::MPI::all_gather(communicator,
-                                 dof_handler.locally_owned_dofs());
-
-    const IndexSet locally_active_dofs =
-      DoFTools::extract_locally_active_dofs(dof_handler);
-
-    AssertThrow(
-      constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor,
-                                            locally_active_dofs,
-                                            communicator,
-                                            /*verbose=*/true),
-      ExcMessage("AffineConstraints object contains inconsistencies!"));
-#endif
+    if constexpr (running_in_debug_mode())
+      {
+        // We did not think about hp-constraints on ghost cells yet.
+        // Thus, we are content with verifying their consistency for now.
+        const std::vector<IndexSet> locally_owned_dofs_per_processor =
+          Utilities::MPI::all_gather(communicator,
+                                     dof_handler.locally_owned_dofs());
+
+        const IndexSet locally_active_dofs =
+          DoFTools::extract_locally_active_dofs(dof_handler);
+
+        AssertThrow(constraints.is_consistent_in_parallel(
+                      locally_owned_dofs_per_processor,
+                      locally_active_dofs,
+                      communicator,
+                      /*verbose=*/true),
+                    ExcMessage(
+                      "AffineConstraints object contains inconsistencies!"));
+      }
 
     constraints.close();
 
index 51b5395a2c5840f64ffe291c0f3ddea5f57ed869..1271697863fd20df2fb2a53a8879ec8033e8928a 100644 (file)
@@ -99,20 +99,21 @@ test(const unsigned int fes_size, const unsigned int max_difference)
   Utilities::MPI::sum(count, tria.get_mpi_communicator(), count);
   deallog << "fe count:" << count << std::endl;
 
-#ifdef DEBUG
-  // check each cell's active FE index by its distance from the center
-  for (const auto &cell :
-       dofh.active_cell_iterators() | IteratorFilters::LocallyOwnedCell())
+  if constexpr (running_in_debug_mode())
     {
-      const double       distance = cell->center().distance(Point<dim>());
-      const unsigned int expected_level =
-        (sequence.size() - 1) -
-        max_difference * static_cast<unsigned int>(std::round(distance));
-
-      Assert(cell->active_fe_index() == sequence[expected_level],
-             ExcInternalError());
+      // check each cell's active FE index by its distance from the center
+      for (const auto &cell :
+           dofh.active_cell_iterators() | IteratorFilters::LocallyOwnedCell())
+        {
+          const double       distance = cell->center().distance(Point<dim>());
+          const unsigned int expected_level =
+            (sequence.size() - 1) -
+            max_difference * static_cast<unsigned int>(std::round(distance));
+
+          Assert(cell->active_fe_index() == sequence[expected_level],
+                 ExcInternalError());
+        }
     }
-#endif
 
   deallog << "OK" << std::endl;
 }
index 6d732193636e84cfae927cfb39998d1b403cbd7d..3223ad955cd0c46fb5f158035bcc8e35248bb5ea 100644 (file)
@@ -106,20 +106,21 @@ test(const unsigned int fes_size, const unsigned int max_difference)
       deallog << "cycle:" << i << ", fe count:" << count << std::endl;
     }
 
-#ifdef DEBUG
-  // check each cell's active FE index by its distance from the center
-  for (const auto &cell :
-       dofh.active_cell_iterators() | IteratorFilters::LocallyOwnedCell())
+  if constexpr (running_in_debug_mode())
     {
-      const double       distance = cell->center().distance(Point<dim>());
-      const unsigned int expected_level =
-        (sequence.size() - 1) -
-        max_difference * static_cast<unsigned int>(std::round(distance));
-
-      Assert(cell->active_fe_index() == sequence[expected_level],
-             ExcInternalError());
+      // check each cell's active FE index by its distance from the center
+      for (const auto &cell :
+           dofh.active_cell_iterators() | IteratorFilters::LocallyOwnedCell())
+        {
+          const double       distance = cell->center().distance(Point<dim>());
+          const unsigned int expected_level =
+            (sequence.size() - 1) -
+            max_difference * static_cast<unsigned int>(std::round(distance));
+
+          Assert(cell->active_fe_index() == sequence[expected_level],
+                 ExcInternalError());
+        }
     }
-#endif
 
   deallog << "OK" << std::endl;
 }
index 0a6c774c35761186c91dd9d68f07fb1fe23feb94..416857a4f899a499ce192693113a37c8a1ba02cb 100644 (file)
@@ -105,18 +105,19 @@ test(const unsigned int fes_size, const unsigned int max_difference)
 
   Assert(fe_indices_changed, ExcInternalError());
 
-#ifdef DEBUG
-  // check each cell's active FE by its h-level
-  for (unsigned int l = 0; l < tria.n_global_levels(); ++l)
-    for (const auto &cell : dofh.cell_iterators_on_level(l))
-      if (cell->is_active() && cell->is_locally_owned())
-        {
-          const unsigned int expected_level = std::max(
-            0, static_cast<int>(sequence.size() - 1 - l * max_difference));
-          Assert(cell->active_fe_index() == sequence[expected_level],
-                 ExcInternalError());
-        }
-#endif
+  if constexpr (running_in_debug_mode())
+    {
+      // check each cell's active FE by its h-level
+      for (unsigned int l = 0; l < tria.n_global_levels(); ++l)
+        for (const auto &cell : dofh.cell_iterators_on_level(l))
+          if (cell->is_active() && cell->is_locally_owned())
+            {
+              const unsigned int expected_level = std::max(
+                0, static_cast<int>(sequence.size() - 1 - l * max_difference));
+              Assert(cell->active_fe_index() == sequence[expected_level],
+                     ExcInternalError());
+            }
+    }
 
   deallog << "OK" << std::endl;
 }
index 84287c7242f97d93b204bfe1459bc02113ef66c7..6ac9b94e081df7742f0e4cb62c8d03e03156883d 100644 (file)
@@ -222,23 +222,25 @@ namespace Step27
                                              0,
                                              Functions::ZeroFunction<dim>(),
                                              constraints);
-#ifdef DEBUG
-    // We have not dealt with chains of constraints on ghost cells yet.
-    // Thus, we are content with verifying their consistency for now.
-    std::vector<IndexSet> locally_owned_dofs_per_processor =
-      Utilities::MPI::all_gather(dof_handler.get_mpi_communicator(),
-                                 dof_handler.locally_owned_dofs());
-
-    const IndexSet locally_active_dofs =
-      DoFTools::extract_locally_active_dofs(dof_handler);
-
-    AssertThrow(
-      constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor,
-                                            locally_active_dofs,
-                                            mpi_communicator,
-                                            /*verbose=*/true),
-      ExcMessage("AffineConstraints object contains inconsistencies!"));
-#endif
+    if constexpr (running_in_debug_mode())
+      {
+        // We have not dealt with chains of constraints on ghost cells yet.
+        // Thus, we are content with verifying their consistency for now.
+        std::vector<IndexSet> locally_owned_dofs_per_processor =
+          Utilities::MPI::all_gather(dof_handler.get_mpi_communicator(),
+                                     dof_handler.locally_owned_dofs());
+
+        const IndexSet locally_active_dofs =
+          DoFTools::extract_locally_active_dofs(dof_handler);
+
+        AssertThrow(constraints.is_consistent_in_parallel(
+                      locally_owned_dofs_per_processor,
+                      locally_active_dofs,
+                      mpi_communicator,
+                      /*verbose=*/true),
+                    ExcMessage(
+                      "AffineConstraints object contains inconsistencies!"));
+      }
     constraints.close();
 
     DynamicSparsityPattern dsp(locally_relevant_dofs);
index 6e08c65868348eb2476f3c40b4753ae8e3f6b4f7..fb96ee86b39706cf6489e2668e3b33e3ea529e61 100644 (file)
@@ -226,23 +226,25 @@ namespace Step27
                                              0,
                                              Functions::ZeroFunction<dim>(),
                                              constraints);
-#ifdef DEBUG
-    // We did not think about hp-constraints on ghost cells yet.
-    // Thus, we are content with verifying their consistency for now.
-    std::vector<IndexSet> locally_owned_dofs_per_processor =
-      Utilities::MPI::all_gather(dof_handler.get_mpi_communicator(),
-                                 dof_handler.locally_owned_dofs());
-
-    const IndexSet locally_active_dofs =
-      DoFTools::extract_locally_active_dofs(dof_handler);
-
-    AssertThrow(
-      constraints.is_consistent_in_parallel(locally_owned_dofs_per_processor,
-                                            locally_active_dofs,
-                                            mpi_communicator,
-                                            /*verbose=*/true),
-      ExcMessage("AffineConstraints object contains inconsistencies!"));
-#endif
+    if constexpr (running_in_debug_mode())
+      {
+        // We did not think about hp-constraints on ghost cells yet.
+        // Thus, we are content with verifying their consistency for now.
+        std::vector<IndexSet> locally_owned_dofs_per_processor =
+          Utilities::MPI::all_gather(dof_handler.get_mpi_communicator(),
+                                     dof_handler.locally_owned_dofs());
+
+        const IndexSet locally_active_dofs =
+          DoFTools::extract_locally_active_dofs(dof_handler);
+
+        AssertThrow(constraints.is_consistent_in_parallel(
+                      locally_owned_dofs_per_processor,
+                      locally_active_dofs,
+                      mpi_communicator,
+                      /*verbose=*/true),
+                    ExcMessage(
+                      "AffineConstraints object contains inconsistencies!"));
+      }
     constraints.close();
 
     DynamicSparsityPattern dsp(locally_relevant_dofs);
index aa45fa3442d0828cfa7f48cdad793770195e2e62..85b382b8f82c0bfe303845518cca5dc0b9bae3c9 100644 (file)
@@ -96,20 +96,21 @@ test(const unsigned int fes_size,
   Utilities::MPI::sum(count, tria.get_mpi_communicator(), count);
   deallog << "fe count:" << count << std::endl;
 
-#ifdef DEBUG
-  // check each cell's active FE index by its distance from the center
-  for (const auto &cell :
-       dofh.active_cell_iterators() | IteratorFilters::LocallyOwnedCell())
+  if constexpr (running_in_debug_mode())
     {
-      const double       distance = cell->center().distance(Point<dim>());
-      const unsigned int expected_level =
-        (sequence.size() - 1) -
-        max_difference * static_cast<unsigned int>(std::round(distance));
-
-      Assert(cell->active_fe_index() == sequence[expected_level],
-             ExcInternalError());
+      // check each cell's active FE index by its distance from the center
+      for (const auto &cell :
+           dofh.active_cell_iterators() | IteratorFilters::LocallyOwnedCell())
+        {
+          const double       distance = cell->center().distance(Point<dim>());
+          const unsigned int expected_level =
+            (sequence.size() - 1) -
+            max_difference * static_cast<unsigned int>(std::round(distance));
+
+          Assert(cell->active_fe_index() == sequence[expected_level],
+                 ExcInternalError());
+        }
     }
-#endif
 
   deallog << "OK" << std::endl;
 }
index fc7093df88cc7d2231e4db79439375d2be03323c..7bb740680841418cac1e6af4f95fe2220ee7aec8 100644 (file)
@@ -102,20 +102,21 @@ test(const unsigned int fes_size,
       deallog << "cycle:" << i << ", fe count:" << count << std::endl;
     }
 
-#ifdef DEBUG
-  // check each cell's active FE index by its distance from the center
-  for (const auto &cell :
-       dofh.active_cell_iterators() | IteratorFilters::LocallyOwnedCell())
+  if constexpr (running_in_debug_mode())
     {
-      const double       distance = cell->center().distance(Point<dim>());
-      const unsigned int expected_level =
-        (sequence.size() - 1) -
-        max_difference * static_cast<unsigned int>(std::round(distance));
-
-      Assert(cell->active_fe_index() == sequence[expected_level],
-             ExcInternalError());
+      // check each cell's active FE index by its distance from the center
+      for (const auto &cell :
+           dofh.active_cell_iterators() | IteratorFilters::LocallyOwnedCell())
+        {
+          const double       distance = cell->center().distance(Point<dim>());
+          const unsigned int expected_level =
+            (sequence.size() - 1) -
+            max_difference * static_cast<unsigned int>(std::round(distance));
+
+          Assert(cell->active_fe_index() == sequence[expected_level],
+                 ExcInternalError());
+        }
     }
-#endif
 
   deallog << "OK" << std::endl;
 }
index 5b44bfcd09f9f104f16f7eee807a56762b89a0a0..14fc78599a305a2a2d8c24f52680e00c89c1ed01 100644 (file)
@@ -104,18 +104,19 @@ test(const unsigned int fes_size,
   (void)fe_indices_changed;
   Assert(fe_indices_changed, ExcInternalError());
 
-#ifdef DEBUG
-  // check each cell's active FE by its h-level
-  for (unsigned int l = 0; l < tria.n_global_levels(); ++l)
-    for (const auto &cell : dofh.cell_iterators_on_level(l))
-      if (cell->is_active() && cell->is_locally_owned())
-        {
-          const unsigned int expected_level = std::max(
-            0, static_cast<int>(sequence.size() - 1 - l * max_difference));
-          Assert(cell->active_fe_index() == sequence[expected_level],
-                 ExcInternalError());
-        }
-#endif
+  if constexpr (running_in_debug_mode())
+    {
+      // check each cell's active FE by its h-level
+      for (unsigned int l = 0; l < tria.n_global_levels(); ++l)
+        for (const auto &cell : dofh.cell_iterators_on_level(l))
+          if (cell->is_active() && cell->is_locally_owned())
+            {
+              const unsigned int expected_level = std::max(
+                0, static_cast<int>(sequence.size() - 1 - l * max_difference));
+              Assert(cell->active_fe_index() == sequence[expected_level],
+                     ExcInternalError());
+            }
+    }
 
   deallog << "OK" << std::endl;
 }
index 6c51256605780ce535b1541326320d5beb51c85a..5dc4fa961dcf91c9534eb4075bb37c71a11386af 100644 (file)
@@ -68,14 +68,15 @@ refine(const std::vector<unsigned int> &n_refinements, Triangulation<dim> &tria)
       tria.execute_coarsening_and_refinement();
     }
 
-#ifdef DEBUG
-  for (const auto &cell : tria.active_cell_iterators())
+  if constexpr (running_in_debug_mode())
     {
-      const unsigned int coarse_cell_id = cell->id().get_coarse_cell_id();
+      for (const auto &cell : tria.active_cell_iterators())
+        {
+          const unsigned int coarse_cell_id = cell->id().get_coarse_cell_id();
 
-      AssertDimension(cell->level(), n_refinements[coarse_cell_id]);
+          AssertDimension(cell->level(), n_refinements[coarse_cell_id]);
+        }
     }
-#endif
 }
 
 
index 5947c9a0a6cd1a3039351c0d98166b688e13c928..fdbd55341df0ab14d8345c0fc673e636322190c0 100644 (file)
@@ -412,11 +412,13 @@ namespace dealii
 
       // add simplex cell in coordinate direction
       const unsigned int coordinate = face_no / 2;
-#ifdef DEBUG
-      // all vertices should be in a plane
-      for (const auto &vertex : vertices)
-        Assert(midpoint[coordinate] == vertex[coordinate], ExcInternalError());
-#endif
+      if constexpr (running_in_debug_mode())
+        {
+          // all vertices should be in a plane
+          for (const auto &vertex : vertices)
+            Assert(midpoint[coordinate] == vertex[coordinate],
+                   ExcInternalError());
+        }
 
       // add another vertex as tip of triangle/pyramid
       Point<spacedim> tip = midpoint;
index 3ffd37b6a899737048905a0095a4b626bf394b76..cae021c05ae0376e3f3cf347ae1dbbd1d01ce9e5 100644 (file)
@@ -67,20 +67,23 @@ main()
 
   SD::Utilities::print_substitution_map(deallog, substitution_map);
 
-#ifdef DEBUG
-  // Check that exceptions are raised when duplicate symbols
-  // are found in a substitution map
-  deal_II_exceptions::disable_abort_on_exception();
-  try
+  if constexpr (running_in_debug_mode())
     {
-      SD::add_to_substitution_map(substitution_map,
-                                  std::make_pair(SD::Expression("x14"), 14));
+      // Check that exceptions are raised when duplicate symbols
+      // are found in a substitution map
+      deal_II_exceptions::disable_abort_on_exception();
+      try
+        {
+          SD::add_to_substitution_map(substitution_map,
+                                      std::make_pair(SD::Expression("x14"),
+                                                     14));
 
-      deallog << "Duplicate symbol in map did not raise an error." << std::endl;
+          deallog << "Duplicate symbol in map did not raise an error."
+                  << std::endl;
+        }
+      catch (const ExcMessage &)
+        {}
     }
-  catch (const ExcMessage &)
-    {}
-#endif
 
   deallog << "OK" << std::endl;
 }
index 0ce8b780a2560e8d35dd8843bd1b5beafd9c4f18..598329c73528db3d9cf0ad97a982409b50e1d723 100644 (file)
@@ -125,33 +125,34 @@ main()
     SD::merge_substitution_maps(substitution_map, substitution_map_1);
   }
 
-#ifdef DEBUG
-  // Check that exceptions are raised when duplicate symbols
-  // associated with unequal values are found in a substitution map
-  deal_II_exceptions::disable_abort_on_exception();
-  try
+  if constexpr (running_in_debug_mode())
     {
-      {
-        SD::types::substitution_map substitution_map;
-        SD::add_to_substitution_map(substitution_map,
-                                    SD::Expression("x1"),
-                                    SD::Expression(1));
-
-        SD::types::substitution_map substitution_map_1;
-        SD::add_to_substitution_map(substitution_map_1,
-                                    SD::Expression("x1"),
-                                    SD::Expression(2));
-
-        SD::merge_substitution_maps(substitution_map, substitution_map_1);
-      }
-
-      deallog
-        << "Duplicate symbol with non-equal value in map did not raise an error."
-        << std::endl;
+      // Check that exceptions are raised when duplicate symbols
+      // associated with unequal values are found in a substitution map
+      deal_II_exceptions::disable_abort_on_exception();
+      try
+        {
+          {
+            SD::types::substitution_map substitution_map;
+            SD::add_to_substitution_map(substitution_map,
+                                        SD::Expression("x1"),
+                                        SD::Expression(1));
+
+            SD::types::substitution_map substitution_map_1;
+            SD::add_to_substitution_map(substitution_map_1,
+                                        SD::Expression("x1"),
+                                        SD::Expression(2));
+
+            SD::merge_substitution_maps(substitution_map, substitution_map_1);
+          }
+
+          deallog
+            << "Duplicate symbol with non-equal value in map did not raise an error."
+            << std::endl;
+        }
+      catch (const ExcMessage &)
+        {}
     }
-  catch (const ExcMessage &)
-    {}
-#endif
 
   deallog << "OK" << std::endl;
 }
index d12d0d560e2372dbb5c22d284616b65038bcf309..f095497ff437879489933bce5b3986da46616218 100644 (file)
@@ -506,39 +506,40 @@ test_symmetric_tensor_tensor_vector_scalar_coupled(
   symb_d2psi_ds_x_dv  = SD::differentiate(symb_dpsi_ds, symb_v);
   symb_d2psi_ds_x_ds  = SD::differentiate(symb_dpsi_ds, symb_s);
 
-#ifdef DEBUG
-  print(std::cout, "symb_st", symb_st);
-  print(std::cout, "symb_t", symb_t);
-  print(std::cout, "symb_v", symb_v);
-  print(std::cout, "symb_s", symb_s);
-
-  print(std::cout, "symb_psi", symb_psi);
-
-  print(std::cout, "symb_dpsi_dst", symb_dpsi_dst);
-  print(std::cout, "symb_dpsi_dt", symb_dpsi_dt);
-  print(std::cout, "symb_dpsi_dv", symb_dpsi_dv);
-  print(std::cout, "symb_dpsi_ds", symb_dpsi_ds);
-
-  print(std::cout, "symb_d2psi_dst_x_dst", symb_d2psi_dst_x_dst);
-  print(std::cout, "symb_d2psi_dst_x_dt", symb_d2psi_dst_x_dt);
-  print(std::cout, "symb_d2psi_dst_x_dv", symb_d2psi_dst_x_dv);
-  print(std::cout, "symb_d2psi_dst_x_ds", symb_d2psi_dst_x_ds);
-
-  print(std::cout, "symb_d2psi_dt_x_dst", symb_d2psi_dt_x_dst);
-  print(std::cout, "symb_d2psi_dt_x_dt", symb_d2psi_dt_x_dt);
-  print(std::cout, "symb_d2psi_dt_x_dv", symb_d2psi_dt_x_dv);
-  print(std::cout, "symb_d2psi_dt_x_ds", symb_d2psi_dt_x_ds);
-
-  print(std::cout, "symb_d2psi_dv_x_dst", symb_d2psi_dv_x_dst);
-  print(std::cout, "symb_d2psi_dv_x_dt", symb_d2psi_dv_x_dt);
-  print(std::cout, "symb_d2psi_dv_x_dv", symb_d2psi_dv_x_dv);
-  print(std::cout, "symb_d2psi_dv_x_ds", symb_d2psi_dv_x_ds);
-
-  print(std::cout, "symb_d2psi_ds_x_dst", symb_d2psi_ds_x_dst);
-  print(std::cout, "symb_d2psi_ds_x_dt", symb_d2psi_ds_x_dt);
-  print(std::cout, "symb_d2psi_ds_x_dv", symb_d2psi_ds_x_dv);
-  print(std::cout, "symb_d2psi_ds_x_ds", symb_d2psi_ds_x_ds);
-#endif
+  if constexpr (running_in_debug_mode())
+    {
+      print(std::cout, "symb_st", symb_st);
+      print(std::cout, "symb_t", symb_t);
+      print(std::cout, "symb_v", symb_v);
+      print(std::cout, "symb_s", symb_s);
+
+      print(std::cout, "symb_psi", symb_psi);
+
+      print(std::cout, "symb_dpsi_dst", symb_dpsi_dst);
+      print(std::cout, "symb_dpsi_dt", symb_dpsi_dt);
+      print(std::cout, "symb_dpsi_dv", symb_dpsi_dv);
+      print(std::cout, "symb_dpsi_ds", symb_dpsi_ds);
+
+      print(std::cout, "symb_d2psi_dst_x_dst", symb_d2psi_dst_x_dst);
+      print(std::cout, "symb_d2psi_dst_x_dt", symb_d2psi_dst_x_dt);
+      print(std::cout, "symb_d2psi_dst_x_dv", symb_d2psi_dst_x_dv);
+      print(std::cout, "symb_d2psi_dst_x_ds", symb_d2psi_dst_x_ds);
+
+      print(std::cout, "symb_d2psi_dt_x_dst", symb_d2psi_dt_x_dst);
+      print(std::cout, "symb_d2psi_dt_x_dt", symb_d2psi_dt_x_dt);
+      print(std::cout, "symb_d2psi_dt_x_dv", symb_d2psi_dt_x_dv);
+      print(std::cout, "symb_d2psi_dt_x_ds", symb_d2psi_dt_x_ds);
+
+      print(std::cout, "symb_d2psi_dv_x_dst", symb_d2psi_dv_x_dst);
+      print(std::cout, "symb_d2psi_dv_x_dt", symb_d2psi_dv_x_dt);
+      print(std::cout, "symb_d2psi_dv_x_dv", symb_d2psi_dv_x_dv);
+      print(std::cout, "symb_d2psi_dv_x_ds", symb_d2psi_dv_x_ds);
+
+      print(std::cout, "symb_d2psi_ds_x_dst", symb_d2psi_ds_x_dst);
+      print(std::cout, "symb_d2psi_ds_x_dt", symb_d2psi_ds_x_dt);
+      print(std::cout, "symb_d2psi_ds_x_dv", symb_d2psi_ds_x_dv);
+      print(std::cout, "symb_d2psi_ds_x_ds", symb_d2psi_ds_x_ds);
+    }
 
   // It pains me to do this manually...
   // This is why we have utility functions to create substitution maps
index ff60c13c473ada06d7d3e9a45e85e10a3cc1e767..a35cd06ac09bf5b40608c6ca3efdc9eb23cca2d1 100644 (file)
@@ -468,11 +468,14 @@ LaplaceProblem<dim>::run()
         {
           GridGenerator::hyper_shell(
             triangulation, Point<dim>(), 0.5, 1., (dim == 3) ? 96 : 12, false);
-#ifdef DEBUG
-          triangulation.refine_global(3);
-#else
-          triangulation.refine_global(5);
-#endif
+          if constexpr (running_in_debug_mode())
+            {
+              triangulation.refine_global(3);
+            }
+          else
+            {
+              triangulation.refine_global(5);
+            }
         }
 
       setup_system();
index 3ad65cb621141754fd867bbb320c0180f15f6785..b3efe8cd72f5b37648c3607795a1c9e4974f67b7 100644 (file)
@@ -469,11 +469,14 @@ LaplaceProblem<dim>::run()
         {
           GridGenerator::hyper_shell(
             triangulation, Point<dim>(), 0.5, 1., (dim == 3) ? 96 : 12, false);
-#ifdef DEBUG
-          triangulation.refine_global(3);
-#else
-          triangulation.refine_global(5);
-#endif
+          if constexpr (running_in_debug_mode())
+            {
+              triangulation.refine_global(3);
+            }
+          else
+            {
+              triangulation.refine_global(5);
+            }
         }
 
       setup_system();

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.