Reference documentation for deal.II version 9.0.0
tria_boundary_lib.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2018 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE at
12 // the top level of the deal.II distribution.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_tria_boundary_lib_h
17 #define dealii_tria_boundary_lib_h
18 
19 
20 #include <deal.II/base/config.h>
21 #include <deal.II/grid/tria_boundary.h>
22 
23 DEAL_II_NAMESPACE_OPEN
24 
53 template <int dim, int spacedim = dim>
54 class DEAL_II_DEPRECATED CylinderBoundary : public StraightBoundary<dim,spacedim>
55 {
56 public:
62  CylinderBoundary (const double radius = 1.0,
63  const unsigned int axis = 0);
64 
71  CylinderBoundary (const double radius,
72  const Point<spacedim> &direction,
73  const Point<spacedim> &point_on_axis);
74 
78  virtual std::unique_ptr<Manifold<dim,spacedim> > clone() const override;
79 
84  virtual Point<spacedim>
85  get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const override;
86 
91  virtual Point<spacedim>
92  get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const override;
93 
100  virtual void
101  get_intermediate_points_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line,
102  std::vector<Point<spacedim> > &points) const override;
103 
110  virtual void
111  get_intermediate_points_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad,
112  std::vector<Point<spacedim> > &points) const override;
113 
120  virtual void
122  typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const override;
123 
127  double get_radius () const;
128 
133  DeclException0 (ExcRadiusNotSet);
134 
135 
136 protected:
140  const double radius;
141 
146 
151 
152 private:
153 
161  void get_intermediate_points_between_points (const Point<spacedim> &p0, const Point<spacedim> &p1,
162  std::vector<Point<spacedim> > &points) const;
163 
167  static Point<spacedim> get_axis_vector (const unsigned int axis);
168 };
169 
170 
171 
208 template <int dim>
209 class DEAL_II_DEPRECATED ConeBoundary : public StraightBoundary<dim>
210 {
211 public:
219  ConeBoundary (const double radius_0,
220  const double radius_1,
221  const Point<dim> x_0,
222  const Point<dim> x_1);
223 
227  virtual std::unique_ptr<Manifold<dim,dim> > clone() const override;
228 
233  double get_radius (const Point<dim> x) const;
234 
239  virtual
240  Point<dim>
241  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const override;
242 
247  virtual
248  Point<dim>
249  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const override;
250 
257  virtual
258  void
260  std::vector<Point<dim> > &points) const override;
261 
268  virtual
269  void
271  std::vector<Point<dim> > &points) const override;
272 
279  virtual
280  void
282  typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const override;
283 
290  virtual
292  normal_vector (const typename Triangulation<dim>::face_iterator &face,
293  const Point<dim> &p) const override;
294 
295 
296 protected:
300  const double radius_0;
301 
305  const double radius_1;
306 
311 
316 
317 private:
325  void
326  get_intermediate_points_between_points (const Point<dim> &p0,
327  const Point<dim> &p1,
328  std::vector<Point<dim> > &points) const;
329 };
330 
331 
332 
354 template <int dim, int spacedim=dim>
355 class DEAL_II_DEPRECATED HyperBallBoundary : public StraightBoundary<dim,spacedim>
356 {
357 public:
362  const double radius = 1.0);
363 
367  virtual std::unique_ptr<Manifold<dim,spacedim> > clone() const override;
368 
373  virtual
375  get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const override;
376 
381  virtual
383  get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const override;
384 
391  virtual
392  void
393  get_intermediate_points_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line,
394  std::vector<Point<spacedim> > &points) const override;
395 
402  virtual
403  void
404  get_intermediate_points_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad,
405  std::vector<Point<spacedim> > &points) const override;
406 
413  virtual
416  const Point<spacedim> &p) const override;
417 
424  virtual
425  void
427  typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const override;
428 
433  get_center () const;
434 
438  double
439  get_radius () const;
440 
445  DeclException0 (ExcRadiusNotSet);
446 
447 
448 protected:
449 
454 
458  const double radius;
459 
469 
470 private:
471 
479  void get_intermediate_points_between_points (const Point<spacedim> &p0, const Point<spacedim> &p1,
480  std::vector<Point<spacedim> > &points) const;
481 };
482 
483 
484 
501 template <int dim>
502 class DEAL_II_DEPRECATED HalfHyperBallBoundary : public HyperBallBoundary<dim>
503 {
504 public:
509  const double radius = 1.0);
510 
514  virtual std::unique_ptr<Manifold<dim,dim> > clone() const override;
515 
519  virtual Point<dim>
520  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const override;
521 
525  virtual Point<dim>
526  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const override;
527 
534  virtual void
536  std::vector<Point<dim> > &points) const override;
537 
544  virtual void
546  std::vector<Point<dim> > &points) const override;
547 
554  virtual void
556  typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const override;
557 };
558 
559 
560 
574 template <int dim>
575 class DEAL_II_DEPRECATED HyperShellBoundary : public HyperBallBoundary<dim>
576 {
577 public:
584  HyperShellBoundary (const Point<dim> &center = Point<dim>());
585 
589  virtual std::unique_ptr<Manifold<dim,dim> > clone() const override;
590 };
591 
592 
593 
610 template <int dim>
611 class DEAL_II_DEPRECATED HalfHyperShellBoundary : public HyperShellBoundary<dim>
612 {
613 public:
621  HalfHyperShellBoundary (const Point<dim> &center = Point<dim>(),
622  const double inner_radius = -1,
623  const double outer_radius = -1);
624 
628  virtual std::unique_ptr<Manifold<dim,dim> > clone() const override;
629 
633  virtual Point<dim>
634  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const override;
635 
639  virtual Point<dim>
640  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const override;
641 
648  virtual void
650  std::vector<Point<dim> > &points) const override;
651 
658  virtual void
660  std::vector<Point<dim> > &points) const override;
661 
668  virtual void
670  typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const override;
671 
672 private:
676  const double inner_radius;
677  const double outer_radius;
678 };
679 
680 
692 template <int dim, int spacedim>
693 class DEAL_II_DEPRECATED TorusBoundary : public Boundary<dim,spacedim>
694 {
695 public:
699  TorusBoundary (const double R, const double r);
700 
704  virtual std::unique_ptr<Manifold<dim,spacedim> > clone() const override;
705 
706 //Boundary Refinement Functions
710  virtual Point<spacedim>
711  get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const override;
712 
716  virtual Point<spacedim>
717  get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const override;
718 
722  virtual void get_intermediate_points_on_line (
723  const typename Triangulation< dim, spacedim >::line_iterator &line,
724  std::vector< Point< spacedim > > &points) const override;
725 
729  virtual void get_intermediate_points_on_quad (
730  const typename Triangulation< dim, spacedim >::quad_iterator &quad,
731  std::vector< Point< spacedim > > &points ) const override;
732 
737  virtual void get_normals_at_vertices (
739  typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const override;
740 
741 private:
742  //Handy functions
749  double get_correct_angle(const double angle,const double x,const double y) const;
750 
755  Point<spacedim> get_real_coord(const Point<dim> &surfP) const;
756 
761  Point<dim> get_surf_coord(const Point<spacedim> &p) const;
762 
767  Point<spacedim> get_surf_norm_from_sp(const Point<dim> &surfP) const;
768 
773  Point<spacedim> get_surf_norm(const Point<spacedim> &p) const;
774 
778  const double R;
779  const double r;
780 };
781 
782 
783 
784 /* -------------- declaration of explicit specializations ------------- */
785 
786 #ifndef DOXYGEN
787 
788 template <>
789 Point<1>
791 get_new_point_on_quad (const Triangulation<1>::quad_iterator &) const;
792 template <>
793 void
795  const Triangulation<1>::line_iterator &,
796  std::vector<Point<1> > &) const;
797 template <>
798 void
800  const Triangulation<3>::quad_iterator &quad,
801  std::vector<Point<3> > &points) const;
802 template <>
803 void
807 template <>
808 Point<1>
810 get_new_point_on_quad (const Triangulation<1>::quad_iterator &) const;
811 template <>
812 void
814 get_intermediate_points_on_quad (const Triangulation<1>::quad_iterator &,
815  std::vector<Point<1> > &) const;
816 template <>
817 void
821 template <>
822 Point<1>
824 get_new_point_on_quad (const Triangulation<1>::quad_iterator &) const;
825 template <>
826 void
828 get_intermediate_points_on_quad (const Triangulation<1>::quad_iterator &,
829  std::vector<Point<1> > &) const;
830 template <>
831 void
835 
836 
837 #endif // DOXYGEN
838 
839 DEAL_II_NAMESPACE_CLOSE
840 
841 #endif
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const override
virtual std::unique_ptr< Manifold< dim, dim > > clone() const override
virtual void get_intermediate_points_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line, std::vector< Point< spacedim > > &points) const
const Point< spacedim > point_on_axis
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, typename Boundary< dim, spacedim >::FaceVertexNormals &face_vertex_normals) const override
const Point< spacedim > direction
const double R
const Point< dim > x_1
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, typename Boundary< dim, spacedim >::FaceVertexNormals &face_vertex_normals) const override
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim >::quad_iterator &quad, std::vector< Point< dim > > &points) const override
virtual void get_normals_at_vertices(const typename Triangulation< dim >::face_iterator &face, typename Boundary< dim >::FaceVertexNormals &face_vertex_normals) const override
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const override
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const
Definition: tria.h:45
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const
Definition: manifold.cc:306
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const override
#define DeclException0(Exception0)
Definition: exceptions.h:323
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const override
virtual Point< dim > get_new_point_on_quad(const typename Triangulation< dim >::quad_iterator &quad) const override
const Point< spacedim > center
const double radius_1
virtual void get_intermediate_points_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line, std::vector< Point< spacedim > > &points) const override
virtual void get_normals_at_vertices(const typename Triangulation< dim >::face_iterator &face, typename Boundary< dim >::FaceVertexNormals &face_vertex_normals) const override
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const
Definition: manifold.cc:320
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, typename Manifold< dim, spacedim >::FaceVertexNormals &face_vertex_normals) const override
virtual Tensor< 1, spacedim > normal_vector(const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const override
virtual Point< dim > get_new_point_on_quad(const typename Triangulation< dim >::quad_iterator &quad) const override
const Point< dim > x_0
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
virtual void get_intermediate_points_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line, std::vector< Point< spacedim > > &points) const override
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim >::quad_iterator &quad, std::vector< Point< dim > > &points) const override
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const override
const double radius_0
virtual std::unique_ptr< Manifold< dim, spacedim > > clone() const override
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const override