Reference documentation for deal.II version 8.5.1
tria_boundary_lib.h
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 1999 - 2016 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 
48 template <int dim, int spacedim = dim>
49 class CylinderBoundary : public StraightBoundary<dim,spacedim>
50 {
51 public:
57  CylinderBoundary (const double radius = 1.0,
58  const unsigned int axis = 0);
59 
66  CylinderBoundary (const double radius,
69 
74  virtual Point<spacedim>
75  get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const;
76 
81  virtual Point<spacedim>
82  get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const;
83 
90  virtual void
91  get_intermediate_points_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line,
92  std::vector<Point<spacedim> > &points) const;
93 
100  virtual void
101  get_intermediate_points_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad,
102  std::vector<Point<spacedim> > &points) const;
103 
110  virtual void
112  typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const;
113 
117  double get_radius () const;
118 
124 
125 
126 protected:
130  const double radius;
131 
136 
141 
142 private:
143 
152  std::vector<Point<spacedim> > &points) const;
153 
157  static Point<spacedim> get_axis_vector (const unsigned int axis);
158 };
159 
160 
161 
194 template <int dim>
195 class ConeBoundary : public StraightBoundary<dim>
196 {
197 public:
205  ConeBoundary (const double radius_0,
206  const double radius_1,
207  const Point<dim> x_0,
208  const Point<dim> x_1);
209 
214  double get_radius (const Point<dim> x) const;
215 
220  virtual
221  Point<dim>
222  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
223 
228  virtual
229  Point<dim>
230  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
231 
238  virtual
239  void
241  std::vector<Point<dim> > &points) const;
242 
249  virtual
250  void
252  std::vector<Point<dim> > &points) const;
253 
260  virtual
261  void
263  typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const;
264 
265 protected:
269  const double radius_0;
270 
274  const double radius_1;
275 
280 
285 
286 private:
294  void
296  const Point<dim> &p1,
297  std::vector<Point<dim> > &points) const;
298 };
299 
300 
301 
319 template <int dim, int spacedim=dim>
320 class HyperBallBoundary : public StraightBoundary<dim,spacedim>
321 {
322 public:
327  const double radius = 1.0);
328 
333  virtual
335  get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const;
336 
341  virtual
343  get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const;
344 
351  virtual
352  void
353  get_intermediate_points_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line,
354  std::vector<Point<spacedim> > &points) const;
355 
362  virtual
363  void
364  get_intermediate_points_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad,
365  std::vector<Point<spacedim> > &points) const;
366 
373  virtual
376  const Point<spacedim> &p) const;
377 
384  virtual
385  void
387  typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const;
388 
393  get_center () const;
394 
398  double
399  get_radius () const;
400 
406 
407 
408 protected:
409 
414 
418  const double radius;
419 
429 
430 private:
431 
440  std::vector<Point<spacedim> > &points) const;
441 };
442 
443 
444 
457 template <int dim>
459 {
460 public:
465  const double radius = 1.0);
466 
470  virtual Point<dim>
471  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
472 
476  virtual Point<dim>
477  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
478 
485  virtual void
487  std::vector<Point<dim> > &points) const;
488 
495  virtual void
497  std::vector<Point<dim> > &points) const;
498 
505  virtual void
507  typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const;
508 };
509 
510 
511 
521 template <int dim>
523 {
524 public:
532 };
533 
534 
535 
548 template <int dim>
550 {
551 public:
560  const double inner_radius = -1,
561  const double outer_radius = -1);
562 
566  virtual Point<dim>
567  get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
568 
572  virtual Point<dim>
573  get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
574 
581  virtual void
583  std::vector<Point<dim> > &points) const;
584 
591  virtual void
593  std::vector<Point<dim> > &points) const;
594 
601  virtual void
603  typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const;
604 
605 private:
609  const double inner_radius;
610  const double outer_radius;
611 };
612 
613 
622 template <int dim, int spacedim>
623 class TorusBoundary : public Boundary<dim,spacedim>
624 {
625 public:
629  TorusBoundary (const double R, const double r);
630 
631 //Boundary Refinement Functions
635  virtual Point<spacedim>
636  get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const;
637 
641  virtual Point<spacedim>
642  get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const;
643 
647  virtual void get_intermediate_points_on_line (
648  const typename Triangulation< dim, spacedim >::line_iterator &line,
649  std::vector< Point< spacedim > > &points) const;
650 
654  virtual void get_intermediate_points_on_quad (
655  const typename Triangulation< dim, spacedim >::quad_iterator &quad,
656  std::vector< Point< spacedim > > &points ) const;
657 
662  virtual void get_normals_at_vertices (
664  typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const;
665 
666 private:
667  //Handy functions
674  double get_correct_angle(const double angle,const double x,const double y) const;
675 
680  Point<spacedim> get_real_coord(const Point<dim> &surfP) const;
681 
686  Point<dim> get_surf_coord(const Point<spacedim> &p) const;
687 
693 
699 
703  const double R;
704  const double r;
705 };
706 
707 
708 
709 /* -------------- declaration of explicit specializations ------------- */
710 
711 #ifndef DOXYGEN
712 
713 template <>
714 Point<1>
716 get_new_point_on_quad (const Triangulation<1>::quad_iterator &) const;
717 template <>
718 void
720  const Triangulation<1>::line_iterator &,
721  std::vector<Point<1> > &) const;
722 template <>
723 void
725  const Triangulation<3>::quad_iterator &quad,
726  std::vector<Point<3> > &points) const;
727 template <>
728 void
732 template <>
733 Point<1>
735 get_new_point_on_quad (const Triangulation<1>::quad_iterator &) const;
736 template <>
737 void
739 get_intermediate_points_on_quad (const Triangulation<1>::quad_iterator &,
740  std::vector<Point<1> > &) const;
741 template <>
742 void
746 template <>
747 Point<1>
749 get_new_point_on_quad (const Triangulation<1>::quad_iterator &) const;
750 template <>
751 void
753 get_intermediate_points_on_quad (const Triangulation<1>::quad_iterator &,
754  std::vector<Point<1> > &) const;
755 template <>
756 void
760 
761 
762 #endif // DOXYGEN
763 
764 DEAL_II_NAMESPACE_CLOSE
765 
766 #endif
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const
void get_intermediate_points_between_points(const Point< spacedim > &p0, const Point< spacedim > &p1, std::vector< Point< spacedim > > &points) const
void get_intermediate_points_between_points(const Point< dim > &p0, const Point< dim > &p1, std::vector< Point< dim > > &points) const
virtual Point< dim > get_new_point_on_line(const typename Triangulation< dim >::line_iterator &line) const
virtual void get_normals_at_vertices(const typename Triangulation< dim >::face_iterator &face, typename Boundary< dim >::FaceVertexNormals &face_vertex_normals) const
const Point< spacedim > point_on_axis
const Point< spacedim > direction
const double R
const Point< dim > x_1
virtual void get_intermediate_points_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line, std::vector< Point< spacedim > > &points) const
virtual Point< dim > get_new_point_on_quad(const typename Triangulation< dim >::quad_iterator &quad) const
virtual void get_intermediate_points_on_line(const typename Triangulation< dim >::line_iterator &line, std::vector< Point< dim > > &points) const
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, typename Boundary< dim, spacedim >::FaceVertexNormals &face_vertex_normals) const
double get_radius(const Point< dim > x) const
Point< dim > get_surf_coord(const Point< spacedim > &p) const
double get_correct_angle(const double angle, const double x, const double y) const
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const
virtual Point< spacedim > get_new_point_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line) const
virtual Point< dim > get_new_point_on_line(const typename Triangulation< dim >::line_iterator &line) const
virtual Point< spacedim > get_new_point_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad) const
virtual Point< dim > get_new_point_on_line(const typename Triangulation< dim >::line_iterator &line) const
static Point< spacedim > get_axis_vector(const unsigned int axis)
HalfHyperShellBoundary(const Point< dim > &center=Point< dim >(), const double inner_radius=-1, const double outer_radius=-1)
Definition: tria.h:52
std::vector< std_cxx11::shared_ptr< QGaussLobatto< 1 > > > points
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, typename Boundary< dim, spacedim >::FaceVertexNormals &face_vertex_normals) const
virtual void get_intermediate_points_on_line(const typename Triangulation< dim >::line_iterator &line, std::vector< Point< dim > > &points) const
virtual Point< dim > get_new_point_on_quad(const typename Triangulation< dim >::quad_iterator &quad) const
HalfHyperBallBoundary(const Point< dim > p=Point< dim >(), const double radius=1.0)
Point< spacedim > get_surf_norm(const Point< spacedim > &p) const
#define DeclException0(Exception0)
Definition: exceptions.h:541
Point< spacedim > get_real_coord(const Point< dim > &surfP) const
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const
ConeBoundary(const double radius_0, const double radius_1, const Point< dim > x_0, const Point< dim > x_1)
const Point< spacedim > center
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim >::quad_iterator &quad, std::vector< Point< dim > > &points) const
static ::ExceptionBase & ExcRadiusNotSet()
const double radius_1
virtual Point< dim > get_new_point_on_quad(const typename Triangulation< dim >::quad_iterator &quad) const
virtual void get_normals_at_vertices(const typename Triangulation< dim >::face_iterator &face, typename Boundary< dim >::FaceVertexNormals &face_vertex_normals) const
virtual void get_intermediate_points_on_line(const typename Triangulation< dim >::line_iterator &line, std::vector< Point< dim > > &points) const
static ::ExceptionBase & ExcRadiusNotSet()
double get_radius() const
HyperShellBoundary(const Point< dim > &center=Point< dim >())
Point< spacedim > get_surf_norm_from_sp(const Point< dim > &surfP) const
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const
double get_radius() const
void get_intermediate_points_between_points(const Point< spacedim > &p0, const Point< spacedim > &p1, std::vector< Point< spacedim > > &points) const
virtual void get_normals_at_vertices(const typename Triangulation< dim, spacedim >::face_iterator &face, typename Boundary< dim, spacedim >::FaceVertexNormals &face_vertex_normals) const
TorusBoundary(const double R, const double r)
const Point< dim > x_0
virtual void get_intermediate_points_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line, std::vector< Point< spacedim > > &points) const
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim >::quad_iterator &quad, std::vector< Point< dim > > &points) const
virtual void get_intermediate_points_on_quad(const typename Triangulation< dim >::quad_iterator &quad, std::vector< Point< dim > > &points) const
HyperBallBoundary(const Point< spacedim > p=Point< spacedim >(), const double radius=1.0)
CylinderBoundary(const double radius=1.0, const unsigned int axis=0)
const double radius_0
virtual Tensor< 1, spacedim > normal_vector(const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const
Point< spacedim > get_center() const
virtual void get_intermediate_points_on_line(const typename Triangulation< dim, spacedim >::line_iterator &line, std::vector< Point< spacedim > > &points) const
virtual void get_normals_at_vertices(const typename Triangulation< dim >::face_iterator &face, typename Boundary< dim >::FaceVertexNormals &face_vertex_normals) const