Reference documentation for deal.II version 8.5.1
Classes | Functions
Boundary and manifold description for triangulations
Collaboration diagram for Boundary and manifold 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::manifold_id number, const Boundary< dim, spacedim > &boundary_object)
 
void Triangulation< dim, spacedim >::set_boundary (const types::manifold_id number)
 
const Boundary< dim, spacedim > & Triangulation< dim, spacedim >::get_boundary (const types::manifold_id number) const
 
std::vector< types::boundary_idTriangulation< dim, spacedim >::get_boundary_ids () const
 

Dealing with boundary indicators

void TriaAccessor< structdim, dim, spacedim >::set_boundary_id (const types::boundary_id) const
 
void TriaAccessor< structdim, dim, spacedim >::set_all_boundary_ids (const types::boundary_id) const
 

Dealing with boundary indicators

void TriaAccessor< 0, 1, spacedim >::set_boundary_id (const types::boundary_id)
 
void TriaAccessor< 0, 1, spacedim >::set_all_boundary_ids (const types::boundary_id)
 
void TriaAccessor< 0, 1, spacedim >::set_manifold_id (const types::manifold_id)
 
void TriaAccessor< 0, 1, spacedim >::set_all_manifold_ids (const types::manifold_id)
 

Detailed Description

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

In the context of triangulations, each object stores a number called manifold_id, and 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 and each triangulation object has an invalid manifold id. On the other hand, the boundary id of faces and the manifold id of objects 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 geometry to certain boundary_id values used in a triangulation and to certain manifold_id values.

Before version 8.2, the library allowed only boundary faces to follow a curved geometric description. Since version 8.2 this has been introduced also for interior faces and cells, and the boundary_id has been separated from the manifold_id.

Although the old behavior is still supported, one should use the boundary indicator only for the physical meaning associated, for example, to boundary conditions, and revert to manifold_ids to describe the geometry of the triangulation.

The behavior of the Triangulation class w.r.t. geometry descriptions is the following: Triangulation::set_boundary() and Triangulation::set_manifold() do the exact same thing: they attach a manifold descriptor to the specified id. The first function expects a Boundary descriptor (which is a specialization of a Manifold description) and is provided mainly for backward compatibility, while the second class expects a Manifold descriptor. Notice that the Triangulation class only uses the Manifold interface, and you could describe both the interior and the boundary of the domain using the same object. The additional information contained in the Boundary interface is related to the computation of the exact normals.

Whenever a new vertex is needed in an object, the Triangulation queries the manifold_id of the object which needs refinement. If the manifold_id is set to numbers::invalid_manifold_id, then the Triangulation queries the boundary_id (if the face is on the boundary) or the material_id (if the Triangulation is of codimension one and the object is a cell). If the previous queries resulted in a number different from numbers::invalid_manifold_id, then the Triangulation looks whether a previous call to Triangulation::set_manifold() (or set_boundary()) was performed with the given id, and if yes, it uses the stored object to obtain new vertices, otherwise it uses a FlatManifold or StraightBoundary object.

Note
This behavior is backward compatible to that of deal.II versions prior to 8.2. If one ignores the manifold_id of an object (i.e., if it has never been set), by default it is and remains set to numbers::invalid_manifold_id. In that case, the first query above will trigger a query to the old style boundary_id. This behavior will be maintained for a while, but might eventually be changed. The suggested strategy is to use manifold_ids to describe the geometry, and boundary_ids to describe boundary conditions.
See also
Glossary entry on boundary indicators
Glossary entry on manifold indicators
Author
Wolfgang Bangerth, Luca Heltai, 1998-2014

Function Documentation

◆ set_boundary() [1/2]

template<int dim, int spacedim>
void Triangulation< dim, spacedim >::set_boundary ( const types::manifold_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

Definition at line 9115 of file tria.cc.

◆ set_boundary() [2/2]

template<int dim, int spacedim>
void Triangulation< dim, spacedim >::set_boundary ( const types::manifold_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

Definition at line 9135 of file tria.cc.

◆ get_boundary()

template<int dim, int spacedim>
const Boundary< dim, spacedim > & Triangulation< dim, spacedim >::get_boundary ( const types::manifold_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

Definition at line 9223 of file tria.cc.

◆ get_boundary_ids()

template<int dim, int spacedim>
std::vector< types::boundary_id > Triangulation< dim, spacedim >::get_boundary_ids ( ) const

Return 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

Definition at line 9261 of file tria.cc.

◆ set_boundary_id() [1/2]

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

Set the boundary indicator of the current object. The same applies as for the boundary_id() function.

This function 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_ids() 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

◆ set_all_boundary_ids() [1/2]

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

Do as set_boundary_id() but also set the boundary indicators of the objects that bound the current object. For example, in 3d, if set_boundary_id() 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_id()) 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

◆ set_boundary_id() [2/2]

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

Set the boundary indicator. The same applies as for the boundary_id() 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

◆ set_all_boundary_ids() [2/2]

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

Set the boundary indicator of this object and all of its lower- dimensional sub-objects. Since this object only represents a single vertex, there are no lower-dimensional object and this function is equivalent to calling set_boundary_id() with the same argument.

See also
Glossary entry on boundary indicators

◆ set_manifold_id()

template<int spacedim>
void TriaAccessor< 0, 1, spacedim >::set_manifold_id ( const types::manifold_id  )

Set the manifold indicator of this vertex. This does nothing so far since manifolds are only used to refine and map objects, but vertices are not refined and the mapping is trivial. This function is here only to allow dimension independent programming.

◆ set_all_manifold_ids()

template<int spacedim>
void TriaAccessor< 0, 1, spacedim >::set_all_manifold_ids ( const types::manifold_id  )

Set the manifold indicator of this object and all of its lower- dimensional sub-objects. Since this object only represents a single vertex, there are no lower-dimensional object and this function is equivalent to calling set_manifold_id() with the same argument.

See also
Glossary entry on manifold indicators