From 2e6192b3a4b783cb1d063732f7be996c40177850 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Fri, 10 Mar 2023 15:53:53 -0500 Subject: [PATCH] Replace #if DEBUG with #ifdef DEBUG --- include/deal.II/matrix_free/vector_access_internal.h | 4 ++-- .../multigrid/mg_transfer_global_coarsening.templates.h | 2 +- source/base/quadrature.cc | 2 +- source/hp/fe_collection.cc | 2 +- source/lac/petsc_parallel_vector.cc | 2 +- tests/adolc/helper_scalar_failure_01.cc | 2 +- tests/adolc/helper_scalar_failure_02.cc | 2 +- tests/adolc/helper_scalar_failure_03.cc | 2 +- tests/adolc/helper_scalar_failure_04.cc | 2 +- tests/adolc/helper_scalar_failure_05.cc | 2 +- tests/symengine/sd_common_tests/batch_optimizer_07.h | 4 ++-- tests/symengine/symengine_tensor_operations_03.cc | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/deal.II/matrix_free/vector_access_internal.h b/include/deal.II/matrix_free/vector_access_internal.h index 92ad7e59d6..abc647baab 100644 --- a/include/deal.II/matrix_free/vector_access_internal.h +++ b/include/deal.II/matrix_free/vector_access_internal.h @@ -25,7 +25,7 @@ #include #include -#if DEBUG +#ifdef DEBUG # include #endif @@ -210,7 +210,7 @@ namespace internal (void)matrix_free; (void)dof_info; -#if DEBUG +#ifdef DEBUG if (vec.partitioners_are_compatible(*dof_info.vector_partitioner) == false) { unsigned int dof_index = numbers::invalid_unsigned_int; diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index 1dd8eb62e2..25288806cf 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -1791,7 +1791,7 @@ namespace internal fe.n_dofs_per_vertex() > 0; }); -#if DEBUG +#ifdef DEBUG const bool fine_element_is_discontinuous = std::all_of(dof_handler_fine.get_fe_collection().begin(), dof_handler_fine.get_fe_collection().end(), diff --git a/source/base/quadrature.cc b/source/base/quadrature.cc index feb1be8d4f..e02be902fa 100644 --- a/source/base/quadrature.cc +++ b/source/base/quadrature.cc @@ -587,7 +587,7 @@ QIterated<1>::QIterated(const Quadrature<1> & base_quadrature, else if (std::abs(i[0] - 1.0) < 1e-12) i[0] = 1.0; -#if DEBUG +#ifdef DEBUG double sum_of_weights = 0; for (unsigned int i = 0; i < this->size(); ++i) sum_of_weights += this->weight(i); diff --git a/source/hp/fe_collection.cc b/source/hp/fe_collection.cc index d90012d775..2ac945c033 100644 --- a/source/hp/fe_collection.cc +++ b/source/hp/fe_collection.cc @@ -480,7 +480,7 @@ namespace hp for (const Edge &e : sub_graph) identities_graph.erase(e); -#if DEBUG +#ifdef DEBUG // There are three checks we ought to perform: // - That the sub-graph is undirected, i.e. that every edge appears // in both directions diff --git a/source/lac/petsc_parallel_vector.cc b/source/lac/petsc_parallel_vector.cc index d305051996..fddd6cbba8 100644 --- a/source/lac/petsc_parallel_vector.cc +++ b/source/lac/petsc_parallel_vector.cc @@ -293,7 +293,7 @@ namespace PETScWrappers Assert(size() == n, ExcDimensionMismatch(size(), n)); -# if DEBUG +# ifdef DEBUG { // test ghost allocation in debug mode PetscInt begin, end; diff --git a/tests/adolc/helper_scalar_failure_01.cc b/tests/adolc/helper_scalar_failure_01.cc index 0440be2097..c562d5106c 100644 --- a/tests/adolc/helper_scalar_failure_01.cc +++ b/tests/adolc/helper_scalar_failure_01.cc @@ -94,7 +94,7 @@ main() initlog(); deal_II_exceptions::disable_abort_on_exception(); -#if DEBUG +#ifdef DEBUG // Asserts should be triggered const bool expected_result = false; #else diff --git a/tests/adolc/helper_scalar_failure_02.cc b/tests/adolc/helper_scalar_failure_02.cc index e4866bfe39..5b24a83dbf 100644 --- a/tests/adolc/helper_scalar_failure_02.cc +++ b/tests/adolc/helper_scalar_failure_02.cc @@ -96,7 +96,7 @@ main() initlog(); deal_II_exceptions::disable_abort_on_exception(); -#if DEBUG +#ifdef DEBUG // Asserts should be triggered const bool expected_result = false; #else diff --git a/tests/adolc/helper_scalar_failure_03.cc b/tests/adolc/helper_scalar_failure_03.cc index 899cb55d3a..a15d2c1eea 100644 --- a/tests/adolc/helper_scalar_failure_03.cc +++ b/tests/adolc/helper_scalar_failure_03.cc @@ -97,7 +97,7 @@ main() initlog(); deal_II_exceptions::disable_abort_on_exception(); -#if DEBUG +#ifdef DEBUG // Asserts should be triggered const bool expected_result = false; #else diff --git a/tests/adolc/helper_scalar_failure_04.cc b/tests/adolc/helper_scalar_failure_04.cc index 5893d63a58..0c287eddad 100644 --- a/tests/adolc/helper_scalar_failure_04.cc +++ b/tests/adolc/helper_scalar_failure_04.cc @@ -95,7 +95,7 @@ main() initlog(); deal_II_exceptions::disable_abort_on_exception(); -#if DEBUG +#ifdef DEBUG // Asserts should be triggered const bool expected_result_taped = false; const bool expected_result_tapeless = false; diff --git a/tests/adolc/helper_scalar_failure_05.cc b/tests/adolc/helper_scalar_failure_05.cc index 89f933c58e..f5b0bf6502 100644 --- a/tests/adolc/helper_scalar_failure_05.cc +++ b/tests/adolc/helper_scalar_failure_05.cc @@ -97,7 +97,7 @@ main() initlog(); deal_II_exceptions::disable_abort_on_exception(); -#if DEBUG +#ifdef DEBUG // Asserts should be triggered const bool expected_result = false; #else diff --git a/tests/symengine/sd_common_tests/batch_optimizer_07.h b/tests/symengine/sd_common_tests/batch_optimizer_07.h index ec4c619f64..0bb447b9ce 100644 --- a/tests/symengine/sd_common_tests/batch_optimizer_07.h +++ b/tests/symengine/sd_common_tests/batch_optimizer_07.h @@ -376,7 +376,7 @@ evaluate_SD_SD_stored_symbols_optimisation(const Tensor<2, dim> &t, using func_sd = CoupledFunction; symb_psi = func_sd::psi(symb_t, symb_v, symb_s); -#if DEBUG_EXTRA +#ifdef DEBUG_EXTRA deallog << "symb_t: " << symb_t << std::endl; deallog << "symb_v: " << symb_v << std::endl; deallog << "symb_s: " << symb_s << std::endl; @@ -397,7 +397,7 @@ evaluate_SD_SD_stored_symbols_optimisation(const Tensor<2, dim> &t, symb_d2psi_dt_ds = SD::differentiate(symb_dpsi_ds, symb_t); symb_d2psi_dv_ds = SD::differentiate(symb_dpsi_ds, symb_v); symb_d2psi_ds_ds = SD::differentiate(symb_dpsi_ds, symb_s); -#if DEBUG_EXTRA +#ifdef DEBUG_EXTRA print(deallog, "symb_psi", symb_psi); print(deallog, "symb_dpsi_dt", symb_dpsi_dt); print(deallog, "symb_dpsi_dv", symb_dpsi_dv); diff --git a/tests/symengine/symengine_tensor_operations_03.cc b/tests/symengine/symengine_tensor_operations_03.cc index 6e44bdbed6..ae7dc10045 100644 --- a/tests/symengine/symengine_tensor_operations_03.cc +++ b/tests/symengine/symengine_tensor_operations_03.cc @@ -507,7 +507,7 @@ 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); -#if DEBUG +#ifdef DEBUG print(std::cout, "symb_st", symb_st); print(std::cout, "symb_t", symb_t); print(std::cout, "symb_v", symb_v); -- 2.39.5