]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove some unnecessary std::moves. 8034/head
authorDavid Wells <drwells@email.unc.edu>
Tue, 7 May 2019 22:27:57 +0000 (18:27 -0400)
committerDavid Wells <drwells@email.unc.edu>
Wed, 8 May 2019 00:17:19 +0000 (20:17 -0400)
GCC 9 and newer complain about this. Fix it by making the original
pointer type correct.

14 files changed:
include/deal.II/fe/fe_face.h
include/deal.II/fe/fe_poly.h
include/deal.II/fe/fe_poly_face.h
include/deal.II/fe/fe_poly_tensor.h
source/fe/fe_dgp_nonparametric.cc
source/fe/fe_enriched.cc
source/fe/fe_nedelec_sz.cc
source/fe/fe_p1nc.cc
source/fe/fe_system.cc
source/fe/mapping_cartesian.cc
source/fe/mapping_fe_field.cc
source/fe/mapping_manifold.cc
source/fe/mapping_q.cc
source/fe/mapping_q_generic.cc

index c0238f6deb7a321fe04a074cf6110a53889ef61a..6b5acf20028e7747051421d6a4530f4702af4413 100644 (file)
@@ -357,22 +357,22 @@ protected:
       & /*output_data*/) const override
   {
     // generate a new data object and initialize some fields
-    auto data = std_cxx14::make_unique<
+    auto data_ptr = std_cxx14::make_unique<
       typename FiniteElement<1, spacedim>::InternalDataBase>();
-    data->update_each = requires_update_flags(update_flags);
+    data_ptr->update_each = requires_update_flags(update_flags);
 
     const unsigned int n_q_points = quadrature.size();
     AssertDimension(n_q_points, 1);
     (void)n_q_points;
 
     // No derivatives of this element are implemented.
-    if (data->update_each & update_gradients ||
-        data->update_each & update_hessians)
+    if (data_ptr->update_each & update_gradients ||
+        data_ptr->update_each & update_hessians)
       {
         Assert(false, ExcNotImplemented());
       }
 
-    return std::move(data);
+    return data_ptr;
   }
 
   std::unique_ptr<typename FiniteElement<1, spacedim>::InternalDataBase>
index 35b01f74dba0934cdd5aa8a4fc6f83e271cce131..e184173ce4f9d71e9182e26914d742f1397f5b63 100644 (file)
@@ -243,8 +243,10 @@ protected:
   {
     // generate a new data object and
     // initialize some fields
-    auto data         = std_cxx14::make_unique<InternalData>();
-    data->update_each = requires_update_flags(update_flags);
+    std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+          data_ptr   = std_cxx14::make_unique<InternalData>();
+    auto &data       = dynamic_cast<InternalData &>(*data_ptr);
+    data.update_each = requires_update_flags(update_flags);
 
     const unsigned int n_q_points = quadrature.size();
 
@@ -281,16 +283,16 @@ protected:
     if ((update_flags & update_values) &&
         !((output_data.shape_values.n_rows() > 0) &&
           (output_data.shape_values.n_cols() == n_q_points)))
-      data->shape_values.reinit(this->dofs_per_cell, n_q_points);
+      data.shape_values.reinit(this->dofs_per_cell, n_q_points);
 
     if (update_flags & update_gradients)
-      data->shape_gradients.reinit(this->dofs_per_cell, n_q_points);
+      data.shape_gradients.reinit(this->dofs_per_cell, n_q_points);
 
     if (update_flags & update_hessians)
-      data->shape_hessians.reinit(this->dofs_per_cell, n_q_points);
+      data.shape_hessians.reinit(this->dofs_per_cell, n_q_points);
 
     if (update_flags & update_3rd_derivatives)
-      data->shape_3rd_derivatives.reinit(this->dofs_per_cell, n_q_points);
+      data.shape_3rd_derivatives.reinit(this->dofs_per_cell, n_q_points);
 
     // next already fill those fields of which we have information by
     // now. note that the shape gradients are only those on the unit
@@ -321,7 +323,7 @@ protected:
                     output_data.shape_values[k][i] = values[k];
                 else
                   for (unsigned int k = 0; k < this->dofs_per_cell; ++k)
-                    data->shape_values[k][i] = values[k];
+                    data.shape_values[k][i] = values[k];
               }
 
           // for everything else, derivatives need to be transformed,
@@ -329,17 +331,17 @@ protected:
           // copy stuff into where FEValues wants it
           if (update_flags & update_gradients)
             for (unsigned int k = 0; k < this->dofs_per_cell; ++k)
-              data->shape_gradients[k][i] = grads[k];
+              data.shape_gradients[k][i] = grads[k];
 
           if (update_flags & update_hessians)
             for (unsigned int k = 0; k < this->dofs_per_cell; ++k)
-              data->shape_hessians[k][i] = grad_grads[k];
+              data.shape_hessians[k][i] = grad_grads[k];
 
           if (update_flags & update_3rd_derivatives)
             for (unsigned int k = 0; k < this->dofs_per_cell; ++k)
-              data->shape_3rd_derivatives[k][i] = third_derivatives[k];
+              data.shape_3rd_derivatives[k][i] = third_derivatives[k];
         }
-    return std::move(data);
+    return data_ptr;
   }
 
   virtual void
index 288f018bb95d486ee226321b4ee4711706d3c5d8..c73705e2d82d11b4e30de3576f9feb497ccf2e86 100644 (file)
@@ -109,8 +109,10 @@ protected:
   {
     // generate a new data object and
     // initialize some fields
-    auto data         = std_cxx14::make_unique<InternalData>();
-    data->update_each = requires_update_flags(update_flags);
+    std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+          data_ptr   = std_cxx14::make_unique<InternalData>();
+    auto &data       = dynamic_cast<InternalData &>(*data_ptr);
+    data.update_each = requires_update_flags(update_flags);
 
     const unsigned int n_q_points = quadrature.size();
 
@@ -124,11 +126,11 @@ protected:
     // initialize fields only if really
     // necessary. otherwise, don't
     // allocate memory
-    if (data->update_each & update_values)
+    if (data.update_each & update_values)
       {
         values.resize(poly_space.n());
-        data->shape_values.resize(poly_space.n(),
-                                  std::vector<double>(n_q_points));
+        data.shape_values.resize(poly_space.n(),
+                                 std::vector<double>(n_q_points));
         for (unsigned int i = 0; i < n_q_points; ++i)
           {
             poly_space.compute(quadrature.point(i),
@@ -139,18 +141,18 @@ protected:
                                empty_vector_of_4th_order_tensors);
 
             for (unsigned int k = 0; k < poly_space.n(); ++k)
-              data->shape_values[k][i] = values[k];
+              data.shape_values[k][i] = values[k];
           }
       }
     // No derivatives of this element
     // are implemented.
-    if (data->update_each & update_gradients ||
-        data->update_each & update_hessians)
+    if (data.update_each & update_gradients ||
+        data.update_each & update_hessians)
       {
         Assert(false, ExcNotImplemented());
       }
 
-    return std::move(data);
+    return data_ptr;
   }
 
   std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
index 582619dffac0be67dbc567b6a0828d095e0aa2b6..1c9903562302f7850bb95c6104e2f64d26723aef 100644 (file)
@@ -227,8 +227,10 @@ protected:
   {
     // generate a new data object and
     // initialize some fields
-    auto data         = std_cxx14::make_unique<InternalData>();
-    data->update_each = requires_update_flags(update_flags);
+    std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+          data_ptr   = std_cxx14::make_unique<InternalData>();
+    auto &data       = dynamic_cast<InternalData &>(*data_ptr);
+    data.update_each = requires_update_flags(update_flags);
 
     const unsigned int n_q_points = quadrature.size();
 
@@ -240,7 +242,7 @@ protected:
     std::vector<Tensor<5, dim>> fourth_derivatives(0);
 
     if (update_flags & (update_values | update_gradients | update_hessians))
-      data->sign_change.resize(this->dofs_per_cell);
+      data.sign_change.resize(this->dofs_per_cell);
 
     // initialize fields only if really
     // necessary. otherwise, don't
@@ -248,31 +250,31 @@ protected:
     if (update_flags & update_values)
       {
         values.resize(this->dofs_per_cell);
-        data->shape_values.reinit(this->dofs_per_cell, n_q_points);
+        data.shape_values.reinit(this->dofs_per_cell, n_q_points);
         if (mapping_type != mapping_none)
-          data->transformed_shape_values.resize(n_q_points);
+          data.transformed_shape_values.resize(n_q_points);
       }
 
     if (update_flags & update_gradients)
       {
         grads.resize(this->dofs_per_cell);
-        data->shape_grads.reinit(this->dofs_per_cell, n_q_points);
-        data->transformed_shape_grads.resize(n_q_points);
+        data.shape_grads.reinit(this->dofs_per_cell, n_q_points);
+        data.transformed_shape_grads.resize(n_q_points);
 
         if ((mapping_type == mapping_raviart_thomas) ||
             (mapping_type == mapping_piola) ||
             (mapping_type == mapping_nedelec) ||
             (mapping_type == mapping_contravariant))
-          data->untransformed_shape_grads.resize(n_q_points);
+          data.untransformed_shape_grads.resize(n_q_points);
       }
 
     if (update_flags & update_hessians)
       {
         grad_grads.resize(this->dofs_per_cell);
-        data->shape_grad_grads.reinit(this->dofs_per_cell, n_q_points);
-        data->transformed_shape_hessians.resize(n_q_points);
+        data.shape_grad_grads.reinit(this->dofs_per_cell, n_q_points);
+        data.transformed_shape_hessians.resize(n_q_points);
         if (mapping_type != mapping_none)
-          data->untransformed_shape_hessian_tensors.resize(n_q_points);
+          data.untransformed_shape_hessian_tensors.resize(n_q_points);
       }
 
     // Compute shape function values
@@ -296,14 +298,14 @@ protected:
             {
               if (inverse_node_matrix.n_cols() == 0)
                 for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
-                  data->shape_values[i][k] = values[i];
+                  data.shape_values[i][k] = values[i];
               else
                 for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
                   {
                     Tensor<1, dim> add_values;
                     for (unsigned int j = 0; j < this->dofs_per_cell; ++j)
                       add_values += inverse_node_matrix(j, i) * values[j];
-                    data->shape_values[i][k] = add_values;
+                    data.shape_values[i][k] = add_values;
                   }
             }
 
@@ -311,14 +313,14 @@ protected:
             {
               if (inverse_node_matrix.n_cols() == 0)
                 for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
-                  data->shape_grads[i][k] = grads[i];
+                  data.shape_grads[i][k] = grads[i];
               else
                 for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
                   {
                     Tensor<2, dim> add_grads;
                     for (unsigned int j = 0; j < this->dofs_per_cell; ++j)
                       add_grads += inverse_node_matrix(j, i) * grads[j];
-                    data->shape_grads[i][k] = add_grads;
+                    data.shape_grads[i][k] = add_grads;
                   }
             }
 
@@ -326,7 +328,7 @@ protected:
             {
               if (inverse_node_matrix.n_cols() == 0)
                 for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
-                  data->shape_grad_grads[i][k] = grad_grads[i];
+                  data.shape_grad_grads[i][k] = grad_grads[i];
               else
                 for (unsigned int i = 0; i < this->dofs_per_cell; ++i)
                   {
@@ -334,11 +336,11 @@ protected:
                     for (unsigned int j = 0; j < this->dofs_per_cell; ++j)
                       add_grad_grads +=
                         inverse_node_matrix(j, i) * grad_grads[j];
-                    data->shape_grad_grads[i][k] = add_grad_grads;
+                    data.shape_grad_grads[i][k] = add_grad_grads;
                   }
             }
         }
-    return std::move(data);
+    return data_ptr;
   }
 
   virtual void
index 140a11c52432620917b923e82d70212b359a8553..73be55da64c0d6926021b10c968ce1abe5ea1abb 100644 (file)
@@ -283,14 +283,14 @@ FE_DGPNonparametric<dim, spacedim>::get_data(
     & /*output_data*/) const
 {
   // generate a new data object
-  auto data = std_cxx14::make_unique<
+  auto data_ptr = std_cxx14::make_unique<
     typename FiniteElement<dim, spacedim>::InternalDataBase>();
-  data->update_each = requires_update_flags(update_flags);
+  data_ptr->update_each = requires_update_flags(update_flags);
 
   // other than that, there is nothing we can add here as discussed
   // in the general documentation of this class
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
index ec5368122ca344bb1e2c2715414e61dc968e7c1e..8c18e281c5d5069c93d98946d15f597aed6cc320 100644 (file)
@@ -331,33 +331,35 @@ FE_Enriched<dim, spacedim>::setup_data(
   // Pass ownership of the FiniteElement::InternalDataBase object
   // that fes_data points to, to the new InternalData object.
   auto update_each_flags = fes_data->update_each;
-  auto data = std_cxx14::make_unique<InternalData>(std::move(fes_data));
+  std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+        data_ptr = std_cxx14::make_unique<InternalData>(std::move(fes_data));
+  auto &data     = dynamic_cast<InternalData &>(*data_ptr);
 
   // copy update_each from FESystem data:
-  data->update_each = update_each_flags;
+  data.update_each = update_each_flags;
 
   // resize cache array according to requested flags
-  data->enrichment.resize(this->n_base_elements());
+  data.enrichment.resize(this->n_base_elements());
 
   const unsigned int n_q_points = quadrature.size();
 
   for (unsigned int base = 0; base < this->n_base_elements(); ++base)
     {
-      data->enrichment[base].resize(this->element_multiplicity(base));
+      data.enrichment[base].resize(this->element_multiplicity(base));
       for (unsigned int m = 0; m < this->element_multiplicity(base); ++m)
         {
           if (flags & update_values)
-            data->enrichment[base][m].values.resize(n_q_points);
+            data.enrichment[base][m].values.resize(n_q_points);
 
           if (flags & update_gradients)
-            data->enrichment[base][m].gradients.resize(n_q_points);
+            data.enrichment[base][m].gradients.resize(n_q_points);
 
           if (flags & update_hessians)
-            data->enrichment[base][m].hessians.resize(n_q_points);
+            data.enrichment[base][m].hessians.resize(n_q_points);
         }
     }
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
index 9e3eebb63795078e0ca52e76f42b05b91ae8ca55..9788479b1d5bb9725d89fde6ae8d0d83aa063e3d 100644 (file)
@@ -131,8 +131,11 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                                                                      spacedim>
     & /*output_data*/) const
 {
-  auto data         = std_cxx14::make_unique<InternalData>();
-  data->update_each = update_each(update_flags) | update_once(update_flags);
+  std::unique_ptr<
+    typename dealii::FiniteElement<dim, spacedim>::InternalDataBase>
+        data_ptr   = std_cxx14::make_unique<InternalData>();
+  auto &data       = dynamic_cast<InternalData &>(*data_ptr);
+  data.update_each = update_each(update_flags) | update_once(update_flags);
 
   // Useful quantities:
   const unsigned int degree(this->degree - 1); // Note: FE holds input degree+1
@@ -144,31 +147,31 @@ FE_NedelecSZ<dim, spacedim>::get_data(
   const unsigned int n_line_dofs = this->dofs_per_line * lines_per_cell;
   const unsigned int n_face_dofs = this->dofs_per_quad * faces_per_cell;
 
-  const UpdateFlags  flags(data->update_each);
+  const UpdateFlags  flags(data.update_each);
   const unsigned int n_q_points = quadrature.size();
 
   // Resize the internal data storage:
-  data->sigma_imj_values.resize(
+  data.sigma_imj_values.resize(
     n_q_points,
     std::vector<std::vector<double>>(vertices_per_cell,
                                      std::vector<double>(vertices_per_cell)));
 
-  data->sigma_imj_grads.resize(vertices_per_cell,
-                               std::vector<std::vector<double>>(
-                                 vertices_per_cell, std::vector<double>(dim)));
+  data.sigma_imj_grads.resize(vertices_per_cell,
+                              std::vector<std::vector<double>>(
+                                vertices_per_cell, std::vector<double>(dim)));
 
   // Resize shape function arrays according to update flags:
   if (flags & update_values)
     {
-      data->shape_values.resize(this->dofs_per_cell,
-                                std::vector<Tensor<1, dim>>(n_q_points));
+      data.shape_values.resize(this->dofs_per_cell,
+                               std::vector<Tensor<1, dim>>(n_q_points));
     }
 
   if (flags & update_gradients)
     {
-      data->shape_grads.resize(this->dofs_per_cell,
-                               std::vector<DerivativeForm<1, dim, dim>>(
-                                 n_q_points));
+      data.shape_grads.resize(this->dofs_per_cell,
+                              std::vector<DerivativeForm<1, dim, dim>>(
+                                n_q_points));
     }
   // Not implementing second derivatives yet:
   if (flags & update_hessians)
@@ -206,7 +209,7 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                 {
                   for (unsigned int j = 0; j < vertices_per_cell; ++j)
                     {
-                      data->sigma_imj_values[q][i][j] =
+                      data.sigma_imj_values[q][i][j] =
                         sigma[q][i] - sigma[q][j];
                     }
                 }
@@ -255,7 +258,7 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                   // Can now calculate the gradient, only non-zero in the
                   // component given: Note some i,j combinations will be
                   // incorrect, but only on invalid edges.
-                  data->sigma_imj_grads[i][j][sigma_imj_component[i][j]] =
+                  data.sigma_imj_grads[i][j][sigma_imj_component[i][j]] =
                     2.0 * sigma_imj_sign[i][j];
                 }
             }
@@ -264,14 +267,14 @@ FE_NedelecSZ<dim, spacedim>::get_data(
           // with global numbering matching that of the reference element:
 
           // Resize the edge parameterisations
-          data->edge_sigma_values.resize(lines_per_cell);
-          data->edge_sigma_grads.resize(lines_per_cell);
+          data.edge_sigma_values.resize(lines_per_cell);
+          data.edge_sigma_grads.resize(lines_per_cell);
           for (unsigned int m = 0; m < lines_per_cell; ++m)
             {
-              data->edge_sigma_values[m].resize(n_q_points);
+              data.edge_sigma_values[m].resize(n_q_points);
 
               // sigma grads are constant in a cell (no need for quad points)
-              data->edge_sigma_grads[m].resize(dim);
+              data.edge_sigma_grads[m].resize(dim);
             }
 
           // Fill the values for edge lambda and edge sigma:
@@ -281,10 +284,10 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                                                                      0,
                                                                      0};
 
-          data->edge_lambda_values.resize(lines_per_cell,
-                                          std::vector<double>(n_q_points));
-          data->edge_lambda_grads_2d.resize(lines_per_cell,
-                                            std::vector<double>(dim));
+          data.edge_lambda_values.resize(lines_per_cell,
+                                         std::vector<double>(n_q_points));
+          data.edge_lambda_grads_2d.resize(lines_per_cell,
+                                           std::vector<double>(dim));
           for (unsigned int m = 0; m < lines_per_cell; ++m)
             {
               // e1=max(reference vertex numbering on this edge)
@@ -296,18 +299,17 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                 GeometryInfo<dim>::line_to_cell_vertices(m, 0));
               for (unsigned int q = 0; q < n_q_points; ++q)
                 {
-                  data->edge_sigma_values[m][q] =
-                    data->sigma_imj_values[q][e2][e1];
-                  data->edge_lambda_values[m][q] =
-                    lambda[q][e1] + lambda[q][e2];
+                  data.edge_sigma_values[m][q] =
+                    data.sigma_imj_values[q][e2][e1];
+                  data.edge_lambda_values[m][q] = lambda[q][e1] + lambda[q][e2];
                 }
 
-              data->edge_sigma_grads[m][edge_sigma_direction[m]] = -2.0;
+              data.edge_sigma_grads[m][edge_sigma_direction[m]] = -2.0;
             }
-          data->edge_lambda_grads_2d[0] = {-1.0, 0.0};
-          data->edge_lambda_grads_2d[1] = {1.0, 0.0};
-          data->edge_lambda_grads_2d[2] = {0.0, -1.0};
-          data->edge_lambda_grads_2d[3] = {0.0, 1.0};
+          data.edge_lambda_grads_2d[0] = {-1.0, 0.0};
+          data.edge_lambda_grads_2d[1] = {1.0, 0.0};
+          data.edge_lambda_grads_2d[2] = {0.0, -1.0};
+          data.edge_lambda_grads_2d[3] = {0.0, 1.0};
 
           // If the polynomial order is 0, then no more work to do:
           if (degree < 1)
@@ -452,29 +454,29 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                               // Type 1:
                               const unsigned int dof_index1(cell_type1_offset +
                                                             shift_ij);
-                              data->shape_values[dof_index1][q][0] =
+                              data.shape_values[dof_index1][q][0] =
                                 2.0 * polyx[i][1] * polyy[j][0];
-                              data->shape_values[dof_index1][q][1] =
+                              data.shape_values[dof_index1][q][1] =
                                 2.0 * polyx[i][0] * polyy[j][1];
 
                               // Type 2:
                               const unsigned int dof_index2(cell_type2_offset +
                                                             shift_ij);
-                              data->shape_values[dof_index2][q][0] =
-                                data->shape_values[dof_index1][q][0];
-                              data->shape_values[dof_index2][q][1] =
-                                -1.0 * data->shape_values[dof_index1][q][1];
+                              data.shape_values[dof_index2][q][0] =
+                                data.shape_values[dof_index1][q][0];
+                              data.shape_values[dof_index2][q][1] =
+                                -1.0 * data.shape_values[dof_index1][q][1];
                             }
                           // Type 3:
                           const unsigned int dof_index3_1(cell_type3_offset1 +
                                                           j);
-                          data->shape_values[dof_index3_1][q][0] = polyy[j][0];
-                          data->shape_values[dof_index3_1][q][1] = 0.0;
+                          data.shape_values[dof_index3_1][q][0] = polyy[j][0];
+                          data.shape_values[dof_index3_1][q][1] = 0.0;
 
                           const unsigned int dof_index3_2(cell_type3_offset2 +
                                                           j);
-                          data->shape_values[dof_index3_2][q][0] = 0.0;
-                          data->shape_values[dof_index3_2][q][1] = polyx[j][0];
+                          data.shape_values[dof_index3_2][q][0] = 0.0;
+                          data.shape_values[dof_index3_2][q][1] = polyx[j][0];
                         }
                     }
                   if (flags & update_gradients)
@@ -489,43 +491,43 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                               // Type 1:
                               const unsigned int dof_index1(cell_type1_offset +
                                                             shift_ij);
-                              data->shape_grads[dof_index1][q][0][0] =
+                              data.shape_grads[dof_index1][q][0][0] =
                                 4.0 * polyx[i][2] * polyy[j][0];
-                              data->shape_grads[dof_index1][q][0][1] =
+                              data.shape_grads[dof_index1][q][0][1] =
                                 4.0 * polyx[i][1] * polyy[j][1];
-                              data->shape_grads[dof_index1][q][1][0] =
-                                data->shape_grads[dof_index1][q][0][1];
-                              data->shape_grads[dof_index1][q][1][1] =
+                              data.shape_grads[dof_index1][q][1][0] =
+                                data.shape_grads[dof_index1][q][0][1];
+                              data.shape_grads[dof_index1][q][1][1] =
                                 4.0 * polyx[i][0] * polyy[j][2];
 
                               // Type 2:
                               const unsigned int dof_index2(cell_type2_offset +
                                                             shift_ij);
-                              data->shape_grads[dof_index2][q][0][0] =
-                                data->shape_grads[dof_index1][q][0][0];
-                              data->shape_grads[dof_index2][q][0][1] =
-                                data->shape_grads[dof_index1][q][0][1];
-                              data->shape_grads[dof_index2][q][1][0] =
-                                -1.0 * data->shape_grads[dof_index1][q][1][0];
-                              data->shape_grads[dof_index2][q][1][1] =
-                                -1.0 * data->shape_grads[dof_index1][q][1][1];
+                              data.shape_grads[dof_index2][q][0][0] =
+                                data.shape_grads[dof_index1][q][0][0];
+                              data.shape_grads[dof_index2][q][0][1] =
+                                data.shape_grads[dof_index1][q][0][1];
+                              data.shape_grads[dof_index2][q][1][0] =
+                                -1.0 * data.shape_grads[dof_index1][q][1][0];
+                              data.shape_grads[dof_index2][q][1][1] =
+                                -1.0 * data.shape_grads[dof_index1][q][1][1];
                             }
                           // Type 3:
                           const unsigned int dof_index3_1(cell_type3_offset1 +
                                                           j);
-                          data->shape_grads[dof_index3_1][q][0][0] = 0.0;
-                          data->shape_grads[dof_index3_1][q][0][1] =
+                          data.shape_grads[dof_index3_1][q][0][0] = 0.0;
+                          data.shape_grads[dof_index3_1][q][0][1] =
                             2.0 * polyy[j][1];
-                          data->shape_grads[dof_index3_1][q][1][0] = 0.0;
-                          data->shape_grads[dof_index3_1][q][1][1] = 0.0;
+                          data.shape_grads[dof_index3_1][q][1][0] = 0.0;
+                          data.shape_grads[dof_index3_1][q][1][1] = 0.0;
 
                           const unsigned int dof_index3_2(cell_type3_offset2 +
                                                           j);
-                          data->shape_grads[dof_index3_2][q][0][0] = 0.0;
-                          data->shape_grads[dof_index3_2][q][0][1] = 0.0;
-                          data->shape_grads[dof_index3_2][q][1][0] =
+                          data.shape_grads[dof_index3_2][q][0][0] = 0.0;
+                          data.shape_grads[dof_index3_2][q][0][1] = 0.0;
+                          data.shape_grads[dof_index3_2][q][1][0] =
                             2.0 * polyx[j][1];
-                          data->shape_grads[dof_index3_2][q][1][1] = 0.0;
+                          data.shape_grads[dof_index3_2][q][1][1] = 0.0;
                         }
                     }
                 }
@@ -574,7 +576,7 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                 {
                   for (unsigned int j = 0; j < vertices_per_cell; ++j)
                     {
-                      data->sigma_imj_values[q][i][j] =
+                      data.sigma_imj_values[q][i][j] =
                         sigma[q][i] - sigma[q][j];
                     }
                 }
@@ -642,7 +644,7 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                   // Can now calculate the gradient, only non-zero in the
                   // component given: Note some i,j combinations will be
                   // incorrect, but only on invalid edges.
-                  data->sigma_imj_grads[i][j][sigma_imj_component[i][j]] =
+                  data.sigma_imj_grads[i][j][sigma_imj_component[i][j]] =
                     2.0 * sigma_imj_sign[i][j];
                 }
             }
@@ -650,30 +652,30 @@ FE_NedelecSZ<dim, spacedim>::get_data(
           // with global numbering matching that of the reference element:
 
           // resize the edge parameterisations
-          data->edge_sigma_values.resize(lines_per_cell);
-          data->edge_lambda_values.resize(lines_per_cell);
-          data->edge_sigma_grads.resize(lines_per_cell);
-          data->edge_lambda_grads_3d.resize(lines_per_cell);
-          data->edge_lambda_gradgrads_3d.resize(lines_per_cell);
+          data.edge_sigma_values.resize(lines_per_cell);
+          data.edge_lambda_values.resize(lines_per_cell);
+          data.edge_sigma_grads.resize(lines_per_cell);
+          data.edge_lambda_grads_3d.resize(lines_per_cell);
+          data.edge_lambda_gradgrads_3d.resize(lines_per_cell);
           for (unsigned int m = 0; m < lines_per_cell; ++m)
             {
-              data->edge_sigma_values[m].resize(n_q_points);
-              data->edge_lambda_values[m].resize(n_q_points);
+              data.edge_sigma_values[m].resize(n_q_points);
+              data.edge_lambda_values[m].resize(n_q_points);
 
               // sigma grads are constant in a cell (no need for quad points)
-              data->edge_sigma_grads[m].resize(dim);
+              data.edge_sigma_grads[m].resize(dim);
 
-              data->edge_lambda_grads_3d[m].resize(n_q_points);
+              data.edge_lambda_grads_3d[m].resize(n_q_points);
               for (unsigned int q = 0; q < n_q_points; ++q)
                 {
-                  data->edge_lambda_grads_3d[m][q].resize(dim);
+                  data.edge_lambda_grads_3d[m][q].resize(dim);
                 }
               // lambda_gradgrads are constant in a cell (no need for quad
               // points)
-              data->edge_lambda_gradgrads_3d[m].resize(dim);
+              data.edge_lambda_gradgrads_3d[m].resize(dim);
               for (unsigned int d = 0; d < dim; ++d)
                 {
-                  data->edge_lambda_gradgrads_3d[m][d].resize(dim);
+                  data.edge_lambda_gradgrads_3d[m][d].resize(dim);
                 }
             }
 
@@ -694,13 +696,12 @@ FE_NedelecSZ<dim, spacedim>::get_data(
 
               for (unsigned int q = 0; q < n_q_points; ++q)
                 {
-                  data->edge_sigma_values[m][q] =
-                    data->sigma_imj_values[q][e2][e1];
-                  data->edge_lambda_values[m][q] =
-                    lambda[q][e1] + lambda[q][e2];
+                  data.edge_sigma_values[m][q] =
+                    data.sigma_imj_values[q][e2][e1];
+                  data.edge_lambda_values[m][q] = lambda[q][e1] + lambda[q][e2];
                 }
 
-              data->edge_sigma_grads[m][edge_sigma_direction[m]] = -2.0;
+              data.edge_sigma_grads[m][edge_sigma_direction[m]] = -2.0;
             }
           // edge_lambda_grads
           for (unsigned int q = 0; q < n_q_points; ++q)
@@ -708,18 +709,18 @@ FE_NedelecSZ<dim, spacedim>::get_data(
               double x(p_list[q][0]);
               double y(p_list[q][1]);
               double z(p_list[q][2]);
-              data->edge_lambda_grads_3d[0][q]  = {z - 1.0, 0.0, x - 1.0};
-              data->edge_lambda_grads_3d[1][q]  = {1.0 - z, 0.0, -x};
-              data->edge_lambda_grads_3d[2][q]  = {0.0, z - 1.0, y - 1.0};
-              data->edge_lambda_grads_3d[3][q]  = {0.0, 1.0 - z, -y};
-              data->edge_lambda_grads_3d[4][q]  = {-z, 0.0, 1.0 - x};
-              data->edge_lambda_grads_3d[5][q]  = {z, 0.0, x};
-              data->edge_lambda_grads_3d[6][q]  = {0.0, -z, 1.0 - y};
-              data->edge_lambda_grads_3d[7][q]  = {0.0, z, y};
-              data->edge_lambda_grads_3d[8][q]  = {y - 1.0, x - 1.0, 0.0};
-              data->edge_lambda_grads_3d[9][q]  = {1.0 - y, -x, 0.0};
-              data->edge_lambda_grads_3d[10][q] = {-y, 1.0 - x, 0.0};
-              data->edge_lambda_grads_3d[11][q] = {y, x, 0.0};
+              data.edge_lambda_grads_3d[0][q]  = {z - 1.0, 0.0, x - 1.0};
+              data.edge_lambda_grads_3d[1][q]  = {1.0 - z, 0.0, -x};
+              data.edge_lambda_grads_3d[2][q]  = {0.0, z - 1.0, y - 1.0};
+              data.edge_lambda_grads_3d[3][q]  = {0.0, 1.0 - z, -y};
+              data.edge_lambda_grads_3d[4][q]  = {-z, 0.0, 1.0 - x};
+              data.edge_lambda_grads_3d[5][q]  = {z, 0.0, x};
+              data.edge_lambda_grads_3d[6][q]  = {0.0, -z, 1.0 - y};
+              data.edge_lambda_grads_3d[7][q]  = {0.0, z, y};
+              data.edge_lambda_grads_3d[8][q]  = {y - 1.0, x - 1.0, 0.0};
+              data.edge_lambda_grads_3d[9][q]  = {1.0 - y, -x, 0.0};
+              data.edge_lambda_grads_3d[10][q] = {-y, 1.0 - x, 0.0};
+              data.edge_lambda_grads_3d[11][q] = {y, x, 0.0};
             }
           // edge_lambda gradgrads:
           const int edge_lambda_sign[GeometryInfo<3>::lines_per_cell] = {
@@ -751,11 +752,11 @@ FE_NedelecSZ<dim, spacedim>::get_data(
               {0, 1}}; // component which edge_lambda[m] depends on.
           for (unsigned int m = 0; m < lines_per_cell; ++m)
             {
-              data->edge_lambda_gradgrads_3d[m][edge_lambda_directions[m][0]]
-                                            [edge_lambda_directions[m][1]] =
+              data.edge_lambda_gradgrads_3d[m][edge_lambda_directions[m][0]]
+                                           [edge_lambda_directions[m][1]] =
                 edge_lambda_sign[m];
-              data->edge_lambda_gradgrads_3d[m][edge_lambda_directions[m][1]]
-                                            [edge_lambda_directions[m][0]] =
+              data.edge_lambda_gradgrads_3d[m][edge_lambda_directions[m][1]]
+                                           [edge_lambda_directions[m][0]] =
                 edge_lambda_sign[m];
             }
           // Precomputation for higher order shape functions,
@@ -763,13 +764,13 @@ FE_NedelecSZ<dim, spacedim>::get_data(
           if (degree > 0)
             {
               // resize required data:
-              data->face_lambda_values.resize(faces_per_cell);
-              data->face_lambda_grads.resize(faces_per_cell);
+              data.face_lambda_values.resize(faces_per_cell);
+              data.face_lambda_grads.resize(faces_per_cell);
               // for face-based shape functions:
               for (unsigned int m = 0; m < faces_per_cell; ++m)
                 {
-                  data->face_lambda_values[m].resize(n_q_points);
-                  data->face_lambda_grads[m].resize(3);
+                  data.face_lambda_values[m].resize(n_q_points);
+                  data.face_lambda_grads[m].resize(3);
                 }
               // Fill in the values (these don't change between cells).
               for (unsigned int q = 0; q < n_q_points; ++q)
@@ -777,20 +778,20 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                   double x(p_list[q][0]);
                   double y(p_list[q][1]);
                   double z(p_list[q][2]);
-                  data->face_lambda_values[0][q] = 1.0 - x;
-                  data->face_lambda_values[1][q] = x;
-                  data->face_lambda_values[2][q] = 1.0 - y;
-                  data->face_lambda_values[3][q] = y;
-                  data->face_lambda_values[4][q] = 1.0 - z;
-                  data->face_lambda_values[5][q] = z;
+                  data.face_lambda_values[0][q] = 1.0 - x;
+                  data.face_lambda_values[1][q] = x;
+                  data.face_lambda_values[2][q] = 1.0 - y;
+                  data.face_lambda_values[3][q] = y;
+                  data.face_lambda_values[4][q] = 1.0 - z;
+                  data.face_lambda_values[5][q] = z;
                 }
               // gradients are constant:
-              data->face_lambda_grads[0] = {-1.0, 0.0, 0.0};
-              data->face_lambda_grads[1] = {1.0, 0.0, 0.0};
-              data->face_lambda_grads[2] = {0.0, -1.0, 0.0};
-              data->face_lambda_grads[3] = {0.0, 1.0, 0.0};
-              data->face_lambda_grads[4] = {0.0, 0.0, -1.0};
-              data->face_lambda_grads[5] = {0.0, 0.0, 1.0};
+              data.face_lambda_grads[0] = {-1.0, 0.0, 0.0};
+              data.face_lambda_grads[1] = {1.0, 0.0, 0.0};
+              data.face_lambda_grads[2] = {0.0, -1.0, 0.0};
+              data.face_lambda_grads[3] = {0.0, 1.0, 0.0};
+              data.face_lambda_grads[4] = {0.0, 0.0, -1.0};
+              data.face_lambda_grads[5] = {0.0, 0.0, 1.0};
 
               // for cell-based shape functions:
               // these don't depend on the cell, so can precompute all here:
@@ -898,13 +899,13 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                                       const unsigned int dof_index1(
                                         cell_type1_offset + shift_ijk);
 
-                                      data->shape_values[dof_index1][q][0] =
+                                      data.shape_values[dof_index1][q][0] =
                                         2.0 * polyx[i][1] * polyy[j][0] *
                                         polyz[k][0];
-                                      data->shape_values[dof_index1][q][1] =
+                                      data.shape_values[dof_index1][q][1] =
                                         2.0 * polyx[i][0] * polyy[j][1] *
                                         polyz[k][0];
-                                      data->shape_values[dof_index1][q][2] =
+                                      data.shape_values[dof_index1][q][2] =
                                         2.0 * polyx[i][0] * polyy[j][0] *
                                         polyz[k][1];
 
@@ -914,22 +915,22 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                                       const unsigned int dof_index2_2(
                                         cell_type2_offset2 + shift_ijk);
 
-                                      data->shape_values[dof_index2_1][q][0] =
-                                        data->shape_values[dof_index1][q][0];
-                                      data->shape_values[dof_index2_1][q][1] =
+                                      data.shape_values[dof_index2_1][q][0] =
+                                        data.shape_values[dof_index1][q][0];
+                                      data.shape_values[dof_index2_1][q][1] =
                                         -1.0 *
-                                        data->shape_values[dof_index1][q][1];
-                                      data->shape_values[dof_index2_1][q][2] =
-                                        data->shape_values[dof_index1][q][2];
+                                        data.shape_values[dof_index1][q][1];
+                                      data.shape_values[dof_index2_1][q][2] =
+                                        data.shape_values[dof_index1][q][2];
 
-                                      data->shape_values[dof_index2_2][q][0] =
-                                        data->shape_values[dof_index1][q][0];
-                                      data->shape_values[dof_index2_2][q][1] =
+                                      data.shape_values[dof_index2_2][q][0] =
+                                        data.shape_values[dof_index1][q][0];
+                                      data.shape_values[dof_index2_2][q][1] =
                                         -1.0 *
-                                        data->shape_values[dof_index1][q][1];
-                                      data->shape_values[dof_index2_2][q][2] =
+                                        data.shape_values[dof_index1][q][1];
+                                      data.shape_values[dof_index2_2][q][2] =
                                         -1.0 *
-                                        data->shape_values[dof_index1][q][2];
+                                        data.shape_values[dof_index1][q][2];
                                     }
                                   // Type 3: (note we re-use k and j for
                                   // convenience):
@@ -943,19 +944,19 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                                   const unsigned int dof_index3_3(
                                     cell_type3_offset3 + shift_ij);
 
-                                  data->shape_values[dof_index3_1][q][0] =
+                                  data.shape_values[dof_index3_1][q][0] =
                                     polyy[j][0] * polyz[k][0];
-                                  data->shape_values[dof_index3_1][q][1] = 0.0;
-                                  data->shape_values[dof_index3_1][q][2] = 0.0;
+                                  data.shape_values[dof_index3_1][q][1] = 0.0;
+                                  data.shape_values[dof_index3_1][q][2] = 0.0;
 
-                                  data->shape_values[dof_index3_2][q][0] = 0.0;
-                                  data->shape_values[dof_index3_2][q][1] =
+                                  data.shape_values[dof_index3_2][q][0] = 0.0;
+                                  data.shape_values[dof_index3_2][q][1] =
                                     polyx[j][0] * polyz[k][0];
-                                  data->shape_values[dof_index3_2][q][2] = 0.0;
+                                  data.shape_values[dof_index3_2][q][2] = 0.0;
 
-                                  data->shape_values[dof_index3_3][q][0] = 0.0;
-                                  data->shape_values[dof_index3_3][q][1] = 0.0;
-                                  data->shape_values[dof_index3_3][q][2] =
+                                  data.shape_values[dof_index3_3][q][0] = 0.0;
+                                  data.shape_values[dof_index3_3][q][1] = 0.0;
+                                  data.shape_values[dof_index3_3][q][2] =
                                     polyx[j][0] * polyy[k][0];
                                 }
                             }
@@ -981,30 +982,30 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                                       const unsigned int dof_index1(
                                         cell_type1_offset + shift_ijk);
 
-                                      data->shape_grads[dof_index1][q][0][0] =
+                                      data.shape_grads[dof_index1][q][0][0] =
                                         4.0 * polyx[i][2] * polyy[j][0] *
                                         polyz[k][0];
-                                      data->shape_grads[dof_index1][q][0][1] =
+                                      data.shape_grads[dof_index1][q][0][1] =
                                         4.0 * polyx[i][1] * polyy[j][1] *
                                         polyz[k][0];
-                                      data->shape_grads[dof_index1][q][0][2] =
+                                      data.shape_grads[dof_index1][q][0][2] =
                                         4.0 * polyx[i][1] * polyy[j][0] *
                                         polyz[k][1];
 
-                                      data->shape_grads[dof_index1][q][1][0] =
-                                        data->shape_grads[dof_index1][q][0][1];
-                                      data->shape_grads[dof_index1][q][1][1] =
+                                      data.shape_grads[dof_index1][q][1][0] =
+                                        data.shape_grads[dof_index1][q][0][1];
+                                      data.shape_grads[dof_index1][q][1][1] =
                                         4.0 * polyx[i][0] * polyy[j][2] *
                                         polyz[k][0];
-                                      data->shape_grads[dof_index1][q][1][2] =
+                                      data.shape_grads[dof_index1][q][1][2] =
                                         4.0 * polyx[i][0] * polyy[j][1] *
                                         polyz[k][1];
 
-                                      data->shape_grads[dof_index1][q][2][0] =
-                                        data->shape_grads[dof_index1][q][0][2];
-                                      data->shape_grads[dof_index1][q][2][1] =
-                                        data->shape_grads[dof_index1][q][1][2];
-                                      data->shape_grads[dof_index1][q][2][2] =
+                                      data.shape_grads[dof_index1][q][2][0] =
+                                        data.shape_grads[dof_index1][q][0][2];
+                                      data.shape_grads[dof_index1][q][2][1] =
+                                        data.shape_grads[dof_index1][q][1][2];
+                                      data.shape_grads[dof_index1][q][2][2] =
                                         4.0 * polyx[i][0] * polyy[j][0] *
                                         polyz[k][2];
 
@@ -1016,31 +1017,34 @@ FE_NedelecSZ<dim, spacedim>::get_data(
 
                                       for (unsigned int d = 0; d < dim; ++d)
                                         {
-                                          data->shape_grads[dof_index2_1][q][0]
-                                                           [d] =
-                                            data->shape_grads[dof_index1][q][0]
-                                                             [d];
-                                          data->shape_grads[dof_index2_1][q][1]
-                                                           [d] =
-                                            -1.0 * data->shape_grads[dof_index1]
-                                                                    [q][1][d];
-                                          data->shape_grads[dof_index2_1][q][2]
-                                                           [d] =
-                                            data->shape_grads[dof_index1][q][2]
-                                                             [d];
-
-                                          data->shape_grads[dof_index2_2][q][0]
-                                                           [d] =
-                                            data->shape_grads[dof_index1][q][0]
-                                                             [d];
-                                          data->shape_grads[dof_index2_2][q][1]
-                                                           [d] =
-                                            -1.0 * data->shape_grads[dof_index1]
-                                                                    [q][1][d];
-                                          data->shape_grads[dof_index2_2][q][2]
-                                                           [d] =
-                                            -1.0 * data->shape_grads[dof_index1]
-                                                                    [q][2][d];
+                                          data.shape_grads[dof_index2_1][q][0]
+                                                          [d] =
+                                            data
+                                              .shape_grads[dof_index1][q][0][d];
+                                          data.shape_grads[dof_index2_1][q][1]
+                                                          [d] =
+                                            -1.0 *
+                                            data
+                                              .shape_grads[dof_index1][q][1][d];
+                                          data.shape_grads[dof_index2_1][q][2]
+                                                          [d] =
+                                            data
+                                              .shape_grads[dof_index1][q][2][d];
+
+                                          data.shape_grads[dof_index2_2][q][0]
+                                                          [d] =
+                                            data
+                                              .shape_grads[dof_index1][q][0][d];
+                                          data.shape_grads[dof_index2_2][q][1]
+                                                          [d] =
+                                            -1.0 *
+                                            data
+                                              .shape_grads[dof_index1][q][1][d];
+                                          data.shape_grads[dof_index2_2][q][2]
+                                                          [d] =
+                                            -1.0 *
+                                            data
+                                              .shape_grads[dof_index1][q][2][d];
                                         }
                                     }
                                   // Type 3: (note we re-use k and j for
@@ -1058,27 +1062,27 @@ FE_NedelecSZ<dim, spacedim>::get_data(
                                     {
                                       for (unsigned int d2 = 0; d2 < dim; ++d2)
                                         {
-                                          data->shape_grads[dof_index3_1][q][d1]
-                                                           [d2] = 0.0;
-                                          data->shape_grads[dof_index3_2][q][d1]
-                                                           [d2] = 0.0;
-                                          data->shape_grads[dof_index3_3][q][d1]
-                                                           [d2] = 0.0;
+                                          data.shape_grads[dof_index3_1][q][d1]
+                                                          [d2] = 0.0;
+                                          data.shape_grads[dof_index3_2][q][d1]
+                                                          [d2] = 0.0;
+                                          data.shape_grads[dof_index3_3][q][d1]
+                                                          [d2] = 0.0;
                                         }
                                     }
-                                  data->shape_grads[dof_index3_1][q][0][1] =
+                                  data.shape_grads[dof_index3_1][q][0][1] =
                                     2.0 * polyy[j][1] * polyz[k][0];
-                                  data->shape_grads[dof_index3_1][q][0][2] =
+                                  data.shape_grads[dof_index3_1][q][0][2] =
                                     2.0 * polyy[j][0] * polyz[k][1];
 
-                                  data->shape_grads[dof_index3_2][q][1][0] =
+                                  data.shape_grads[dof_index3_2][q][1][0] =
                                     2.0 * polyx[j][1] * polyz[k][0];
-                                  data->shape_grads[dof_index3_2][q][1][2] =
+                                  data.shape_grads[dof_index3_2][q][1][2] =
                                     2.0 * polyx[j][0] * polyz[k][1];
 
-                                  data->shape_grads[dof_index3_3][q][2][0] =
+                                  data.shape_grads[dof_index3_3][q][2][0] =
                                     2.0 * polyx[j][1] * polyy[k][0];
-                                  data->shape_grads[dof_index3_3][q][2][1] =
+                                  data.shape_grads[dof_index3_3][q][2][1] =
                                     2.0 * polyx[j][0] * polyy[k][1];
                                 }
                             }
@@ -1093,7 +1097,7 @@ FE_NedelecSZ<dim, spacedim>::get_data(
           Assert(false, ExcNotImplemented());
         }
     }
-  return std::move(data);
+  return data_ptr;
 }
 
 template <int dim, int spacedim>
index f681aece31667cdf8debb52b8b489152ca844674..1f81305bff6013c69f132be87aed6469d87f204b 100644 (file)
@@ -140,18 +140,19 @@ FE_P1NC::get_data(
   dealii::internal::FEValuesImplementation::FiniteElementRelatedData<2, 2>
     &output_data) const
 {
-  auto data = std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
+  auto data_ptr =
+    std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
 
-  data->update_each = requires_update_flags(update_flags);
+  data_ptr->update_each = requires_update_flags(update_flags);
 
   const unsigned int n_q_points = quadrature.size();
-  output_data.initialize(n_q_points, FE_P1NC(), data->update_each);
+  output_data.initialize(n_q_points, FE_P1NC(), data_ptr->update_each);
 
   // this is a linear element, so its second derivatives are zero
-  if (data->update_each & update_hessians)
+  if (data_ptr->update_each & update_hessians)
     output_data.shape_hessians.fill(Tensor<2, 2>());
 
-  return data;
+  return data_ptr;
 }
 
 
@@ -164,18 +165,19 @@ FE_P1NC::get_face_data(
   dealii::internal::FEValuesImplementation::FiniteElementRelatedData<2, 2>
     &output_data) const
 {
-  auto data = std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
+  auto data_ptr =
+    std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
 
-  data->update_each = requires_update_flags(update_flags);
+  data_ptr->update_each = requires_update_flags(update_flags);
 
   const unsigned int n_q_points = quadrature.size();
-  output_data.initialize(n_q_points, FE_P1NC(), data->update_each);
+  output_data.initialize(n_q_points, FE_P1NC(), data_ptr->update_each);
 
   // this is a linear element, so its second derivatives are zero
-  if (data->update_each & update_hessians)
+  if (data_ptr->update_each & update_hessians)
     output_data.shape_hessians.fill(Tensor<2, 2>());
 
-  return data;
+  return data_ptr;
 }
 
 
@@ -188,18 +190,19 @@ FE_P1NC::get_subface_data(
   dealii::internal::FEValuesImplementation::FiniteElementRelatedData<2, 2>
     &output_data) const
 {
-  auto data = std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
+  auto data_ptr =
+    std_cxx14::make_unique<FiniteElement<2, 2>::InternalDataBase>();
 
-  data->update_each = requires_update_flags(update_flags);
+  data_ptr->update_each = requires_update_flags(update_flags);
 
   const unsigned int n_q_points = quadrature.size();
-  output_data.initialize(n_q_points, FE_P1NC(), data->update_each);
+  output_data.initialize(n_q_points, FE_P1NC(), data_ptr->update_each);
 
   // this is a linear element, so its second derivatives are zero
-  if (data->update_each & update_hessians)
+  if (data_ptr->update_each & update_hessians)
     output_data.shape_hessians.fill(Tensor<2, 2>());
 
-  return data;
+  return data_ptr;
 }
 
 
index 7477fa495cde7ee9e464750cd66268d763f3eefa..fbc334f1826e5ce42e7bcea85c8221d3fa5630ee 100644 (file)
@@ -940,8 +940,10 @@ FESystem<dim, spacedim>::get_data(
   // and so the current object's update_each flag needs to be
   // correct in case the current FESystem is a base element for another,
   // higher-level FESystem itself.
-  auto data = std_cxx14::make_unique<InternalData>(this->n_base_elements());
-  data->update_each = requires_update_flags(flags);
+  std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+        data_ptr = std_cxx14::make_unique<InternalData>(this->n_base_elements());
+  auto &data     = dynamic_cast<InternalData &>(*data_ptr);
+  data.update_each = requires_update_flags(flags);
 
   // get data objects from each of the base elements and store
   // them. one might think that doing this in parallel (over the
@@ -958,7 +960,7 @@ FESystem<dim, spacedim>::get_data(
   for (unsigned int base_no = 0; base_no < this->n_base_elements(); ++base_no)
     {
       internal::FEValuesImplementation::FiniteElementRelatedData<dim, spacedim>
-        &base_fe_output_object = data->get_fe_output_object(base_no);
+        &base_fe_output_object = data.get_fe_output_object(base_no);
       base_fe_output_object.initialize(
         quadrature.size(),
         base_element(base_no),
@@ -975,10 +977,10 @@ FESystem<dim, spacedim>::get_data(
                                                          quadrature,
                                                          base_fe_output_object);
 
-      data->set_fe_data(base_no, std::move(base_fe_data));
+      data.set_fe_data(base_no, std::move(base_fe_data));
     }
 
-  return std::move(data);
+  return data_ptr;
 }
 
 // The following function is a clone of get_data, with the exception
@@ -1001,8 +1003,10 @@ FESystem<dim, spacedim>::get_face_data(
   // and so the current object's update_each flag needs to be
   // correct in case the current FESystem is a base element for another,
   // higher-level FESystem itself.
-  auto data = std_cxx14::make_unique<InternalData>(this->n_base_elements());
-  data->update_each = requires_update_flags(flags);
+  std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+        data_ptr = std_cxx14::make_unique<InternalData>(this->n_base_elements());
+  auto &data     = dynamic_cast<InternalData &>(*data_ptr);
+  data.update_each = requires_update_flags(flags);
 
   // get data objects from each of the base elements and store
   // them. one might think that doing this in parallel (over the
@@ -1019,7 +1023,7 @@ FESystem<dim, spacedim>::get_face_data(
   for (unsigned int base_no = 0; base_no < this->n_base_elements(); ++base_no)
     {
       internal::FEValuesImplementation::FiniteElementRelatedData<dim, spacedim>
-        &base_fe_output_object = data->get_fe_output_object(base_no);
+        &base_fe_output_object = data.get_fe_output_object(base_no);
       base_fe_output_object.initialize(
         quadrature.size(),
         base_element(base_no),
@@ -1034,10 +1038,10 @@ FESystem<dim, spacedim>::get_face_data(
       auto base_fe_data = base_element(base_no).get_face_data(
         flags, mapping, quadrature, base_fe_output_object);
 
-      data->set_fe_data(base_no, std::move(base_fe_data));
+      data.set_fe_data(base_no, std::move(base_fe_data));
     }
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
@@ -1062,8 +1066,11 @@ FESystem<dim, spacedim>::get_subface_data(
   // and so the current object's update_each flag needs to be
   // correct in case the current FESystem is a base element for another,
   // higher-level FESystem itself.
-  auto data = std_cxx14::make_unique<InternalData>(this->n_base_elements());
-  data->update_each = requires_update_flags(flags);
+  std::unique_ptr<typename FiniteElement<dim, spacedim>::InternalDataBase>
+        data_ptr = std_cxx14::make_unique<InternalData>(this->n_base_elements());
+  auto &data     = dynamic_cast<InternalData &>(*data_ptr);
+
+  data.update_each = requires_update_flags(flags);
 
   // get data objects from each of the base elements and store
   // them. one might think that doing this in parallel (over the
@@ -1080,7 +1087,7 @@ FESystem<dim, spacedim>::get_subface_data(
   for (unsigned int base_no = 0; base_no < this->n_base_elements(); ++base_no)
     {
       internal::FEValuesImplementation::FiniteElementRelatedData<dim, spacedim>
-        &base_fe_output_object = data->get_fe_output_object(base_no);
+        &base_fe_output_object = data.get_fe_output_object(base_no);
       base_fe_output_object.initialize(
         quadrature.size(),
         base_element(base_no),
@@ -1095,10 +1102,10 @@ FESystem<dim, spacedim>::get_subface_data(
       auto base_fe_data = base_element(base_no).get_subface_data(
         flags, mapping, quadrature, base_fe_output_object);
 
-      data->set_fe_data(base_no, std::move(base_fe_data));
+      data.set_fe_data(base_no, std::move(base_fe_data));
     }
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
index aad2315648d587ba11df65b3fe1c99277c764265..fa4d762321a67c4d3d62de73aafb5ae2f3328282 100644 (file)
@@ -98,14 +98,16 @@ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
 MappingCartesian<dim, spacedim>::get_data(const UpdateFlags      update_flags,
                                           const Quadrature<dim> &q) const
 {
-  auto data = std_cxx14::make_unique<InternalData>(q);
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>(q);
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
 
   // store the flags in the internal data object so we can access them
   // in fill_fe_*_values(). use the transitive hull of the required
   // flags
-  data->update_each = requires_update_flags(update_flags);
+  data.update_each = requires_update_flags(update_flags);
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
@@ -116,8 +118,10 @@ MappingCartesian<dim, spacedim>::get_face_data(
   const UpdateFlags          update_flags,
   const Quadrature<dim - 1> &quadrature) const
 {
-  auto data = std_cxx14::make_unique<InternalData>(
-    QProjector<dim>::project_to_all_faces(quadrature));
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>(
+      QProjector<dim>::project_to_all_faces(quadrature));
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
 
   // verify that we have computed the transitive hull of the required
   // flags and that FEValues has faithfully passed them on to us
@@ -126,9 +130,9 @@ MappingCartesian<dim, spacedim>::get_face_data(
 
   // store the flags in the internal data object so we can access them
   // in fill_fe_*_values()
-  data->update_each = update_flags;
+  data.update_each = update_flags;
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
@@ -139,8 +143,10 @@ MappingCartesian<dim, spacedim>::get_subface_data(
   const UpdateFlags          update_flags,
   const Quadrature<dim - 1> &quadrature) const
 {
-  auto data = std_cxx14::make_unique<InternalData>(
-    QProjector<dim>::project_to_all_subfaces(quadrature));
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>(
+      QProjector<dim>::project_to_all_subfaces(quadrature));
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
 
   // verify that we have computed the transitive hull of the required
   // flags and that FEValues has faithfully passed them on to us
@@ -149,9 +155,9 @@ MappingCartesian<dim, spacedim>::get_subface_data(
 
   // store the flags in the internal data object so we can access them
   // in fill_fe_*_values()
-  data->update_each = update_flags;
+  data.update_each = update_flags;
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
index 1659ccfb3a657acbce7f7cd29f6f077989386f2a..a7eb6f30a4ead39fdb9633346071c58bb8544b0a 100644 (file)
@@ -566,10 +566,12 @@ MappingFEField<dim, spacedim, VectorType, DoFHandlerType>::get_data(
   const UpdateFlags      update_flags,
   const Quadrature<dim> &quadrature) const
 {
-  auto data =
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
     std_cxx14::make_unique<InternalData>(euler_dof_handler->get_fe(), fe_mask);
-  this->compute_data(update_flags, quadrature, quadrature.size(), *data);
-  return std::move(data);
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
+  this->compute_data(update_flags, quadrature, quadrature.size(), data);
+
+  return data_ptr;
 }
 
 
@@ -580,12 +582,13 @@ MappingFEField<dim, spacedim, VectorType, DoFHandlerType>::get_face_data(
   const UpdateFlags          update_flags,
   const Quadrature<dim - 1> &quadrature) const
 {
-  auto data =
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
     std_cxx14::make_unique<InternalData>(euler_dof_handler->get_fe(), fe_mask);
+  auto &                data = dynamic_cast<InternalData &>(*data_ptr);
   const Quadrature<dim> q(QProjector<dim>::project_to_all_faces(quadrature));
-  this->compute_face_data(update_flags, q, quadrature.size(), *data);
+  this->compute_face_data(update_flags, q, quadrature.size(), data);
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
@@ -595,12 +598,13 @@ MappingFEField<dim, spacedim, VectorType, DoFHandlerType>::get_subface_data(
   const UpdateFlags          update_flags,
   const Quadrature<dim - 1> &quadrature) const
 {
-  auto data =
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
     std_cxx14::make_unique<InternalData>(euler_dof_handler->get_fe(), fe_mask);
+  auto &                data = dynamic_cast<InternalData &>(*data_ptr);
   const Quadrature<dim> q(QProjector<dim>::project_to_all_subfaces(quadrature));
-  this->compute_face_data(update_flags, q, quadrature.size(), *data);
+  this->compute_face_data(update_flags, q, quadrature.size(), data);
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
index b31dc9ed8080615234b0de022141bb8617b9d5c2..3895e55443426f800a704347f55302698358510e 100644 (file)
@@ -314,10 +314,12 @@ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
 MappingManifold<dim, spacedim>::get_data(const UpdateFlags      update_flags,
                                          const Quadrature<dim> &q) const
 {
-  auto data = std_cxx14::make_unique<InternalData>();
-  data->initialize(this->requires_update_flags(update_flags), q, q.size());
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>();
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
+  data.initialize(this->requires_update_flags(update_flags), q, q.size());
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
@@ -328,12 +330,14 @@ MappingManifold<dim, spacedim>::get_face_data(
   const UpdateFlags          update_flags,
   const Quadrature<dim - 1> &quadrature) const
 {
-  auto data = std_cxx14::make_unique<InternalData>();
-  data->initialize_face(this->requires_update_flags(update_flags),
-                        QProjector<dim>::project_to_all_faces(quadrature),
-                        quadrature.size());
-
-  return std::move(data);
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>();
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
+  data.initialize_face(this->requires_update_flags(update_flags),
+                       QProjector<dim>::project_to_all_faces(quadrature),
+                       quadrature.size());
+
+  return data_ptr;
 }
 
 
@@ -344,12 +348,14 @@ MappingManifold<dim, spacedim>::get_subface_data(
   const UpdateFlags          update_flags,
   const Quadrature<dim - 1> &quadrature) const
 {
-  auto data = std_cxx14::make_unique<InternalData>();
-  data->initialize_face(this->requires_update_flags(update_flags),
-                        QProjector<dim>::project_to_all_subfaces(quadrature),
-                        quadrature.size());
-
-  return std::move(data);
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>();
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
+  data.initialize_face(this->requires_update_flags(update_flags),
+                       QProjector<dim>::project_to_all_subfaces(quadrature),
+                       quadrature.size());
+
+  return data_ptr;
 }
 
 
index 661c7286f2c69835ea86e3ab15f97b582211244a..8d012d3e23fe7112b37e558df6aff189c16ee782 100644 (file)
@@ -151,7 +151,9 @@ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
 MappingQ<dim, spacedim>::get_data(const UpdateFlags      update_flags,
                                   const Quadrature<dim> &quadrature) const
 {
-  auto data = std_cxx14::make_unique<InternalData>();
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>();
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
 
   // build the Q1 and Qp internal data objects in parallel
   Threads::Task<
@@ -162,15 +164,15 @@ MappingQ<dim, spacedim>::get_data(const UpdateFlags      update_flags,
                                     quadrature);
 
   if (!use_mapping_q_on_all_cells)
-    data->mapping_q1_data = Utilities::dynamic_unique_cast<
+    data.mapping_q1_data = Utilities::dynamic_unique_cast<
       typename MappingQGeneric<dim, spacedim>::InternalData>(
       std::move(q1_mapping->get_data(update_flags, quadrature)));
 
   // wait for the task above to finish and use returned value
-  data->mapping_qp_data = Utilities::dynamic_unique_cast<
+  data.mapping_qp_data = Utilities::dynamic_unique_cast<
     typename MappingQGeneric<dim, spacedim>::InternalData>(
     std::move(do_get_data.return_value()));
-  return std::move(data);
+  return data_ptr;
 }
 
 
@@ -181,7 +183,9 @@ MappingQ<dim, spacedim>::get_face_data(
   const UpdateFlags          update_flags,
   const Quadrature<dim - 1> &quadrature) const
 {
-  auto data = std_cxx14::make_unique<InternalData>();
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>();
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
 
   // build the Q1 and Qp internal data objects in parallel
   Threads::Task<
@@ -193,15 +197,15 @@ MappingQ<dim, spacedim>::get_face_data(
                         quadrature);
 
   if (!use_mapping_q_on_all_cells)
-    data->mapping_q1_data = Utilities::dynamic_unique_cast<
+    data.mapping_q1_data = Utilities::dynamic_unique_cast<
       typename MappingQGeneric<dim, spacedim>::InternalData>(
       std::move(q1_mapping->get_face_data(update_flags, quadrature)));
 
   // wait for the task above to finish and use returned value
-  data->mapping_qp_data = Utilities::dynamic_unique_cast<
+  data.mapping_qp_data = Utilities::dynamic_unique_cast<
     typename MappingQGeneric<dim, spacedim>::InternalData>(
     std::move(do_get_data.return_value()));
-  return std::move(data);
+  return data_ptr;
 }
 
 
@@ -212,7 +216,9 @@ MappingQ<dim, spacedim>::get_subface_data(
   const UpdateFlags          update_flags,
   const Quadrature<dim - 1> &quadrature) const
 {
-  auto data = std_cxx14::make_unique<InternalData>();
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>();
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
 
   // build the Q1 and Qp internal data objects in parallel
   Threads::Task<
@@ -224,15 +230,15 @@ MappingQ<dim, spacedim>::get_subface_data(
                         quadrature);
 
   if (!use_mapping_q_on_all_cells)
-    data->mapping_q1_data = Utilities::dynamic_unique_cast<
+    data.mapping_q1_data = Utilities::dynamic_unique_cast<
       typename MappingQGeneric<dim, spacedim>::InternalData>(
       std::move(q1_mapping->get_subface_data(update_flags, quadrature)));
 
   // wait for the task above to finish and use returned value
-  data->mapping_qp_data = Utilities::dynamic_unique_cast<
+  data.mapping_qp_data = Utilities::dynamic_unique_cast<
     typename MappingQGeneric<dim, spacedim>::InternalData>(
     std::move(do_get_data.return_value()));
-  return std::move(data);
+  return data_ptr;
 }
 
 
index d7d8e96d88f2bc2fca58bb1d548e80971a3cc98b..252a391aecc6dd6818e09b1656490d05c2541150 100644 (file)
@@ -2724,10 +2724,12 @@ std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase>
 MappingQGeneric<dim, spacedim>::get_data(const UpdateFlags      update_flags,
                                          const Quadrature<dim> &q) const
 {
-  auto data = std_cxx14::make_unique<InternalData>(polynomial_degree);
-  data->initialize(this->requires_update_flags(update_flags), q, q.size());
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>(polynomial_degree);
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
+  data.initialize(this->requires_update_flags(update_flags), q, q.size());
 
-  return std::move(data);
+  return data_ptr;
 }
 
 
@@ -2738,12 +2740,14 @@ MappingQGeneric<dim, spacedim>::get_face_data(
   const UpdateFlags          update_flags,
   const Quadrature<dim - 1> &quadrature) const
 {
-  auto data = std_cxx14::make_unique<InternalData>(polynomial_degree);
-  data->initialize_face(this->requires_update_flags(update_flags),
-                        QProjector<dim>::project_to_all_faces(quadrature),
-                        quadrature.size());
-
-  return std::move(data);
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>(polynomial_degree);
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
+  data.initialize_face(this->requires_update_flags(update_flags),
+                       QProjector<dim>::project_to_all_faces(quadrature),
+                       quadrature.size());
+
+  return data_ptr;
 }
 
 
@@ -2754,12 +2758,14 @@ MappingQGeneric<dim, spacedim>::get_subface_data(
   const UpdateFlags          update_flags,
   const Quadrature<dim - 1> &quadrature) const
 {
-  auto data = std_cxx14::make_unique<InternalData>(polynomial_degree);
-  data->initialize_face(this->requires_update_flags(update_flags),
-                        QProjector<dim>::project_to_all_subfaces(quadrature),
-                        quadrature.size());
-
-  return std::move(data);
+  std::unique_ptr<typename Mapping<dim, spacedim>::InternalDataBase> data_ptr =
+    std_cxx14::make_unique<InternalData>(polynomial_degree);
+  auto &data = dynamic_cast<InternalData &>(*data_ptr);
+  data.initialize_face(this->requires_update_flags(update_flags),
+                       QProjector<dim>::project_to_all_subfaces(quadrature),
+                       quadrature.size());
+
+  return data_ptr;
 }
 
 

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.