From 75e0e9f95ddf1d6676900cd050367c54ca424404 Mon Sep 17 00:00:00 2001 From: Federico Fernandez Date: Mon, 7 Jul 2025 18:57:55 +0200 Subject: [PATCH] Replace `-numeric_limits::max()` by `numeric_limits::lowest()` --- examples/step-31/step-31.cc | 4 ++-- examples/step-32/step-32.cc | 6 +++--- examples/step-36/step-36.cc | 2 +- examples/step-42/step-42.cc | 2 +- examples/step-43/step-43.cc | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/step-31/step-31.cc b/examples/step-31/step-31.cc index 9f7b708e7b..f4a1a46d66 100644 --- a/examples/step-31/step-31.cc +++ b/examples/step-31/step-31.cc @@ -673,7 +673,7 @@ namespace Step31 if (timestep_number != 0) { double min_temperature = std::numeric_limits::max(), - max_temperature = -std::numeric_limits::max(); + max_temperature = std::numeric_limits::lowest(); for (const auto &cell : temperature_dof_handler.active_cell_iterators()) { @@ -699,7 +699,7 @@ namespace Step31 else { double min_temperature = std::numeric_limits::max(), - max_temperature = -std::numeric_limits::max(); + max_temperature = std::numeric_limits::lowest(); for (const auto &cell : temperature_dof_handler.active_cell_iterators()) { diff --git a/examples/step-32/step-32.cc b/examples/step-32/step-32.cc index e22b9b3287..55d5e070f8 100644 --- a/examples/step-32/step-32.cc +++ b/examples/step-32/step-32.cc @@ -1374,7 +1374,7 @@ namespace Step32 // entropy as well as keeps track of the area/volume of the part of the // domain we locally own and the integral over the entropy on it: double min_entropy = std::numeric_limits::max(), - max_entropy = -std::numeric_limits::max(), area = 0, + max_entropy = std::numeric_limits::lowest(), area = 0, entropy_integrated = 0; for (const auto &cell : temperature_dof_handler.active_cell_iterators()) @@ -1455,7 +1455,7 @@ namespace Step32 std::vector old_old_temperature_values(n_q_points); double min_local_temperature = std::numeric_limits::max(), - max_local_temperature = -std::numeric_limits::max(); + max_local_temperature = std::numeric_limits::lowest(); if (timestep_number != 0) { @@ -2915,7 +2915,7 @@ namespace Step32 << " CG iterations for temperature" << std::endl; double temperature[2] = {std::numeric_limits::max(), - -std::numeric_limits::max()}; + std::numeric_limits::lowest()}; double global_temperature[2]; for (unsigned int i = diff --git a/examples/step-36/step-36.cc b/examples/step-36/step-36.cc index 71d29e23af..e67c8470bc 100644 --- a/examples/step-36/step-36.cc +++ b/examples/step-36/step-36.cc @@ -310,7 +310,7 @@ namespace Step36 // ensure that we can ignore them should they show up in our // computations. double min_spurious_eigenvalue = std::numeric_limits::max(), - max_spurious_eigenvalue = -std::numeric_limits::max(); + max_spurious_eigenvalue = std::numeric_limits::lowest(); for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i) if (constraints.is_constrained(i)) diff --git a/examples/step-42/step-42.cc b/examples/step-42/step-42.cc index bb6aeade33..168f0993c0 100644 --- a/examples/step-42/step-42.cc +++ b/examples/step-42/step-42.cc @@ -1696,7 +1696,7 @@ namespace Step42 mpi_communicator); double residual_norm; - double previous_residual_norm = -std::numeric_limits::max(); + double previous_residual_norm = std::numeric_limits::lowest(); const double correct_sigma = sigma_0; diff --git a/examples/step-43/step-43.cc b/examples/step-43/step-43.cc index dfeb205f9f..06efb039c7 100644 --- a/examples/step-43/step-43.cc +++ b/examples/step-43/step-43.cc @@ -1989,7 +1989,7 @@ namespace Step43 if (timestep_number != 0) { double min_saturation = std::numeric_limits::max(), - max_saturation = -std::numeric_limits::max(); + max_saturation = std::numeric_limits::lowest(); for (const auto &cell : saturation_dof_handler.active_cell_iterators()) { @@ -2015,7 +2015,7 @@ namespace Step43 else { double min_saturation = std::numeric_limits::max(), - max_saturation = -std::numeric_limits::max(); + max_saturation = std::numeric_limits::lowest(); for (const auto &cell : saturation_dof_handler.active_cell_iterators()) { -- 2.39.5