From 4c3a890d2bd2d3477c0ea6c7343ec1238596032f Mon Sep 17 00:00:00 2001 From: bangerth Date: Thu, 25 Aug 2011 16:03:13 +0000 Subject: [PATCH] Compute normal vectors in no_normal_flux by querying the Boundary object, rather than the Mapping object. git-svn-id: https://svn.dealii.org/trunk@24198 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 17 +++++++++++++++++ deal.II/include/deal.II/numerics/vectors.h | 7 ++++--- .../deal.II/numerics/vectors.templates.h | 8 ++++++-- 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index d8a307474c..7c28b89c31 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -281,6 +281,23 @@ and DoF handlers embedded in higher dimensional space have been added.

Specific improvements

    +
  1. Changed: The function VectorTools::compute_no_normal_flux_constraints +used to compute its constraints by evaluating the normal vector to the +surface as described by the mapping, rather than using the normal to +the surface described by the Boundary object associated with this face. +(Note that the Mapping computes its approximation by polynomial interpolation +of the surface described by the Boundary object.) This has now been changed: +the normal vector is now obtained from the Boundary object directly, at +points computed by the Mapping. +
    +(Wolfgang Bangerth, 2011/08/25) + +
  2. New: The Boundary base class now has a function Boundary::normal_vector +that returns the normal vector to the surface at a given location. Derived +classes need to implement it, of course, if they want it to be used. +
    +(Wolfgang Bangerth, 2011/08/25) +
  3. Fixed: The function VectorTools::compute_no_normal_flux_constraints had a problem that led to extremely difficult to pin down bugs when running with sufficiently many processors. Basically, the constraints computed diff --git a/deal.II/include/deal.II/numerics/vectors.h b/deal.II/include/deal.II/numerics/vectors.h index 3f40890cff..3b01ca30a3 100644 --- a/deal.II/include/deal.II/numerics/vectors.h +++ b/deal.II/include/deal.II/numerics/vectors.h @@ -1267,9 +1267,10 @@ class VectorTools * function onces with the whole set of * boundary indicators at once. * - * The last argument is denoted to - * compute the normal vector $\vec n$ at - * the boundary points. + * The mapping argument is used to + * compute the boundary points where the function + * needs to request the normal vector $\vec n$ + * from the boundary description. * * @note When combining adaptively * refined meshes with hanging node diff --git a/deal.II/include/deal.II/numerics/vectors.templates.h b/deal.II/include/deal.II/numerics/vectors.templates.h index 9763b62fc9..78a23c855a 100644 --- a/deal.II/include/deal.II/numerics/vectors.templates.h +++ b/deal.II/include/deal.II/numerics/vectors.templates.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -4204,7 +4205,7 @@ compute_no_normal_flux_constraints (const DH &dof_handler, hp::FEFaceValues x_fe_face_values (mapping_collection, fe_collection, face_quadrature_collection, - update_normal_vectors); + update_q_points); // have a map that stores normal // vectors for each vector-dof @@ -4345,7 +4346,10 @@ compute_no_normal_flux_constraints (const DH &dof_handler, // length of the vector // back to one, just to be // on the safe side - Point normal_vector = fe_values.normal_vector(i); + Point normal_vector + = (cell->face(face_no)->get_boundary() + .normal_vector (cell->face(face_no), + fe_values.quadrature_point(i))); Assert (std::fabs(normal_vector.norm() - 1) < 1e-14, ExcInternalError()); for (unsigned int d=0; d