Reference documentation for deal.II version Git 689de043d4 2020-08-10 16:46:15 +0200
\(\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\}}\)
Public Member Functions | Public Attributes | List of all members
internal::TriangulationImplementation::TriaLevel Class Reference

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

Public Member Functions

 TriaLevel (const unsigned int dim)
 
 TriaLevel ()
 
std::size_t memory_consumption () const
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Public Attributes

unsigned int dim
 
std::vector< std::uint8_t > refine_flags
 
std::vector< boolcoarsen_flags
 
std::vector< unsigned intactive_cell_indices
 
std::vector< std::pair< int, int > > neighbors
 
std::vector< types::subdomain_idsubdomain_ids
 
std::vector< types::subdomain_idlevel_subdomain_ids
 
std::vector< intparents
 
std::vector< booldirection_flags
 
TriaObjects cells
 
std::vector< unsigned char > face_orientations
 
std::vector< ReferenceCell::Typereference_cell_type
 

Detailed Description

Store all information which belongs to one level of the multilevel hierarchy.

In TriaLevel, all cell data is stored which is not dependent on the dimension, e.g. a field to store the refinement flag for the cells (what a cell actually is is declared elsewhere), etc. See also TriaObjects for non level-oriented data.

There is another field, which may fit in here, namely the material data (for cells) or the boundary indicators (for faces), but since we need for a line or quad either boundary information or material data, we store them with the lines and quads rather than with the common data. Likewise, in 3d, we need boundary indicators for lines and quads (we need to know how to refine a line if the two adjacent faces have different boundary indicators), and material data for cells.

Definition at line 55 of file tria_levels.h.

Constructor & Destructor Documentation

◆ TriaLevel() [1/2]

internal::TriangulationImplementation::TriaLevel::TriaLevel ( const unsigned int  dim)
inline

Constructor.

Parameters
dimDimension of the Triangulation.

Definition at line 63 of file tria_levels.h.

◆ TriaLevel() [2/2]

internal::TriangulationImplementation::TriaLevel::TriaLevel ( )
inline

Default constructor (needed by Boost).

Definition at line 71 of file tria_levels.h.

Member Function Documentation

◆ memory_consumption()

std::size_t internal::TriangulationImplementation::TriaLevel::memory_consumption ( ) const

Determine an estimate for the memory consumption (in bytes) of this object.

Definition at line 28 of file tria_levels.cc.

◆ serialize()

template<class Archive >
void internal::TriangulationImplementation::TriaLevel::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

Definition at line 236 of file tria_levels.h.

Member Data Documentation

◆ dim

unsigned int internal::TriangulationImplementation::TriaLevel::dim

Dimension of the Triangulation.

Definition at line 79 of file tria_levels.h.

◆ refine_flags

std::vector<std::uint8_t> internal::TriangulationImplementation::TriaLevel::refine_flags

RefinementCase<dim>::Type flags for the cells to be refined with or not (RefinementCase<dim>::no_refinement). The meaning what a cell is, is dimension specific, therefore also the length of this vector depends on the dimension: in one dimension, the length of this vector equals the length of the lines vector, in two dimensions that of the quads vector, etc.

Definition at line 89 of file tria_levels.h.

◆ coarsen_flags

std::vector<bool> internal::TriangulationImplementation::TriaLevel::coarsen_flags

Same meaning as the one above, but specifies whether a cell must be coarsened.

Definition at line 95 of file tria_levels.h.

◆ active_cell_indices

std::vector<unsigned int> internal::TriangulationImplementation::TriaLevel::active_cell_indices

An integer that, for every active cell, stores the how many-th active cell this is. For non-active cells, this value is unused and set to an invalid value.

Definition at line 103 of file tria_levels.h.

◆ neighbors

std::vector<std::pair<int, int> > internal::TriangulationImplementation::TriaLevel::neighbors

Levels and indices of the neighbors of the cells. Convention is, that the neighbors of the cell with index i are stored in the fields following \(i*(2*real\_space\_dimension)\), e.g. in one spatial dimension, the neighbors of cell 0 are stored in neighbors[0] and neighbors[1], the neighbors of cell 1 are stored in neighbors[2] and neighbors[3], and so on.

In neighbors, neighbors[i].first is the level, while neighbors[i].first is the index of the neighbor.

If a neighbor does not exist (cell is at the boundary), level=index=-1 is set.

Conventions: The ith neighbor of a cell is the one which shares the ith face (Line in 2D, Quad in 3D) of this cell.

The neighbor of a cell has at most the same level as this cell, i.e. it may or may not be refined.

In one dimension, a neighbor may have any level less or equal the level of this cell. If it has the same level, it may be refined an arbitrary number of times, but the neighbor pointer still points to the cell on the same level, while the neighbors of the children of the neighbor may point to this cell or its children.

In two and more dimensions, the neighbor is either on the same level and refined (in which case its children have neighbor pointers to this cell or its direct children), unrefined on the same level or one level down (in which case its neighbor pointer points to the mother cell of this cell).

Definition at line 138 of file tria_levels.h.

◆ subdomain_ids

std::vector<types::subdomain_id> internal::TriangulationImplementation::TriaLevel::subdomain_ids

One integer per cell to store which subdomain it belongs to. This field is most often used in parallel computations, where it denotes which processor shall work on/owns the cells with a given subdomain number.

This number is only used on active cells.

Definition at line 148 of file tria_levels.h.

◆ level_subdomain_ids

std::vector<types::subdomain_id> internal::TriangulationImplementation::TriaLevel::level_subdomain_ids

The subdomain id used on each level for parallel multigrid.

In contrast to the subdomain_id, this number is also used on inactive cells once the mesh has been partitioned also on the lower levels of the multigrid hierarchy.

Definition at line 157 of file tria_levels.h.

◆ parents

std::vector<int> internal::TriangulationImplementation::TriaLevel::parents

One integer for every consecutive pair of cells to store which index their parent has.

(We store this information once for each pair of cells since every refinement, isotropic or anisotropic, and in any space dimension, always creates children in multiples of two, so there is no need to store the parent index for every cell.)

Definition at line 168 of file tria_levels.h.

◆ direction_flags

std::vector<bool> internal::TriangulationImplementation::TriaLevel::direction_flags

One bool per cell to indicate the direction of the normal true: use orientation from vertex false: revert the orientation. See GlossDirectionFlag.

This is only used for codim==1 meshes.

Definition at line 177 of file tria_levels.h.

◆ cells

TriaObjects internal::TriangulationImplementation::TriaLevel::cells

The object containing the data on lines and related functions

Definition at line 182 of file tria_levels.h.

◆ face_orientations

std::vector<unsigned char> internal::TriangulationImplementation::TriaLevel::face_orientations

For edges, we enforce a standard convention that opposite edges should be parallel. Now, that's enforceable in most cases, and we have code that makes sure that if a mesh allows this to happen, that we have this convention. We also know that it is always possible to have opposite faces have parallel normal vectors. (For both things, see the paper by Agelek, Anderson, Bangerth, Barth in the ACM Transactions on Mathematical Software mentioned in the documentation of the GridReordering class.)

The problem is that we originally had another condition, namely that faces 0, 2 and 4 have normals that point into the cell, while the other faces have normals that point outward. It turns out that this is not always possible. In effect, we have to store whether the normal vector of each face of each cell follows this convention or not. If this is so, then this variable stores a true value, otherwise a false value.

In effect, this field has 6*n_cells elements, being the number of cells times the six faces each has.

Note
Only needed for dim=3.

Definition at line 208 of file tria_levels.h.

◆ reference_cell_type

std::vector<ReferenceCell::Type> internal::TriangulationImplementation::TriaLevel::reference_cell_type

Reference cell type of each cell.

Note
Used only for dim=2 and dim=3.

Definition at line 215 of file tria_levels.h.


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