From: Daniel Arndt Date: Sat, 5 Jan 2019 22:36:37 +0000 (+0100) Subject: Fix include/lac X-Git-Tag: v9.1.0-rc1~425^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8dc77b36086c09f9f68d664186a7717ded9e088d;p=dealii.git Fix include/lac --- diff --git a/include/deal.II/lac/affine_constraints.templates.h b/include/deal.II/lac/affine_constraints.templates.h index 830500af51..631ab78720 100644 --- a/include/deal.II/lac/affine_constraints.templates.h +++ b/include/deal.II/lac/affine_constraints.templates.h @@ -166,7 +166,7 @@ AffineConstraints::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); diff --git a/include/deal.II/lac/la_parallel_vector.templates.h b/include/deal.II/lac/la_parallel_vector.templates.h index 84eb0b5f92..ae0ec7c961 100644 --- a/include/deal.II/lac/la_parallel_vector.templates.h +++ b/include/deal.II/lac/la_parallel_vector.templates.h @@ -911,7 +911,7 @@ namespace LinearAlgebra { Number *new_val; Utilities::System::posix_memalign( - (void **)&new_val, + reinterpret_cast(&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(&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(&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(&new_val), 64, sizeof(Number) * allocated_size); diff --git a/include/deal.II/lac/matrix_out.h b/include/deal.II/lac/matrix_out.h index 5fbf56f82f..7825e3434f 100644 --- a/include/deal.II/lac/matrix_out.h +++ b/include/deal.II/lac/matrix_out.h @@ -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(-i); + patches[index].vertices[0](1) = -static_cast(i); patches[index].vertices[1](0) = j; - patches[index].vertices[1](1) = static_cast(-i - 1); + patches[index].vertices[1](1) = -static_cast(i + 1); patches[index].vertices[2](0) = j + 1; - patches[index].vertices[2](1) = static_cast(-i); + patches[index].vertices[2](1) = -static_cast(i); patches[index].vertices[3](0) = j + 1; - patches[index].vertices[3](1) = static_cast(-i - 1); + patches[index].vertices[3](1) = -static_cast(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;