]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Also replace std::vector<std::vector<T>> by Table<2,T> in FE_Poly::InternalData.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 23 Dec 2015 04:35:19 +0000 (22:35 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 23 Dec 2015 18:17:53 +0000 (12:17 -0600)
include/deal.II/fe/fe_poly.h
include/deal.II/fe/fe_poly.templates.h
source/fe/fe_poly.cc

index b39690899585ba966c25e1e61329dca4ee4a0579..acb4677afb53707023d656d87cb838b40b29bed7 100644 (file)
@@ -271,20 +271,16 @@ protected:
         !((output_data.shape_values.n_rows() > 0)
           &&
           (output_data.shape_values.n_cols() == n_q_points)))
-      data->shape_values.resize (this->dofs_per_cell,
-                                 std::vector<double> (n_q_points));
+      data->shape_values.reinit (this->dofs_per_cell, n_q_points);
 
     if (update_flags & update_gradients)
-      data->shape_gradients.resize (this->dofs_per_cell,
-                                    std::vector<Tensor<1,dim> > (n_q_points));
+      data->shape_gradients.reinit (this->dofs_per_cell, n_q_points);
 
     if (update_flags & update_hessians)
-      data->shape_hessians.resize (this->dofs_per_cell,
-                                   std::vector<Tensor<2,dim> > (n_q_points));
+      data->shape_hessians.reinit (this->dofs_per_cell, n_q_points);
 
     if (update_flags & update_3rd_derivatives)
-      data->shape_3rd_derivatives.resize (this->dofs_per_cell,
-                                          std::vector<Tensor<3,dim> > (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
@@ -432,7 +428,7 @@ protected:
      * under transformation to the real cell, we only need to copy them over
      * when visiting a concrete cell.
      */
-    std::vector<std::vector<double> > shape_values;
+    Table<2,double> shape_values;
 
     /**
      * Array with shape function gradients in quadrature points. There is one
@@ -443,7 +439,7 @@ protected:
      * then only have to apply the transformation (which is a matrix-vector
      * multiplication) when visiting an actual cell.
      */
-    std::vector<std::vector<Tensor<1,dim> > > shape_gradients;
+    Table<2,Tensor<1,dim> > shape_gradients;
 
     /**
      * Array with shape function hessians in quadrature points. There is one
@@ -453,7 +449,7 @@ protected:
      * We store the hessians in the quadrature points on the unit cell. We
      * then only have to apply the transformation when visiting an actual cell.
      */
-    std::vector<std::vector<Tensor<2,dim> > > shape_hessians;
+    Table<2,Tensor<2,dim> > shape_hessians;
 
     /**
      * Array with shape function third derivatives in quadrature points. There
@@ -464,7 +460,7 @@ protected:
      * cell. We then only have to apply the transformation when visiting an
      * actual cell.
      */
-    std::vector<std::vector<Tensor<3,dim> > > shape_3rd_derivatives;
+    Table<2,Tensor<3,dim> > shape_3rd_derivatives;
   };
 
   /**
index 30df2b076e87f17222b871ab9c46167305024400..0de38d29b30e092ee5938ff36b0bd3a87bb06fc6 100644 (file)
@@ -259,7 +259,7 @@ fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &,
   // we were in get_data()
   if (flags & update_gradients && cell_similarity != CellSimilarity::translation)
     for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-      mapping.transform (make_array_view(fe_data.shape_gradients[k]),
+      mapping.transform (make_array_view(fe_data.shape_gradients, k),
                          mapping_covariant,
                          mapping_internal,
                          make_array_view(output_data.shape_gradients, k));
@@ -267,7 +267,7 @@ fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &,
   if (flags & update_hessians && cell_similarity != CellSimilarity::translation)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (make_array_view(fe_data.shape_hessians[k]),
+        mapping.transform (make_array_view(fe_data.shape_hessians, k),
                            mapping_covariant_gradient,
                            mapping_internal,
                            make_array_view(output_data.shape_hessians, k));
@@ -283,7 +283,7 @@ fill_fe_values (const typename Triangulation<dim,spacedim>::cell_iterator &,
   if (flags & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives[k]),
+        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives, k),
                            mapping_covariant_hessian,
                            mapping_internal,
                            make_array_view(output_data.shape_3rd_derivatives, k));
@@ -337,7 +337,7 @@ fill_fe_face_values (const typename Triangulation<dim,spacedim>::cell_iterator
 
   if (flags & update_gradients)
     for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-      mapping.transform (ArrayView<const Tensor<1,dim> >(&fe_data.shape_gradients[k][offset], quadrature.size()),
+      mapping.transform (make_array_view(fe_data.shape_gradients, k, offset, quadrature.size()),
                          mapping_covariant,
                          mapping_internal,
                          make_array_view(output_data.shape_gradients, k));
@@ -345,8 +345,7 @@ fill_fe_face_values (const typename Triangulation<dim,spacedim>::cell_iterator
   if (flags & update_hessians)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (ArrayView<const Tensor<2,dim> >(&fe_data.shape_hessians[k][offset],
-                                                           quadrature.size()),
+        mapping.transform (make_array_view(fe_data.shape_hessians, k, offset, quadrature.size()),
                            mapping_covariant_gradient,
                            mapping_internal,
                            make_array_view(output_data.shape_hessians, k));
@@ -362,8 +361,7 @@ fill_fe_face_values (const typename Triangulation<dim,spacedim>::cell_iterator
   if (flags & update_3rd_derivatives)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (ArrayView<const Tensor<3,dim> >(&fe_data.shape_3rd_derivatives[k][offset],
-                                                           quadrature.size()),
+        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives, k, offset, quadrature.size()),
                            mapping_covariant_hessian,
                            mapping_internal,
                            make_array_view(output_data.shape_3rd_derivatives, k));
@@ -419,8 +417,7 @@ fill_fe_subface_values (const typename Triangulation<dim,spacedim>::cell_iterato
 
   if (flags & update_gradients)
     for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-      mapping.transform (ArrayView<const Tensor<1,dim> >(&fe_data.shape_gradients[k][offset],
-                                                         quadrature.size()),
+      mapping.transform (make_array_view(fe_data.shape_gradients, k, offset, quadrature.size()),
                          mapping_covariant,
                          mapping_internal,
                          make_array_view(output_data.shape_gradients, k));
@@ -428,8 +425,7 @@ fill_fe_subface_values (const typename Triangulation<dim,spacedim>::cell_iterato
   if (flags & update_hessians)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (ArrayView<const Tensor<2,dim> >(&fe_data.shape_hessians[k][offset],
-                                                           quadrature.size()),
+        mapping.transform (make_array_view(fe_data.shape_hessians, k, offset, quadrature.size()),
                            mapping_covariant_gradient,
                            mapping_internal,
                            make_array_view(output_data.shape_hessians, k));
@@ -445,8 +441,7 @@ fill_fe_subface_values (const typename Triangulation<dim,spacedim>::cell_iterato
   if (flags & update_3rd_derivatives)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (ArrayView<const Tensor<3,dim> >(&fe_data.shape_3rd_derivatives[k][offset],
-                                                           quadrature.size()),
+        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives, k, offset, quadrature.size()),
                            mapping_covariant_hessian,
                            mapping_internal,
                            make_array_view(output_data.shape_3rd_derivatives, k));
index e9c78aedcb38cd29dc40b8d9fba0c687fc95f0a6..54dbb5b82d306c84f6dc508eb130efb8ed937bb6 100644 (file)
@@ -52,7 +52,7 @@ fill_fe_values (const Triangulation<1,2>::cell_iterator &,
   // we were in get_data()
   if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
     for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-      mapping.transform (make_array_view(fe_data.shape_gradients[k]),
+      mapping.transform (make_array_view(fe_data.shape_gradients, k),
                          mapping_covariant,
                          mapping_internal,
                          make_array_view(output_data.shape_gradients, k));
@@ -60,7 +60,7 @@ fill_fe_values (const Triangulation<1,2>::cell_iterator &,
   if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (make_array_view(fe_data.shape_hessians[k]),
+        mapping.transform (make_array_view(fe_data.shape_hessians, k),
                            mapping_covariant_gradient,
                            mapping_internal,
                            make_array_view(output_data.shape_hessians, k));
@@ -76,7 +76,7 @@ fill_fe_values (const Triangulation<1,2>::cell_iterator &,
   if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives[k]),
+        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives, k),
                            mapping_covariant_hessian,
                            mapping_internal,
                            make_array_view(output_data.shape_3rd_derivatives, k));
@@ -111,7 +111,7 @@ fill_fe_values (const Triangulation<2,3>::cell_iterator &,
   // we were in get_data()
   if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
     for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-      mapping.transform (make_array_view(fe_data.shape_gradients[k]),
+      mapping.transform (make_array_view(fe_data.shape_gradients, k),
                          mapping_covariant,
                          mapping_internal,
                          make_array_view(output_data.shape_gradients, k));
@@ -119,7 +119,7 @@ fill_fe_values (const Triangulation<2,3>::cell_iterator &,
   if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (make_array_view(fe_data.shape_hessians[k]),
+        mapping.transform (make_array_view(fe_data.shape_hessians, k),
                            mapping_covariant_gradient,
                            mapping_internal,
                            make_array_view(output_data.shape_hessians, k));
@@ -135,7 +135,7 @@ fill_fe_values (const Triangulation<2,3>::cell_iterator &,
   if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives[k]),
+        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives, k),
                            mapping_covariant_hessian,
                            mapping_internal,
                            make_array_view(output_data.shape_3rd_derivatives, k));
@@ -171,7 +171,7 @@ fill_fe_values (const Triangulation<1,2>::cell_iterator &,
   // we were in get_data()
   if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
     for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-      mapping.transform (make_array_view(fe_data.shape_gradients[k]),
+      mapping.transform (make_array_view(fe_data.shape_gradients, k),
                          mapping_covariant,
                          mapping_internal,
                          make_array_view(output_data.shape_gradients, k));
@@ -179,7 +179,7 @@ fill_fe_values (const Triangulation<1,2>::cell_iterator &,
   if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (make_array_view(fe_data.shape_hessians[k]),
+        mapping.transform (make_array_view(fe_data.shape_hessians, k),
                            mapping_covariant_gradient,
                            mapping_internal,
                            make_array_view(output_data.shape_hessians, k));
@@ -195,7 +195,7 @@ fill_fe_values (const Triangulation<1,2>::cell_iterator &,
   if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives[k]),
+        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives, k),
                            mapping_covariant_hessian,
                            mapping_internal,
                            make_array_view(output_data.shape_3rd_derivatives, k));
@@ -226,7 +226,7 @@ fill_fe_values (const Triangulation<2,3>::cell_iterator &,
   // we were in get_data()
   if (fe_data.update_each & update_gradients && cell_similarity != CellSimilarity::translation)
     for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-      mapping.transform (make_array_view(fe_data.shape_gradients[k]),
+      mapping.transform (make_array_view(fe_data.shape_gradients, k),
                          mapping_covariant,
                          mapping_internal,
                          make_array_view(output_data.shape_gradients, k));
@@ -234,7 +234,7 @@ fill_fe_values (const Triangulation<2,3>::cell_iterator &,
   if (fe_data.update_each & update_hessians && cell_similarity != CellSimilarity::translation)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (make_array_view(fe_data.shape_hessians[k]),
+        mapping.transform (make_array_view(fe_data.shape_hessians, k),
                            mapping_covariant_gradient,
                            mapping_internal,
                            make_array_view(output_data.shape_hessians, k));
@@ -250,7 +250,7 @@ fill_fe_values (const Triangulation<2,3>::cell_iterator &,
   if (fe_data.update_each & update_3rd_derivatives && cell_similarity != CellSimilarity::translation)
     {
       for (unsigned int k=0; k<this->dofs_per_cell; ++k)
-        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives[k]),
+        mapping.transform (make_array_view(fe_data.shape_3rd_derivatives, k),
                            mapping_covariant_hessian,
                            mapping_internal,
                            make_array_view(output_data.shape_3rd_derivatives, k));

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.