From: Alexander Grayver Date: Tue, 6 Nov 2018 14:19:16 +0000 (+0100) Subject: Fix FEFaceValues X-Git-Tag: v9.1.0-rc1~555^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4425c5e5a3f4438e6229e08e1ba528dc517730e5;p=dealii.git Fix FEFaceValues --- diff --git a/source/fe/fe_nedelec_sz.cc b/source/fe/fe_nedelec_sz.cc index 54470ac551..b7832f3c23 100644 --- a/source/fe/fe_nedelec_sz.cc +++ b/source/fe/fe_nedelec_sz.cc @@ -2093,12 +2093,15 @@ FE_NedelecSZ::fill_fe_face_values( { // Now have all shape_grads stored on the reference cell. // Must now transform to the physical cell. + std::vector> input(n_q_points); std::vector> transformed_shape_grads(n_q_points); for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) { - mapping.transform(make_array_view(fe_data.shape_grads[dof], - offset, - n_q_points), + for (unsigned int q = 0; q < n_q_points; ++q) + { + input[q] = fe_data.shape_grads[dof][offset + q]; + } + mapping.transform(input, mapping_covariant_gradient, mapping_internal, make_array_view(transformed_shape_grads)); diff --git a/tests/fe/fe_nedelec_sz_face_values.cc b/tests/fe/fe_nedelec_sz_face_values.cc new file mode 100644 index 0000000000..80ac5653e5 --- /dev/null +++ b/tests/fe/fe_nedelec_sz_face_values.cc @@ -0,0 +1,68 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 1998 - 2018 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- +// +// By Alexander Grayver +// +// Fix bug with FEFaceValues initialization when used with FE_NedelecSZ + +#include + +#include +#include + +#include + +#include +#include + +#include +#include + +#include "../tests.h" + +using namespace dealii; + +template +void +test(unsigned p) +{ + FE_NedelecSZ fe(p); + Triangulation triangulation; + + GridGenerator::hyper_cube(triangulation, -1., 1.); + + DoFHandler dof_handler(triangulation); + dof_handler.distribute_dofs(fe); + + QGauss quadrature(3); + FEFaceValues fe_face_values(fe, + quadrature, + update_values | update_gradients); + fe_face_values.reinit(dof_handler.begin_active(), 0); + + deallog << "OK" << std::endl; +} + +int +main() +{ + initlog(); + + for (unsigned int p = 0; p < 3; ++p) + { + test<2>(p); + test<3>(p); + } +} diff --git a/tests/fe/fe_nedelec_sz_face_values.output b/tests/fe/fe_nedelec_sz_face_values.output new file mode 100644 index 0000000000..0aa61ff573 --- /dev/null +++ b/tests/fe/fe_nedelec_sz_face_values.output @@ -0,0 +1,7 @@ + +DEAL::OK +DEAL::OK +DEAL::OK +DEAL::OK +DEAL::OK +DEAL::OK