Reference documentation for deal.II version 8.4.1
Public Types | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
Boundary< dim, spacedim > Class Template Reference

#include <deal.II/grid/tria_boundary.h>

Inheritance diagram for Boundary< dim, spacedim >:
[legend]

Public Types

typedef Tensor< 1, spacedim > FaceVertexNormals[GeometryInfo< dim >::vertices_per_face]
 

Public Member Functions

virtual ~Boundary ()
 
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, spacedim >::quad_iterator &quad, std::vector< Point< spacedim > > &points) const
 
void get_intermediate_points_on_face (const typename Triangulation< dim, spacedim >::face_iterator &face, std::vector< Point< spacedim > > &points) const
 
virtual Tensor< 1, spacedim > normal_vector (const typename Triangulation< dim, spacedim >::face_iterator &face, const Point< spacedim > &p) const
 
virtual void get_normals_at_vertices (const typename Triangulation< dim, spacedim >::face_iterator &face, FaceVertexNormals &face_vertex_normals) const
 
virtual Point< spacedim > project_to_surface (const typename Triangulation< dim, spacedim >::line_iterator &line, const Point< spacedim > &candidate) const
 
virtual Point< spacedim > project_to_surface (const typename Triangulation< dim, spacedim >::quad_iterator &quad, const Point< spacedim > &candidate) const
 
virtual Point< spacedim > project_to_surface (const typename Triangulation< dim, spacedim >::hex_iterator &hex, const Point< spacedim > &candidate) const
 
- Public Member Functions inherited from FlatManifold< dim, spacedim >
 FlatManifold (const Point< spacedim > periodicity=Point< spacedim >(), const double tolerance=1e-10)
 
virtual Point< spacedim > get_new_point (const Quadrature< spacedim > &quad) const
 
virtual Point< spacedim > project_to_manifold (const std::vector< Point< spacedim > > &points, const Point< spacedim > &candidate) const
 
- Public Member Functions inherited from Manifold< dim, spacedim >
virtual ~Manifold ()
 
virtual Point< spacedim > get_new_point_on_line (const typename Triangulation< dim, spacedim >::line_iterator &line) 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_hex (const typename Triangulation< dim, spacedim >::hex_iterator &hex) const
 
Point< spacedim > get_new_point_on_face (const typename Triangulation< dim, spacedim >::face_iterator &face) const
 
Point< spacedim > get_new_point_on_cell (const typename Triangulation< dim, spacedim >::cell_iterator &cell) const
 
- Public Member Functions inherited from Subscriptor
 Subscriptor ()
 
 Subscriptor (const Subscriptor &)
 
virtual ~Subscriptor ()
 
Subscriptoroperator= (const Subscriptor &)
 
void subscribe (const char *identifier=0) const
 
void unsubscribe (const char *identifier=0) const
 
unsigned int n_subscriptions () const
 
void list_subscribers () const
 
 DeclException3 (ExcInUse, int, char *, std::string &,<< "Object of class "<< arg2<< " is still used by "<< arg1<< " other objects."<< "\n\n"<< "(Additional information: "<< arg3<< ")\n\n"<< "See the entry in the Frequently Asked Questions of "<< "deal.II (linked to from http://www.dealii.org/) for "<< "a lot more information on what this error means and "<< "how to fix programs in which it happens.")
 
 DeclException2 (ExcNoSubscriber, char *, char *,<< "No subscriber with identifier <"<< arg2<< "> subscribes to this object of class "<< arg1<< ". Consequently, it cannot be unsubscribed.")
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Protected Member Functions

const std::vector< Point< 1 > > & get_line_support_points (const unsigned int n_intermediate_points) const
 

Private Attributes

std::vector< std_cxx11::shared_ptr< QGaussLobatto< 1 > > > points
 
Threads::Mutex mutex
 

Detailed Description

template<int dim, int spacedim = dim>
class Boundary< dim, spacedim >

This class is used to represent a boundary to a triangulation. When a triangulation creates a new vertex on the boundary of the domain, it determines the new vertex' coordinates through the following code (here in two dimensions):

...
Point<2> new_vertex = boundary.get_new_point_on_line (line);
...

line denotes the line at the boundary that shall be refined and for which we seek the common point of the two child lines.

In 3D, a new vertex may be placed on the middle of a line or on the middle of a side. Respectively, the library calls

...
Point<3> new_line_vertices[4]
= { boundary.get_new_point_on_line (face->line(0)),
boundary.get_new_point_on_line (face->line(1)),
boundary.get_new_point_on_line (face->line(2)),
boundary.get_new_point_on_line (face->line(3)) };
...

to get the four midpoints of the lines bounding the quad at the boundary, and after that

...
Point<3> new_quad_vertex = boundary.get_new_point_on_quad (face);
...

to get the midpoint of the face. It is guaranteed that this order (first lines, then faces) holds, so you can use information from the children of the four lines of a face, since these already exist at the time the midpoint of the face is to be computed.

Since iterators are passed to the functions, you may use information about boundary indicators and the like, as well as all other information provided by these objects.

There are specializations, StraightBoundary, which places the new point right into the middle of the given points, and HyperBallBoundary creating a hyperball with given radius around a given center point.

Author
Wolfgang Bangerth, 1999, 2001, 2009, Ralf Hartmann, 2001, 2008, Luca Heltai, 2014

Definition at line 46 of file tria.h.

Member Typedef Documentation

template<int dim, int spacedim = dim>
typedef Tensor<1,spacedim> Boundary< dim, spacedim >::FaceVertexNormals[GeometryInfo< dim >::vertices_per_face]

Type keeping information about the normals at the vertices of a face of a cell. Thus, there are GeometryInfo<dim>::vertices_per_face normal vectors, that define the tangent spaces of the boundary at the vertices. Note that the vectors stored in this object are not required to be normalized, nor to actually point outward, as one often will only want to check for orthogonality to define the tangent plane; if a function requires the normals to be normalized, then it must do so itself.

For obvious reasons, this type is not useful in 1d.

Definition at line 100 of file tria_boundary.h.

Constructor & Destructor Documentation

template<int dim, int spacedim>
Boundary< dim, spacedim >::~Boundary ( )
virtual

Destructor. Does nothing here, but needs to be declared to make it virtual.

Definition at line 32 of file tria_boundary.cc.

Member Function Documentation

template<int dim, int spacedim>
void Boundary< dim, spacedim >::get_intermediate_points_on_line ( const typename Triangulation< dim, spacedim >::line_iterator &  line,
std::vector< Point< spacedim > > &  points 
) const
virtual

Return intermediate points on a line spaced according to the interior support points of the 1D Gauss-Lobatto quadrature formula.

The number of points requested is given by the size of the vector points. It is the task of derived classes to arrange the points in approximately equal distances along the length of the line segment on the boundary bounded by the vertices of the first argument.

Among other places in the library, this function is called by the Mapping classes, for example the MappingQGeneric class. On the other hand, not all mapping classes actually require intermediate points on lines (for example, \(Q_1\) mappings do not). Consequently this function is not made pure virtual, to allow users to define their own boundary classes without having to overload this function. However, the default implementation throws an error in any case and can, consequently, not be used if you use a mapping that does need the information provided by this function.

Reimplemented in TorusBoundary< dim, spacedim >, HyperBallBoundary< dim, spacedim >, StraightBoundary< dim, spacedim >, StraightBoundary< dim, dim >, and CylinderBoundary< dim, spacedim >.

Definition at line 39 of file tria_boundary.cc.

template<int dim, int spacedim>
void Boundary< dim, spacedim >::get_intermediate_points_on_quad ( const typename Triangulation< dim, spacedim >::quad_iterator &  quad,
std::vector< Point< spacedim > > &  points 
) const
virtual

Return intermediate points on a line spaced according to the tensor product of the interior support points of the 1D Gauss-Lobatto quadrature formula.

The number of points requested is given by the size of the vector points. It is required that this number is a square of another integer, i.e. n=points.size()=m*m. It is the task of the derived classes to arrange the points such they split the quad into (m+1)(m+1) approximately equal-sized subquads.

Among other places in the library, this function is called by the Mapping classes, for example the MappingQGeneric class. On the other hand, not all mapping classes actually require intermediate points on quads (for example, \(Q_1\) mappings do not). Consequently this function is not made pure virtual, to allow users to define their own boundary classes without having to overload this function. However, the default implementation throws an error in any case and can, consequently, not be used if you use a mapping that does need the information provided by this function.

Reimplemented in TorusBoundary< dim, spacedim >, HyperBallBoundary< dim, spacedim >, StraightBoundary< dim, spacedim >, StraightBoundary< dim, dim >, and CylinderBoundary< dim, spacedim >.

Definition at line 50 of file tria_boundary.cc.

template<int dim, int spacedim>
void Boundary< dim, spacedim >::get_intermediate_points_on_face ( const typename Triangulation< dim, spacedim >::face_iterator &  face,
std::vector< Point< spacedim > > &  points 
) const

Depending on dim=2 or dim=3 this function calls the get_intermediate_points_on_line or the get_intermediate_points_on_quad function. It throws an exception for dim=1. This wrapper allows dimension independent programming.

Definition at line 60 of file tria_boundary.cc.

template<int dim, int spacedim>
Tensor< 1, spacedim > Boundary< dim, spacedim >::normal_vector ( const typename Triangulation< dim, spacedim >::face_iterator &  face,
const Point< spacedim > &  p 
) const
virtual

Return the normal vector to the surface at the point p. If p is not in fact on the surface, but only close-by, try to return something reasonable, for example the normal vector at the surface point closest to p. (The point p will in fact not normally lie on the actual surface, but rather be a quadrature point mapped by some polynomial mapping; the mapped surface, however, will not usually coincide with the actual surface.)

The face iterator gives an indication which face this function is supposed to compute the normal vector for. This is useful if the boundary of the domain is composed of different nondifferential pieces (for example when using the StraightBoundary class to approximate a geometry that is completely described by the coarse mesh, with piecewise (bi-)linear components between the vertices, but where the boundary may have a kink at the vertices itself).

Note
Implementations of this function should be able to assume that the point p lies within or close to the face described by the first argument. In turn, callers of this function should ensure that this is in fact the case.

Reimplemented in HyperBallBoundary< dim, spacedim >, StraightBoundary< dim, spacedim >, and StraightBoundary< dim, dim >.

Definition at line 114 of file tria_boundary.cc.

template<int dim, int spacedim>
void Boundary< dim, spacedim >::get_normals_at_vertices ( const typename Triangulation< dim, spacedim >::face_iterator &  face,
FaceVertexNormals face_vertex_normals 
) const
virtual

Compute the normal vectors to the boundary at each vertex of the given face. It is not required that the normal vectors be normed somehow. Neither is it required that the normals actually point outward.

This function is needed to compute data for C1 mappings. The default implementation is to throw an error, so you need not overload this function in case you do not intend to use C1 mappings.

Note that when computing normal vectors at a vertex where the boundary is not differentiable, you have to make sure that you compute the one-sided limits, i.e. limit with respect to points inside the given face.

Definition at line 126 of file tria_boundary.cc.

template<int dim, int spacedim>
Point< spacedim > Boundary< dim, spacedim >::project_to_surface ( const typename Triangulation< dim, spacedim >::line_iterator &  line,
const Point< spacedim > &  candidate 
) const
virtual

Given a candidate point and a line segment characterized by the iterator, return a point that lies on the surface described by this object. This function is used in some mesh smoothing algorithms that try to move around points in order to improve the mesh quality but need to ensure that points that were on the boundary remain on the boundary.

If spacedim==1, then the line represented by the line iterator is the entire space (i.e. it is a cell, not a part of the boundary), and the returned point equals the given input point.

Derived classes do not need to implement this function unless mesh smoothing algorithms are used with a particular boundary object. The default implementation of this function throws an exception of type ExcPureFunctionCalled.

Reimplemented in StraightBoundary< dim, spacedim >, and StraightBoundary< dim, dim >.

Definition at line 137 of file tria_boundary.cc.

template<int dim, int spacedim>
Point< spacedim > Boundary< dim, spacedim >::project_to_surface ( const typename Triangulation< dim, spacedim >::quad_iterator &  quad,
const Point< spacedim > &  candidate 
) const
virtual

Same function as above but for a point that is to be projected onto the area characterized by the given quad.

If spacedim<=2, then the surface represented by the quad iterator is the entire space (i.e. it is a cell, not a part of the boundary), and the returned point equals the given input point.

Reimplemented in StraightBoundary< dim, spacedim >, and StraightBoundary< dim, dim >.

Definition at line 154 of file tria_boundary.cc.

template<int dim, int spacedim>
Point< spacedim > Boundary< dim, spacedim >::project_to_surface ( const typename Triangulation< dim, spacedim >::hex_iterator &  hex,
const Point< spacedim > &  candidate 
) const
virtual

Same function as above but for a point that is to be projected onto the area characterized by the given quad.

If spacedim<=3, then the manifold represented by the hex iterator is the entire space (i.e. it is a cell, not a part of the boundary), and the returned point equals the given input point.

Reimplemented in StraightBoundary< dim, spacedim >, and StraightBoundary< dim, dim >.

Definition at line 171 of file tria_boundary.cc.

template<int dim, int spacedim>
const std::vector< Point< 1 > > & Boundary< dim, spacedim >::get_line_support_points ( const unsigned int  n_intermediate_points) const
protected

Returns the support points of the Gauss-Lobatto quadrature formula used for intermediate points.

Note
Since the boundary description is closely tied to the unit cell support points of MappingQ, new boundary descriptions need to explicitly use these Gauss-Lobatto points and not equidistant points.

Definition at line 188 of file tria_boundary.cc.

Member Data Documentation

template<int dim, int spacedim = dim>
std::vector<std_cxx11::shared_ptr<QGaussLobatto<1> > > Boundary< dim, spacedim >::points
mutableprivate

Point generator for the intermediate points on a boundary.

Definition at line 275 of file tria_boundary.h.

template<int dim, int spacedim = dim>
Threads::Mutex Boundary< dim, spacedim >::mutex
mutableprivate

Mutex for protecting the points array.

Definition at line 280 of file tria_boundary.h.


The documentation for this class was generated from the following files: