Reference documentation for deal.II version 9.0.0
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

Warning
This module describes usage of the Boundary classes, which are deprecated: see the Manifold description for triangulations module for detailed information on how to describe curved boundaries with the Manifold classes, which are the replacements for the Boundary classes.

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 a flat_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 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. The former is used to identify the type of boundary conditions to apply, while the latter is used to identify the geometry and describe how new vertices should be created upon refinement of the mesh, or where high order Mapping objects should place their support points on the exact geometry.

Since version 9.0 of the library, the boundary_id associated to the boundary faces is ignored by Manifold objects, and Manifold descriptors can only be attached to manifold ids.

The behavior of the Triangulation class with respect to geometry descriptions is the following: Triangulation::set_manifold() attaches a manifold descriptor to the specified manifold_id. The function expects a Manifold descriptor, and you could describe both the interior and the boundary of the domain using the same object.

Whenever a new vertex is needed in an object, the Triangulation queries the manifold_id of the object which needs refinement. If the query resulted in a number different from numbers::flat_manifold_id, then the Triangulation looks whether a previous call to Triangulation::set_manifold() was performed with the given id. If it was, then the triangulation uses the stored object to obtain new vertices, otherwise it uses a FlatManifold object.

Note
This behavior is not backward compatible to that of deal.II versions prior to 9.0. 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::flat_manifold_id. In previous versions of the library, the boundary_id of the boundary faces would be queried and used in place of the manifold_id. If you have old programs that only set boundary ids, you should modify them to use manifold ids instead (or you could use GridTools::copy_boundary_to_manifold_ids or GridTools::map_boundary_to_manifold_ids)
See also
Glossary entry on boundary indicators
Glossary entry on manifold indicators
Author
Wolfgang Bangerth, Luca Heltai, 1998-2018

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.

Deprecated:
This method has been deprecated. Use Triangulation::set_manifold() instead.
See also
Glossary entry on boundary indicators

Definition at line 8947 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.

Deprecated:
This method has been deprecated. Use Triangulation::reset_manifold() instead.
See also
Glossary entry on boundary indicators

Definition at line 8967 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

Deprecated:
This method has been deprecated. Use Triangulation::get_manifold() instead.
See also
Glossary entry on boundary indicators

Definition at line 9070 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 9105 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 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 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