Reference documentation for deal.II version 8.4.2
Public Member Functions | Friends | List of all members
CellId Class Reference

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

Public Member Functions

 CellId (unsigned int coarse_cell_id_, std::vector< unsigned char > id_)
 
 CellId ()
 
std::string to_string () const
 
bool operator== (const CellId &other) const
 
bool operator!= (const CellId &other) const
 
bool operator< (const CellId &other) const
 

Friends

std::istream & operator>> (std::istream &is, CellId &cid)
 
std::ostream & operator<< (std::ostream &os, const CellId &cid)
 

Detailed Description

A class to represent a unique ID for a cell in a Triangulation. This class stores the index of the coarse cell from which a cell is descendant, together with information on how to reach the cell from that coarse cell (i.e., which child index to take on each level when moving from one cell to its children). The important point about this class is that an object of the current class uniquely identifies a cell in triangulation, and it even does so in the context of objects of type parallel::distributed::Triangulation where the local portion of a mesh may not store all cells. For example, the CellId computed for a ghost cell on one processor will be exactly the same as the CellId computed for the very same cell on the processor that actually owns the cell, although the level and index of the iterators pointing to that cell within the triangulation stored on each of the processors may (and in general will) be different. In other words, CellId provides the tool with which it is possible to uniquely identify cells in a parallel triangulation, and consequently makes it possible to exchange data between processors tied to individual cells.

Note
How this data is internally represented is not of importance (and not exposed on purpose).
Todo:
Does it make sense to implement a more efficient representation (internally and/or as a string)? If yes, something like a 64bit int as in p4est would be a good option.

Definition at line 55 of file cell_id.h.

Constructor & Destructor Documentation

§ CellId() [1/2]

CellId::CellId ( unsigned int  coarse_cell_id_,
std::vector< unsigned char >  id_ 
)
inlineexplicit

construct CellId with a given coarse_cell_index and list of child indices

Definition at line 61 of file cell_id.h.

§ CellId() [2/2]

CellId::CellId ( )
inline

construct an empty CellId.

Definition at line 68 of file cell_id.h.

Member Function Documentation

§ to_string()

std::string CellId::to_string ( ) const

Return a string representation of this CellId.

Definition at line 23 of file cell_id.cc.

§ operator==()

bool CellId::operator== ( const CellId other) const
inline

compare two CellIds

Definition at line 140 of file cell_id.h.

§ operator!=()

bool CellId::operator!= ( const CellId other) const
inline

compare two CellIds

Definition at line 148 of file cell_id.h.

§ operator<()

bool CellId::operator< ( const CellId other) const
inline

compare two CellIds

Definition at line 154 of file cell_id.h.

Friends And Related Function Documentation

§ operator>>

std::istream& operator>> ( std::istream &  is,
CellId cid 
)
friend

read CellId from a stream

Definition at line 113 of file cell_id.h.

§ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CellId cid 
)
friend

output CellId into a stream

Definition at line 102 of file cell_id.h.


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