Reference documentation for deal.II version GIT relicensing-136-gb80d0be4af 2024-03-18 08:20:02+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
CellData< structdim > Struct Template Reference

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

Inheritance diagram for CellData< structdim >:
Inheritance graph
[legend]

Public Member Functions

 CellData (const unsigned int n_vertices=ReferenceCells::get_hypercube< structdim >().n_vertices())
 
bool operator== (const CellData< structdim > &other) const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Public Attributes

std::vector< unsigned intvertices
 
union { 
 
   types::material_id   material_id 
 
   types::boundary_id   boundary_id 
 
};  
 
types::manifold_id manifold_id
 

Detailed Description

template<int structdim>
struct CellData< structdim >

The CellData class (and the related SubCellData class) is used to provide a comprehensive, but minimal, description of the cells when creating a triangulation via Triangulation::create_triangulation(). Specifically, each CellData object – describing one cell in a triangulation – has member variables for indices of the \(2^d\) vertices (the actual coordinates of the vertices are described in a separate vector passed to Triangulation::create_triangulation(), so the CellData object only needs to store indices into that vector), the material id of the cell that can be used in applications to describe which part of the domain a cell belongs to (see the glossary entry on material ids), and a manifold id that is used to describe the geometry object that is responsible for this cell (see the glossary entry on manifold ids) to describe the manifold this object belongs to.

This structure is also used to represent data for faces and edges when used as a member of the SubCellData class. In this case, the template argument structdim of an object will be less than the dimension dim of the triangulation. If this is so, then vertices array represents the indices of the vertices of one face or edge of one of the cells passed to Triangulation::create_triangulation(). Furthermore, for faces the material id has no meaning, and the material_id field is reused to store a boundary_id instead to designate which part of the boundary the face or edge belongs to (see the glossary entry on boundary ids).

An example showing how this class can be used is in the create_coarse_grid() function of step-14. There are also many more use cases in the implementation of the functions of the GridGenerator namespace.

Definition at line 78 of file tria_description.h.

Constructor & Destructor Documentation

◆ CellData()

template<int structdim>
CellData< structdim >::CellData ( const unsigned int  n_vertices = ReferenceCells::get_hypercube<structdim>().n_vertices())

Default constructor. Sets the member variables to the following values:

  • vertex indices to invalid values
  • boundary or material id zero (the default for boundary or material ids)
  • manifold id to numbers::flat_manifold_id.

By default, the constructor initializes the vertices member variable to have as many entries as it takes to describe a hypercube cell (i.e., a ReferenceCells::Line, ReferenceCells::Quadrilateral, or ReferenceCells::Hexahedron). This is historical and dates back to the time where deal.II could only deal with these kinds of cells. If you want an object of the current type to describe, for example, a triangle or tetrahedron, then you either have to call this constructor with an explicit argument different from the default value, or manually resize the vertices member variable after construction.

Definition at line 34 of file tria_description.cc.

Member Function Documentation

◆ operator==()

template<int structdim>
bool CellData< structdim >::operator== ( const CellData< structdim > &  other) const

Comparison operator.

Definition at line 44 of file tria_description.cc.

◆ serialize()

template<int structdim>
template<class Archive >
void CellData< structdim >::serialize ( Archive &  ar,
const unsigned int  version 
)

Read or write the data of this object to or from a stream for the purpose of serialization using the BOOST serialization library.

Definition at line 280 of file tria_description.h.

Member Data Documentation

◆ vertices

template<int structdim>
std::vector<unsigned int> CellData< structdim >::vertices

Indices of the vertices of this cell. These indices correspond to entries in the vector of vertex locations passed to Triangulation::create_triangulation().

By default, the constructor of this class initializes this variable to have as many entries as it takes to describe a hypercube cell (i.e., a ReferenceCells::Line, ReferenceCells::Quadrilateral, or ReferenceCells::Hexahedron). This is historical and dates back to the time where deal.II could only deal with these kinds of cells. If you want an object of the current type to describe, for example, a triangle or tetrahedron, then you either have to call this constructor with an explicit argument different from the default value, or manually resize the vertices member variable after construction.

The kind of cell described by the current object is then determined by calling ReferenceCell::n_vertices_to_type() on the number of vertices described by this array.

Definition at line 99 of file tria_description.h.

◆ material_id

template<int structdim>
types::material_id CellData< structdim >::material_id

The material id of the cell being described. See the documentation of the CellData class for examples of how to use this field.

This variable can only be used if the current object is used to describe a cell, i.e., if structdim equals the dimension dim of a triangulation.

Definition at line 118 of file tria_description.h.

◆ boundary_id

template<int structdim>
types::boundary_id CellData< structdim >::boundary_id

The boundary id of a face or edge being described. See the documentation of the CellData class for examples of how to use this field.

This variable can only be used if the current object is used to describe a face or edge, i.e., if structdim is less than the dimension dim of a triangulation. In this case, the CellData object this variable belongs to will be part of a SubCellData object.

Definition at line 129 of file tria_description.h.

◆ [union]

union { ... } CellData< structdim >

Material or boundary indicator of this cell. This field is a union that stores either a boundary or a material id, depending on whether the current object is used to describe a cell (in a vector of CellData objects) or a face or edge (as part of a SubCellData object).

◆ manifold_id

template<int structdim>
types::manifold_id CellData< structdim >::manifold_id

Manifold identifier of this object. This identifier should be used to identify the manifold to which this object belongs, and from which this object will collect information on how to add points upon refinement.

See the documentation of the CellData class for examples of how to use this field.

Definition at line 140 of file tria_description.h.


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