]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move a function out of an anonymous namespace. 5143/head
authorDavid Wells <wellsd2@rpi.edu>
Sun, 24 Sep 2017 19:38:52 +0000 (15:38 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Sun, 24 Sep 2017 19:44:48 +0000 (15:44 -0400)
We only call this function in debug mode right now, so the compiler
complains (in release mode) that we have an unused function.

source/sundials/copy.cc

index 27c554d063959263436e408400ba2cdbd7a1bcb5..fb3d6fc147052aa3f921513f133f401de2467256 100644 (file)
@@ -22,40 +22,37 @@ namespace SUNDIALS
 {
   namespace internal
   {
-    namespace
+    /**
+     * SUNDIALS provides different macros for getting the local length of a
+     * vector for serial and parallel vectors (as well as various parallel
+     * vectors that are not yet supported by deal.II). This function provides
+     * a generic interface to both and does a (checked) conversion from long
+     * int (the type SUNDIALS uses for lengths) to std::size_t.
+     */
+    inline
+    std::size_t
+    N_Vector_length(const N_Vector &vec)
     {
-      /**
-       * SUNDIALS provides different macros for getting the local length of a
-       * vector for serial and parallel vectors (as well as various parallel
-       * vectors that are not yet supported by deal.II). This function provides
-       * a generic interface to both and does a (checked) conversion from long
-       * int (the type SUNDIALS uses for lengths) to std::size_t.
-       */
-      inline
-      std::size_t
-      N_Vector_length(const N_Vector &vec)
-      {
-        const N_Vector_ID id = N_VGetVectorID(vec);
-        long int length = -1;
-        switch (id)
-          {
-          case SUNDIALS_NVEC_SERIAL:
-          {
-            length = NV_LENGTH_S(vec);
-            break;
-          }
-          case SUNDIALS_NVEC_PARALLEL:
-          {
-            length = NV_LOCLENGTH_P(vec);
-            break;
-          }
-          default:
-            Assert(false, ExcNotImplemented());
-          }
-
-        Assert(length >= 0, ExcInternalError());
-        return static_cast<std::size_t>(length);
-      }
+      const N_Vector_ID id = N_VGetVectorID(vec);
+      long int length = -1;
+      switch (id)
+        {
+        case SUNDIALS_NVEC_SERIAL:
+        {
+          length = NV_LENGTH_S(vec);
+          break;
+        }
+        case SUNDIALS_NVEC_PARALLEL:
+        {
+          length = NV_LOCLENGTH_P(vec);
+          break;
+        }
+        default:
+          Assert(false, ExcNotImplemented());
+        }
+
+      Assert(length >= 0, ExcInternalError());
+      return static_cast<std::size_t>(length);
     }
 
 #ifdef DEAL_II_WITH_MPI

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.