From d6b22f20d6aa0d40174502e46ee5f187416ad398 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 29 Mar 2001 09:22:12 +0000 Subject: [PATCH] Impemlement get_normals_at_vertices fpr HyperShell and HalfHyperShell as well. git-svn-id: https://svn.dealii.org/trunk@4321 0785d39b-7218-0410-832d-ea1e28bc413d --- .../deal.II/include/grid/tria_boundary_lib.h | 30 +++++++++- .../deal.II/source/grid/tria_boundary_lib.cc | 60 +++++++++++++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/deal.II/deal.II/include/grid/tria_boundary_lib.h b/deal.II/deal.II/include/grid/tria_boundary_lib.h index 92cb636666..5ea463b7ad 100644 --- a/deal.II/deal.II/include/grid/tria_boundary_lib.h +++ b/deal.II/deal.II/include/grid/tria_boundary_lib.h @@ -248,7 +248,21 @@ class HyperShellBoundary : public StraightBoundary */ virtual Point get_new_point_on_quad (const typename Triangulation::quad_iterator &quad) const; - + + /** + * Compute the normals to the + * boundary at the vertices of + * the given face. + * + * Refer to the general + * documentation of this class + * and the documentation of the + * base class. + */ + virtual void + get_normals_at_vertices (const typename Triangulation::face_iterator &face, + typename Boundary::FaceVertexNormals &face_vertex_normals) const; + private: /** * Store the center of the spheres. @@ -290,6 +304,20 @@ class HalfHyperShellBoundary : public HyperShellBoundary */ virtual Point get_new_point_on_quad (const typename Triangulation::quad_iterator &quad) const; + + /** + * Compute the normals to the + * boundary at the vertices of + * the given face. + * + * Refer to the general + * documentation of this class + * and the documentation of the + * base class. + */ + virtual void + get_normals_at_vertices (const typename Triangulation::face_iterator &face, + typename Boundary::FaceVertexNormals &face_vertex_normals) const; private: /** diff --git a/deal.II/deal.II/source/grid/tria_boundary_lib.cc b/deal.II/deal.II/source/grid/tria_boundary_lib.cc index db57d1d01a..ac081480ed 100644 --- a/deal.II/deal.II/source/grid/tria_boundary_lib.cc +++ b/deal.II/deal.II/source/grid/tria_boundary_lib.cc @@ -469,6 +469,37 @@ get_new_point_on_quad (const typename Triangulation::quad_iterator &quad) c }; + +#if deal_II_dimension == 1 + +template <> +void +HyperShellBoundary<1>:: +get_normals_at_vertices (const Triangulation<1>::face_iterator &, + Boundary<1>::FaceVertexNormals &) const +{ + Assert (false, Boundary<1>::ExcFunctionNotUseful(1)); +}; + +#endif + + +template +void +HyperShellBoundary:: +get_normals_at_vertices (const typename Triangulation::face_iterator &face, + typename Boundary::FaceVertexNormals &face_vertex_normals) const +{ + // this is equivalent to the case + // in the hyperball boundary. note + // that we need not normalize nor + // direct the normal + for (unsigned int vertex=0; vertex::vertices_per_face; ++vertex) + face_vertex_normals[vertex] = face->vertex(vertex)-center; +}; + + + /* ---------------------------------------------------------------------- */ @@ -541,6 +572,35 @@ get_new_point_on_quad (const typename Triangulation::quad_iterator &quad) c +#if deal_II_dimension == 1 + +template <> +void +HalfHyperShellBoundary<1>:: +get_normals_at_vertices (const Triangulation<1>::face_iterator &, + Boundary<1>::FaceVertexNormals &) const +{ + Assert (false, Boundary<1>::ExcFunctionNotUseful(1)); +}; + +#endif + + + +template +void +HalfHyperShellBoundary:: +get_normals_at_vertices (const typename Triangulation::face_iterator &face, + typename Boundary::FaceVertexNormals &face_vertex_normals) const +{ + if (face->center()(0) == center(0)) + StraightBoundary::get_normals_at_vertices (face, face_vertex_normals); + else + HyperShellBoundary::get_normals_at_vertices (face, face_vertex_normals); +}; + + + // explicit instantiations template class HyperBallBoundary; template class HalfHyperBallBoundary; -- 2.39.5