Reference documentation for deal.II version 8.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Functions
Boundary description for triangulations
Collaboration diagram for Boundary description for triangulations:

Classes

class  Boundary< dim, spacedim >
 
class  StraightBoundary< dim, spacedim >
 
class  CylinderBoundary< dim, spacedim >
 
class  HyperBallBoundary< dim, spacedim >
 
class  HalfHyperBallBoundary< dim >
 
class  HyperShellBoundary< dim >
 
class  HalfHyperShellBoundary< dim >
 

Functions

void Triangulation< dim, spacedim >::set_boundary (const types::boundary_id number, const Boundary< dim, spacedim > &boundary_object)
 
void Triangulation< dim, spacedim >::set_boundary (const types::boundary_id number)
 
const Boundary< dim, spacedim > & Triangulation< dim, spacedim >::get_boundary (const types::boundary_id number) const
 
std::vector< types::boundary_idTriangulation< dim, spacedim >::get_boundary_indicators () const
 

Dealing with boundary indicators

void TriaAccessor< int, int, int >::set_boundary_indicator (const types::boundary_id) const
 
void TriaAccessor< int, int, int >::set_all_boundary_indicators (const types::boundary_id) const
 

Dealing with boundary indicators

void TriaAccessor< 0, 1, spacedim >::set_boundary_indicator (const types::boundary_id)
 
void TriaAccessor< 0, 1, spacedim >::set_all_boundary_indicators (const types::boundary_id)
 

Detailed Description

The classes in this module are concerned with the description of the boundary of a domain in which a Triangulation lives. This boundary description is necessary in three contexts:

In the context of triangulations, each face of a cell that is located at the boundary of the domain stores a number called boundary_id that uniquely identifies which part of the boundary this face is on. If nothing is specified at creation time, each boundary face has a zero boundary id. On the other hand, the boundary id of faces can be set either at creation time or later by looping over all cells and querying their faces.

It is then possible to associate objects describing the boundary to certain boundary_id values used in a triangulation. Note that this is not necessary: in some cases one may want to use the default straight boundary approximation, and use non-zero boundary indicators for completely different purposes, for example to indicate that a part of the boundary has a different kind of boundary condition in the partial differential equation.

See Also
Glossary entry on boundary indicators
Author
Wolfgang Bangerth, 1998-2006

Function Documentation

template<int structdim, int dim, int spacedim>
void TriaAccessor< structdim, dim, spacedim >::set_boundary_indicator ( const types::boundary_id  boundary_ind) const

Set the boundary indicator. The same applies as for the boundary_indicator() function.

Note that it only sets the boundary object of the current object itself, not the indicators of the ones that bound it. For example, in 3d, if this function is called on a face, then the boundary indicator of the 4 edges that bound the face remain unchanged. If you want to set the boundary indicators of face and edges at the same time, use the set_all_boundary_indicators() function. You can see the result of not using the correct function in the results section of step-49.

Warning
You should never set the boundary indicator of an interior face (a face not at the boundary of the domain), or set set the boundary indicator of an exterior face to numbers::internal_face_boundary_id (this value is reserved for another purpose). Algorithms may not work or produce very confusing results if boundary cells have a boundary indicator of numbers::internal_face_boundary_id or if interior cells have boundary indicators other than numbers::internal_face_boundary_id. Unfortunately, the current object has no means of finding out whether it really is at the boundary of the domain and so cannot determine whether the value you are trying to set makes sense under the current circumstances.
See Also
Glossary entry on boundary indicators

Definition at line 1889 of file tria_accessor.templates.h.

template<int structdim, int dim, int spacedim>
void TriaAccessor< structdim, dim, spacedim >::set_all_boundary_indicators ( const types::boundary_id  boundary_ind) const

Do as set_boundary_indicator() but also set the boundary indicators of the objects that bound the current object. For example, in 3d, if set_boundary_indicator() is called on a face, then the boundary indicator of the 4 edges that bound the face remain unchanged. In contrast, if you call the current function, the boundary indicators of face and edges are all set to the given value.

This function is useful if you set boundary indicators of faces in 3d (in 2d, the function does the same as set_boundary_indicator()) and you do so because you want a curved boundary object to represent the part of the boundary that corresponds to the current face. In that case, the Triangulation class needs to figure out where to put new vertices upon mesh refinement, and higher order Mapping objects also need to figure out where new interpolation points for a curved boundary approximation should be. In either case, the two classes first determine where interpolation points on the edges of a boundary face should be, asking the boundary object, before asking the boundary object for the interpolation points corresponding to the interior of the boundary face. For this to work properly, it is not sufficient to have set the boundary indicator for the face alone, but you also need to set the boundary indicators of the edges that bound the face. This function does all of this at once. You can see the result of not using the correct function in the results section of step-49.

See Also
Glossary entry on boundary indicators

Definition at line 1902 of file tria_accessor.templates.h.

template<int spacedim>
void TriaAccessor< 0, 1, spacedim >::set_boundary_indicator ( const types::boundary_id  b)
inline

Set the boundary indicator. The same applies as for the boundary_indicator() function.

Warning
You should never set the boundary indicator of an interior face (a face not at the boundary of the domain), or set set the boundary indicator of an exterior face to numbers::internal_face_boundary_id (this value is reserved for another purpose). Algorithms may not work or produce very confusing results if boundary cells have a boundary indicator of numbers::internal_face_boundary_id or if interior cells have boundary indicators other than numbers::internal_face_boundary_id. Unfortunately, the current object has no means of finding out whether it really is at the boundary of the domain and so cannot determine whether the value you are trying to set makes sense under the current circumstances.
See Also
Glossary entry on boundary indicators

Definition at line 2436 of file tria_accessor.templates.h.

template<int spacedim>
void TriaAccessor< 0, 1, spacedim >::set_all_boundary_indicators ( const types::boundary_id  b)
inline

Since this object only represents a single vertex, call set_boundary_indicator with the same argument.

See Also
Glossary entry on boundary indicators

Definition at line 2449 of file tria_accessor.templates.h.

template<int dim, int spacedim>
void Triangulation< dim, spacedim >::set_boundary ( const types::boundary_id  number,
const Boundary< dim, spacedim > &  boundary_object 
)

If dim==spacedim, assign a boundary object to a certain part of the boundary of a the triangulation. If a face with boundary number number is refined, this object is used to find the location of new vertices on the boundary (see the results section of step-49 for a more in-depth discussion of this, with examples). It is also used for non-linear (i.e.: non-Q1) transformations of cells to the unit cell in shape function calculations.

If dim!=spacedim the boundary object is in fact the exact manifold that the triangulation is approximating (for example a circle approximated by a polygon triangulation). As above, the refinement is made in such a way that the new points are located on the exact manifold.

Numbers of boundary objects correspond to material numbers of faces at the boundary, for instance the material id in a UCD input file. They are not necessarily consecutive but must be in the range 0-(types::boundary_id-1). Material IDs on boundaries are also called boundary indicators and are accessed with accessor functions of that name.

The boundary_object is not copied and MUST persist until the triangulation is destroyed. This is also true for triangulations generated from this one by copy_triangulation.

It is possible to remove or replace the boundary object during the lifetime of a non-empty triangulation. Usually, this is done before the first refinement and is dangerous afterwards. Removal of a boundary object is done by set_boundary(number), i.e. the function of same name but only one argument. This operation then replaces the boundary object given before by a straight boundary approximation.

See Also
Glossary entry on boundary indicators
template<int dim, int spacedim>
void Triangulation< dim, spacedim >::set_boundary ( const types::boundary_id  number)

Reset those parts of the boundary with the given number to use a straight boundary approximation. This is the default state of a triangulation, and undoes assignment of a different boundary object by the function of same name and two arguments.

See Also
Glossary entry on boundary indicators
template<int dim, int spacedim>
const Boundary<dim,spacedim>& Triangulation< dim, spacedim >::get_boundary ( const types::boundary_id  number) const

Return a constant reference to a boundary object used for this triangulation. Number is the same as in set_boundary

See Also
Glossary entry on boundary indicators
template<int dim, int spacedim>
std::vector<types::boundary_id> Triangulation< dim, spacedim >::get_boundary_indicators ( ) const

Returns a vector containing all boundary indicators assigned to boundary faces of this Triangulation object. Note, that each boundary indicator is reported only once. The size of the return vector will represent the number of different indicators (which is greater or equal one).

See Also
Glossary entry on boundary indicators