
For each vertex, line, quad, etc, we store a list of the indices of degrees of freedom living on this object. These indices refer to the unconstrained degrees of freedom, i.e. constrained degrees of freedom are numbered in the same way as unconstrained ones, and are only later eliminated. This leads to the fact that indices in global vectors and matrices also refer to all degrees of freedom and some kind of condensation is needed to restrict the systems of equations to the unconstrained degrees of freedom only. The actual layout of storage of the indices is described in the internal::DoFHandler::DoFLevel class documentation.
The class offers iterators to traverse all cells, in much the same way as the Triangulation class does. Using the begin() and end() functions (and all their companions, like begin_active(), begin_line(), etc, just as for the Triangulation class), one can obtain iterators to walk over cells, and query the degree of freedom structures as well as the triangulation data. These iterators are built on top of those of the Triangulation class, but offer the additional information on degrees of freedom functionality than pure triangulation iterators. The order in which dof iterators are presented by the ++ and -- operators is the same as that for the corresponding triangulation iterators.
The degrees of freedom (`dofs') are distributed on the given triangulation by the function distribute_dofs(). It gets passed a finite element object describing how many degrees of freedom are located on vertices, lines, etc. It traverses the triangulation cell by cell and numbers the dofs of that cell if not yet numbered. For non-multigrid algorithms, only active cells are considered. Active cells are defined to be those cells which have no children, i.e. they are the most refined ones.
Since the triangulation is traversed starting with the cells of the coarsest active level and going to more refined levels, the lowest numbers for dofs are given to the largest cells as well as their bounding lines and vertices, with the dofs of more refined cells getting higher numbers.
This numbering implies very large bandwiths of the resulting matrices and is thus vastly suboptimal for some solution algorithms. For this reason, the DoFRenumbering class offers several algorithms to reorder the dof numbering according. See there for a discussion of the implemented algorithms.
The DoFRenumbering class offers a number of renumbering schemes like the Cuthill-McKey scheme. Basically, the function sets up an array in which for each degree of freedom we store the new index this DoF should have after renumbering. Using this array, the renumber_dofs() function of the present class is called, which actually performs the change from old DoF indices to the ones given in the array. In some cases, however, a user may want to compute her own renumbering order; in this case, one can allocate an array with one element per degree of freedom and fill it with the number that the respective degree of freedom shall be assigned. This number may, for example, be obtained by sorting the support points of the degrees of freedom in downwind direction. Then call the renumber_dofs(vector<unsigned int>) function with the array, which converts old into new degree of freedom indices.
| typedef IteratorSelector::raw_line_iterator DoFHandler< dim >::raw_line_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::line_iterator DoFHandler< dim >::line_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::active_line_iterator DoFHandler< dim >::active_line_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::raw_quad_iterator DoFHandler< dim >::raw_quad_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::quad_iterator DoFHandler< dim >::quad_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::active_quad_iterator DoFHandler< dim >::active_quad_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::raw_hex_iterator DoFHandler< dim >::raw_hex_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::hex_iterator DoFHandler< dim >::hex_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::active_hex_iterator DoFHandler< dim >::active_hex_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::raw_cell_iterator DoFHandler< dim >::raw_cell_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::cell_iterator DoFHandler< dim >::cell_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::active_cell_iterator DoFHandler< dim >::active_cell_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::raw_face_iterator DoFHandler< dim >::raw_face_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::face_iterator DoFHandler< dim >::face_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef IteratorSelector::active_face_iterator DoFHandler< dim >::active_face_iterator |
Reimplemented in MGDoFHandler< dim >.
| typedef ::FunctionMap<dim>::type DoFHandler< dim >::FunctionMap |
Alias the FunctionMap type declared elsewhere.
| DoFHandler< dim >::DoFHandler | ( | const Triangulation< dim > & | tria | ) |
Constructor. Take tria as the triangulation to work on.
| virtual DoFHandler< dim >::~DoFHandler | ( | ) | [virtual] |
Destructor.
| DoFHandler< dim >::DoFHandler | ( | const DoFHandler< dim > & | ) | [private] |
Copy constructor. I can see no reason why someone might want to use it, so I don't provide it. Since this class has pointer members, making it private prevents the compiler to provide it's own, incorrect one if anyone chose to copy such an object.
| virtual void DoFHandler< dim >::distribute_dofs | ( | const FiniteElement< dim > & | fe, | |
| const unsigned int | offset = 0 | |||
| ) | [virtual] |
Go through the triangulation and distribute the degrees of freedoms needed for the given finite element according to the given distribution method.
The additional optional parameter offset allows you to reserve space for a finite number of additional vector entries in the beginning of all discretization vectors, by starting the enumeration of degrees of freedom on the grid at a nonzero value. By default, this value is of course zero.
A pointer of the transferred finite element is stored. Therefore, the lifetime of the finite element object shall be longer than that of this object. If you don't want this behaviour, you may want to call the clear member function which also releases the lock of this object to the finite element.
Reimplemented in MGDoFHandler< dim >.
| virtual void DoFHandler< dim >::clear | ( | ) | [virtual] |
Clear all data of this object and especially delete the lock this object has to the finite element used the last time when distribute_dofs was called.
Reimplemented in MGDoFHandler< dim >.
| void DoFHandler< dim >::renumber_dofs | ( | const std::vector< unsigned int > & | new_numbers | ) |
Renumber degrees of freedom based on a list of new dof numbers for all the dofs.
new_numbers is an array of integers with size equal to the number of dofs on the present grid. It stores the new indices after renumbering in the order of the old indices.
This function is called by the functions in DoFRenumbering function after computing the ordering of the degrees of freedom. However, you can call this function yourself, which is necessary if a user wants to implement an ordering scheme herself, for example downwind numbering.
The new_number array must have a size equal to the number of degrees of freedom. Each entry must state the new global DoF number of the degree of freedom referenced.
Reimplemented in MGDoFHandler< dim >.
Referenced by MGDoFHandler< dim >::renumber_dofs().
| unsigned int DoFHandler< dim >::max_couplings_between_dofs | ( | ) | const |
Return the maximum number of degrees of freedom a degree of freedom in the given triangulation with the given finite element may couple with. This is the maximum number of entries per line in the system matrix; this information can therefore be used upon construction of the SparsityPattern object.
The returned number is not really the maximum number but an estimate based on the finite element and the maximum number of cells meeting at a vertex. The number holds for the constrained matrix as well.
The determination of the number of couplings can be done by simple picture drawing. An example can be found in the implementation of this function.
Note that this function is most often used to determine the maximal row length for sparsity patterns. Unfortunately, while the estimates returned by this function are rather accurate in 1d and 2d, they are often significantly too high in 3d, leading the SparsityPattern class to allocate much too much memory in some cases. Unless someone comes around to improving the present function for 3d, there is not very much one can do about these cases. The typical way to work around this problem is to use an intermediate compressed sparsity pattern that only allocates memory on demand. Refer to the step-11 example program on how to do this. The problem is also discussed in the documentation of the module on Sparsity patterns.
| unsigned int DoFHandler< dim >::max_couplings_between_boundary_dofs | ( | ) | const |
Return the number of degrees of freedom located on the boundary another dof on the boundary can couple with.
The number is the same as for max_couplings_between_dofs() in one dimension less.
| raw_cell_iterator DoFHandler< dim >::begin_raw | ( | const unsigned int | level = 0 |
) | const |
Iterator to the first cell, used or not, on level level. If a level has no cells, a past-the-end iterator is returned.
This function calls begin_raw_line in 1D and begin_raw_quad in 2D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| cell_iterator DoFHandler< dim >::begin | ( | const unsigned int | level = 0 |
) | const |
Iterator to the first used cell on level level.
This function calls begin_line in 1D and begin_quad in 2D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| active_cell_iterator DoFHandler< dim >::begin_active | ( | const unsigned int | level = 0 |
) | const |
Iterator to the first active cell on level level.
This function calls begin_active_line in 1D and begin_active_quad in 2D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| raw_cell_iterator DoFHandler< dim >::end | ( | ) | const |
Iterator past the end; this iterator serves for comparisons of iterators with past-the-end or before-the-beginning states.
This function calls end_line in 1D and end_quad in 2D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| cell_iterator DoFHandler< dim >::end | ( | const unsigned int | level | ) | const |
Return an iterator which is the first iterator not on level. If level is the last level, then this returns end().
Reimplemented in MGDoFHandler< dim >.
| raw_cell_iterator DoFHandler< dim >::end_raw | ( | const unsigned int | level | ) | const |
Return a raw iterator which is the first iterator not on level. If level is the last level, then this returns end().
Reimplemented in MGDoFHandler< dim >.
| active_cell_iterator DoFHandler< dim >::end_active | ( | const unsigned int | level | ) | const |
Return an active iterator which is the first iterator not on level. If level is the last level, then this returns end().
Reimplemented in MGDoFHandler< dim >.
| raw_cell_iterator DoFHandler< dim >::last_raw | ( | ) | const |
Return an iterator pointing to the last cell, used or not.
This function calls last_raw_line in 1D and last_raw_quad in 2D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| raw_cell_iterator DoFHandler< dim >::last_raw | ( | const unsigned int | level | ) | const |
Return an iterator pointing to the last cell of the level level, used or not.
This function calls last_raw_line in 1D and last_raw_quad in 2D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| cell_iterator DoFHandler< dim >::last | ( | ) | const |
Return an iterator pointing to the last used cell.
This function calls last_line in 1D and last_quad in 2D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| cell_iterator DoFHandler< dim >::last | ( | const unsigned int | level | ) | const |
Return an iterator pointing to the last used cell on level level.
This function calls last_line in 1D and last_quad in 2D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| active_cell_iterator DoFHandler< dim >::last_active | ( | ) | const |
Return an iterator pointing to the last active cell.
This function calls last_active_line in 1D and last_active_quad in 2D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| active_cell_iterator DoFHandler< dim >::last_active | ( | const unsigned int | level | ) | const |
Return an iterator pointing to the last active cell on level level.
This function calls last_active_line in 1D and last_active_quad in 2D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| raw_face_iterator DoFHandler< dim >::begin_raw_face | ( | ) | const |
Iterator to the first face, used or not, on level level. If a level has no faces, a past-the-end iterator is returned.
This function calls begin_raw_line in 2D and begin_raw_quad in 3D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| face_iterator DoFHandler< dim >::begin_face | ( | ) | const |
Iterator to the first used face on level level.
This function calls begin_line in 2D and begin_quad in 3D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| active_face_iterator DoFHandler< dim >::begin_active_face | ( | ) | const |
Iterator to the first active face on level level.
This function calls begin_active_line in 2D and begin_active_quad in 3D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| raw_face_iterator DoFHandler< dim >::end_face | ( | ) | const |
Iterator past the end; this iterator serves for comparisons of iterators with past-the-end or before-the-beginning states.
This function calls end_line in 2D and end_quad in 3D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| raw_face_iterator DoFHandler< dim >::end_raw_face | ( | ) | const |
Return a raw iterator which is the first iterator not on level. If level is the last level, then this returns end().
Reimplemented in MGDoFHandler< dim >.
| active_face_iterator DoFHandler< dim >::end_active_face | ( | ) | const |
Return an active iterator which is the first iterator not on level. If level is the last level, then this returns end().
Reimplemented in MGDoFHandler< dim >.
| raw_face_iterator DoFHandler< dim >::last_raw_face | ( | ) | const |
Return an iterator pointing to the last face, used or not.
This function calls last_raw_line in 2D and last_raw_quad in 3D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| face_iterator DoFHandler< dim >::last_face | ( | ) | const |
Return an iterator pointing to the last used face.
This function calls last_line in 2D and last_quad in 3D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| face_iterator DoFHandler< dim >::last_face | ( | const unsigned int | level | ) | const |
Return an iterator pointing to the last used face on level level.
This function calls last_line in 2D and last_quad in 3D.
| active_face_iterator DoFHandler< dim >::last_active_face | ( | ) | const |
Return an iterator pointing to the last active face.
This function calls last_active_line in 2D and last_active_quad in 3D.
Reimplemented in MGDoFHandler< dim >, MGDoFHandler< dim >, MGDoFHandler< dim >, and MGDoFHandler< dim >.
| raw_line_iterator DoFHandler< dim >::begin_raw_line | ( | const unsigned int | level = 0 |
) | const |
Iterator to the first line, used or not, on level level. If a level has no lines, a past-the-end iterator is returned.
Reimplemented in MGDoFHandler< dim >.
| line_iterator DoFHandler< dim >::begin_line | ( | const unsigned int | level = 0 |
) | const |
Iterator to the first used line on level level.
Reimplemented in MGDoFHandler< dim >.
| active_line_iterator DoFHandler< dim >::begin_active_line | ( | const unsigned int | level = 0 |
) | const |
Iterator to the first active line on level level.
Reimplemented in MGDoFHandler< dim >.
| raw_line_iterator DoFHandler< dim >::end_line | ( | ) | const |
Iterator past the end; this iterator serves for comparisons of iterators with past-the-end or before-the-beginning states.
Reimplemented in MGDoFHandler< dim >.
| line_iterator DoFHandler< dim >::end_line | ( | const unsigned int | level | ) | const |
Return an iterator which is the first iterator not on level. If level is the last level, then this returns end().
Reimplemented in MGDoFHandler< dim >.
| raw_line_iterator DoFHandler< dim >::end_raw_line | ( | const unsigned int | level | ) | const |
Return a raw iterator which is the first iterator not on level. If level is the last level, then this returns end().
Reimplemented in MGDoFHandler< dim >.
| active_line_iterator DoFHandler< dim >::end_active_line | ( | const unsigned int | level | ) | const |
Return an active iterator which is the first iterator not on level. If level is the last level, then this returns end().
Reimplemented in MGDoFHandler< dim >.
| raw_line_iterator DoFHandler< dim >::last_raw_line | ( | ) | const |
Return an iterator pointing to the last line, used or not.
Reimplemented in MGDoFHandler< dim >.
| raw_line_iterator DoFHandler< dim >::last_raw_line | ( | const unsigned int | level | ) | const |
Return an iterator pointing to the last line of the level level, used or not.
Reimplemented in MGDoFHandler< dim >.
| line_iterator DoFHandler< dim >::last_line | ( | ) | const |
Return an iterator pointing to the last used line.
Reimplemented in MGDoFHandler< dim >.
| line_iterator DoFHandler< dim >::last_line | ( | const unsigned int | level | ) | const |
Return an iterator pointing to the last used line on level level.
Reimplemented in MGDoFHandler< dim >.
| active_line_iterator DoFHandler< dim >::last_active_line | ( | ) | const |
Return an iterator pointing to the last active line.
Reimplemented in MGDoFHandler< dim >.
| active_line_iterator DoFHandler< dim >::last_active_line | ( | const unsigned int | level | ) | const |
Return an iterator pointing to the last active line on level level.
Reimplemented in MGDoFHandler< dim >.
| raw_quad_iterator DoFHandler< dim >::begin_raw_quad | ( | const unsigned int | level = 0 |
) | const |
Iterator to the first quad, used or not, on level level. If a level has no quads, a past-the-end iterator is returned.
Reimplemented in MGDoFHandler< dim >, and MGDoFHandler< dim >.
| quad_iterator DoFHandler< dim >::begin_quad | ( | const unsigned int | level = 0 |
) | const |
Iterator to the first used quad on level level.
Reimplemented in MGDoFHandler< dim >, and MGDoFHandler< dim >.
| active_quad_iterator DoFHandler< dim >::begin_active_quad | ( | const unsigned int | level = 0 |
) | const |
Iterator to the first active quad on level level.
Reimplemented in MGDoFHandler< dim >, and MGDoFHandler< dim >.
| raw_quad_iterator DoFHandler< dim >::end_quad | ( | ) | const |
Iterator past the end; this iterator serves for comparisons of iterators with past-the-end or before-the-beginning states.
Reimplemented in MGDoFHandler< dim >, and MGDoFHandler< dim >.
| quad_iterator DoFHandler< dim >::end_quad | ( | const unsigned int | level | ) | const |
Return an iterator which is the first iterator not on level. If level is the last level, then this returns end().
Reimplemented in MGDoFHandler< dim >.