]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix include/lac
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sat, 5 Jan 2019 22:36:37 +0000 (23:36 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Fri, 18 Jan 2019 10:27:10 +0000 (11:27 +0100)
include/deal.II/lac/affine_constraints.templates.h
include/deal.II/lac/la_parallel_vector.templates.h
include/deal.II/lac/matrix_out.h

index 830500af51b5d8aadb2abf67cdaabfa10424416e..631ab78720ac616bae5103e2359484d94b736bc8 100644 (file)
@@ -166,7 +166,7 @@ AffineConstraints<number>::is_consistent_in_parallel(
   for (const auto &kv : received)
     {
       // for each incoming line:
-      for (auto &lineit : kv.second)
+      for (const auto &lineit : kv.second)
         {
           const ConstraintLine reference = get_line(lineit.index);
 
index 84eb0b5f92f881acf06eb9b2bec89f0b3f6a709d..ae0ec7c9612a3a217ad3f3a4f0601ab45f0c2818 100644 (file)
@@ -911,7 +911,7 @@ namespace LinearAlgebra
             {
               Number *new_val;
               Utilities::System::posix_memalign(
-                (void **)&new_val,
+                reinterpret_cast<void **>(&new_val),
                 64,
                 sizeof(Number) * partitioner->n_import_indices());
               import_data.values.reset(new_val);
@@ -926,7 +926,7 @@ namespace LinearAlgebra
       // uses a view of the array and thus we need the data on the host to
       // outlive the scope of the function.
       Number *new_val;
-      Utilities::System::posix_memalign((void **)&new_val,
+      Utilities::System::posix_memalign(reinterpret_cast<void **>(&new_val),
                                         64,
                                         sizeof(Number) * allocated_size);
 
@@ -1071,7 +1071,7 @@ namespace LinearAlgebra
             {
               Number *new_val;
               Utilities::System::posix_memalign(
-                (void **)&new_val,
+                reinterpret_cast<void **>(&new_val),
                 64,
                 sizeof(Number) * partitioner->n_import_indices());
               import_data.values.reset(new_val);
@@ -1086,7 +1086,7 @@ namespace LinearAlgebra
       // uses a view of the array and thus we need the data on the host to
       // outlive the scope of the function.
       Number *new_val;
-      Utilities::System::posix_memalign((void **)&new_val,
+      Utilities::System::posix_memalign(reinterpret_cast<void **>(&new_val),
                                         64,
                                         sizeof(Number) * allocated_size);
 
index 5fbf56f82f4567532209fd9d4a4321ad7f334d1b..7825e3434f9470cc18658972fc97bcccc4f23b11 100644 (file)
@@ -350,40 +350,27 @@ MatrixOut::build_patches(const Matrix &     matrix,
   for (size_type i = 0; i < gridpoints_y; ++i)
     for (size_type j = 0; j < gridpoints_x; ++j, ++index)
       {
-        // within each patch, order
-        // the points in such a way
-        // that if some graphical
-        // output program (such as
-        // gnuplot) plots the
-        // quadrilaterals as two
-        // triangles, then the
-        // diagonal of the
-        // quadrilateral which cuts
-        // it into the two printed
-        // triangles is parallel to
-        // the diagonal of the
-        // matrix, rather than
-        // perpendicular to it. this
-        // has the advantage that,
-        // for example, the unit
-        // matrix is plotted as a
-        // straight rim, rather than
-        // as a series of bumps and
-        // valleys along the diagonal
+        // within each patch, order the points in such a way that if some
+        // graphical output program (such as gnuplot) plots the quadrilaterals
+        // as two triangles, then the diagonal of the quadrilateral which cuts
+        // it into the two printed triangles is parallel to the diagonal of the
+        // matrix, rather than perpendicular to it. this has the advantage that,
+        // for example, the unit matrix is plotted as a straight rim, rather
+        // than as a series of bumps and valleys along the diagonal
         patches[index].vertices[0](0) = j;
-        patches[index].vertices[0](1) = static_cast<signed int>(-i);
+        patches[index].vertices[0](1) = -static_cast<signed int>(i);
         patches[index].vertices[1](0) = j;
-        patches[index].vertices[1](1) = static_cast<signed int>(-i - 1);
+        patches[index].vertices[1](1) = -static_cast<signed int>(i + 1);
         patches[index].vertices[2](0) = j + 1;
-        patches[index].vertices[2](1) = static_cast<signed int>(-i);
+        patches[index].vertices[2](1) = -static_cast<signed int>(i);
         patches[index].vertices[3](0) = j + 1;
-        patches[index].vertices[3](1) = static_cast<signed int>(-i - 1);
+        patches[index].vertices[3](1) = -static_cast<signed int>(i + 1);
         // next scale all the patch
         // coordinates by the block
         // size, to get original
         // coordinates
-        for (unsigned int v = 0; v < 4; ++v)
-          patches[index].vertices[v] *= options.block_size;
+        for (auto &vertex : patches[index].vertices)
+          vertex *= options.block_size;
 
         patches[index].n_subdivisions = 1;
 

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.