]> https://gitweb.dealii.org/ - dealii.git/commitdiff
small changes which resulted in problems when merging a GCC 11 fix 12264/head
authorMathias Anselmann <mathias.anselmann@posteo.de>
Thu, 20 May 2021 16:51:38 +0000 (18:51 +0200)
committerMathias Anselmann <mathias.anselmann@posteo.de>
Thu, 20 May 2021 16:51:38 +0000 (18:51 +0200)
20 files changed:
examples/step-12/step-12.cc
examples/step-12b/step-12b.cc
examples/step-19/step-19.cc
examples/step-4/step-4.cc
examples/step-47/step-47.cc
examples/step-61/step-61.cc
examples/step-9/step-9.cc
include/deal.II/base/quadrature_lib.h
include/deal.II/fe/mapping_q_internal.h
include/deal.II/grid/grid_generator.h
include/deal.II/integrators/laplace.h
include/deal.II/matrix_free/shape_info.templates.h
include/deal.II/numerics/vector_tools_boundary.templates.h
include/deal.II/numerics/vector_tools_constraints.templates.h
source/base/quadrature_lib.cc
source/grid/grid_generator.cc
source/grid/grid_generator_from_name.cc
source/numerics/derivative_approximation.cc
source/numerics/point_value_history.cc
source/particles/generators.cc

index e61887b79b6ca2b722ac9a0bbe8c48e9a9384642..f91e94999ed4c4700cf2b0b90ba76faf5a212028 100644 (file)
@@ -120,9 +120,9 @@ namespace Step12
   {
     Assert(dim >= 2, ExcNotImplemented());
 
-    Point<dim> wind_field;
-    wind_field(0) = -p(1);
-    wind_field(1) = p(0);
+    Tensor<1, dim> wind_field;
+    wind_field[0] = -p[1];
+    wind_field[1] = p[0];
 
     if (wind_field.norm() > 1e-10)
       wind_field /= wind_field.norm();
index 0b3fc7352643cfd2baa421fd20bc1f8c043f5a30..9c006081147d720982864432608439ad0c1821c4 100644 (file)
@@ -126,9 +126,9 @@ namespace Step12
   {
     Assert(dim >= 2, ExcNotImplemented());
 
-    Point<dim> wind_field;
-    wind_field(0) = -p(1);
-    wind_field(1) = p(0);
+    Tensor<1, dim> wind_field;
+    wind_field[0] = -p[1];
+    wind_field[1] = p[0];
     wind_field /= wind_field.norm();
 
     return wind_field;
index e3af6b4d97deb2d8148afbe2dd8dda66bd9992d5..37af1155059803c56962f54e0709fa2984b26363 100644 (file)
@@ -470,7 +470,7 @@ namespace Step19
         if (particle_handler.n_particles_in_cell(cell) > 0)
           for (const auto &particle : particle_handler.particles_in_cell(cell))
             {
-              const Point<dim> reference_location =
+              const Point<dim> &reference_location =
                 particle.get_reference_location();
               for (const unsigned int i : fe_values.dof_indices())
                 cell_rhs(i) +=
@@ -613,7 +613,7 @@ namespace Step19
                 if ((E * fe_face_values.normal_vector(q_point) < 0) &&
                     (E.norm() > Constants::E_threshold))
                   {
-                    const Point<dim> location =
+                    const Point<dim> &location =
                       fe_face_values.quadrature_point(q_point);
 
                     Particles::Particle<dim> new_particle;
@@ -682,7 +682,8 @@ namespace Step19
                  particle != particles_in_cell.end();
                  ++particle, ++particle_index)
               {
-                const Tensor<1, dim> E = evaluator.get_gradient(particle_index);
+                const Tensor<1, dim> &E =
+                  evaluator.get_gradient(particle_index);
 
                 // Having now obtained the electric field at the location of one
                 // of the particles, we use this to update first the velocity
index 9f552e049b1c17e1ae457b9be17e387e5e07b425..6084770a39b7d31b4bd5fbf90ddfdd22eeb7bcef 100644 (file)
@@ -378,7 +378,7 @@ void Step4<dim>::assemble_system()
                  fe_values.shape_grad(j, q_index) * // grad phi_j(x_q)
                  fe_values.JxW(q_index));           // dx
 
-            const auto x_q = fe_values.quadrature_point(q_index);
+            const auto &x_q = fe_values.quadrature_point(q_index);
             cell_rhs(i) += (fe_values.shape_value(i, q_index) * // phi_i(x_q)
                             right_hand_side.value(x_q) *        // f(x_q)
                             fe_values.JxW(q_index));            // dx
index 8440a29f40dfd4e445393ec0a92dc5b783f59329..e683a19ee6faf3c92515010d08fa3b73f6b8a5eb 100644 (file)
@@ -405,12 +405,12 @@ namespace Step47
         {
           for (unsigned int i = 0; i < dofs_per_cell; ++i)
             {
-              const Tensor<2, dim> hessian_i =
+              const Tensor<2, dim> &hessian_i =
                 fe_values.shape_hessian(i, qpoint);
 
               for (unsigned int j = 0; j < dofs_per_cell; ++j)
                 {
-                  const Tensor<2, dim> hessian_j =
+                  const Tensor<2, dim> &hessian_j =
                     fe_values.shape_hessian(j, qpoint);
 
                   copy_data.cell_matrix(i, j) +=
index 9b66d909825dd6bd8b26635dc57130b06246ae4a..d3c35b6b2a86969564c3ff7ee39dc8fb3b96eae8 100644 (file)
@@ -522,7 +522,7 @@ namespace Step61
 
             for (unsigned int q = 0; q < n_face_q_points; ++q)
               {
-                const Tensor<1, dim> normal = fe_face_values.normal_vector(q);
+                const Tensor<1, dim> &normal = fe_face_values.normal_vector(q);
 
                 for (unsigned int i = 0; i < dofs_per_cell_dgrt; ++i)
                   {
@@ -769,7 +769,7 @@ namespace Step61
 
             for (unsigned int q = 0; q < n_face_q_points; ++q)
               {
-                const Tensor<1, dim> normal = fe_face_values.normal_vector(q);
+                const Tensor<1, dim> &normal = fe_face_values.normal_vector(q);
 
                 for (unsigned int i = 0; i < dofs_per_cell_dgrt; ++i)
                   {
@@ -939,7 +939,7 @@ namespace Step61
                 const Tensor<1, dim> true_velocity =
                   exact_velocity.value(fe_face_values_dgrt.quadrature_point(q));
 
-                const Tensor<1, dim> normal =
+                const Tensor<1, dim> &normal =
                   fe_face_values_dgrt.normal_vector(q);
 
                 L2_err_flux_face_sqr_local +=
index 49ed119ec9e994a7e5f7b59518e7e0cf52903b04..d29c49fed8e9ff5c44eea9fbfef607696539a476 100644 (file)
@@ -131,7 +131,7 @@ namespace Step9
   template <int dim>
   Tensor<1, dim> AdvectionField<dim>::value(const Point<dim> &p) const
   {
-    Point<dim> value;
+    Tensor<1, dim> value;
     value[0] = 2;
     for (unsigned int i = 1; i < dim; ++i)
       value[i] = 1 + 0.8 * std::sin(8. * numbers::PI * p[0]);
index a1bcf8802ae8dc7afbc9a0196c0c8bff85d51d17..af9a4c01746f091ad109ef5e2e2b22569264770a 100644 (file)
@@ -253,7 +253,7 @@ public:
    * formula or it is factored out, to be included in the integrand.
    */
   QGaussLogR(const unsigned int n,
-             const Point<dim>   x0                         = Point<dim>(),
+             const Point<dim> & x0                         = Point<dim>(),
              const double       alpha                      = 1,
              const bool         factor_out_singular_weight = false);
 
@@ -333,7 +333,7 @@ public:
    * @endcode
    */
   QGaussOneOverR(const unsigned int n,
-                 const Point<dim>   singularity,
+                 const Point<dim> & singularity,
                  const bool         factor_out_singular_weight = false);
   /**
    * The constructor takes three arguments: the order of the Gauss formula,
@@ -380,7 +380,7 @@ private:
    * the cell, on an edge of the cell, or on a corner of the cell.
    */
   static unsigned int
-  quad_size(const Point<dim> singularity, const unsigned int n);
+  quad_size(const Point<dim> &singularity, const unsigned int n);
 };
 
 
@@ -911,7 +911,7 @@ template <>
 QGaussLog<1>::QGaussLog(const unsigned int n, const bool revert);
 template <>
 QGaussLogR<1>::QGaussLogR(const unsigned int n,
-                          const Point<1>     x0,
+                          const Point<1> &   x0,
                           const double       alpha,
                           const bool         flag);
 template <>
index 77bd25c84e299f9e8df7a46150a7ae80d60003ab..4ee907fcfde28f73362c7ffc152b5c6fcb843d31 100644 (file)
@@ -261,7 +261,7 @@ namespace internal
       for (unsigned int i = 0; i < M; ++i)
         for (unsigned int j = 0; j < M; ++j)
           {
-            const Point<2> p =
+            const Point<2> &p =
               gl.point((i + 1) * (polynomial_degree + 1) + (j + 1));
             const unsigned int index_table = i * M + j;
             for (unsigned int v = 0; v < 4; ++v)
@@ -315,8 +315,8 @@ namespace internal
         for (unsigned int j = 0; j < M; ++j)
           for (unsigned int k = 0; k < M; ++k)
             {
-              const Point<3>     p = gl.point((i + 1) * (M + 2) * (M + 2) +
-                                          (j + 1) * (M + 2) + (k + 1));
+              const Point<3> &   p = gl.point((i + 1) * (M + 2) * (M + 2) +
+                                           (j + 1) * (M + 2) + (k + 1));
               const unsigned int index_table = i * M * M + j * M + k;
 
               // vertices
index 2da9f9590c7436466db40b4454300ceb61333448..90fca82336375dcbf34b6680573eae3c33248dc0 100644 (file)
@@ -395,7 +395,7 @@ namespace GridGenerator
                     const double             pad_top           = 2.,
                     const double             pad_left          = 1.,
                     const double             pad_right         = 1.,
-                    const Point<dim>         center            = Point<dim>(),
+                    const Point<dim> &       center            = Point<dim>(),
                     const types::manifold_id polar_manifold_id = 0,
                     const types::manifold_id tfi_manifold_id   = 1,
                     const double             L                 = 1.,
index 0be1d8326c1136065cafdf2871c02291fddb81ad..875de4e703404b832423a708ac43259bfa02796e 100644 (file)
@@ -167,8 +167,8 @@ namespace LocalIntegrators
 
       for (unsigned int k = 0; k < fe.n_quadrature_points; ++k)
         {
-          const double         dx = fe.JxW(k) * factor;
-          const Tensor<1, dim> n  = fe.normal_vector(k);
+          const double          dx = fe.JxW(k) * factor;
+          const Tensor<1, dim> &n  = fe.normal_vector(k);
           for (unsigned int i = 0; i < n_dofs; ++i)
             for (unsigned int j = 0; j < n_dofs; ++j)
               for (unsigned int d = 0; d < n_comp; ++d)
@@ -382,8 +382,8 @@ namespace LocalIntegrators
 
       for (unsigned int k = 0; k < fe1.n_quadrature_points; ++k)
         {
-          const double         dx = fe1.JxW(k);
-          const Tensor<1, dim> n  = fe1.normal_vector(k);
+          const double          dx = fe1.JxW(k);
+          const Tensor<1, dim> &n  = fe1.normal_vector(k);
           for (unsigned int d = 0; d < fe1.get_fe().n_components(); ++d)
             {
               for (unsigned int i = 0; i < n_dofs; ++i)
index 591010b170ebd4925a58f0da38989dc48f6325c2..218713f9c2f0a4146c500078a9e76848daa5a8c6 100644 (file)
@@ -386,7 +386,7 @@ namespace internal
                         for (unsigned int i = 0; i < n_dofs; ++i)
                           for (unsigned int q = 0; q < n_q_points_face; ++q)
                             {
-                              const auto point =
+                              const auto &point =
                                 projected_quad_face.point(q + offset);
 
                               shape_values_face(f, o, i * n_q_points_face + q) =
index f50a56ea29dc662a5d6272a046e240cf893ad5d1..6fb5ec1c587ac857f6160ad005e2bd06aa3472df 100644 (file)
@@ -2832,7 +2832,7 @@ namespace VectorTools
                     }
 
                   // Tensor of normal vector on the face at q_point;
-                  const Tensor<1, dim> normal_vector =
+                  const Tensor<1, dim> &normal_vector =
                     fe_face_values.normal_vector(q_point);
 
                   // Now compute the linear system:
index 24477aac63080c4a2a457a178638bd79e6aff38f..d3e51e020e04f05448b317eeee6da44b83ae5d51 100644 (file)
@@ -656,8 +656,8 @@ namespace VectorTools
                         normal_vector[d] = 0;
                     normal_vector /= normal_vector.norm();
 
-                    const Point<dim> point = fe_values.quadrature_point(i);
-                    Vector<double>   b_values(dim);
+                    const Point<dim> &point = fe_values.quadrature_point(i);
+                    Vector<double>    b_values(dim);
                     function_map.at(*b_id)->vector_value(point, b_values);
 
                     // now enter the (dofs,(normal_vector,cell)) entry into
@@ -1165,8 +1165,8 @@ namespace VectorTools
                                            i, face_no)
                                          .second][component] = face_dofs[i];
 
-                      const Point<dim> point = fe_values.quadrature_point(i);
-                      const double     b_value =
+                      const Point<dim> &point = fe_values.quadrature_point(i);
+                      const double      b_value =
                         function_map.at(*b_id)->value(point, component);
                       dof_to_b_value.insert(
                         std::make_pair(face_dofs[i], b_value));
index 2733115cb3364e09dffe9812d7a940fa80bffe18..88ad96517d14df96b7cd4ddf2c134bb572260f21 100644 (file)
@@ -526,7 +526,7 @@ QGaussLog<1>::get_quadrature_weights(const unsigned int n)
 
 template <>
 QGaussLogR<1>::QGaussLogR(const unsigned int n,
-                          const Point<1>     origin,
+                          const Point<1> &   origin,
                           const double       alpha,
                           const bool         factor_out_singularity)
   : Quadrature<1>(
@@ -606,7 +606,7 @@ QGaussLogR<1>::QGaussLogR(const unsigned int n,
 
 template <>
 unsigned int
-QGaussOneOverR<2>::quad_size(const Point<2> singularity, const unsigned int n)
+QGaussOneOverR<2>::quad_size(const Point<2> &singularity, const unsigned int n)
 {
   const double eps = 1e-8;
   const bool   on_edge =
@@ -628,7 +628,7 @@ QGaussOneOverR<2>::quad_size(const Point<2> singularity, const unsigned int n)
 
 template <>
 QGaussOneOverR<2>::QGaussOneOverR(const unsigned int n,
-                                  const Point<2>     singularity,
+                                  const Point<2> &   singularity,
                                   const bool         factor_out_singularity)
   : Quadrature<2>(quad_size(singularity, n))
 {
@@ -1258,8 +1258,8 @@ QTrianglePolar::QTrianglePolar(const Quadrature<1> &radial_quadrature,
   this->weights.resize(base.size());
   for (unsigned int i = 0; i < base.size(); ++i)
     {
-      const auto q = base.point(i);
-      const auto w = base.weight(i);
+      const auto &q = base.point(i);
+      const auto  w = base.weight(i);
 
       const auto xhat = q[0];
       const auto yhat = q[1];
@@ -1295,8 +1295,8 @@ QDuffy::QDuffy(const Quadrature<1> &radial_quadrature,
   this->weights.resize(base.size());
   for (unsigned int i = 0; i < base.size(); ++i)
     {
-      const auto q = base.point(i);
-      const auto w = base.weight(i);
+      const auto &q = base.point(i);
+      const auto  w = base.weight(i);
 
       const auto xhat = q[0];
       const auto yhat = q[1];
index 1728060c3c9d0a98420335d426d5755133a272bc..81fdd1eef02ef80e286007392507574e70478605 100644 (file)
@@ -413,7 +413,7 @@ namespace GridGenerator
          *  airfoil points.
          */
         static std::array<std::vector<Point<2>>, 2>
-        joukowski(const Point<2>     centerpoint,
+        joukowski(const Point<2> &   centerpoint,
                   const unsigned int number_points,
                   const unsigned int factor)
         {
@@ -3282,7 +3282,7 @@ namespace GridGenerator
                          const double /*pad_top*/,
                          const double /*pad_left*/,
                          const double /*pad_right*/,
-                         const Point<1> /*center*/,
+                         const Point<1> /*center*/,
                          const types::manifold_id /*polar_manifold_id*/,
                          const types::manifold_id /*tfi_manifold_id*/,
                          const double /*L*/,
@@ -3344,7 +3344,7 @@ namespace GridGenerator
                          const double             pad_top,
                          const double             pad_left,
                          const double             pad_right,
-                         const Point<2>           new_center,
+                         const Point<2> &         new_center,
                          const types::manifold_id polar_manifold_id,
                          const types::manifold_id tfi_manifold_id,
                          const double             L,
@@ -3527,7 +3527,7 @@ namespace GridGenerator
                          const double             pad_top,
                          const double             pad_left,
                          const double             pad_right,
-                         const Point<3>           new_center,
+                         const Point<3> &         new_center,
                          const types::manifold_id polar_manifold_id,
                          const types::manifold_id tfi_manifold_id,
                          const double             L,
index 1ac0314e93405afde35b6e3cac9ce8ce3e1a7553..60f8952640eb300a4b50bce8c02b6a694bc79d51 100644 (file)
@@ -111,7 +111,7 @@ namespace GridGenerator
                          double,
                          double,
                          double,
-                         const Point<dim>,
+                         const Point<dim> &,
                          types::manifold_id,
                          types::manifold_id,
                          double,
index 5871717aded8bb5071afb37673ea6b8f44b6736b..e07ae53b956f816ec1945a3ff5460afab0d3654f 100644 (file)
@@ -839,7 +839,7 @@ namespace DerivativeApproximation
                 neighbor_fe_midpoint_value, solution, component);
 
           // ...and the place where it lives
-          const Point<dim> neighbor_center =
+          const Point<dim> &neighbor_center =
             neighbor_fe_midpoint_value.quadrature_point(0);
 
 
@@ -848,6 +848,7 @@ namespace DerivativeApproximation
           // direction between
           // the centers of two
           // cells
+
           Tensor<1, dim> y        = neighbor_center - this_center;
           const double   distance = y.norm();
           // normalize y
index 2c190caf41f2f0ccff4c806d48e97be8675de9d9..79575ef9e78763c754a4beb0fa2dd4c084a470e8 100644 (file)
@@ -255,7 +255,8 @@ PointValueHistory<dim>::add_point(const Point<dim> &location)
           unsigned int component = dof_handler->get_fe()
                                      .system_to_component_index(support_point)
                                      .first;
-          Point<dim> test_point = fe_values.quadrature_point(support_point);
+          const Point<dim> &test_point =
+            fe_values.quadrature_point(support_point);
 
           if (location.distance(test_point) <
               location.distance(current_points[component]))
@@ -402,7 +403,8 @@ PointValueHistory<dim>::add_points(const std::vector<Point<dim>> &locations)
           unsigned int component = dof_handler->get_fe()
                                      .system_to_component_index(support_point)
                                      .first;
-          Point<dim> test_point = fe_values.quadrature_point(support_point);
+          const Point<dim> &test_point =
+            fe_values.quadrature_point(support_point);
 
           for (unsigned int point = 0; point < locations.size(); point++)
             {
index e54b47608c4867a1668b59ce362e24f619fff8be..32750d09fdad114e82a8ff75f3bbd98348eb8a43 100644 (file)
@@ -177,7 +177,7 @@ namespace Particles
       std::uniform_real_distribution<double> uniform_distribution_01(0, 1);
 
       const BoundingBox<spacedim> cell_bounding_box(cell->bounding_box());
-      const std::pair<Point<spacedim>, Point<spacedim>> cell_bounds(
+      const std::pair<Point<spacedim>, Point<spacedim>> &cell_bounds(
         cell_bounding_box.get_boundary_points());
 
       // Generate random points in these bounds until one is within the cell

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.