]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use alias for sundials booleantype.
authorMarc Fehling <mafehling.git@gmail.com>
Fri, 12 Apr 2024 10:40:53 +0000 (12:40 +0200)
committerMarc Fehling <mafehling.git@gmail.com>
Fri, 12 Apr 2024 11:04:32 +0000 (13:04 +0200)
include/deal.II/sundials/sundials_types.h
source/sundials/arkode.cc

index ce4b8c1ea554631bd0d33d7efc52ae846ae71cb0..a2e9b5cf5d6fe3c98e1b52e7b131d13753d8e31a 100644 (file)
@@ -25,11 +25,13 @@ DEAL_II_NAMESPACE_OPEN
 namespace SUNDIALS
 {
 /**
- * Alias for the real type used by SUNDIALS.
+ * Alias for the bool and real types used by SUNDIALS.
  */
 #  if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
+  using booltype = sunbooleantype;
   using realtype = ::sunrealtype;
 #  else
+  using booltype = booleantype;
   using realtype = ::realtype;
 #  endif
 } // namespace SUNDIALS
index a1a909290147ea98182580867ee4e110121f4663..bae405956b062c0c58c982e0523eac9e9a8a4985 100644 (file)
@@ -520,18 +520,14 @@ namespace SUNDIALS
                 lr);
             };
 
-            auto jacobian_solver_setup_callback = [](SUNDIALS::realtype t,
-                                                     N_Vector           y,
-                                                     N_Vector           fy,
-#  if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
-                                                     sunbooleantype  jok,
-                                                     sunbooleantype *jcurPtr,
-#  else
-                                                     booleantype  jok,
-                                                     booleantype *jcurPtr,
-#  endif
-                                                     SUNDIALS::realtype gamma,
-                                                     void *user_data) -> int {
+            auto jacobian_solver_setup_callback =
+              [](SUNDIALS::realtype  t,
+                 N_Vector            y,
+                 N_Vector            fy,
+                 SUNDIALS::booltype  jok,
+                 SUNDIALS::booltype *jcurPtr,
+                 SUNDIALS::realtype  gamma,
+                 void               *user_data) -> int {
               Assert(user_data != nullptr, ExcInternalError());
               ARKode<VectorType> &solver =
                 *static_cast<ARKode<VectorType> *>(user_data);
@@ -641,13 +637,8 @@ namespace SUNDIALS
 #  endif
           }
 
-#  if DEAL_II_SUNDIALS_VERSION_GTE(6, 0, 0)
-        sunbooleantype mass_time_dependent =
+        SUNDIALS::booltype mass_time_dependent =
           data.mass_is_time_independent ? SUNFALSE : SUNTRUE;
-#  else
-        booleantype mass_time_dependent =
-          data.mass_is_time_independent ? SUNFALSE : SUNTRUE;
-#  endif
 
         status = ARKStepSetMassLinearSolver(arkode_mem,
                                             sun_mass_linear_solver,

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.