From: Wolfgang Bangerth Date: Mon, 4 Apr 2016 02:31:33 +0000 (-0500) Subject: Use a fixed size data structure for MappingFEField::InternalData::unit_tangentials. X-Git-Tag: v8.5.0-rc1~1132^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf1a8e84948088536b5870b7e74dcc9c5824026f;p=dealii.git Use a fixed size data structure for MappingFEField::InternalData::unit_tangentials. --- diff --git a/include/deal.II/fe/mapping_fe_field.h b/include/deal.II/fe/mapping_fe_field.h index a7d04356c5..aae3975343 100644 --- a/include/deal.II/fe/mapping_fe_field.h +++ b/include/deal.II/fe/mapping_fe_field.h @@ -25,6 +25,8 @@ #include #include +#include + DEAL_II_NAMESPACE_OPEN @@ -361,7 +363,7 @@ public: * Unit tangential vectors. Used for the computation of boundary forms and * normal vectors. * - * This vector has (dim-1)GeometryInfo::faces_per_cell entries. The first + * This array has (dim-1)*GeometryInfo::faces_per_cell entries. The first * GeometryInfo::faces_per_cell contain the vectors in the first * tangential direction for each face; the second set of * GeometryInfo::faces_per_cell entries contain the vectors in the second @@ -370,7 +372,7 @@ public: * * Filled once. */ - std::vector > > unit_tangentials; + std_cxx11::array >, GeometryInfo::faces_per_cell *(dim-1)> unit_tangentials; /** * Number of shape functions. If this is a Q1 mapping, then it is simply diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index 54b2da4d93..7f7f2297c9 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2001 - 2015 by the deal.II authors +// Copyright (C) 2001 - 2016 by the deal.II authors // // This file is part of the deal.II library. // @@ -409,27 +409,27 @@ MappingFEField::compute_face_data { data.aux.resize (dim-1, std::vector > (n_original_q_points)); - // Compute tangentials to the - // unit cell. - const unsigned int nfaces = GeometryInfo::faces_per_cell; - data.unit_tangentials.resize (nfaces*(dim-1), - std::vector > (n_original_q_points)); + // Compute tangentials to the unit cell. + for (unsigned int i=0; i::faces_per_cell; ++i) { Tensor<1,dim> tang; tang[1-i/2]=tangential_orientation[i]; std::fill (data.unit_tangentials[i].begin(), - data.unit_tangentials[i].end(), tang); + data.unit_tangentials[i].end(), + tang); } } else if (dim==3) { - for (unsigned int i=0; i::faces_per_cell; ++i) { Tensor<1,dim> tang1, tang2; @@ -451,9 +451,11 @@ MappingFEField::compute_face_data // for all quadrature // points on this face std::fill (data.unit_tangentials[i].begin(), - data.unit_tangentials[i].end(), tang1); - std::fill (data.unit_tangentials[nfaces+i].begin(), - data.unit_tangentials[nfaces+i].end(), tang2); + data.unit_tangentials[i].end(), + tang1); + std::fill (data.unit_tangentials[GeometryInfo::faces_per_cell+i].begin(), + data.unit_tangentials[GeometryInfo::faces_per_cell+i].end(), + tang2); } } }