From: Wolfgang Bangerth Date: Wed, 23 Dec 2015 04:35:19 +0000 (-0600) Subject: Also replace std::vector> by Table<2,T> in FE_Poly::InternalData. X-Git-Tag: v8.4.0-rc2~131^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7916475d71d5414625955cf7e7bc1e5d48c79c3e;p=dealii.git Also replace std::vector> by Table<2,T> in FE_Poly::InternalData. --- diff --git a/include/deal.II/fe/fe_poly.h b/include/deal.II/fe/fe_poly.h index b396908995..acb4677afb 100644 --- a/include/deal.II/fe/fe_poly.h +++ b/include/deal.II/fe/fe_poly.h @@ -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 (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 > (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 > (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 > (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 > 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 > > 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 > > 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 > > shape_3rd_derivatives; + Table<2,Tensor<3,dim> > shape_3rd_derivatives; }; /** diff --git a/include/deal.II/fe/fe_poly.templates.h b/include/deal.II/fe/fe_poly.templates.h index 30df2b076e..0de38d29b3 100644 --- a/include/deal.II/fe/fe_poly.templates.h +++ b/include/deal.II/fe/fe_poly.templates.h @@ -259,7 +259,7 @@ fill_fe_values (const typename Triangulation::cell_iterator &, // we were in get_data() if (flags & update_gradients && cell_similarity != CellSimilarity::translation) for (unsigned int k=0; kdofs_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::cell_iterator &, if (flags & update_hessians && cell_similarity != CellSimilarity::translation) { for (unsigned int k=0; kdofs_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::cell_iterator &, if (flags & update_3rd_derivatives && cell_similarity != CellSimilarity::translation) { for (unsigned int k=0; kdofs_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::cell_iterator if (flags & update_gradients) for (unsigned int k=0; kdofs_per_cell; ++k) - mapping.transform (ArrayView >(&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::cell_iterator if (flags & update_hessians) { for (unsigned int k=0; kdofs_per_cell; ++k) - mapping.transform (ArrayView >(&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::cell_iterator if (flags & update_3rd_derivatives) { for (unsigned int k=0; kdofs_per_cell; ++k) - mapping.transform (ArrayView >(&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::cell_iterato if (flags & update_gradients) for (unsigned int k=0; kdofs_per_cell; ++k) - mapping.transform (ArrayView >(&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::cell_iterato if (flags & update_hessians) { for (unsigned int k=0; kdofs_per_cell; ++k) - mapping.transform (ArrayView >(&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::cell_iterato if (flags & update_3rd_derivatives) { for (unsigned int k=0; kdofs_per_cell; ++k) - mapping.transform (ArrayView >(&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)); diff --git a/source/fe/fe_poly.cc b/source/fe/fe_poly.cc index e9c78aedcb..54dbb5b82d 100644 --- a/source/fe/fe_poly.cc +++ b/source/fe/fe_poly.cc @@ -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; kdofs_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; kdofs_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; kdofs_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; kdofs_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; kdofs_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; kdofs_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; kdofs_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; kdofs_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; kdofs_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; kdofs_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; kdofs_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; kdofs_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));