]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Replace `-numeric_limits::max()` by `numeric_limits::lowest()`
authorFederico Fernandez <fernandezerbes@gmail.com>
Mon, 7 Jul 2025 16:57:55 +0000 (18:57 +0200)
committerFederico Fernandez <fernandezerbes@gmail.com>
Mon, 7 Jul 2025 17:51:49 +0000 (19:51 +0200)
examples/step-31/step-31.cc
examples/step-32/step-32.cc
examples/step-36/step-36.cc
examples/step-42/step-42.cc
examples/step-43/step-43.cc

index 9f7b708e7bb7f2b283fd43d28298fb8148a4116b..f4a1a46d668e27e17190ddfad681e3cfcda25199 100644 (file)
@@ -673,7 +673,7 @@ namespace Step31
     if (timestep_number != 0)
       {
         double min_temperature = std::numeric_limits<double>::max(),
-               max_temperature = -std::numeric_limits<double>::max();
+               max_temperature = std::numeric_limits<double>::lowest();
 
         for (const auto &cell : temperature_dof_handler.active_cell_iterators())
           {
@@ -699,7 +699,7 @@ namespace Step31
     else
       {
         double min_temperature = std::numeric_limits<double>::max(),
-               max_temperature = -std::numeric_limits<double>::max();
+               max_temperature = std::numeric_limits<double>::lowest();
 
         for (const auto &cell : temperature_dof_handler.active_cell_iterators())
           {
index e22b9b32873287896b3ac4054315fb63b9a4d2d2..55d5e070f8115c23dc6b5f90a8043e1be3df7690 100644 (file)
@@ -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<double>::max(),
-           max_entropy = -std::numeric_limits<double>::max(), area = 0,
+           max_entropy = std::numeric_limits<double>::lowest(), area = 0,
            entropy_integrated = 0;
 
     for (const auto &cell : temperature_dof_handler.active_cell_iterators())
@@ -1455,7 +1455,7 @@ namespace Step32
     std::vector<double> old_old_temperature_values(n_q_points);
 
     double min_local_temperature = std::numeric_limits<double>::max(),
-           max_local_temperature = -std::numeric_limits<double>::max();
+           max_local_temperature = std::numeric_limits<double>::lowest();
 
     if (timestep_number != 0)
       {
@@ -2915,7 +2915,7 @@ namespace Step32
             << " CG iterations for temperature" << std::endl;
 
       double temperature[2] = {std::numeric_limits<double>::max(),
-                               -std::numeric_limits<double>::max()};
+                               std::numeric_limits<double>::lowest()};
       double global_temperature[2];
 
       for (unsigned int i =
index 71d29e23af790552ea92cb0ad4cc6f6694618b20..e67c8470bc8f0f1b0b1bf98c36c7e27304efcbad 100644 (file)
@@ -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<double>::max(),
-           max_spurious_eigenvalue = -std::numeric_limits<double>::max();
+           max_spurious_eigenvalue = std::numeric_limits<double>::lowest();
 
     for (unsigned int i = 0; i < dof_handler.n_dofs(); ++i)
       if (constraints.is_constrained(i))
index bb6aeade33a20c7c7c52164af7efbc3922b9e529..168f0993c0a44c1804ac9650693e620463eb02de 100644 (file)
@@ -1696,7 +1696,7 @@ namespace Step42
                                                        mpi_communicator);
 
     double residual_norm;
-    double previous_residual_norm = -std::numeric_limits<double>::max();
+    double previous_residual_norm = std::numeric_limits<double>::lowest();
 
     const double correct_sigma = sigma_0;
 
index dfeb205f9feba2c03e22f91322d8ab5f3b853119..06efb039c798b2f438112863f39f8bdc2a647c35 100644 (file)
@@ -1989,7 +1989,7 @@ namespace Step43
     if (timestep_number != 0)
       {
         double min_saturation = std::numeric_limits<double>::max(),
-               max_saturation = -std::numeric_limits<double>::max();
+               max_saturation = std::numeric_limits<double>::lowest();
 
         for (const auto &cell : saturation_dof_handler.active_cell_iterators())
           {
@@ -2015,7 +2015,7 @@ namespace Step43
     else
       {
         double min_saturation = std::numeric_limits<double>::max(),
-               max_saturation = -std::numeric_limits<double>::max();
+               max_saturation = std::numeric_limits<double>::lowest();
 
         for (const auto &cell : saturation_dof_handler.active_cell_iterators())
           {

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.