From: Wolfgang Bangerth Date: Fri, 21 Aug 2015 02:11:21 +0000 (-0500) Subject: Make the type of normal vectors a Tensor. X-Git-Tag: v8.4.0-rc2~565^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8e44a50bf14fb82e3573efcf8539b1dd55435e41;p=dealii.git Make the type of normal vectors a Tensor. As discussed in #496, normal vectors are currently returned by FEValues as Point objects, but since they are differential vectors, the correct data type should be Tensor<1,dim>. This patch implements the solution discussed in #496 by * changing the return type of FEValues::normal_vector() * deprecating FEValues::get_normal_vectors() * introducing FEValues::get_all_normal_vectors() that returns a vector of tensors. The old get_normal_vectors() function was deprecated. In order to make it work, I also had to change the return type from a reference to a straight array. This array may be bound to a reference in many places in user codes, but the style we have used everywhere is to make these reference variables very localized in scope and so I don't foresee any problems. --- diff --git a/doc/news/changes.h b/doc/news/changes.h index dc04d369f4..86dd14786f 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -38,6 +38,23 @@ inconvenience this causes.

    + +
  1. Changed: FEValues::normal_vector() for historical reasons returned a + value of type Point, though a normal vector is more adequately described + as a Tensor@<1,dim@>. Many similar cases were already clarified in deal.II + 8.3. The current case has now also been changed: FEValues::normal_vector() + now returns a Tensor, rather than a Point. +
    + In a similar spirit, the FEValues::get_normal_vectors() function that + still returns a vector of Points has been deprecated and a new function, + FEValues::get_all_normal_vectors(), that returns a vector of tensors, + has been added. This was necessary since there is no way to change the + return type of the existing function in a backward compatible way. The + old function will be removed in the next version, and the new function + will then be renamed to the old name. +
    + (Wolfgang Bangerth, 2015/08/20) +
  2. Changed: The mesh_converter program has been removed from the contrib folder. The equivalent functionality can now be found in diff --git a/examples/step-12/step-12.cc b/examples/step-12/step-12.cc index fa1342b191..bc39ef2c0e 100644 --- a/examples/step-12/step-12.cc +++ b/examples/step-12/step-12.cc @@ -357,7 +357,7 @@ namespace Step12 Vector &local_vector = dinfo.vector(0).block(0); const std::vector &JxW = fe_v.get_JxW_values (); - const std::vector > &normals = fe_v.get_normal_vectors (); + const std::vector > &normals = fe_v.get_all_normal_vectors (); std::vector g(fe_v.n_quadrature_points); @@ -421,7 +421,7 @@ namespace Step12 // solution and the right hand side does not receive any contributions. const std::vector &JxW = fe_v.get_JxW_values (); - const std::vector > &normals = fe_v.get_normal_vectors (); + const std::vector > &normals = fe_v.get_all_normal_vectors (); for (unsigned int point=0; point &cell_vector) const { const std::vector &JxW = fe_v.get_JxW_values (); - const std::vector > &normals = fe_v.get_normal_vectors (); + const std::vector > &normals = fe_v.get_all_normal_vectors (); std::vector > beta (fe_v.n_quadrature_points); std::vector g(fe_v.n_quadrature_points); @@ -272,7 +272,7 @@ namespace Step30 FullMatrix &ue_ve_matrix) const { const std::vector &JxW = fe_v.get_JxW_values (); - const std::vector > &normals = fe_v.get_normal_vectors (); + const std::vector > &normals = fe_v.get_all_normal_vectors (); std::vector > beta (fe_v.n_quadrature_points); diff --git a/examples/step-33/step-33.cc b/examples/step-33/step-33.cc index a807803b7e..821943bf9f 100644 --- a/examples/step-33/step-33.cc +++ b/examples/step-33/step-33.cc @@ -260,7 +260,7 @@ namespace Step33 // $\alpha$. It's form has also been given already in the introduction: template static - void numerical_normal_flux (const Point &normal, + void numerical_normal_flux (const Tensor<1,dim> &normal, const InputVector &Wplus, const InputVector &Wminus, const double alpha, @@ -374,7 +374,7 @@ namespace Step33 static void compute_Wminus (const BoundaryKind (&boundary_kind)[n_components], - const Point &normal_vector, + const Tensor<1,dim> &normal_vector, const DataVector &Wplus, const Vector &boundary_values, const DataVector &Wminus) diff --git a/examples/step-34/step-34.cc b/examples/step-34/step-34.cc index 2d94b432f6..dd54cbb4d7 100644 --- a/examples/step-34/step-34.cc +++ b/examples/step-34/step-34.cc @@ -601,8 +601,8 @@ namespace Step34 fe_v.reinit(cell); cell->get_dof_indices(local_dof_indices); - const std::vector > &q_points = fe_v.get_quadrature_points(); - const std::vector > &normals = fe_v.get_normal_vectors(); + const std::vector > &q_points = fe_v.get_quadrature_points(); + const std::vector > &normals = fe_v.get_all_normal_vectors(); wind.vector_value_list(q_points, cell_wind); // We then form the integral over the current cell for all degrees of @@ -687,8 +687,8 @@ namespace Step34 std::vector > singular_cell_wind( singular_quadrature.size(), Vector(dim) ); - const std::vector > &singular_normals = fe_v_singular.get_normal_vectors(); - const std::vector > &singular_q_points = fe_v_singular.get_quadrature_points(); + const std::vector > &singular_normals = fe_v_singular.get_all_normal_vectors(); + const std::vector > &singular_q_points = fe_v_singular.get_quadrature_points(); wind.vector_value_list(singular_q_points, singular_cell_wind); @@ -957,8 +957,8 @@ namespace Step34 { fe_v.reinit(cell); - const std::vector > &q_points = fe_v.get_quadrature_points(); - const std::vector > &normals = fe_v.get_normal_vectors(); + const std::vector > &q_points = fe_v.get_quadrature_points(); + const std::vector > &normals = fe_v.get_all_normal_vectors(); cell->get_dof_indices(dofs); fe_v.get_function_values(phi, local_phi); diff --git a/examples/step-51/step-51.cc b/examples/step-51/step-51.cc index 8826af2918..eda88d2dce 100644 --- a/examples/step-51/step-51.cc +++ b/examples/step-51/step-51.cc @@ -810,7 +810,7 @@ namespace Step51 const double JxW = scratch.fe_face_values.JxW(q); const Point quadrature_point = scratch.fe_face_values.quadrature_point(q); - const Point normal = scratch.fe_face_values.normal_vector(q); + const Tensor<1,dim> normal = scratch.fe_face_values.normal_vector(q); const Tensor<1,dim> convection = scratch.convection_velocity.value(quadrature_point); diff --git a/include/deal.II/fe/fe_update_flags.h b/include/deal.II/fe/fe_update_flags.h index e9a7f56d90..4c40e6dd10 100644 --- a/include/deal.II/fe/fe_update_flags.h +++ b/include/deal.II/fe/fe_update_flags.h @@ -411,14 +411,12 @@ namespace internal std::vector > quadrature_points; /** - * List of outward normal vectors at the quadrature points. This field is - * filled in by the finite element class. + * List of outward normal vectors at the quadrature points. */ - std::vector > normal_vectors; + std::vector > normal_vectors; /** - * List of boundary forms at the quadrature points. This field is filled in - * by the finite element class. + * List of boundary forms at the quadrature points. */ std::vector > boundary_forms; }; diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index d49fa36763..c73190e914 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -2078,14 +2078,16 @@ public: * For a face, return the outward normal vector to the cell at the * ith quadrature point. * - * For a cell of codimension one, return the normal vector, as it is - * specified by the numbering of the vertices. + * For a cell of codimension one, return the normal vector. There + * are of course two normal directions to a manifold in that case, + * and this function returns the "up" direction as induced by the + * numbering of the vertices. * * The length of the vector is normalized to one. * * @dealiiRequiresUpdateFlags{update_normal_vectors} */ - const Point &normal_vector (const unsigned int i) const; + const Tensor<1,spacedim> &normal_vector (const unsigned int i) const; /** * Return the normal vectors at the quadrature points. For a face, these are @@ -2093,8 +2095,28 @@ public: * the orientation is given by the numbering of vertices. * * @dealiiRequiresUpdateFlags{update_normal_vectors} + * + * @note This function should really be named get_normal_vectors(), + * but this function already exists with a different return type + * that returns a vector of Point objects, rather than a vector of + * Tensor objects. This is a historical accident, but can not + * be fixed in a backward compatible style. That said, the + * get_normal_vectors() function is now deprecated, will be removed + * in the next version, and the current function will then be renamed. */ - const std::vector > &get_normal_vectors () const; + const std::vector > &get_all_normal_vectors () const; + + /** + * Return the normal vectors at the quadrature points as a vector of + * Point objects. This function is deprecated because normal vectors + * are correctly represented by rank-1 Tensor objects, not Point objects. + * Use get_all_normal_vectors() instead. + * + * @dealiiRequiresUpdateFlags{update_normal_vectors} + * + * @deprecated + */ + std::vector > get_normal_vectors () const DEAL_II_DEPRECATED; /** * Transform a set of vectors, one for each quadrature point. The @@ -3989,7 +4011,7 @@ FEValuesBase::inverse_jacobian (const unsigned int i) const template inline -const Point & +const Tensor<1,spacedim> & FEValuesBase::normal_vector (const unsigned int i) const { typedef FEValuesBase FVB; diff --git a/include/deal.II/fe/mapping_cartesian.h b/include/deal.II/fe/mapping_cartesian.h index 01424fee79..f830b9e001 100644 --- a/include/deal.II/fe/mapping_cartesian.h +++ b/include/deal.II/fe/mapping_cartesian.h @@ -246,7 +246,7 @@ private: const CellSimilarity::Similarity cell_similarity, const InternalData &data, std::vector > &quadrature_points, - std::vector > &normal_vectors) const; + std::vector > &normal_vectors) const; /** * Value to indicate that a given face or subface number is invalid. diff --git a/include/deal.II/integrators/elasticity.h b/include/deal.II/integrators/elasticity.h index 40007170a2..db3ce2d200 100644 --- a/include/deal.II/integrators/elasticity.h +++ b/include/deal.II/integrators/elasticity.h @@ -127,7 +127,7 @@ namespace LocalIntegrators for (unsigned int k=0; k &n = fe.normal_vector(k); + const Tensor<1,dim> n = fe.normal_vector(k); for (unsigned int i=0; i &n = fe.normal_vector(k); + const Tensor<1,dim> n = fe.normal_vector(k); for (unsigned int i=0; i &n = fe.normal_vector(k); + const Tensor<1,dim> n = fe.normal_vector(k); for (unsigned int i=0; i &n = fe1.normal_vector(k); + const Tensor<1,dim> n = fe1.normal_vector(k); for (unsigned int i=0; i &n = fe1.normal_vector(k); + const Tensor<1,dim> n = fe1.normal_vector(k); for (unsigned int i=0; i &n = fe.normal_vector(k); + const Tensor<1,dim> n = fe.normal_vector(k); for (unsigned int i=0; i &n = fe.normal_vector(k); + const Tensor<1,dim> n = fe.normal_vector(k); for (unsigned int i=0; i &n = fe.normal_vector(k); + const Tensor<1,dim> n = fe.normal_vector(k); for (unsigned int i=0; i &n = fe1.normal_vector(k); + const Tensor<1,dim> n = fe1.normal_vector(k); for (unsigned int d=0; d &n = fe1.normal_vector(k); + const Tensor<1,dim> n = fe1.normal_vector(k); for (unsigned int i=0; i &n = fe1.normal_vector(k); + const Tensor<1,dim> n = fe1.normal_vector(k); for (unsigned int i=0; i &n = fe1.normal_vector(k); + const Tensor<1,dim> n = fe1.normal_vector(k); for (unsigned int i=0; i &n = fe.normal_vector(k); + const Tensor<1,dim> n = fe.normal_vector(k); for (unsigned int i=0; i &n = fe.normal_vector(k); + const Tensor<1,dim> n = fe.normal_vector(k); for (unsigned int i=0; i &n = fe1.normal_vector(k); + const Tensor<1,dim> n = fe1.normal_vector(k); for (unsigned int i=0; i normal_at_q_point = fe_face_values.normal_vector(q_point); + Tensor<1,dim> normal_at_q_point = fe_face_values.normal_vector(q_point); for (unsigned int j = 0; j < associated_edge_dofs; ++j) { const unsigned int j_face_idx = associated_edge_dof_to_face_dof[j]; @@ -4226,15 +4226,15 @@ namespace VectorTools // Using n cross phi edge_matrix(i,j) += fe_face_values.JxW (q_point) - * ((phi_i[1]*normal_at_q_point(0) - phi_i[0]*normal_at_q_point(1)) - * (phi_j[1]*normal_at_q_point(0) - phi_j[0]*normal_at_q_point(1))); + * ((phi_i[1]*normal_at_q_point[0] - phi_i[0]*normal_at_q_point[1]) + * (phi_j[1]*normal_at_q_point[0] - phi_j[0]*normal_at_q_point[1])); } // Using n cross phi edge_rhs(j) += fe_face_values.JxW (q_point) - * ((values[q_point] (first_vector_component+1) * normal_at_q_point (0) - - values[q_point] (first_vector_component) * normal_at_q_point (1)) - * (phi_j[1]*normal_at_q_point(0) - phi_j[0]*normal_at_q_point(1))); + * ((values[q_point] (first_vector_component+1) * normal_at_q_point[0] + - values[q_point] (first_vector_component) * normal_at_q_point[1]) + * (phi_j[1]*normal_at_q_point[0] - phi_j[0]*normal_at_q_point[1])); } } @@ -4343,14 +4343,10 @@ namespace VectorTools // associated with this face. We also must include the residuals from the // shape funcations associated with edges. Tensor<1, dim> tmp; - Tensor<1, dim> normal_vector, - cross_product_i, + Tensor<1, dim> cross_product_i, cross_product_j, cross_product_rhs; - // Store all normal vectors at quad points: - std::vector > normal_vector_list(fe_face_values.get_normal_vectors()); - // Loop to construct face linear system. for (unsigned int q_point = 0; q_point < fe_face_values.n_quadrature_points; ++q_point) @@ -4383,10 +4379,8 @@ namespace VectorTools } // Tensor of normal vector on the face at q_point; - for (unsigned int d = 0; d < dim; ++d) - { - normal_vector[d] = normal_vector_list[q_point](d); - } + const Tensor<1,dim> normal_vector = fe_face_values.normal_vector(q_point); + // Now compute the linear system: // On a face: // The matrix entries are: @@ -4756,7 +4750,7 @@ namespace VectorTools // functions supported on the boundary. const FEValuesExtractors::Vector vec (first_vector_component); const FiniteElement<2> &fe = cell->get_fe (); - const std::vector > &normals = fe_values.get_normal_vectors (); + const std::vector > &normals = fe_values.get_all_normal_vectors (); const unsigned int face_coordinate_direction[GeometryInfo<2>::faces_per_cell] = {1, 1, 0, 0}; std::vector > @@ -4837,7 +4831,7 @@ namespace VectorTools // functions supported on the boundary. const FEValuesExtractors::Vector vec (first_vector_component); const FiniteElement<3> &fe = cell->get_fe (); - const std::vector > &normals = fe_values.get_normal_vectors (); + const std::vector > &normals = fe_values.get_all_normal_vectors (); const unsigned int face_coordinate_directions[GeometryInfo<3>::faces_per_cell][2] = {{1, 2}, {1, 2}, @@ -5410,7 +5404,7 @@ namespace VectorTools = (cell->face(face_no)->get_boundary().normal_vector (cell->face(face_no), fe_values.quadrature_point(i))); - if (normal_vector * static_cast >(fe_values.normal_vector(i)) < 0) + if (normal_vector * fe_values.normal_vector(i) < 0) normal_vector *= -1; Assert (std::fabs(normal_vector.norm() - 1) < 1e-14, ExcInternalError()); @@ -6211,9 +6205,8 @@ namespace VectorTools { // compute (f.n) n const Number f_dot_n - = (data.psi_grads[q][k] * Tensor<1,spacedim,Number>(fe_values.normal_vector(q))); - const Tensor<1,spacedim,Number> f_dot_n_times_n - = f_dot_n * Tensor<1,spacedim,Number>(fe_values.normal_vector(q)); + = (data.psi_grads[q][k] * fe_values.normal_vector(q)); + const Tensor<1,spacedim,Number> f_dot_n_times_n (f_dot_n * fe_values.normal_vector(q)); data.psi_grads[q][k] -= (data.function_grads[q][k] + f_dot_n_times_n); } diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index bb75e3bc55..7003914a6d 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -3148,8 +3148,8 @@ FEValuesBase::get_cell () const template -const std::vector > & -FEValuesBase::get_normal_vectors () const +const std::vector > & +FEValuesBase::get_all_normal_vectors () const { typedef FEValuesBase FEVB; Assert (this->update_flags & update_normal_vectors, @@ -3159,6 +3159,24 @@ FEValuesBase::get_normal_vectors () const +template +std::vector > +FEValuesBase::get_normal_vectors () const +{ + typedef FEValuesBase FEVB; + Assert (this->update_flags & update_normal_vectors, + typename FEVB::ExcAccessToUninitializedField("update_normal_vectors")); + + // copy things into a vector of Points, then return that + std::vector > tmp (this->normal_vectors.size()); + for (unsigned int q=0; qnormal_vectors.size(); ++q) + tmp[q] = Point(this->normal_vectors[q]); + + return tmp; +} + + + template void FEValuesBase::transform ( diff --git a/source/fe/mapping_cartesian.cc b/source/fe/mapping_cartesian.cc index 6b192da404..9a366a9c84 100644 --- a/source/fe/mapping_cartesian.cc +++ b/source/fe/mapping_cartesian.cc @@ -154,7 +154,7 @@ MappingCartesian::compute_fill (const typename Triangulation > &quadrature_points, - std::vector > &normal_vectors) const + std::vector > &normal_vectors) const { const UpdateFlags update_flags = data.update_each; @@ -346,7 +346,7 @@ fill_fe_values (const typename Triangulation::cell_iterator &cell, Assert (dynamic_cast (&internal_data) != 0, ExcInternalError()); const InternalData &data = static_cast (internal_data); - std::vector > dummy; + std::vector > dummy; compute_fill (cell, invalid_face_number, invalid_face_number, cell_similarity, data, diff --git a/source/numerics/data_out_faces.cc b/source/numerics/data_out_faces.cc index 0768241e7c..c67af1892b 100644 --- a/source/numerics/data_out_faces.cc +++ b/source/numerics/data_out_faces.cc @@ -153,7 +153,12 @@ build_one_patch (const FaceDescriptor *cell_and_face, // thus does not depend on the number of components of the data // vector if (update_flags & update_normal_vectors) - data.patch_normals=this_fe_patch_values.get_normal_vectors(); + { +//TODO: undo this copying when we can change the data type of +// data.patch_normals to Tensor<1,spacedim> as well + for (unsigned int q=0; q(this_fe_patch_values.get_all_normal_vectors()[q]); + } if (n_components == 1) { diff --git a/source/numerics/error_estimator.cc b/source/numerics/error_estimator.cc index 6278501fe5..93383b29cd 100644 --- a/source/numerics/error_estimator.cc +++ b/source/numerics/error_estimator.cc @@ -149,7 +149,7 @@ namespace internal /** * The normal vectors of the finite element function on one face */ - std::vector > normal_vectors; + std::vector > normal_vectors; /** * Two arrays needed for the values of coefficients in the jumps, if @@ -364,7 +364,7 @@ namespace internal // change the sign. We take the outward normal. parallel_data.normal_vectors = - fe_face_values_cell.get_present_fe_values().get_normal_vectors(); + fe_face_values_cell.get_present_fe_values().get_all_normal_vectors(); for (unsigned int n=0; n::H1) && base.conforms(FiniteElementData::Hdiv)) for (unsigned int point=0; point &tria) fe_face_values2.JxW(q)) < 1e-14, ExcInternalError()); AssertThrow ((fe_face_values1.normal_vector(q) + - fe_face_values2.normal_vector(q)).square() + fe_face_values2.normal_vector(q)).norm_square() < 1e-20, ExcInternalError()); } diff --git a/tests/bits/rt_2.cc b/tests/bits/rt_2.cc index f095367ee7..235930421c 100644 --- a/tests/bits/rt_2.cc +++ b/tests/bits/rt_2.cc @@ -107,9 +107,9 @@ void evaluate_normal (DoFHandler<2> &dof_handler, for (unsigned int q_point=0; q_point vn = fe_v_face.normal_vector (q_point); - double nx = vn(0); - double ny = vn(1); + Tensor<1,2> vn = fe_v_face.normal_vector (q_point); + double nx = vn[0]; + double ny = vn[1]; double u = this_value[q_point](0); double v = this_value[q_point](1); diff --git a/tests/bits/step-12.cc b/tests/bits/step-12.cc index c7d9e4d012..e889852c6c 100644 --- a/tests/bits/step-12.cc +++ b/tests/bits/step-12.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2005 - 2014 by the deal.II authors +// Copyright (C) 2005 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -205,7 +205,7 @@ void DGTransportEquation::assemble_boundary_term( Vector &cell_vector) const { const std::vector &JxW = fe_v.get_JxW_values (); - const std::vector > &normals = fe_v.get_normal_vectors (); + const std::vector > &normals = fe_v.get_all_normal_vectors (); std::vector > beta (fe_v.n_quadrature_points); std::vector g(fe_v.n_quadrature_points); @@ -241,7 +241,7 @@ void DGTransportEquation::assemble_face_term1( FullMatrix &ue_vi_matrix) const { const std::vector &JxW = fe_v.get_JxW_values (); - const std::vector > &normals = fe_v.get_normal_vectors (); + const std::vector > &normals = fe_v.get_all_normal_vectors (); std::vector > beta (fe_v.n_quadrature_points); beta_function.value_list (fe_v.get_quadrature_points(), beta); @@ -277,7 +277,7 @@ void DGTransportEquation::assemble_face_term2( FullMatrix &ue_ve_matrix) const { const std::vector &JxW = fe_v.get_JxW_values (); - const std::vector > &normals = fe_v.get_normal_vectors (); + const std::vector > &normals = fe_v.get_all_normal_vectors (); std::vector > beta (fe_v.n_quadrature_points); diff --git a/tests/bits/step-51.cc b/tests/bits/step-51.cc index 2ae285dd65..250b215223 100644 --- a/tests/bits/step-51.cc +++ b/tests/bits/step-51.cc @@ -638,7 +638,7 @@ namespace Step51 const double JxW = scratch.fe_face_values.JxW(q); const Point quadrature_point = scratch.fe_face_values.quadrature_point(q); - const Point normal = scratch.fe_face_values.normal_vector(q); + const Tensor<1,dim> normal = scratch.fe_face_values.normal_vector(q); const Tensor<1,dim> convection = scratch.convection_velocity.value(quadrature_point); diff --git a/tests/bits/step-51p.cc b/tests/bits/step-51p.cc index 11b39616ac..27b368443b 100644 --- a/tests/bits/step-51p.cc +++ b/tests/bits/step-51p.cc @@ -638,7 +638,7 @@ namespace Step51 const double JxW = scratch.fe_face_values.JxW(q); const Point quadrature_point = scratch.fe_face_values.quadrature_point(q); - const Point normal = scratch.fe_face_values.normal_vector(q); + const Tensor<1,dim> normal = scratch.fe_face_values.normal_vector(q); const Tensor<1,dim> convection = scratch.convection_velocity.value(quadrature_point); diff --git a/tests/codim_one/bem.cc b/tests/codim_one/bem.cc index e8e1d6b0da..7b28ad6d92 100644 --- a/tests/codim_one/bem.cc +++ b/tests/codim_one/bem.cc @@ -266,7 +266,7 @@ BEM::assemble_system() FullMatrix cell_DLP_matrix (dofs_per_cell, dofs_per_cell); Vector cell_rhs (dofs_per_cell); - std::vector< Point > cell_normals_i, cell_normals_j; + std::vector< Tensor<1,spacedim> > cell_normals_i, cell_normals_j; std::vector local_dof_indices_i (dofs_per_cell); std::vector local_dof_indices_j (dofs_per_cell); @@ -289,7 +289,7 @@ BEM::assemble_system() { fe_values_i.reinit (cell_i); - cell_normals_i = fe_values_i.get_normal_vectors(); + cell_normals_i = fe_values_i.get_all_normal_vectors(); cell_i->get_dof_indices (local_dof_indices_i); // if (cell_i->index()%100==0) @@ -353,7 +353,7 @@ BEM::assemble_system() for (cell_j=dof_handler.begin_active(); cell_j!=endc; ++cell_j) { fe_values_j.reinit (cell_j); - cell_normals_j = fe_values_j.get_normal_vectors(); + cell_normals_j = fe_values_j.get_all_normal_vectors(); cell_j->get_dof_indices (local_dof_indices_j); if (cell_j != cell_i) @@ -570,7 +570,7 @@ BEM::solve() update_gradients | update_normal_vectors ); - std::vector< Point > cell_normals(q_iterated.size()); + std::vector< Tensor<1,spacedim> > cell_normals(q_iterated.size()); std::vector< Point > cell_tangentials(q_iterated.size()); std::vector local_dof_indices (fe_q.dofs_per_cell); @@ -596,7 +596,7 @@ BEM::solve() // std::cout< &r, const Tensor<1,3> &a1, const Tensor<1,3> &a2, - const Point<3> &n, + const Tensor<1,3> &n, const double &rn_c); double term_D(const Tensor<1,3> &r, @@ -123,9 +123,9 @@ LaplaceKernelIntegration<2>::compute_SD_integral_on_cell(vector &dst, ExcDimensionMismatch(dst.size(), 2)); fe_values->reinit(cell); vector > jacobians = fe_values->get_jacobians(); - vector > normals = fe_values->get_normal_vectors(); + vector > normals = fe_values->get_all_normal_vectors(); - Point<3> n,n_c; + Tensor<1,3> n,n_c; Tensor<1,3> r_c = point-cell->center(); n_c = normals[4]; @@ -151,7 +151,7 @@ double LaplaceKernelIntegration::term_S (const Tensor<1,3> &r, const Tensor<1,3> &a1, const Tensor<1,3> &a2, - const Point<3> &n, + const Tensor<1,3> &n, const double &rn_c) { Point<3> ra1, ra2, a12; diff --git a/tests/codim_one/gradients.cc b/tests/codim_one/gradients.cc index 1f3e330adb..45b51788e6 100644 --- a/tests/codim_one/gradients.cc +++ b/tests/codim_one/gradients.cc @@ -124,7 +124,7 @@ void test(std::string filename) FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); - std::vector< Point > cell_normals(q_midpoint.size()); + std::vector< Tensor<1,spacedim> > cell_normals(q_midpoint.size()); std::vector< Point > cell_tangentials(q_midpoint.size()); std::vector shape_directional_derivative(dofs_per_cell); Vector projected_directional_derivative(triangulation.n_cells()); @@ -140,7 +140,7 @@ void test(std::string filename) fe_values.reinit(cell); cell-> get_dof_indices (local_dof_indices); - cell_normals = fe_values.get_normal_vectors(); + cell_normals = fe_values.get_all_normal_vectors(); // The cell tangential is calculated // in the midpoint of the cell. For diff --git a/tests/codim_one/surface.cc b/tests/codim_one/surface.cc index e8e211069e..8544b17589 100644 --- a/tests/codim_one/surface.cc +++ b/tests/codim_one/surface.cc @@ -76,7 +76,7 @@ void test(std::string filename) for (; cell!=endc; ++cell) { fe_values.reinit (cell); - const std::vector > &cellnormals = fe_values.get_normal_vectors(); + const std::vector > &cellnormals = fe_values.get_all_normal_vectors(); const std::vector > &quad_points = fe_values.get_quadrature_points(); for (unsigned int i=0; i > neumann_value_list(n_face_q_points, Vector(fe.n_components())); - std::vector > normal_vector_list(fe_face_values.get_normal_vectors()); + std::vector > normal_vector_list(fe_face_values.get_all_normal_vectors()); Tensor<1,dim> neumann_value_vector(dim); Tensor<1,dim> neumann_value(dim); Tensor<1,dim> normal_vector; diff --git a/tests/deal.II/project_boundary_rt_01.cc b/tests/deal.II/project_boundary_rt_01.cc index 37d05c837d..ab4ba2cd70 100644 --- a/tests/deal.II/project_boundary_rt_01.cc +++ b/tests/deal.II/project_boundary_rt_01.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2007 - 2014 by the deal.II authors +// Copyright (C) 2007 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -111,7 +111,7 @@ double integrate_error(const DoFHandler &dof, { double diff = 0.; for (unsigned int d=0; d(1) {} double jump (const Point< dim> &p, - const Point &normal) const; + const Tensor<1,dim> &normal) const; }; template double JumpFunction::jump (const Point &p, - const Point &normal) const + const Tensor<1,dim> &normal) const { double x = p[0]; double y = p[1]; @@ -596,8 +596,8 @@ namespace Step22 { fe_v_face.reinit (cell, face_no); - const std::vector > &normals = - fe_v_face.get_normal_vectors (); + const std::vector > &normals = + fe_v_face.get_all_normal_vectors (); const std::vector > &quad_points= fe_v_face.get_quadrature_points(); diff --git a/tests/fe/mapping.cc b/tests/fe/mapping.cc index 6f7d72bae1..cd4ebc860e 100644 --- a/tests/fe/mapping.cc +++ b/tests/fe/mapping.cc @@ -110,7 +110,7 @@ plot_faces(Mapping &mapping, for (unsigned int nx=0; nx x = fe_values.quadrature_point(k); - const Point &n = fe_values.normal_vector(k); + const Tensor<1,dim> n = fe_values.normal_vector(k); const double ds = fe_values.JxW(k); deallog << x << '\t' << n << '\t' << ds << std::endl; @@ -149,8 +149,8 @@ plot_subfaces(Mapping &mapping, { fe_values.reinit(cell, face_nr, sub_nr); - const std::vector > &normals - =fe_values.get_normal_vectors(); + const std::vector > &normals + =fe_values.get_all_normal_vectors(); unsigned int k=0; for (unsigned int ny=0; ny<((dim>2) ? nq : 1); ++ny) diff --git a/tests/fe/mapping_c1.cc b/tests/fe/mapping_c1.cc index 697f0912aa..cc6f45fea2 100644 --- a/tests/fe/mapping_c1.cc +++ b/tests/fe/mapping_c1.cc @@ -96,7 +96,7 @@ int main () // there should now be two // normal vectors, one for // each vertex of the face - Assert (c1_values.get_normal_vectors().size() == 2, + Assert (c1_values.get_all_normal_vectors().size() == 2, ExcInternalError()); // check that these two diff --git a/tests/fe/rt_normal_02.cc b/tests/fe/rt_normal_02.cc index 58b57eb7a3..3defae43bf 100644 --- a/tests/fe/rt_normal_02.cc +++ b/tests/fe/rt_normal_02.cc @@ -141,9 +141,9 @@ void EvaluateNormal2 (DoFHandler<2> *dof_handler, for (unsigned int q_point=0; q_point vn = fe_v_face.normal_vector (q_point); - double nx = vn(0); - double ny = vn(1); + Tensor<1,2> vn = fe_v_face.normal_vector (q_point); + double nx = vn[0]; + double ny = vn[1]; double u = this_value[q_point + offset](0); double v = this_value[q_point + offset](1); @@ -230,9 +230,9 @@ void EvaluateNormal (DoFHandler<2> *dof_handler, for (unsigned int q_point=0; q_point vn = fe_v_face.normal_vector (q_point); - double nx = vn(0); - double ny = vn(1); + Tensor<1,2> vn = fe_v_face.normal_vector (q_point); + double nx = vn[0]; + double ny = vn[1]; double u = this_value[q_point](0); double v = this_value[q_point](1); diff --git a/tests/grid/mesh_3d_6.cc b/tests/grid/mesh_3d_6.cc index cce1d791bf..96ae7f4f83 100644 --- a/tests/grid/mesh_3d_6.cc +++ b/tests/grid/mesh_3d_6.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2003 - 2014 by the deal.II authors +// Copyright (C) 2003 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -80,7 +80,7 @@ void check_this (Triangulation<3> &tria) // so their sum should be // close to zero Assert ((fe_face_values1.normal_vector(0) + - fe_face_values2.normal_vector(0)).square() + fe_face_values2.normal_vector(0)).norm_square() < 1e-20, ExcInternalError()); } diff --git a/tests/hp/step-12.cc b/tests/hp/step-12.cc index abce655f73..633d86818c 100644 --- a/tests/hp/step-12.cc +++ b/tests/hp/step-12.cc @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 2005 - 2014 by the deal.II authors +// Copyright (C) 2005 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -207,7 +207,7 @@ void DGTransportEquation::assemble_boundary_term( Vector &cell_vector) const { const std::vector &JxW = fe_v.get_present_fe_values().get_JxW_values (); - const std::vector > &normals = fe_v.get_present_fe_values().get_normal_vectors (); + const std::vector > &normals = fe_v.get_present_fe_values().get_all_normal_vectors (); std::vector > beta (fe_v.get_present_fe_values().n_quadrature_points); std::vector g(fe_v.get_present_fe_values().n_quadrature_points); @@ -244,7 +244,7 @@ void DGTransportEquation::assemble_face_term1( FullMatrix &ue_vi_matrix) const { const std::vector &JxW = fe_v.get_present_fe_values().get_JxW_values (); - const std::vector > &normals = fe_v.get_present_fe_values().get_normal_vectors (); + const std::vector > &normals = fe_v.get_present_fe_values().get_all_normal_vectors (); std::vector > beta (fe_v.get_present_fe_values().n_quadrature_points); beta_function.value_list (fe_v.get_present_fe_values().get_quadrature_points(), beta); @@ -281,7 +281,7 @@ void DGTransportEquation::assemble_face_term2( FullMatrix &ue_ve_matrix) const { const std::vector &JxW = fe_v.get_present_fe_values().get_JxW_values (); - const std::vector > &normals = fe_v.get_present_fe_values().get_normal_vectors (); + const std::vector > &normals = fe_v.get_present_fe_values().get_all_normal_vectors (); std::vector > beta (fe_v.get_present_fe_values().n_quadrature_points);